:root {
  /* Light "editorial color-block" theme - cool gray canvas, white cards with
     large radii, cobalt blue accent, black feature elements, bold colored
     stat tiles. --navy keeps its old NAME (it's referenced all over) but now
     means "dark feature background" = near-black. */
  --navy: #15171c;
  --navy-light: #2a2d35;
  --accent: #2f5ce0;
  --accent-2: #15171c;
  --accent-light: #e4eafb;
  --green: #2e7d4f;
  --red: #c0453a;
  --amber: #a8720f;
  --bg-gradient: #eceef0;
  --bg: #eceef0;
  --border: #e2e4e8;
  --text: #33363d;
  --muted: #8b909a;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --canvas: #f9fafb;
  --heading: #16181d;
  --glass-blur: 0px;
  --glass-shadow: 0 2px 10px rgba(22,24,29,0.05);
  --glass-glow: 0 0 0 0 rgba(0,0,0,0);
}

[data-theme="dark"] {
  /* Dark companion theme - near-black canvas, graphite cards, cobalt accent */
  --navy: #0d0e11;
  --navy-light: #23252c;
  --accent: #5d82ea;
  --accent-2: #eceef0;
  --accent-light: rgba(93,130,234,0.16);
  --green: #7fc795;
  --red: #ee8f86;
  --amber: #e0b25e;
  --bg-gradient: #121317;
  --bg: #121317;
  --border: rgba(255,255,255,0.1);
  --text: #d7dade;
  --muted: rgba(215,218,222,0.6);
  --surface: #1c1e24;
  --surface-2: #24262e;
  --canvas: #17181d;
  --heading: #f0f2f5;
  --glass-shadow: 0 2px 14px rgba(0,0,0,0.45);
  --glass-glow: 0 0 0 0 rgba(0,0,0,0);
}

/* Mobile hamburger toggle - hidden by default on desktop */
.hamburger-btn { display: none; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
}

/* ---------- Shared glass treatment (reused by every card-like surface) ---------- */
.card, .stat-box, .modal, .login-card, .customer-card, .material-item, .reminder-item,
.update-alert, .update-log-item, .chat-contacts, .chat-main, .chat-header, .chat-input-row,
.emoji-picker, .mention-dropdown, .addr-suggest, .dashboard-widget {
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow), var(--glass-glow);
}

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.login-brand {
  font-size: 26px;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: 0.02em;
  margin-bottom: 22px;
  text-align: center;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px 36px;
  border-radius: 16px;
  width: 340px;
}
.login-card h1 {
  font-size: 22px;
  margin: 0 0 4px;
  color: var(--heading);
}
.login-card p.sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--surface-2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47,92,224,0.18);
}
button.btn {
  cursor: pointer;
  border: none;
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(47,92,224,0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
button.btn:hover { background: #2549bd; box-shadow: 0 4px 12px rgba(47,92,224,0.4); transform: translateY(-1px); }
button.btn.secondary {
  background: var(--surface); color: var(--heading); border: 1px solid var(--border);
  box-shadow: none;
}
button.btn.secondary:hover { background: var(--surface-2); box-shadow: none; }
button.btn.danger { background: var(--red); box-shadow: 0 2px 8px rgba(192,69,58,0.3); }
button.btn.danger:hover { background: #a93c32; }
button.btn.small { padding: 6px 12px; font-size: 12px; }
button.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.error-msg {
  background: rgba(192,69,58,0.08);
  border: 1px solid rgba(192,69,58,0.3);
  color: var(--red);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ---------- App shell ---------- */
.app {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  background: var(--surface);
  color: var(--heading);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  flex-shrink: 0;
}
.sidebar .brand {
  padding: 0 20px 20px;
  font-weight: 700;
  font-size: 17px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .brand img.logo-img { max-height: 34px; max-width: 140px; object-fit: contain; }
.sidebar .brand .brand-text small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); margin-top: 3px; }
.sidebar .brand small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); margin-top: 3px; }

.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  margin-left: auto;
}
#notifBellBtn {
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; background: var(--surface); border: 1px solid var(--border);
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow), var(--glass-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#notifBellBtn:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(28,48,38,0.12); }
#notifBadge {
  position: absolute; top: -3px; right: -3px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 20px; padding: 1px 5px; min-width: 15px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}

/* ---------- Notification Hub (bell dropdown) ---------- */
.notif-bell-wrap { position: relative; display: inline-block; }
.notif-hub {
  display: none; position: absolute; right: 0; top: 50px; width: 340px; max-height: 440px;
  overflow: hidden; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow), var(--glass-glow);
  z-index: 100; animation: notifHubIn 0.18s ease-out;
}
.notif-hub.open { display: flex; }
@keyframes notifHubIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.notif-hub-header {
  display: flex; align-items: center; gap: 10px; padding: 16px 18px 4px;
}
.notif-hub-icon {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; background: var(--accent); box-shadow: none;
}
.notif-hub-title { font-weight: 700; font-size: 15px; color: var(--heading); }
.notif-hub-sublabel { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 10px 18px 6px; }
.notif-hub-list { overflow-y: auto; flex: 1; padding: 0 8px 8px; }
.notif-hub-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 10px; border-radius: 10px; position: relative;
  transition: background 0.15s ease;
}
.notif-hub-item:hover { background: var(--surface-2); }
.notif-hub-item .nh-icon { font-size: 18px; flex-shrink: 0; line-height: 1.3; }
.notif-hub-item .nh-body { flex: 1; min-width: 0; }
.notif-hub-item .nh-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.notif-hub-item.unread .nh-text { font-weight: 600; color: var(--heading); }
.notif-hub-item .nh-time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-hub-item .nh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 5px; }
.nh-empty { padding: 26px 16px; text-align: center; font-size: 13px; color: var(--muted); }
.notif-hub-footer { padding: 10px 14px; border-top: 1px solid var(--border); }
.notif-hub-footer .btn { width: 100%; }

.customer-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 18px; background: var(--surface);
}
.customer-card .cc-name { font-size: 19px; font-weight: 700; color: var(--heading); margin-bottom: 2px; }
.customer-card .cc-owner { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; }
.customer-card .cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.customer-card .cc-field { }
.customer-card .cc-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 3px; }
.customer-card .cc-value { font-size: 14px; color: var(--text); }
.customer-card .cc-comment { grid-column: 1 / -1; }
.customer-card .cc-section-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); font-weight: 700; margin: 18px 0 12px; padding-top: 14px; border-top: 1px solid var(--border); }

.attach-row { display: flex; gap: 6px; align-items: center; }
.attach-row button { background: none; border: none; cursor: pointer; font-size: 18px; padding: 6px; border-radius: 6px; }
.attach-row button:hover { background: var(--surface-2); }
.recording-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 5px; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.3;} }
.sidebar nav a {
  display: block;
  padding: 11px 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  border-radius: 0 20px 20px 0;
  margin-right: 12px;
}
.sidebar nav a:hover { background: var(--surface-2); color: var(--heading); }
.sidebar nav a.active { background: var(--navy); color: #ffffff; border-left-color: transparent; border-radius: 20px; margin-left: 12px; font-weight: 600; }
[data-theme="dark"] .sidebar nav a.active { background: #f0f2f5; color: #16181d; }
.sidebar .spacer { flex: 1; }
.sidebar .userbox {
  padding: 18px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  text-align: center;
}
.sidebar .userbox .name { font-weight: 600; margin-top: 10px; color: var(--heading); }
.sidebar .userbox .role { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.sidebar .userbox button { margin-top: 10px; width: 100%; }

/* ---------- Self-service profile picture ---------- */
.user-avatar-wrap { position: relative; width: 64px; height: 64px; margin: 0 auto; }
.user-avatar {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #ffffff;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.avatar-edit-btn {
  position: absolute; bottom: -2px; right: -2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface); display: flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer; transition: transform 0.15s ease;
}
.avatar-edit-btn:hover { transform: scale(1.08); }
.avatar-remove-btn {
  position: absolute; top: -2px; left: -2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--surface); color: #fff; font-size: 10px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}

/* ---------- Sidebar profile menu rows ---------- */
.userbox-menu { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.userbox-row {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 !important;
  padding: 9px 12px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text); font-size: 12.5px; font-weight: 500;
  cursor: pointer; text-align: left; transition: background 0.15s ease, transform 0.15s ease;
}
.userbox-row:hover { background: var(--accent-light); transform: translateX(1px); }
.userbox-row .ub-icon { font-size: 14px; }
.userbox-row.danger { color: var(--red); }
.userbox-row.danger:hover { background: rgba(192,69,58,0.1); }

.main { flex: 1; padding: 28px 34px; overflow-x: auto; }
.main h2 { margin: 0 0 4px; font-size: 21px; color: var(--heading); }
.main .page-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

.panel { display: none; }
.panel.active { display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card h3 { margin: 0 0 16px; font-size: 15px; color: var(--heading); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  min-width: 160px;
  flex: 1;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.stat-box:hover, .card:hover { transform: translateY(-2px); }
.stat-box { border-radius: 20px; }
.stat-box .label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-box .value { font-size: 26px; font-weight: 700; color: var(--heading); }
.stat-box .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-box.good .value { color: var(--green); }
.stat-box.warn .value { color: var(--amber); }
.spark { margin-top: 8px; height: 30px; width: 100%; display: block; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; }
.spark path.fill { fill: rgba(47,92,224,0.12); stroke: none; }

/* Color-blocked stat tiles (reference style): 1st cobalt, 2nd teal, 3rd black,
   4th yellow, rest stay white. Text/spark colors flip for contrast. */
.stat-row .stat-box:nth-child(1) { background: #2f5ce0; border-color: #2f5ce0; }
.stat-row .stat-box:nth-child(1) .label { color: rgba(255,255,255,0.75); }
.stat-row .stat-box:nth-child(1) .value, .stat-row .stat-box:nth-child(1) .sub { color: #ffffff; }
.stat-row .stat-box:nth-child(1) .spark polyline { stroke: rgba(255,255,255,0.9); }
.stat-row .stat-box:nth-child(1) .spark path.fill { fill: rgba(255,255,255,0.2); }
.stat-row .stat-box:nth-child(2) { background: #3f8e96; border-color: #3f8e96; }
.stat-row .stat-box:nth-child(2) .label { color: rgba(255,255,255,0.78); }
.stat-row .stat-box:nth-child(2) .value, .stat-row .stat-box:nth-child(2) .sub { color: #ffffff; }
.stat-row .stat-box:nth-child(2) .spark polyline { stroke: rgba(255,255,255,0.9); }
.stat-row .stat-box:nth-child(2) .spark path.fill { fill: rgba(255,255,255,0.2); }
.stat-row .stat-box:nth-child(3) { background: #15171c; border-color: #15171c; }
.stat-row .stat-box:nth-child(3) .label { color: rgba(255,255,255,0.65); }
.stat-row .stat-box:nth-child(3) .value, .stat-row .stat-box:nth-child(3) .sub { color: #ffffff; }
.stat-row .stat-box:nth-child(4) { background: #f2df4e; border-color: #f2df4e; }
.stat-row .stat-box:nth-child(4) .label { color: #6b6215; }
.stat-row .stat-box:nth-child(4) .value, .stat-row .stat-box:nth-child(4) .sub { color: #2c2907; }
.stat-row .stat-box:nth-child(5) { background: #e2795b; border-color: #e2795b; }
.stat-row .stat-box:nth-child(5) .label { color: rgba(255,255,255,0.8); }
.stat-row .stat-box:nth-child(5) .value, .stat-row .stat-box:nth-child(5) .sub { color: #ffffff; }
.stat-row .stat-box:nth-child(5) .spark polyline { stroke: rgba(255,255,255,0.9); }
.stat-row .stat-box:nth-child(5) .spark path.fill { fill: rgba(255,255,255,0.2); }

/* ---------- Overview two-column dashboard layout ---------- */
.dashboard-columns { display: flex; gap: 20px; align-items: flex-start; }
.dashboard-main { flex: 1; min-width: 0; }
.dashboard-feed { width: 320px; flex-shrink: 0; }
.dashboard-widget {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; position: sticky; top: 20px;
}
.dashboard-widget h3 { margin: 0 0 14px; font-size: 15px; color: var(--heading); }
.activity-list { display: flex; flex-direction: column; gap: 12px; max-height: 560px; overflow-y: auto; }
.activity-item { display: flex; gap: 10px; align-items: flex-start; padding: 0; background: none; border: none; }
.activity-item .ai-icon { font-size: 16px; flex-shrink: 0; line-height: 1.4; }
.activity-item .ai-body { flex: 1; min-width: 0; }
.activity-item .ai-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.activity-item .ai-time { font-size: 11px; color: var(--muted); margin-top: 2px; }

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar .fill { height: 100%; background: var(--accent); }
.progress-bar .fill.done { background: var(--green); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface-2);
}
table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; transition: background 0.15s ease; }
table tr:hover td { background: var(--surface-2); }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}
.tag.sale { background: #e3f2e7; color: #1e5c38; border-color: #cbe6d3; }
.tag.no-sale { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.tag.active { background: #e3f2e7; color: #1e5c38; border-color: #cbe6d3; }
.tag.inactive { background: #fae9e6; color: #8c3325; border-color: #f0d4ce; }
.tag.disp-sale { background: #e3f2e7; color: #1e5c38; border-color: #cbe6d3; }
.tag.disp-no_answer, .tag.disp-busy, .tag.disp-voicemail { background: #faf3d3; color: #6b6215; border-color: #efe4a8; }
.tag.disp-hung_up, .tag.disp-not_interested, .tag.disp-do_not_call, .tag.disp-wrong_number { background: #fae9e6; color: #8c3325; border-color: #f0d4ce; }
.tag.disp-call_back { background: #e4eafb; color: #24448f; border-color: #cdd8f4; }
.tag.disp-other { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

.filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.filters .field { margin-bottom: 0; min-width: 150px; }

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.notice.warn { background: #fdf1dc; color: #7a5410; border: 1px solid #f3e2be; }
.notice.ok { background: #e3f2e7; color: #1e5c38; border: 1px solid #cbe6d3; }
.notice.info { background: var(--accent-light); color: #24448f; border: 1px solid #cdd8f4; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(28,42,36,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; width: 420px; max-width: 90vw;
  max-height: 85vh; overflow-y: auto;
}
.modal h3 { margin-top: 0; color: var(--heading); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.checkbox-row input { width: auto; }

.tabs-2 { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs-2 button { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--muted); transition: all 0.15s ease; }
.tabs-2 button { border-radius: 20px; }
.tabs-2 button.active { background: var(--accent); color: #ffffff; border-color: transparent; box-shadow: 0 2px 8px rgba(121,194,141,0.35); }

.email-layout { display: flex; gap: 20px; }
.email-list { width: 320px; flex-shrink: 0; border-right: 1px solid var(--border); padding-right: 16px; max-height: 560px; overflow-y: auto; }
.email-item { padding: 10px; border-radius: 8px; cursor: pointer; margin-bottom: 4px; }
.email-item:hover { background: var(--surface-2); }
.email-item.active { background: var(--accent-light); }
.email-item .subj { font-weight: 600; font-size: 13.5px; }
.email-item .meta { font-size: 12px; color: var(--muted); }
.email-item .unread-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
.email-body { flex: 1; }
.email-body .subj-lg { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.email-body .from-line { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.email-body .content { white-space: pre-wrap; line-height: 1.6; font-size: 14px; }

.small-muted { font-size: 12px; color: var(--muted); }
.right { text-align: right; }
.mt-0 { margin-top: 0; }

/* ---------- Chat (WhatsApp-style) ---------- */
.chat-layout { display: flex; height: 560px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.chat-contacts { width: 300px; flex-shrink: 0; border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface-2); }
.chat-contacts .search-box { padding: 10px; border-bottom: 1px solid var(--border); }
.chat-contacts .search-box input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--surface); color: var(--text); }
.chat-contact { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.chat-contact:hover { background: var(--surface-2); filter: brightness(0.96); }
.chat-contact.active { background: var(--accent-light); }
.chat-contact .avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.chat-contact .info { flex: 1; min-width: 0; }
.chat-contact .cname { font-weight: 600; font-size: 13.5px; display: flex; justify-content: space-between; }
.chat-contact .cpreview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-contact .ctime { font-size: 11px; color: var(--muted); }
.chat-contact .unread-badge {
  background: var(--accent); color: #fff; border-radius: 20px; font-size: 11px; font-weight: 700;
  padding: 1px 7px; margin-left: 6px;
}
.chat-main { flex: 1; display: flex; flex-direction: column; background: var(--canvas); }
.chat-header { padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--border); font-weight: 600; }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.chat-bubble { max-width: 60%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; position: relative; }
.chat-bubble.received { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 4px; }
.chat-bubble.sent { align-self: flex-end; background: #dfe7fb; border-bottom-right-radius: 4px; }
.chat-bubble .btime { display: block; font-size: 10.5px; color: var(--muted); margin-top: 4px; text-align: right; }
.chat-input-row { display: flex; gap: 10px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--border); }
.chat-input-row input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 20px; font-size: 13.5px; }
.chat-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 13.5px; }

/* ---------- US timezone digital clock widget ---------- */
.tz-widget { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.tz-clock {
  background: #15171c; color: #ffffff; border-radius: 16px; padding: 14px 16px;
  text-align: center;
}
.tz-clock.ist { background: #f2df4e; color: #2c2907; }
.tz-clock .tz-name { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #9ba1ad; margin-bottom: 6px; }
.tz-clock.ist .tz-name { color: #6b6215; }
.tz-clock .tz-time { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.tz-clock .tz-date { font-size: 10.5px; color: #9ba1ad; margin-top: 4px; }
.tz-clock.ist .tz-date { color: #6b6215; }

/* ---------- Training materials ---------- */
.material-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: var(--surface); }
.material-item .m-icon { font-size: 24px; }
.material-item .m-info { flex: 1; min-width: 0; }
.material-item .m-title { font-weight: 600; font-size: 14px; }
.material-item .m-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.material-item .m-desc { font-size: 12.5px; color: var(--text); margin-top: 4px; }

/* ---------- Reminders ---------- */
.reminder-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: var(--surface); }
.reminder-item.overdue { border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.08); }
.reminder-item.done { opacity: 0.55; }
.reminder-item .r-info { flex: 1; min-width: 0; }
.reminder-item .r-title { font-weight: 600; font-size: 14px; }
.reminder-item .r-time { font-size: 12px; color: var(--muted); margin-top: 2px; }
.reminder-item .r-notes { font-size: 12.5px; color: var(--text); margin-top: 4px; }

/* ---------- Emoji picker ---------- */
.emoji-picker {
  position: absolute; bottom: 52px; left: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px;
  width: 300px; max-height: 320px; z-index: 90; display: flex; flex-direction: column;
}
.emoji-picker .ep-search { width: 100%; padding: 6px 8px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; background: var(--surface-2); color: var(--text); flex-shrink: 0; box-sizing: border-box; }
.emoji-picker .ep-tabs { display: flex; gap: 2px; overflow-x: auto; margin-bottom: 6px; flex-shrink: 0; }
.emoji-picker .ep-tabs button { background: none; border: none; font-size: 16px; cursor: pointer; padding: 4px 6px; border-radius: 6px; flex-shrink: 0; opacity: 0.55; }
.emoji-picker .ep-tabs button.active { background: var(--surface-2); opacity: 1; }
.emoji-picker .ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; overflow-y: auto; }
.emoji-picker .ep-grid button { background: none; border: none; font-size: 19px; cursor: pointer; padding: 5px; border-radius: 6px; }
.emoji-picker .ep-grid button:hover { background: var(--surface-2); }
.emoji-picker .ep-empty { font-size: 12px; color: var(--muted); padding: 10px; text-align: center; grid-column: 1 / -1; }

/* ---------- Mention autocomplete ---------- */
.mention-dropdown {
  position: absolute; bottom: 52px; left: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; z-index: 90; min-width: 200px; overflow: hidden;
}
.mention-dropdown .m-opt { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.mention-dropdown .m-opt:hover, .mention-dropdown .m-opt.sel { background: var(--accent-light); }
.chat-bubble .mention { color: var(--accent); font-weight: 600; }

/* ---------- Address autocomplete ---------- */
.addr-autocomplete { position: relative; }
.addr-suggest {
  position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; z-index: 60; margin-top: 3px; font-size: 13px;
}
.addr-suggest .as-opt { padding: 8px 12px; cursor: pointer; }
.addr-suggest .as-opt:hover { background: var(--accent-light); }

/* ---------- Company Update: un-dismissable corner alert ---------- */
.update-alert-stack { position: fixed; top: 20px; right: 20px; z-index: 500; width: 340px; display: flex; flex-direction: column; gap: 12px; }
.update-alert {
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--amber); border-radius: 10px;
  padding: 16px 18px;
  animation: slideIn 0.25s ease-out;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.update-alert .ua-badge { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--amber); font-weight: 700; margin-bottom: 6px; }
.update-alert .ua-title { font-weight: 700; font-size: 15px; color: var(--heading); margin-bottom: 4px; }
.update-alert .ua-body { font-size: 13px; color: var(--text); line-height: 1.5; margin-bottom: 6px; }
.update-alert .ua-meta { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.update-alert button { width: 100%; }

.update-log-item { padding: 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: var(--surface); }
.update-log-item .ul-title { font-weight: 700; color: var(--heading); font-size: 14.5px; }
.update-log-item .ul-body { font-size: 13px; margin: 6px 0; line-height: 1.5; }
.update-log-item .ul-meta { font-size: 11.5px; color: var(--muted); }

/* ---------- Chat popup toast (shows on any panel/tab when a new message arrives) ---------- */
.chat-toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 600; width: 320px; display: flex; flex-direction: column; gap: 10px; }
.chat-toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: 10px;
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow), var(--glass-glow); padding: 14px 16px; cursor: pointer;
  animation: slideIn 0.25s ease-out;
}
.chat-toast .ct-title { font-weight: 700; font-size: 13.5px; color: var(--heading); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.chat-toast .ct-body { font-size: 13px; color: var(--text); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 860px) {
  .chat-toast-stack { left: 12px; right: 12px; width: auto; bottom: 12px; }
}

/* ---------- Read receipts (WhatsApp-style seen/unseen) ---------- */
.read-receipt { font-size: 10.5px; color: var(--muted); margin-top: 2px; text-align: right; cursor: default; }
.read-receipt.seen { color: var(--accent); }
.read-receipt.clickable { cursor: pointer; text-decoration: underline; }
.seen-by-modal .sb-group { margin-bottom: 14px; }
.seen-by-modal .sb-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 6px; }
.seen-by-modal .sb-names { font-size: 13.5px; line-height: 1.6; }

/* ---------- Training material view/delete row ---------- */
.material-item .m-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---------- Theme toggle ---------- */
.theme-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 10px; padding: 7px 10px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--border);
  width: 100%; box-sizing: border-box; overflow: hidden;
}
.theme-toggle-row span {
  font-size: 11.5px; color: var(--muted); font-weight: 500;
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar .userbox .theme-switch {
  width: 36px; height: 20px; border-radius: 20px; margin-top: 0;
  background: #d8d5ca; border: 1px solid var(--border);
  cursor: pointer; position: relative; flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}
[data-theme="dark"] .theme-switch { background: var(--accent); border-color: transparent; }
.theme-switch .knob {
  position: absolute; top: 1px; left: 1px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform 0.25s cubic-bezier(.4,0,.2,1);
  display: flex; align-items: center; justify-content: center; font-size: 9px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}
[data-theme="dark"] .theme-switch .knob { transform: translateX(16px); }

/* ---------- Dark-mode component tint overrides ---------- */
[data-theme="dark"] .error-msg { background: rgba(242,147,138,0.12); border-color: rgba(242,147,138,0.3); color: var(--red); }
[data-theme="dark"] .notice.warn { background: rgba(232,180,90,0.12); border-color: rgba(232,180,90,0.3); color: var(--amber); }
[data-theme="dark"] .notice.ok { background: rgba(121,194,141,0.12); border-color: rgba(121,194,141,0.3); color: var(--green); }
[data-theme="dark"] .notice.info { background: rgba(121,194,141,0.12); border-color: rgba(121,194,141,0.3); color: var(--green); }
[data-theme="dark"] .tag.sale, [data-theme="dark"] .tag.disp-sale, [data-theme="dark"] .tag.active { background: rgba(121,194,141,0.16); color: var(--green); border-color: rgba(121,194,141,0.3); }
[data-theme="dark"] .tag.no-sale, [data-theme="dark"] .tag.disp-other { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
[data-theme="dark"] .tag.inactive, [data-theme="dark"] .tag.disp-hung_up, [data-theme="dark"] .tag.disp-not_interested, [data-theme="dark"] .tag.disp-do_not_call, [data-theme="dark"] .tag.disp-wrong_number { background: rgba(242,147,138,0.14); color: var(--red); border-color: rgba(242,147,138,0.3); }
[data-theme="dark"] .tag.disp-no_answer, [data-theme="dark"] .tag.disp-busy, [data-theme="dark"] .tag.disp-voicemail { background: rgba(232,180,90,0.14); color: var(--amber); border-color: rgba(232,180,90,0.3); }
[data-theme="dark"] .tag.disp-call_back { background: rgba(133,183,235,0.14); color: #a5c9ea; border-color: rgba(133,183,235,0.3); }
[data-theme="dark"] .reminder-item.overdue { background: rgba(242,147,138,0.1); border-color: rgba(242,147,138,0.3); }
[data-theme="dark"] .chat-bubble.sent { background: #2c3a5e; color: var(--text); }
[data-theme="dark"] .tz-clock { background: #23252c; }
[data-theme="dark"] .tz-clock.ist { background: #b3a63a; color: #1c1a04; }
[data-theme="dark"] .modal-backdrop { background: rgba(0,0,0,0.6); }
[data-theme="dark"] ::placeholder { color: #5f6f66; }

/* ================= Mobile responsiveness ================= */
@media (max-width: 860px) {
  .hamburger-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface); color: var(--heading); font-size: 18px; cursor: pointer; margin-right: auto;
  }
  .topbar { justify-content: space-between; }

  .app { position: relative; overflow-x: hidden; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200; width: 250px;
    transform: translateX(-100%); transition: transform 0.22s ease; box-shadow: 0 0 0 rgba(0,0,0,0);
  }
  .sidebar.open { transform: translateX(0); box-shadow: 10px 0 30px rgba(0,0,0,0.25); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 190; }
  .sidebar-backdrop.open { display: block; }

  .main { padding: 16px; width: 100%; }
  .main h2 { font-size: 18px; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-box { min-width: 130px; }

  table { font-size: 12.5px; }
  .modal { width: 92vw; padding: 18px; }

  .chat-layout { height: calc(100vh - 160px); position: relative; }
  .chat-contacts { position: absolute; inset: 0; width: 100%; z-index: 2; transition: transform 0.2s ease; }
  .chat-main { position: absolute; inset: 0; width: 100%; transform: translateX(100%); transition: transform 0.2s ease; }
  .chat-layout.mobile-chat-open .chat-contacts { transform: translateX(-100%); }
  .chat-layout.mobile-chat-open .chat-main { transform: translateX(0); }
  .chat-bubble { max-width: 82%; }
  .chat-back-btn { display: inline-flex; margin-right: 8px; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--heading); }

  .tz-widget { grid-template-columns: repeat(2, 1fr); }
  .update-alert-stack { left: 12px; right: 12px; width: auto; top: 12px; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .field { min-width: 0; }

  .dashboard-columns { flex-direction: column; }
  .dashboard-feed { width: 100%; }
  .dashboard-widget { position: static; }
}
@media (min-width: 861px) {
  .chat-back-btn { display: none; }
  .sidebar-backdrop { display: none !important; }
}

/* ---------- Task schedule calendar (Reminders) ---------- */
.task-cal { max-width: 420px; }
.tc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tc-month { font-weight: 700; color: var(--heading); font-size: 14.5px; }
.tc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.tc-dows { margin-bottom: 6px; }
.tc-dow { text-align: center; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tc-cell {
  position: relative; aspect-ratio: 1; border-radius: 12px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--text); cursor: pointer;
  border: 1px solid transparent; transition: transform 0.12s ease, border-color 0.12s ease;
  user-select: none;
}
.tc-cell:hover:not(.empty) { transform: translateY(-1px); border-color: var(--border-strong, var(--border)); }
.tc-cell.empty { background: transparent; cursor: default; }
.tc-cell.has { background: #2f5ce0; color: #ffffff; font-weight: 600; }
.tc-cell.done { background: #3f8e96; color: #ffffff; font-weight: 600; }
.tc-cell.overdue { background: #c0453a; color: #ffffff; font-weight: 600; }
.tc-cell.today { outline: 2px solid #f2df4e; outline-offset: 1px; }
.tc-cell.today:not(.has):not(.done):not(.overdue) { background: #f2df4e; color: #2c2907; font-weight: 700; outline: none; }
.tc-cell.selected { box-shadow: 0 0 0 2px var(--navy); }
.tc-dot {
  position: absolute; top: 3px; right: 4px; font-size: 9px; font-weight: 700;
  background: rgba(255,255,255,0.92); color: #15171c; border-radius: 8px; padding: 0 4px; line-height: 1.5;
}
.tc-cell.today:not(.has):not(.done):not(.overdue) .tc-dot { background: rgba(0,0,0,0.75); color: #f2df4e; }
.tc-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 11px; color: var(--muted); }
.tc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tc-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.tc-swatch.sw-today { background: #f2df4e; }
.tc-swatch.sw-has { background: #2f5ce0; }
.tc-swatch.sw-done { background: #3f8e96; }
.tc-swatch.sw-overdue { background: #c0453a; }
[data-theme="dark"] .tc-cell { background: var(--surface-2); }
[data-theme="dark"] .tc-cell.selected { box-shadow: 0 0 0 2px #f0f2f5; }

/* ---------- Agent dashboard widget grid ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.dash-grid .card { margin-bottom: 0; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---------- Messenger-style chat upgrade ---------- */
.chat-layout { border-radius: 20px; }
.chat-contacts { background: var(--surface); }
.chat-contact { border-bottom: none; margin: 2px 8px; border-radius: 14px; padding: 10px 12px; }
.chat-contact:hover { background: var(--surface-2); filter: none; }
.chat-contact.active { background: var(--accent-light); }
.chat-contact .avatar { position: relative; }
.online-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: #37c978; border: 2px solid var(--surface); flex-shrink: 0;
}
.avatar .online-dot { position: absolute; bottom: -1px; right: -1px; }
.chat-online-strip { display: flex; gap: 10px; padding: 10px 14px 4px; overflow-x: auto; }
.chat-online-strip .os-item { text-align: center; width: 46px; flex-shrink: 0; }
.chat-online-strip .avatar { width: 40px; height: 40px; margin: 0 auto; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; overflow: hidden; position: relative; }
.chat-online-strip .os-name { font-size: 9.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-strip-label { padding: 8px 14px 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

.chat-header { display: flex; align-items: center; gap: 10px; }
.chat-header .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; overflow: hidden; position: relative; flex-shrink: 0; }
.chat-header .ch-status { font-size: 11px; font-weight: 400; color: var(--muted); }
.chat-header .ch-status.online { color: #2c9e5f; }
.chat-header .ch-actions { margin-left: auto; display: flex; gap: 6px; }

.chat-day-sep { text-align: center; margin: 10px 0 4px; }
.chat-day-sep span { font-size: 10.5px; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 3px 10px; }

.chat-bubble-wrap { display: flex; gap: 8px; align-items: flex-end; max-width: 78%; position: relative; }
.chat-bubble-wrap.sent { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble-wrap.received { align-self: flex-start; }
.chat-bubble-wrap .b-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; overflow: hidden; flex-shrink: 0; }
.chat-bubble-wrap .chat-bubble { max-width: 100%; }
.chat-bubble { border-radius: 16px; }
.chat-bubble.received { background: var(--surface); border: 1px solid var(--border); }
.chat-bubble.sent { background: var(--accent); color: #ffffff; }
.chat-bubble.sent .btime, .chat-bubble.sent .read-receipt { color: rgba(255,255,255,0.75); }
.chat-bubble.sent .read-receipt.seen { color: #ffffff; }
.chat-bubble.sent .mention { color: #ffe28a; }
.chat-bubble.poke { background: #fdf1dc; border: 1px solid #f3e2be; color: #7a5410; font-weight: 600; }
[data-theme="dark"] .chat-bubble.poke { background: rgba(232,180,90,0.14); border-color: rgba(232,180,90,0.3); color: var(--amber); }

.react-row { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; align-items: center; }
.react-chip {
  font-size: 11px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 1px 7px; cursor: pointer; color: var(--text); user-select: none;
}
.react-chip.mine { background: var(--accent-light); border-color: var(--accent); }
.chat-bubble.sent .react-chip { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.35); color: #fff; }
.chat-bubble.sent .react-chip.mine { background: rgba(255,255,255,0.35); }
.react-add { font-size: 12px; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity 0.15s ease; user-select: none; }
.chat-bubble.sent .react-add { color: rgba(255,255,255,0.8); }
.chat-bubble-wrap:hover .react-add { opacity: 1; }
.react-picker {
  position: absolute; bottom: calc(100% + 4px); left: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 9px; display: flex; gap: 6px; box-shadow: 0 4px 14px rgba(22,24,29,0.14);
}
.react-picker span { font-size: 17px; cursor: pointer; transition: transform 0.1s ease; }
.react-picker span:hover { transform: scale(1.25); }

.cust-share-card {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 12px; cursor: pointer; min-width: 190px;
}
.chat-bubble.sent .cust-share-card { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); }
.cust-share-card .cs-icon { font-size: 20px; }
.cust-share-card .cs-name { font-weight: 700; font-size: 12.5px; }
.cust-share-card .cs-meta { font-size: 11px; opacity: 0.75; }
.cust-share-card .cs-open { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--accent); }
.chat-bubble.sent .cust-share-card .cs-open { color: #fff; }

.typing-note { font-size: 11.5px; color: var(--accent); padding: 2px 18px 6px; font-style: italic; }

.chat-input-row input { background: var(--surface-2); border-radius: 22px; }
.chat-input-row .btn { border-radius: 50%; width: 40px; height: 40px; padding: 0; font-size: 15px; display: flex; align-items: center; justify-content: center; }

.share-person { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.share-person:hover { background: var(--accent-light); }

/* ---------- Full-screen 3-column chat (Messages | Thread | Info) ---------- */
.chat-layout.chat-fullscreen { height: calc(100vh - 150px); min-height: 480px; border-radius: 20px; }
#panel-chat.panel-chat-full.active { display: block; }
.chat-msgs-header { padding: 16px 16px 6px; font-size: 18px; font-weight: 700; color: var(--heading); }
.chat-info { width: 268px; flex-shrink: 0; border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 18px 16px; display: none; }
@media (min-width: 1180px) { .chat-layout.chat-fullscreen .chat-info { display: block; } }
.chat-info .ci-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.chat-info .ci-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; margin: 10px auto 10px; overflow: hidden; position: relative; }
.chat-info .ci-avatar .online-dot { position: absolute; bottom: 3px; right: 3px; width: 14px; height: 14px; }
.chat-info .ci-name { text-align: center; font-weight: 700; font-size: 15px; color: var(--heading); }
.chat-info .ci-sub { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.chat-info .ci-actions { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.chat-info .ci-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 16px 0 8px; }
.chat-info .ci-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chat-info .ci-media img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: pointer; }
.chat-info .ci-file { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 10px; background: var(--surface-2); margin-bottom: 6px; font-size: 12px; color: var(--text); overflow: hidden; }
.chat-info .ci-file .cf-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-info .ci-member { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; color: var(--text); }
.chat-info .ci-member .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; overflow: hidden; position: relative; flex-shrink: 0; }
.chat-info .ci-empty { font-size: 12px; color: var(--muted); }
@media (max-width: 860px) { .chat-layout.chat-fullscreen { height: calc(100vh - 150px); } }

/* ---------- Global customer finder widget ---------- */
.cf-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 20px;
  font-size: 13.5px; background: var(--surface-2); color: var(--text);
}
.cf-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,92,224,0.15); }
.cf-results { margin-top: 10px; max-height: 260px; overflow-y: auto; }
.cf-hint { font-size: 12px; color: var(--muted); padding: 6px 2px; }
.cf-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px;
  cursor: pointer; transition: background 0.12s ease;
}
.cf-row:hover { background: var(--accent-light); }
.cf-info { flex: 1; min-width: 0; }
.cf-name { font-weight: 600; font-size: 13px; color: var(--heading); }
.cf-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-owner {
  font-size: 10.5px; font-weight: 700; background: var(--navy); color: #fff;
  border-radius: 12px; padding: 3px 9px; flex-shrink: 0;
}

/* ---------- Wide dashboard layout: use the full page width ---------- */
.main { max-width: 1600px; }
.dashboard-columns .dashboard-main { min-width: 0; }
.dash-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
/* Explorer table breathes on wide screens */
#ap_tbody td, #ap_tbody th { white-space: nowrap; }
@media (min-width: 1400px) {
  .dashboard-feed { width: 340px; }
}

/* ---------- World clock: all 7 zones on one line ---------- */
.tz-clock { padding: 12px 8px; }
.tz-clock .tz-name { font-size: 10px; letter-spacing: 0.03em; white-space: nowrap; }
.tz-clock .tz-time { font-size: clamp(13px, 1.25vw, 20px); white-space: nowrap; }
.tz-clock .tz-date { font-size: 10px; white-space: nowrap; }
@media (max-width: 1100px) { .tz-widget { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Face pile inside the "Active agents" tile ---------- */
.face-stack { display: flex; align-items: center; margin-top: 12px; padding-left: 4px; }
.face-stack .fs-face {
  width: 30px; height: 30px; border-radius: 50%; margin-left: -8px;
  background: rgba(255,255,255,0.22); border: 2px solid #e2795b;
  color: #ffffff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  transition: transform 0.15s ease;
}
.face-stack .fs-face:first-child { margin-left: 0; }
.face-stack .fs-face img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.stat-box:hover .face-stack .fs-face { transform: translateY(-2px); }
.face-stack .fs-more { background: rgba(0,0,0,0.22); font-size: 10.5px; }

/* ---------- Privacy mode: subtle marker so admin knows revenue is hidden ---------- */
body.privacy-on #privacyBtn { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Goal-hit celebration ---------- */
.notice.ok.goal-hit {
  border-color: var(--green);
  animation: goalPop 0.5s ease-out;
}
@keyframes goalPop {
  0% { transform: scale(0.96); opacity: 0.4; }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- Incentive tile (agent dashboard) ---------- */
.stat-box.incentive-tile { position: relative; }
.inc-eye {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.12); border: none; cursor: pointer;
  font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.inc-eye:hover { background: rgba(0,0,0,0.22); transform: scale(1.08); }
.stat-box.incentive-tile .value { letter-spacing: -0.01em; }

/* ---------------- Incentives ---------------- */

/* Admin slab editor */
.inc-edit-table td { vertical-align: middle; }
.inc-in {
  width: 58px; padding: 5px 7px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--card); color: var(--text);
}
.inc-in.wide { width: 86px; }
.inc-in::placeholder { color: var(--muted); }
.inc-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.inc-switch { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
td.num, th.num { text-align: right; }

/* Small circular avatar for use inside table rows. Needs an explicit size:
   avatarInner() renders an <img> at width/height 100%, so without a sized
   container the photo stretches to fill the whole table cell. */
.avatar-inline {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 50%; overflow: hidden;
  background: var(--navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; line-height: 1;
  vertical-align: middle; margin-right: 8px;
}
.avatar-inline img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* Live-scheme flags */
.inc-flag {
  display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .5px;
  background: var(--yellow); color: var(--navy);
  border-radius: 20px; padding: 2px 7px; vertical-align: middle; margin-left: 4px;
}
.inc-flag.alt { background: var(--teal); color: #fff; }

/* Agent tile */
.incentive-tile { position: relative; }
.inc-detail {
  margin-top: 8px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,.18); color: inherit;
  border: 1px solid rgba(255,255,255,.35); border-radius: 20px;
  padding: 3px 10px; cursor: pointer;
}
.inc-detail:hover { background: rgba(255,255,255,.3); }

/* Agent breakdown modal */
.inc-camp { margin-bottom: 16px; }
.inc-camp h4 { margin: 0 0 6px; font-size: 13.5px; color: var(--heading); }
.inc-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.inc-table td { padding: 5px 0; border-bottom: 1px solid var(--border); }
.inc-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.inc-table tr.total td { font-weight: 700; border-bottom: none; padding-top: 8px; }
.inc-table tr.muted-row td { color: var(--muted); }
.inc-next {
  margin: 8px 0 0; font-size: 12.5px; font-weight: 600;
  color: var(--teal); background: rgba(63,142,150,.09);
  border-radius: 8px; padding: 7px 10px;
}

/* Incentive adjustments: deductions read red, additions green. */
.adj-minus { color: var(--red, #c0392b); font-weight: 600; }
.adj-plus  { color: var(--green, #2e7d52); font-weight: 600; }

/* ---------------- Permission editor ---------------- */
.perm-group { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.perm-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.perm-group-head h3, .perm-group-head h4 { margin: 0; flex: 1; font-size: 13px; color: var(--heading); }
.perm-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px;
}
.perm-row:first-of-type { border-top: none; }
.perm-row input[type=checkbox] { margin-top: 2px; flex: 0 0 auto; }
.perm-row strong { font-weight: 600; }
.tag.admin-tag {
  background: var(--accent); color: #fff; font-size: 9.5px;
  padding: 1px 6px; border-radius: 20px; letter-spacing: .3px;
}

/* Revealed password - deliberately plain and copyable. */
.pw-reveal {
  margin-top: 10px; padding: 10px 12px;
  background: var(--card-alt, rgba(0,0,0,.04)); border: 1px solid var(--border); border-radius: 10px;
}
.pw-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px; font-weight: 700; letter-spacing: .5px;
  user-select: all; word-break: break-all; margin: 2px 0 4px;
}

/* "online" / "5m ago" under each chat contact */
.chat-contact .cseen { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.chat-contact .cseen.on { color: var(--green, #2e7d52); font-weight: 600; }

/* ---------------- Zip availability widget ---------------- */
.zip-look input[type=text] { width: 100%; margin-bottom: 10px; }
.zip-out { min-height: 40px; }
.zip-place {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--navy); color: #fff; margin-bottom: 10px;
}
.zip-place .zip-code { font-family: ui-monospace, Menlo, monospace; font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.zip-place .zip-where { flex: 1; line-height: 1.25; }
.zip-place .zip-where .small-muted { color: rgba(255,255,255,.65); font-size: 11px; }
.zip-place .zip-count {
  min-width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.zip-place .zip-count.ok { background: var(--teal); color: #fff; }
.zip-place .zip-count.none { background: rgba(255,255,255,.15); color: rgba(255,255,255,.7); }
.zip-group { margin-bottom: 8px; }
.zip-group-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.zip-prod {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px; font-size: 13px; margin-bottom: 4px;
}
.zip-prod.ok { background: rgba(63,142,150,.12); font-weight: 600; }
.zip-prod.off { color: var(--muted); text-decoration: line-through; }
.zip-prod .zip-val { font-variant-numeric: tabular-nums; font-weight: 700; }
.zip-none { font-size: 13px; color: var(--muted); }
#zp_text { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

/* ---------------- Punch in / attendance widget ---------------- */
.punch-state { font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }
.punch-state.in { color: var(--teal); }
.punch-state.done { color: var(--muted); }
.punch-state.off { color: var(--muted); }
.punch-late { color: var(--red, #c0392b); font-weight: 700; }
.punch-btn { width: 100%; margin-bottom: 12px; }
.punch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.punch-grid div { background: rgba(0,0,0,.04); border-radius: 8px; padding: 6px 2px; }
.punch-grid strong { display: block; font-size: 16px; }
.punch-grid span { font-size: 10px; color: var(--muted); }
.punch-lates { margin-top: 10px; font-size: 12px; color: var(--muted); }
.punch-lates.warn { color: var(--red, #c0392b); font-weight: 600; }
.at-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.at-status.present { background: rgba(63,142,150,.15); color: var(--teal); }
.at-status.late { background: rgba(242,223,78,.35); color: #7a6a00; }
.at-status.half_day { background: rgba(226,121,91,.2); color: #a8452a; }
.at-status.absent { background: rgba(192,57,43,.12); color: #c0392b; }
.at-status.week_off { background: rgba(0,0,0,.06); color: var(--muted); }
.punch-lates .punch-over { font-size: 11px; font-weight: 500; margin-top: 3px; line-height: 1.4; }

/* ---------------- Attendance gate ---------------- */
/* Shown until presence is marked. Deliberately covers everything - work does
   not begin before attendance is recorded. */
body.gated { overflow: hidden; }
.att-gate {
  position: fixed; inset: 0; z-index: 9998;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.att-gate-card { max-width: 460px; text-align: center; }
.att-gate-icon { font-size: 46px; margin-bottom: 10px; }
.att-gate-card h2 { color: #fff; margin: 0 0 10px; font-size: 24px; }
.att-gate-card p { color: rgba(255,255,255,.8); font-size: 14.5px; line-height: 1.6; margin-bottom: 20px; }
.att-gate-card strong { color: #fff; }
.att-gate-btn { font-size: 16px; padding: 12px 30px; margin-bottom: 14px; }
.att-gate .small-muted { color: rgba(255,255,255,.55); font-size: 12px; line-height: 1.6; }
.att-gate .gate-err { color: var(--yellow); font-weight: 600; }
.at-mode { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: rgba(0,0,0,.06); color: var(--muted); }
.at-mode.auto { background: rgba(63,142,150,.15); color: var(--teal); }
.at-mode.none { background: rgba(0,0,0,.05); }

/* ---- My attendance calendar (agent dashboard) -------------------------- */
/* Same card, same borders, same radii as everywhere else. The calendar is
   capped in width and the month's totals sit beside it - a month of tiles is
   about square, so stretching it across a full-width card just made seven
   very wide, very empty cells. */
.dash-grid .card.wide { grid-column: 1 / -1; }

.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-nav span { font-size: 13px; font-weight: 600; color: var(--heading); min-width: 116px; text-align: center; }
.cal-nav button { line-height: 1; padding: 3px 9px; font-size: 13px; }
.cal-nav button:disabled { opacity: .35; cursor: default; }

.cal-wrap { display: flex; align-items: flex-start; gap: 22px; flex-wrap: wrap; }
.cal-main { flex: 1 1 380px; max-width: 560px; min-width: 300px; }
.cal-side { flex: 0 1 200px; min-width: 170px; display: flex; flex-direction: column; gap: 4px; }

.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { margin-bottom: 5px; }
.cal-head div { text-align: center; font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }

.cal-cell {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.cal-cell:not(.blank):not(.future):hover { transform: translateY(-1px); box-shadow: var(--glass-shadow); }
.cal-cell.blank { border: none; background: none; }

/* Days that have not happened yet: outlined only, so the month reads as
   "nothing here yet" rather than a wall of empty boxes. */
.cal-cell.future { background: none; border-style: dashed; border-color: var(--border); }
.cal-cell.future .cal-day { color: var(--muted); font-weight: 500; }

.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }

.cal-day { font-size: 12px; font-weight: 600; color: var(--heading); line-height: 1.1; }
.cal-mark { font-size: 13px; line-height: 1; }
.cal-time { font-size: 9px; color: var(--muted); line-height: 1.1; }

.cal-cell.present  { background: color-mix(in srgb, var(--green) 12%, var(--surface)); border-color: color-mix(in srgb, var(--green) 28%, var(--border)); }
.cal-cell.present  .cal-mark { color: var(--green); }
.cal-cell.late     { background: color-mix(in srgb, var(--amber) 14%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 30%, var(--border)); }
.cal-cell.late     .cal-mark { color: var(--amber); }
.cal-cell.half     { background: color-mix(in srgb, var(--amber) 14%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 30%, var(--border)); }
.cal-cell.half     .cal-mark { color: var(--amber); }
.cal-cell.absent   { background: color-mix(in srgb, var(--red) 12%, var(--surface)); border-color: color-mix(in srgb, var(--red) 28%, var(--border)); }
.cal-cell.absent   .cal-mark { color: var(--red); }
.cal-cell.weekoff  { background: var(--surface-2); border-color: transparent; }
.cal-cell.weekoff  .cal-day { color: var(--muted); font-weight: 500; }
.cal-cell.weekoff  .cal-mark { display: none; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.cal-key.present { color: var(--green); }
.cal-key.late, .cal-key.half { color: var(--amber); }
.cal-key.absent { color: var(--red); }

/* Month totals, read as a list rather than five identical boxes. */
.cal-stat {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 7px 11px; border-radius: 8px; background: var(--surface-2);
  font-size: 12px; color: var(--muted);
}
.cal-stat strong { font-size: 15px; color: var(--heading); font-variant-numeric: tabular-nums; }
.cal-stat.zero strong { color: var(--muted); font-weight: 500; }
.cal-stat.present strong { color: var(--green); }
.cal-stat.late strong, .cal-stat.half strong { color: var(--amber); }
.cal-stat.absent strong { color: var(--red); }
.cal-stat.total {
  margin-top: 4px; background: var(--accent-light);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.cal-stat.total span { color: var(--heading); font-weight: 600; }
.cal-stat.total strong { color: var(--accent); font-size: 17px; }

.cal-note { margin-top: 8px; font-size: 11px; line-height: 1.45; color: var(--muted); }
.cal-note.warn { color: var(--amber); }

@media (max-width: 780px) {
  .cal-wrap { gap: 16px; }
  .cal-main { max-width: none; }
  .cal-side { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; }
  .cal-side .cal-stat { flex: 1 1 100px; }
}
@media (max-width: 480px) {
  .cal-time { display: none; }
  .card-head { flex-wrap: wrap; }
}

/* ---- Health & repair --------------------------------------------------- */
.hl-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 12px; font-weight: 700; line-height: 1;
}
.hl-dot.ok      { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.hl-dot.warn    { background: color-mix(in srgb, var(--amber) 20%, transparent); color: var(--amber); }
.hl-dot.problem { background: color-mix(in srgb, var(--red) 18%, transparent);   color: var(--red); }

/* The zip widget carries two lists side by side when there is room for them. */
@media (min-width: 900px) {
  .card.wide .zip-out .zip-group { display: inline-block; vertical-align: top; width: 48%; }
  .card.wide .zip-out .zip-group + .zip-group { margin-left: 3%; }
}

/* A required field is marked once, in the label. */
.field .req { color: var(--red); font-weight: 600; }

/* ---- Customer form builder --------------------------------------------- */
.fb-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px;
  font-size: 10px; font-weight: 600; letter-spacing: .02em;
  background: var(--accent-light); color: var(--accent);
}
.fb-tag.locked { background: var(--surface-2); color: var(--muted); }

/* ---- Do Not Call warning ------------------------------------------------ */
/* Deliberately louder than every other message on the form. */
.notice.danger {
  background: color-mix(in srgb, var(--red) 14%, var(--surface));
  border: 1px solid var(--red);
  color: var(--red);
}
.dnc-warning { font-size: 15px; line-height: 1.5; padding: 12px 14px; }
.dnc-warning div { font-weight: 400; font-size: 13px; margin-top: 4px; color: var(--text); }

/* ---- Leave and holidays ------------------------------------------------ */
/* Same tile, same radius, same colour tokens as the rest of the calendar -
   these are extra states of an existing component, not a new one. */

.cal-cell.holiday { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.cal-cell.holiday .cal-mark { color: var(--accent); }
.cal-cell.leave   { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 26%, var(--border)); }
.cal-cell.leave   .cal-mark { color: var(--accent); }
.cal-cell.sick    { background: color-mix(in srgb, var(--green) 10%, var(--surface)); border-color: color-mix(in srgb, var(--green) 26%, var(--border)); }
.cal-cell.sick    .cal-mark { color: var(--green); }
.cal-cell.unpaid  { background: color-mix(in srgb, var(--amber) 10%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 26%, var(--border)); }
.cal-cell.unpaid  .cal-mark { color: var(--amber); }

.cal-key.holiday, .cal-key.leave { color: var(--accent); }
.cal-key.sick { color: var(--green); }
.cal-key.unpaid { color: var(--amber); }

.cal-stat.holiday strong, .cal-stat.leave strong { color: var(--accent); }
.cal-stat.sick strong { color: var(--green); }
.cal-stat.unpaid strong { color: var(--amber); }

.leave-balance { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.leave-balance .cal-stat { flex: 1 1 160px; }

.leave-table td { vertical-align: top; }

.holiday-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.holiday-chip {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  background: var(--surface-2);
  min-width: 130px;
}
.holiday-chip strong { font-size: 13px; color: var(--heading); }
.holiday-chip span { font-size: 12px; color: var(--muted); }
.holiday-chip.past { opacity: .5; }

/* Small status word. Used for leave state and for paid/unpaid, which is a
   different question from approved/rejected and reads better beside it. */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.pill.ok     { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.pill.warn   { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }
.pill.danger { background: color-mix(in srgb, var(--red) 14%, transparent);   color: var(--red); }
.pill.muted  { background: var(--surface-2); color: var(--muted); }

.leave-decide { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Count of things waiting on the admin, in the sidebar. */
.nav-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 16px;
}
.danger-text { color: var(--red); }
