/* FinSchool CRM theme (Filing Index style). Loaded after styles.css: restyles every shared
   component (colours, type, spacing, buttons, tabs, cards, tables, forms) without changing markup.
   The public enquiry and password-reset pages keep the finschools.in look and do not use this file. */

:root {
  --ink: #0f1e2e;
  --body-ink: #334155;
  --muted: #64748b;
  --line: #dfe5ec;
  --line-strong: #cbd5e1;
  --panel: #ffffff;
  --soft: #f3f6f9;
  --brand: #0f7f9b;
  --brand-strong: #0c6a82;
  --brand-soft: #e7f4f8;
  --navy: #0b1b2b;
  --navy-strong: #16293d;
  --nav-bg: #13324a;
  --nav-bg-2: #0f2639;
  --nav-ink: #d6e3ec;
  --nav-active: #1d5a6e;
  --stat-bg: #eef6fc;
  --stat-line: #cfe3f2;
  --stat-ink: #1769aa;
  --good: #15803d;
  --good-soft: #f0fdf4;
  --good-line: #bbf7d0;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --bad-line: #fecaca;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 30, 46, 0.05);
  --shadow-lg: 0 24px 60px rgba(15, 30, 46, 0.2);
  --ring: 0 0 0 3px rgba(15, 127, 155, 0.22);
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

body {
  background: var(--soft);
  color: var(--body-ink);
  font-family: var(--font);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(15, 127, 155, 0.18); }
* { scrollbar-width: thin; scrollbar-color: #b8c4d0 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #b8c4d0; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Icons (masks, so they follow the text colour) ---------- */
.nav-item::before,
.top-action-button::before,
.tools-menu > summary::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.nav-item, .top-action-button, .tools-menu > summary { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/></svg>"); }
[data-view="lead-dashboard"], [data-view="student-dashboard"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='7' height='9' rx='1'/><rect x='14' y='3' width='7' height='5' rx='1'/><rect x='14' y='12' width='7' height='9' rx='1'/><rect x='3' y='16' width='7' height='5' rx='1'/></svg>"); }
[data-view="lead-management"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M22 21v-2a4 4 0 0 0-3-3.87'/><path d='M16 3.13a4 4 0 0 1 0 7.75'/></svg>"); }
[data-view="student-list"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 10 12 5 2 10l10 5 10-5z'/><path d='M6 12v5c3 3 9 3 12 0v-5'/></svg>"); }
[data-view="exams"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='8' y='2' width='8' height='4' rx='1'/><path d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/><path d='m9 14 2 2 4-4'/></svg>"); }
[data-view="fee-collection"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='6' width='20' height='14' rx='2'/><path d='M2 10h20'/><path d='M6 15h4'/></svg>"); }
[data-view="placement"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='7' width='20' height='14' rx='2'/><path d='M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16'/></svg>"); }
[data-view="certificates"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='8' r='6'/><path d='M15.48 12.89 17 22l-5-3-5 3 1.52-9.11'/></svg>"); }
[data-view="reports"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 3v18h18'/><path d='M18 17V9'/><path d='M13 17V5'/><path d='M8 17v-3'/></svg>"); }
[data-view="expenses"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z'/><path d='M8 8h8'/><path d='M8 12h8'/><path d='M8 16h5'/></svg>"); }
[data-view="user-management"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='7' r='4'/><path d='M2 21v-2a4 4 0 0 1 4-4h6'/><circle cx='18' cy='17' r='3'/><path d='M18 12v2'/><path d='M18 20v2'/></svg>"); }
[data-view="settings"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/><path d='M12 2v3'/><path d='M12 19v3'/><path d='m4.9 4.9 2.1 2.1'/><path d='m17 17 2.1 2.1'/><path d='M2 12h3'/><path d='M19 12h3'/><path d='m4.9 19.1 2.1-2.1'/><path d='m17 7 2.1-2.1'/></svg>"); }
[data-view="backup-restore"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><ellipse cx='12' cy='5' rx='9' ry='3'/><path d='M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5'/><path d='M3 12c0 1.66 4 3 9 3s9-1.34 9-3'/></svg>"); }
[data-view="app-logs"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 6h13'/><path d='M8 12h13'/><path d='M8 18h13'/><path d='M3 6h.01'/><path d='M3 12h.01'/><path d='M3 18h.01'/></svg>"); }
#teamChatButton { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/></svg>"); }
#notificationButton { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/><path d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/></svg>"); }
#quickLeadButton, #quickStudentButton { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M12 5v14'/><path d='M5 12h14'/></svg>"); }
#saveNowButton { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>"); }
#logoutButton { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><path d='m16 17 5-5-5-5'/><path d='M21 12H9'/></svg>"); }
.tools-menu > summary { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/></svg>"); }
.tools-menu-list .top-action-button::before { display: none; }

/* ---------- Login ---------- */
.login-screen {
  background:
    radial-gradient(900px 500px at 85% 15%, rgba(15, 127, 155, 0.35), transparent 60%),
    linear-gradient(160deg, var(--nav-bg), var(--nav-bg-2));
}
.login-screen::before { border-color: rgba(255, 255, 255, 0.08); border-radius: 26px; }
.login-screen::after { color: rgba(255, 255, 255, 0.06); }
.login-card { border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); }
.login-heading h2 { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.login-heading p { color: var(--muted); }
.login-form label { color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.login-button { min-height: 46px; border: 0; border-radius: var(--radius-sm); background: var(--brand); color: #fff; font-weight: 700; box-shadow: 0 8px 20px rgba(15, 127, 155, 0.3); }
.login-button:hover { background: var(--brand-strong); }
.login-forgot { margin: 2px 0 0; text-align: center; font-size: 14px; }
.login-forgot a { color: var(--brand); font-weight: 700; text-decoration: none; }
.login-forgot a:hover { text-decoration: underline; }

/* ---------- App frame ---------- */
.app-shell { grid-template-columns: 272px minmax(0, 1fr); }
.sidebar {
  background: linear-gradient(180deg, var(--nav-bg), var(--nav-bg-2));
  color: var(--nav-ink);
  padding: 18px 14px;
  border-right: 0;
}
.sidebar-logo-brand {
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.nav { gap: 4px; }
.nav-group { gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.nav-heading {
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 12px 6px;
}
.nav-item {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--nav-ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 14px;
  font-size: 14.5px;
  font-weight: 600;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.nav-item::before { opacity: 0.85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; box-shadow: none; transform: none; }
.nav-item.active {
  background: var(--nav-active);
  border-color: rgba(94, 197, 220, 0.35);
  color: #fff;
  box-shadow: inset 3px 0 0 #5ec5dc;
  transform: none;
}
.nav-item.active::before { opacity: 1; }
.sidebar-user { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; }
.sidebar-user em { background: #5ec5dc; color: var(--navy); font-weight: 700; }

.workspace { padding: 0 28px 28px; }

/* ---------- Top bar: breadcrumb, title and tile buttons ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -28px 22px;
  padding: 18px 28px 16px;
  background: rgba(243, 246, 249, 0.9);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  align-items: flex-end;
}
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar h2 {
  display: flex;
  flex-direction: column;
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.topbar h2::before {
  content: "FinSchool CRM";
  margin-bottom: 6px;
  color: #475569;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.topbar-actions { gap: 10px; }
.top-action-button,
.chat-action, .notification-action, .lead-action, .student-action,
.logout-action, .backup-action, .save-now-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
  filter: none;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.top-action-button:hover { transform: none; filter: none; border-color: var(--brand); box-shadow: var(--ring); background: #fff; }
.chat-action { border-color: #b9dbe5; }
.chat-action::before { color: var(--brand); }
.notification-action { border-color: #f5d0a8; }
.notification-action::before { color: var(--warn); }
.lead-action, .student-action { border-color: var(--navy); background: var(--navy); color: #fff; }
.lead-action:hover, .student-action:hover { background: var(--navy-strong); border-color: var(--navy-strong); box-shadow: none; }
.save-now-action { border-color: var(--good-line); background: var(--good-soft); color: var(--good); }
.logout-action { border-color: var(--bad-line); color: var(--bad); }
.logout-action:hover { background: var(--bad-soft); border-color: var(--bad); box-shadow: none; }
.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  margin: 0;
}

/* Admin tools menu */
.tools-menu { position: relative; }
.tools-menu > summary { list-style: none; cursor: pointer; border-color: #ddd0fb; }
.tools-menu > summary::before { color: var(--violet); }
.tools-menu > summary::-webkit-details-marker { display: none; }
.tools-menu > summary::after { content: "▾"; font-size: 11px; color: var(--muted); }
.tools-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 210px;
  display: grid;
  gap: 4px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.tools-menu-list button,
.tools-menu-list .top-action-button {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  background: transparent;
  font-weight: 600;
}
.tools-menu-list button:hover { background: var(--soft); box-shadow: none; }
.tools-menu-list button[hidden] { display: none; }

/* ---------- Cards and figures ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel-header h3,
.section-title h2 { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.backup-panel { border-top: 1px solid var(--line); }
.backup-card { border: 1px solid var(--line); background: #fff; border-radius: 12px; box-shadow: none; }

.metric-grid { gap: 12px; }
.metric,
.metric:nth-child(2n), .metric:nth-child(3n), .metric:nth-child(4n) {
  position: relative;
  background: var(--stat-bg);
  border: 1px solid var(--stat-line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: none;
  overflow: hidden;
}
.metric::before,
.metric:nth-child(2n)::before, .metric:nth-child(3n)::before, .metric:nth-child(4n)::before { display: none; }
.metric span { color: var(--ink); font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; text-transform: none; }
.metric strong { color: var(--stat-ink); font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.metric-button:hover { border-color: var(--stat-ink); box-shadow: var(--ring); transform: none; }

/* ---------- Buttons ---------- */
.primary-button, .secondary-button, .danger-button, .icon-button, .file-button, .import-button,
.excel-button, .pdf-button, .ledger-button, .template-button,
.lead-export-button, .lead-export-button.csv, .lead-export-button.excel, .lead-export-button.pdf,
.certificate-export-button, .student-fetch-button, .student-list-clear-button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
  filter: none;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.primary-button { background: var(--brand); border-color: var(--brand); color: #fff; }
.primary-button:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.secondary-button, .icon-button, .template-button, .student-list-clear-button { background: #eef2f6; border-color: var(--line-strong); }
.secondary-button:hover, .icon-button:hover, .template-button:hover, .student-list-clear-button:hover { background: #e2e8f0; }
.excel-button, .lead-export-button.excel, .lead-export-button.csv, .import-button, .file-button { background: var(--good-soft); border-color: var(--good-line); color: var(--good); }
.excel-button:hover, .lead-export-button.excel:hover, .lead-export-button.csv:hover, .import-button:hover, .file-button:hover { background: #dcfce7; }
.pdf-button, .lead-export-button.pdf, .danger-button { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.pdf-button:hover, .lead-export-button.pdf:hover, .danger-button:hover { background: #fee2e2; }
.ledger-button, .student-fetch-button, .certificate-export-button { background: var(--brand-soft); border-color: #b9dbe5; color: var(--brand-strong); }
.ledger-button:hover, .student-fetch-button:hover, .certificate-export-button:hover { background: #d6edf4; }
.compact-button, .small-button { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: 8px; }
button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
/* "+ Add" buttons in panel headers read as the main action. */
.panel-header .primary-button { background: var(--navy); border-color: var(--navy); }
.panel-header .primary-button:hover { background: var(--navy-strong); border-color: var(--navy-strong); }

/* ---------- Tabs ---------- */
.segmented, .chat-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; background: transparent; border: 0; }
.segmented button, .segmented .primary-button, .segmented .secondary-button, .chat-tab-option span {
  flex: 1 1 150px;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: none;
}
.segmented button:hover { border-color: var(--brand); color: var(--brand-strong); background: #fff; }
.segmented .primary-button, .segmented button.active, .segmented button[aria-selected="true"], .chat-tab-option input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
#reports .segmented button { flex-basis: 200px; }

/* ---------- Forms and filters ---------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 14.5px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
textarea { min-height: 90px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
.field label, .filter-cell span {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
.lead-filter-table { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; background: #fff; padding: 6px; }
.filter-cell { border-color: transparent !important; background: #fff; }

/* ---------- Tables: light shaded header, full grid lines ---------- */
.table-wrap { border: 1px solid var(--line-strong); border-radius: 12px; overflow: auto; background: #fff; }
.table-wrap table, table { border-collapse: separate; border-spacing: 0; background: #fff; }
.table-wrap th, table th, .lead-table th,
.lead-report-table th, .student-list-table th, .fee-report-table th, .expense-report-table th,
.placement-report-table th, .certificate-table th, .app-log-table th, .expense-table th,
.backup-history-table th, .installment-schedule-table th, .student-master-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f4f8;
  color: var(--ink);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 16px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  vertical-align: middle;
}
.table-wrap th:last-child, table th:last-child { border-right: 0; }
.table-wrap th[colspan], table th[colspan],
.student-list-table th[colspan], .lead-report-table th[colspan], .fee-report-table th[colspan] {
  background: var(--brand-soft);
  color: var(--brand-strong);
  text-align: center;
  letter-spacing: 0.04em;
}
.table-wrap td, table td,
.lead-table tbody td, .lead-table tbody td:first-child, .lead-table tbody td:last-child {
  padding: 15px 14px;
  color: var(--ink);
  font-size: 14px;
  vertical-align: middle;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.table-wrap td:last-child, table td:last-child { border-right: 0; }
.table-wrap tbody tr:last-child td, table tbody tr:last-child td { border-bottom: 0; }
.table-wrap table tbody tr td, table tbody tr td { background: #fff; }
.table-wrap table tbody tr:hover td, table tbody tr:hover td { background: #f6fafc; }
/* Names in the first text column read in bold, as in the Filing Index screen. */
.lead-table tbody td strong, .student-list-table tbody td strong { color: var(--ink); font-weight: 700; }
table tfoot td, table tfoot th { position: static; background: #f1f4f8; color: var(--ink); font-weight: 700; border-top: 1px solid var(--line-strong); }
.lead-table { border-collapse: separate; border-spacing: 0; padding: 0; background: #fff; }
.lead-table tbody tr, .lead-table tbody tr:nth-child(even), .lead-table tbody tr:hover { background: transparent; box-shadow: none; }

/* ---------- Notices, modal, chat ---------- */
.notice { border: 1px solid #cfe3f2; background: var(--stat-bg); color: #1e3a5f; border-radius: 12px; }
.danger-notice { border-color: var(--bad-line); background: var(--bad-soft); color: #991b1b; }
.certificate-report-title, #studentLeadFetchPanel { border: 1px solid #b9dbe5; border-radius: 12px; background: var(--brand-soft); }
.certificate-section h3 { background: #f1f4f8; color: var(--ink); border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.modal-backdrop { background: rgba(11, 27, 43, 0.5); backdrop-filter: blur(4px); }
.modal { border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-header h3 { font-size: 19px; font-weight: 700; color: var(--ink); }
.icon-button { border-radius: 999px; min-width: 38px; }
.chat-drawer { border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.chat-drawer-header { background: linear-gradient(160deg, var(--nav-bg), var(--nav-bg-2)); color: #fff; }
.chat-drawer-body { background: var(--soft); }
.chat-avatar { background: var(--brand); }
.chat-bubble { border-radius: 14px; border: 1px solid var(--line); }
.chat-row.own .chat-bubble { background: var(--brand); border-color: var(--brand); color: #fff; }
.chat-row.own .chat-bubble small, .chat-row.own .chat-meta { color: rgba(255, 255, 255, 0.85); }
.chat-send-button { background: var(--brand); color: #fff; border: 0; border-radius: var(--radius-sm); }
.chat-message { background: #fff; border: 1px solid var(--line); border-radius: 12px; }

/* ---------- Layout fixes ---------- */
.settings-two-column > *, .settings-left > *, .settings-right > *, .settings-grid > *, .dashboard-tabs > *, .split > * { min-width: 0; }
.settings-two-column { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Phone layout ---------- */
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}
.sidebar-backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(11, 27, 43, 0.5); }
.sidebar-backdrop[hidden] { display: none; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .workspace { padding: 0 16px 20px; }
  .menu-toggle { display: inline-grid; place-items: center; flex: none; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    width: min(290px, 86vw);
    height: 100vh;
    transform: translateX(-102%);
    transition: transform 200ms ease;
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open { overflow: hidden; }
  .topbar { margin: 0 -16px 16px; padding: 12px 16px; flex-wrap: wrap; gap: 10px; align-items: center; }
  .topbar h2 { font-size: 22px; }
  .topbar h2::before { font-size: 11px; margin-bottom: 3px; }
  .topbar-actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding: 8px 2px 2px; }
  .topbar-actions > * { flex: none; }
  .tools-menu-list { position: fixed; right: 16px; left: auto; top: auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel { padding: 16px; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); overflow: auto; }
  .settings-two-column, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .metric-grid { grid-template-columns: 1fr; }
  .segmented button, .segmented .primary-button, .segmented .secondary-button { flex: 1 1 calc(50% - 8px); }
  .login-card { padding: 24px; }
}

/* =================== Workspace: dashboard, to-do, notification centre, chat =================== */
.ws-tone-blue { --tone: #1d63c9; --tone-soft: #eef4fe; --tone-line: #c9dcf8; }
.ws-tone-green { --tone: #15803d; --tone-soft: #effbf3; --tone-line: #bfe9cd; }
.ws-tone-amber { --tone: #b45309; --tone-soft: #fff8ec; --tone-line: #f5d9ad; }
.ws-tone-violet { --tone: #7c3aed; --tone-soft: #f5f1ff; --tone-line: #ddd0fb; }
.ws-tone-teal { --tone: #0f7f8f; --tone-soft: #ebf8f8; --tone-line: #bfe5e6; }
.ws-tone-red { --tone: #d0304a; --tone-soft: #fff1f3; --tone-line: #f7c6cf; }
.ws-eyebrow { display: block; color: #475569; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }

/* Existing dashboards: tinted KPI tiles */
#lead-dashboard .metric-grid, #student-dashboard .metric-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
#lead-dashboard .metric, #student-dashboard .metric { border-top: 4px solid var(--tone, #1d63c9); background: linear-gradient(160deg, #fff, var(--tone-soft, #eef4fe)); border-color: var(--tone-line, #c9dcf8); border-top-color: var(--tone, #1d63c9); }
#lead-dashboard .metric strong, #student-dashboard .metric strong { color: var(--tone, #1d63c9); }
#lead-dashboard .metric:nth-child(6n+1), #student-dashboard .metric:nth-child(6n+1) { --tone: #1d63c9; --tone-soft: #eef4fe; --tone-line: #c9dcf8; }
#lead-dashboard .metric:nth-child(6n+2), #student-dashboard .metric:nth-child(6n+2) { --tone: #15803d; --tone-soft: #effbf3; --tone-line: #bfe9cd; }
#lead-dashboard .metric:nth-child(6n+3), #student-dashboard .metric:nth-child(6n+3) { --tone: #b45309; --tone-soft: #fff8ec; --tone-line: #f5d9ad; }
#lead-dashboard .metric:nth-child(6n+4), #student-dashboard .metric:nth-child(6n+4) { --tone: #7c3aed; --tone-soft: #f5f1ff; --tone-line: #ddd0fb; }
#lead-dashboard .metric:nth-child(6n+5), #student-dashboard .metric:nth-child(6n+5) { --tone: #0f7f8f; --tone-soft: #ebf8f8; --tone-line: #bfe5e6; }
#lead-dashboard .metric:nth-child(6n), #student-dashboard .metric:nth-child(6n) { --tone: #d0304a; --tone-soft: #fff1f3; --tone-line: #f7c6cf; }

/* Overview */
.ws-filterbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ws-filter-note { margin: 0; color: var(--muted); font-size: 13px; }
.ws-field { display: grid; gap: 6px; min-width: 0; }
.ws-field > span { color: var(--ink); font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.ws-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.ws-kpi {
  display: grid; gap: 6px; text-align: left; padding: 16px 18px; cursor: pointer;
  border: 1px solid var(--tone-line); border-top: 4px solid var(--tone); border-radius: 14px;
  background: linear-gradient(160deg, #fff 30%, var(--tone-soft));
  transition: box-shadow 150ms ease, transform 150ms ease;
}
.ws-kpi:hover { box-shadow: 0 10px 24px rgba(15, 30, 46, 0.08); transform: translateY(-1px); }
.ws-kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 700; }
.ws-kpi-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--tone); color: #fff; }
.ws-kpi strong { color: var(--tone); font-size: 27px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; overflow-wrap: anywhere; }
.ws-kpi small { color: var(--muted); font-size: 12.5px; }
.ws-grid-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.ws-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ws-card { border-top: 4px solid var(--accent, var(--brand)); }
.ws-accent-teal { --accent: #0f7f8f; }
.ws-accent-violet { --accent: #7c3aed; }
.ws-accent-amber { --accent: #d39410; }
.ws-accent-red { --accent: #d0304a; }
.ws-accent-green { --accent: #15803d; }
.ws-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ws-card-head h3 { margin: 4px 0 0; color: var(--ink); font-size: 18px; font-weight: 700; }
.ws-card-note { margin: 12px 0 14px; color: var(--muted); font-size: 13px; }
.ws-link { border: 0; border-radius: 8px; padding: 7px 12px; background: var(--brand-soft); color: var(--brand-strong); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ws-link:hover { background: #d6edf4; }
.ws-pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.ws-step { display: grid; gap: 6px; align-content: start; padding: 12px; border: 1px solid var(--tone-line); border-bottom: 3px solid var(--tone); border-radius: 12px; background: var(--tone-soft); }
.ws-step-no { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--tone); color: #fff; font-size: 12px; font-weight: 800; }
.ws-step strong { color: var(--tone); font-size: 26px; font-weight: 800; line-height: 1.1; }
.ws-step > span:not(.ws-step-no):not(.ws-bar) { color: var(--ink); font-size: 13px; font-weight: 600; min-height: 34px; }
.ws-bar { display: block; height: 6px; border-radius: 999px; background: rgba(15, 30, 46, 0.08); overflow: hidden; }
.ws-bar i { display: block; height: 100%; border-radius: inherit; background: var(--tone, var(--brand)); }
.ws-funnel { display: grid; gap: 8px; }
.ws-funnel-row { display: grid; grid-template-columns: minmax(120px, 1.1fr) 2fr 40px 44px; align-items: center; gap: 10px; padding: 10px 12px; border-left: 4px solid var(--tone); border-radius: 10px; background: var(--tone-soft); color: var(--ink); font-size: 13.5px; }
.ws-funnel-row strong { color: var(--tone); text-align: right; }
.ws-funnel-row em { color: var(--muted); font-style: normal; font-size: 12px; text-align: right; }
.ws-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.ws-list li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.ws-list li:last-child { border-bottom: 0; }
.ws-list strong { display: block; color: var(--ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-list small { color: var(--muted); font-size: 12.5px; }
.ws-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.ws-dot.is-bad { background: var(--bad); }
.ws-date { color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.ws-empty { margin: 14px 0 0; color: var(--muted); }
.ws-chart { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 10px; height: 200px; margin-top: 14px; }
.ws-col { display: grid; grid-template-rows: auto 1fr auto; align-items: end; justify-items: center; gap: 6px; height: 100%; }
.ws-col i { width: 70%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #34a37a, #15803d); align-self: end; }
.ws-col span { color: var(--muted); font-size: 12px; font-weight: 600; }
.ws-col .ws-col-val { color: var(--ink); font-size: 10.5px; white-space: nowrap; }

/* To-Do */
.ws-page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ws-sub { margin: 0; color: var(--muted); }
.ws-dark { background: var(--navy) !important; border-color: var(--navy) !important; }
.ws-dark:hover { background: var(--navy-strong) !important; }
.ws-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ws-tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: #eef2f6; color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; }
.ws-tabs button span { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: rgba(15, 30, 46, 0.08); font-size: 12px; text-align: center; }
.ws-tabs button.is-active { border-color: var(--brand); background: #fff; color: var(--brand-strong); box-shadow: inset 0 0 0 1px var(--brand); }
.ws-tabs button.is-active span { background: var(--brand); color: #fff; }
.ws-filter-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ws-filter-title strong { color: var(--ink); font-size: 15px; }
.ws-filter-title span { color: var(--muted); font-size: 13px; }
.ws-filter-title .ws-link { margin-left: auto; }
.ws-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ws-wide { grid-column: span 2; }
.ws-todo-table { margin-top: 16px; }
.ws-cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-overdue { color: var(--bad) !important; font-weight: 700; }
.ws-overdue small { display: block; font-weight: 700; }
.ws-actions { white-space: nowrap; }
.ws-actions .compact-button { margin-right: 4px; }
.ws-empty-row { padding: 28px !important; text-align: center; color: var(--muted) !important; }
.ws-pill { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ws-kind-reminder { background: #eef4fe; color: #1d63c9; }
.ws-kind-task { background: #ebf8f2; color: #0f7a55; }
.ws-pri-high { background: #fff1f3; color: #c0263f; }
.ws-pri-medium { background: #ebf8f6; color: #0f7f74; }
.ws-pri-low { background: #f1f5f9; color: #475569; }
.ws-st-open { background: #eef4fe; color: #1d63c9; }
.ws-st-in-progress { background: #fff8ec; color: #b45309; }
.ws-st-on-hold { background: #fff1f3; color: #c0263f; }
.ws-st-completed { background: #effbf3; color: #15803d; }
.ws-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ws-form textarea { min-height: 80px; }

/* Workspace windows (notification centre, team chat) */
body.ws-locked { overflow: hidden; }
.ws-overlay { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 28px; background: rgba(11, 27, 43, 0.45); backdrop-filter: blur(5px); }
.ws-overlay.is-open { display: grid; }
.ws-window { width: min(1180px, 100%); max-height: calc(100vh - 56px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-lg); }
.ws-window-head { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #f2f9fb, #fff); }
.ws-window-icon { width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(15, 127, 155, 0.3); }
.ws-window-icon svg { width: 24px; height: 24px; }
.ws-window-titles { min-width: 0; }
.ws-window-titles .ws-eyebrow { color: var(--brand-strong); }
.ws-window-titles h2 { margin: 2px 0; color: var(--ink); font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.ws-window-titles p { margin: 0; color: var(--muted); font-size: 13.5px; }
.ws-window-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ws-icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; }
.ws-icon-btn:hover { background: var(--soft); }
.ws-window-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.ws-window-foot .secondary-button, .ws-notify-bar .secondary-button { display: inline-flex; align-items: center; gap: 8px; }
.ws-empty-big { display: grid; justify-items: center; gap: 6px; padding: 48px 20px; color: var(--muted); text-align: center; }
.ws-empty-big svg { width: 40px; height: 40px; color: #94a3b8; }
.ws-empty-big strong { color: var(--ink); font-size: 16px; }

.ws-window-notifications { max-width: 1120px; }
.ws-notify-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.ws-tabs-sm { margin: 0; }
.ws-tabs-sm button { min-width: 90px; justify-content: center; }
.ws-tabs-sm button.is-active { background: var(--brand); color: #fff; box-shadow: none; }
.ws-tabs-sm button.is-active span { background: rgba(255, 255, 255, 0.25); }
.ws-notify-list { flex: 1; overflow: auto; padding: 16px 24px; display: grid; gap: 10px; align-content: start; background: #f8fafc; }
.ws-notify { display: grid; grid-template-columns: 10px 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid #c9dfe8; border-radius: 14px; background: #fff; }
.ws-notify.is-read { border-color: var(--line); opacity: 0.8; }
.ws-unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); }
.ws-notify.is-read .ws-unread-dot { background: transparent; }
.ws-notify-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--tone-soft); color: var(--tone); }
.ws-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--tone-soft); color: var(--tone); font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.ws-notify-body h4 { margin: 4px 0 2px; color: var(--ink); font-size: 15.5px; font-weight: 700; }
.ws-notify-body p { margin: 0 0 4px; color: var(--body-ink); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-notify-body small { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; }
.ws-notify-body small b { color: var(--bad); font-weight: 600; }
.ws-notify.is-read .ws-notify-body small b { color: var(--muted); }
.ws-notify-actions { display: flex; gap: 8px; }
.ws-notify-actions .secondary-button { display: inline-flex; align-items: center; gap: 6px; background: #fff; }
.ws-btn-open { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 1px solid #b9dbe5; border-radius: 10px; background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; cursor: pointer; }
.ws-btn-open:hover { background: #d6edf4; }

.ws-window-chat { height: calc(100vh - 56px); }
.ws-chat { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); }
.ws-convs { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.ws-convs-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.ws-convs-head strong { color: var(--ink); font-size: 15px; }
.ws-convs-head span { color: var(--muted); font-size: 12px; }
.ws-search { display: flex; align-items: center; gap: 8px; margin: 12px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--muted); }
.ws-search:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.ws-search input { flex: 1; min-height: 40px !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; background: transparent !important; }
.ws-conv-list { flex: 1; overflow: auto; padding: 0 12px 12px; display: grid; gap: 8px; align-content: start; }
.ws-conv { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; cursor: pointer; }
.ws-conv:hover { border-color: #b9dbe5; }
.ws-conv.is-active { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.ws-conv-text strong { display: block; color: var(--ink); font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-conv-text small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #e1f2f5; color: var(--brand-strong); font-size: 13px; font-weight: 800; }
.ws-avatar-lg { width: 46px; height: 46px; }
.ws-count { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 800; }
.ws-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ws-thread-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ws-thread-head strong { display: block; color: var(--ink); font-size: 17px; }
.ws-thread-head small { color: var(--muted); font-size: 12.5px; }
.ws-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ws-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border: 1px solid #b9dbe5; border-radius: 8px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 600; }
.ws-chip i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px; background: #e1f2f5; color: var(--brand-strong); font-size: 9.5px; font-style: normal; font-weight: 800; }
.ws-messages { flex: 1; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; background: #f4f8fa; }
.ws-day { display: flex; justify-content: center; margin: 6px 0; }
.ws-day span { padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 700; }
.ws-msg { display: flex; }
.ws-msg.is-own { justify-content: flex-end; }
.ws-bubble { max-width: min(560px, 78%); padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; background: #fff; box-shadow: var(--shadow); }
.ws-msg.is-own .ws-bubble { border-color: var(--brand); border-radius: 14px 14px 4px 14px; background: var(--brand); color: #fff; }
.ws-bubble b { display: block; margin-bottom: 2px; color: var(--brand-strong); font-size: 12.5px; }
.ws-bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.ws-bubble small { display: block; margin-top: 4px; text-align: right; color: var(--muted); font-size: 11px; }
.ws-msg.is-own .ws-bubble small { color: rgba(255, 255, 255, 0.8); }
.ws-attachment { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #f8fafc; color: var(--ink); font-size: 13px; cursor: pointer; }
.ws-composer { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fff; }
.ws-attach { display: inline-flex !important; align-items: center; gap: 6px; cursor: pointer; flex: none; }
.ws-compose-field { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ws-compose-field input { width: 100%; }
.ws-file-name { color: var(--brand-strong); font-size: 12.5px; font-weight: 600; }
.ws-send { width: 48px; height: 46px; flex: none; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--navy); color: #fff; cursor: pointer; }
.ws-send:hover { background: var(--navy-strong); }

@media (max-width: 1280px) {
  .ws-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ws-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .ws-grid-2, .ws-grid-3 { grid-template-columns: 1fr; }
  .ws-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-overlay { padding: 0; }
  .ws-window { max-height: 100vh; height: 100vh; border-radius: 0; }
  .ws-chat { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .ws-convs { max-height: 34vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .ws-notify { grid-template-columns: 10px 40px minmax(0, 1fr); }
  .ws-notify-actions { grid-column: 2 / -1; }
}
@media (max-width: 560px) {
  .ws-kpis, .ws-filters, .ws-form, .ws-pipeline { grid-template-columns: 1fr; }
  .ws-wide { grid-column: auto; }
  .ws-funnel-row { grid-template-columns: 1fr 1fr 32px; }
  .ws-funnel-row em { display: none; }
  .ws-window-head { padding: 14px 16px; }
  .ws-window-titles h2 { font-size: 20px; }
}

/* Accounts pages */
.acc-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.acc-kpi { cursor: default; }
.acc-kpi:hover { transform: none; box-shadow: none; }
.acc-num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.acc-in { color: var(--good) !important; font-weight: 700; }
.acc-out { color: var(--bad) !important; font-weight: 700; }
tr.acc-bf td { background: var(--brand-soft) !important; }
.acc-bill-frame { width: 100%; height: min(70vh, 760px); border: 1px solid var(--line); border-radius: 12px; background: #fff; }
@media (max-width: 980px) { .acc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .acc-kpis { grid-template-columns: 1fr; } }

/* Date fields: calendar icon (click it to open the date picker) */
input[data-date-input]:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
form input[data-date-input] {
  padding-right: 40px !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f7f9b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><path d='M16 2v4'/><path d='M8 2v4'/><path d='M3 10h18'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 18px 18px !important;
  cursor: text;
}
.date-picker-proxy-global { position: fixed; z-index: -1; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.readonly-input { background: var(--soft) !important; color: var(--muted) !important; cursor: not-allowed; }

/* ---------- Row actions: ⋯ menu ---------- */
td.inline-actions[data-kebab], td.ws-actions[data-kebab] { width: 72px; text-align: center; white-space: nowrap; }
.kebab-trigger {
  width: 44px; height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; cursor: pointer;
}
.kebab-trigger span { width: 4px; height: 4px; border-radius: 50%; background: var(--ink); }
.kebab-trigger:hover, .kebab-trigger[aria-expanded="true"] { border-color: var(--brand); box-shadow: var(--ring); }
.kebab-menu {
  position: fixed; z-index: 70; min-width: 190px; display: grid; gap: 2px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.kebab-menu[hidden] { display: none; }
.kebab-menu > button, .kebab-menu > a, .kebab-menu > label {
  width: 100%; min-height: 36px; margin: 0 !important; display: flex; align-items: center; justify-content: flex-start;
  padding: 7px 12px !important; border: 0 !important; border-radius: 8px !important; box-shadow: none !important;
  background: transparent !important; color: var(--ink) !important; font-size: 14px !important; font-weight: 600 !important; text-align: left; cursor: pointer;
}
.kebab-menu > button:hover, .kebab-menu > a:hover, .kebab-menu > label:hover { background: var(--soft) !important; }
.kebab-menu > .danger-button, .kebab-menu > .danger-inline, .kebab-menu > [data-action$="delete"], .kebab-menu > [data-ws="todo-delete"] { color: var(--bad) !important; }
.kebab-menu > .danger-button:hover, .kebab-menu > [data-action$="delete"]:hover { background: var(--bad-soft) !important; }

/* ---------- Filter bars: compact date boxes and small buttons ---------- */
.lead-filter-table {
  display: flex !important; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 12px 14px;
}
.lead-filter-table .filter-cell { flex: 1 1 170px; padding: 0; border: 0 !important; background: transparent; }
.lead-filter-table .filter-cell:has(input[data-date-input]) { flex: 0 0 170px; }
.lead-filter-table .filter-actions { flex: 0 0 auto; padding: 0; border: 0 !important; background: transparent; }
.lead-filter-table .filter-actions button,
.filter-actions button {
  width: auto !important; min-width: 84px; min-height: 40px; padding: 7px 16px; font-size: 13.5px;
}
.lead-period-row .filter-actions:first-of-type { margin-left: 4px; }
td.lead-mobile { white-space: nowrap; }
td.lead-mobile a { color: var(--ink); text-decoration: none; font-weight: 600; }
td.lead-mobile a:hover { color: var(--brand); text-decoration: underline; }
@media (max-width: 560px) {
  .lead-filter-table .filter-cell, .lead-filter-table .filter-cell:has(input[data-date-input]) { flex: 1 1 100%; }
}

/* Student Master: status dialog and filter row */
.ws-status-now { margin: 0; color: var(--body-ink); }
.ws-status-history { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); font-size: 13px; }
.ws-status-history ul { margin: 6px 0 0; padding-left: 18px; color: var(--body-ink); }
.ws-form [hidden] { display: none !important; }
.student-filter-row .filter-cell:first-child { flex: 2 1 220px; }

/* ---------- Desktop: show everything at 85% size ---------- */
/* Phones and tablets keep full size. Screen-height rules are divided by the zoom so panels,
   the sidebar and dialogs still fill the window exactly. */
@media (min-width: 981px) {
  html { zoom: 0.85; }
  .login-screen, .app-shell { min-height: calc(100vh / 0.85); }
  .sidebar { height: calc(100vh / 0.85); }
  .chat-drawer { height: calc(100vh / 0.85 - 24px); width: min(560px, calc(100vw / 0.85 - 24px)); }
  .modal { max-height: min(calc(88vh / 0.85), 1060px); }
  .ws-window { max-height: calc(100vh / 0.85 - 56px); }
  .ws-window-chat { height: calc(100vh / 0.85 - 56px); }
  .acc-bill-frame { height: min(calc(70vh / 0.85), 900px); }
}
