/* Komandur — Centralised Concern Redressal System
   Magenta #9e156f · Navy #2f2f91 · Accent #1f8ec8 */

:root {
  --magenta: #9e156f;
  --magenta-dark: #7c1056;
  --magenta-light: #f8edf5;
  --navy: #2f2f91;
  --navy-dark: #1f1f6b;
  --navy-light: #eef0fb;
  --accent: #1f8ec8;
  --accent-light: #e8f6fc;
  --surface: #f4f6fc;
  --surface-2: #ffffff;
  --border: #dde3f0;
  --border-soft: #e8ecf4;
  --text: #1a1a3e;
  --text-soft: #5c5f7a;
  --ok: #0d7a3e;
  --warn: #b45309;
  --danger: #be123c;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(31, 31, 107, 0.06);
  --shadow-md: 0 8px 24px rgba(31, 31, 107, 0.08);
  --shadow-lg: 0 16px 40px rgba(31, 31, 107, 0.12);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar-w: 268px;
  --space-1: 0.4rem;
  --space-2: 0.65rem;
  --space-3: 0.9rem;
  --space-4: 1.15rem;
  --space-5: 1.5rem;
  --control-h: 42px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  margin: 0;
  font: 14px/1.55 "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--text);
  background: var(--surface);
  overflow-x: hidden;
  max-width: 100vw;
}

#app, #login-view {
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  min-height: 100vh;
}

::selection {
  background: rgba(158, 21, 111, 0.15);
}

a { color: var(--magenta); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3 {
  margin: 0 0 0.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy-dark);
}

h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

.muted { color: var(--text-soft); font-size: 0.9rem; }
.hint, .small { color: var(--text-soft); font-size: 0.82rem; line-height: 1.45; }
.mono {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
}
.hidden { display: none !important; }

/* —— Full-page loader (WeCare logo) —— */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.5rem max(1.5rem, env(safe-area-inset-bottom));
  background: linear-gradient(160deg, #2f2f91 0%, #1e1e6b 48%, #141452 100%);
  transition: opacity 0.22s var(--ease), visibility 0.22s var(--ease);
}

.page-loader.hidden {
  display: none !important;
}

.page-loader.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.page-loader-logo-wrap {
  position: relative;
  width: min(220px, 72vw);
  height: min(220px, 72vw);
  display: grid;
  place-items: center;
}

.page-loader-logo {
  position: relative;
  z-index: 1;
  width: 78%;
  height: auto;
  max-height: 78%;
  object-fit: contain;
  background: #fff;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  animation: page-loader-pulse 1.6s var(--ease) infinite;
}

.page-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.92);
  animation: page-loader-spin 0.95s linear infinite;
}

.page-loader-text {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

body.page-is-loading .erp-shell,
body.page-is-loading .login-wrap,
body.page-is-loading .public-header,
body.page-is-loading .public-main {
  visibility: hidden;
}

@keyframes page-loader-spin {
  to { transform: rotate(360deg); }
}

@keyframes page-loader-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.97); opacity: 0.92; }
}
.error { color: var(--danger); margin: 0; font-weight: 500; font-size: 0.86rem; }

.success {
  border: 1px solid #9ed8b2;
  background: #eefcf3;
  color: #135b31;
  border-radius: var(--radius-sm);
  padding: 1rem;
}

/* ─── Auth (login) ─── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 3rem;
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 55%, #3a3aa8 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(158, 21, 111, 0.35), transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(31, 142, 200, 0.25), transparent 40%);
  pointer-events: none;
}

.auth-logo, .auth-title, .auth-lead, .auth-parent-link {
  position: relative;
  z-index: 1;
}

.auth-logo {
  max-width: 220px;
  max-height: 260px;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #fff;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.auth-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}

.auth-lead {
  margin: 0;
  max-width: 360px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}

.auth-parent-link {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: background 0.2s var(--ease);
}

.auth-parent-link:hover {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--surface);
}

.auth-form-panel--solo { grid-column: 1 / -1; }

.auth-page--compact { grid-template-columns: 1fr; }

.login-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 1.5rem;
}

.login-wrap:has(.auth-page) {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.login-panel {
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
}

/* ─── Public concern form ─── */
.public-page { background: var(--surface); min-height: 100vh; }

.public-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.public-header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.public-logo {
  max-width: 180px;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.public-login-link { white-space: nowrap; }

.public-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.public-form-panel { box-shadow: var(--shadow-md); }

.panel-head { margin-bottom: 1rem; }

.public-app-name {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--magenta);
}

/* ─── Cards & forms ─── */
.panel, .card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.stack { display: flex; flex-direction: column; gap: var(--space-2); }
.stack-tight { gap: var(--space-1); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--navy-dark);
}

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:hover, select:hover, textarea:hover { border-color: #c5cee0; }

input:focus, select:focus, textarea:focus {
  border-color: var(--magenta);
  box-shadow: 0 0 0 3px rgba(158, 21, 111, 0.12);
}

textarea { min-height: 100px; resize: vertical; }

label.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  cursor: pointer;
}

label.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

.file-upload-label input[type="file"] {
  padding: 0.45rem 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.file-upload-label input[type="file"]::file-selector-button {
  margin-right: 0.65rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--navy-light);
  color: var(--navy);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button, .nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--control-h);
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--magenta) 0%, #b51a82 100%);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(158, 21, 111, 0.28);
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s;
}

button:hover, .nav-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 18px rgba(158, 21, 111, 0.32);
}

button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

button:focus-visible, .nav-btn:focus-visible, .ghost:focus-visible, .tab:focus-visible, .ticket-row:focus-visible, .action-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ghost, .sidebar-signout {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.ghost:hover, .sidebar-signout:hover {
  background: var(--navy-light);
  border-color: #c5cee0;
  filter: none;
}

.ghost.small {
  min-height: 32px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 14px rgba(190, 18, 60, 0.28);
}

.btn-danger:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 18px rgba(190, 18, 60, 0.34);
}

.danger-zone {
  border-color: rgba(190, 18, 60, 0.35);
  background: #fff8fa;
}

.otp-reopen-block {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-soft);
}

.otp-reopen-hint {
  margin: 0 0 0.55rem;
}

.close-queue-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.otp-reopen-inline {
  margin: 0;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem;
  margin-bottom: 0.75rem;
  background: var(--navy-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}

.tab {
  flex: 1;
  background: transparent;
  color: var(--navy);
  box-shadow: none;
  min-height: 38px;
}

.tab:hover { background: rgba(255, 255, 255, 0.8); filter: none; }

.tab.active {
  background: var(--surface-2);
  color: var(--magenta);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* ─── App shell ─── */
.erp-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: stretch;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
}

/* Suite embed: column layout + navy top menu (matches HR Feedback / We Support) */
.erp-shell--suite {
  grid-template-columns: 1fr;
  min-height: 100%;
}

.suite-topnav-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--navy);
  color: #fff;
}

.suite-topnav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 0;
}

.suite-topnav-logo {
  height: 34px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  padding: 5px 9px;
}

.suite-topnav-titles strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #fff;
}

.suite-topnav-titles small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.suite-topnav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-align: right;
}

.suite-topnav-user .user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.suite-topnav-user-text {
  min-width: 0;
}

.suite-topnav-user-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.suite-topnav-user-text small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.suite-topnav-tabs {
  position: sticky;
  top: 58px;
  z-index: 30;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  width: 100%;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--navy);
  scrollbar-width: none;
}

.suite-topnav-tabs::-webkit-scrollbar {
  display: none;
}

/* Compact tabs — do NOT use .nav-btn (sidebar sets width:100% + magenta CTA styles) */
.suite-topnav-tabs .suite-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
  filter: none;
  transform: none;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.suite-topnav-tabs .suite-tab:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
  filter: none;
  box-shadow: none;
  transform: none;
}

.suite-topnav-tabs .suite-tab.active {
  color: #fff;
  background: rgba(158, 21, 111, 0.28);
  border-bottom-color: var(--magenta);
  box-shadow: none;
}

.suite-topnav-tabs .suite-tab .nav-badge {
  margin-left: 4px;
  min-width: 1.1rem;
  height: 1.1rem;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.suite-topnav-tabs .suite-tab.active .nav-badge {
  background: rgba(255, 255, 255, 0.28);
}

.suite-filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 24px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

body.crs-suite-embed .erp-shell--suite .erp-main-wrap {
  min-width: 0;
}

body.crs-suite-embed .erp-shell--suite .main {
  padding-top: 0;
}

@media (max-width: 760px) {
  .suite-topnav-header {
    padding: 12px 16px;
  }

  .suite-topnav-tabs {
    top: 56px;
    padding: 0 12px;
  }

  .suite-topnav-user-text,
  .suite-topnav-titles small {
    display: none;
  }

  .suite-topnav-tabs .suite-tab {
    padding: 10px 12px;
    font-size: 13px;
  }

  .suite-filterbar {
    padding: 10px 16px;
  }
}

.erp-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 100vh;
  height: 100%;
  padding: var(--space-4) var(--space-3);
  background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 100%);
  color: #fff;
  box-sizing: border-box;
}

.brand-block {
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.brand-logo {
  width: 100%;
  max-width: 180px;
  max-height: 150px;
  height: auto;
  object-fit: contain;
  display: block;
  padding: 0.4rem 0.5rem;
  background: #fff;
  border-radius: var(--radius-sm);
}

.brand-tagline {
  margin: 0.55rem 0 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--magenta), #b51a82);
  color: #fff;
  flex-shrink: 0;
}

.user-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.user-role {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.nav-section-label {
  margin: 0;
  padding: 0 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.nav-toggle {
  display: none;
  width: 100%;
  min-height: 40px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.nav-btn {
  width: 100%;
  justify-content: flex-start;
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  box-shadow: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.86rem;
  text-align: left;
  position: relative;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  filter: none;
  transform: none;
  box-shadow: none;
}

.nav-btn.active {
  background: var(--magenta);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: auto;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #fff;
  color: var(--magenta);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.nav-btn.active .nav-badge {
  background: rgba(255, 255, 255, 0.95);
  color: var(--magenta-dark);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.sidebar-signout {
  width: 100%;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-signout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.erp-main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  height: 100%;
  overflow-x: hidden;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: 1rem 1.75rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar-leading {
  min-width: 0;
}

.topbar-school-filter {
  flex-shrink: 0;
}

.topbar-school-filter .school-filter-select {
  margin: 0;
}

.page-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy-dark);
  letter-spacing: -0.03em;
}

.page-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--magenta);
}

.topbar-divider {
  width: 4px;
  height: 40px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--magenta), var(--accent));
}

.main {
  flex: 1;
  padding: 1.5rem 1.75rem 2rem;
  width: 100%;
}

.page-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 1200px;
  width: 100%;
  min-width: 0;
}

/* Legacy bar (public header fallback) */
.bar {
  border-bottom: 3px solid var(--accent);
  background: var(--surface-2);
  padding: 0.85rem 1.25rem;
}

.brand-ribbon { color: var(--navy); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

/* ─── Dashboard ─── */
.dashboard-page { display: flex; flex-direction: column; gap: var(--space-4); }

.dashboard-filter {
  display: flex;
  justify-content: flex-end;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.page-head h2 { margin: 0; }

.page-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.school-filter-select {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
  min-width: 0;
}

.school-filter-select select {
  min-width: 14rem;
  width: 100%;
  min-height: 2.5rem;
  font-weight: 500;
}

.multi-select {
  position: relative;
  min-width: 14rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.multi-select-label {
  display: block;
  margin-bottom: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
}

.multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.multi-select-trigger > span,
.multi-select-trigger-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-trigger::after {
  content: "▾";
  flex-shrink: 0;
  margin-left: 0.35rem;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.multi-select-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 24, 60, 0.12);
  max-height: 16rem;
  overflow: auto;
}

.multi-select-panel[hidden] {
  display: none !important;
}

.multi-select-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  width: 100%;
  box-sizing: border-box;
}

.multi-select-option:hover {
  background: var(--surface);
}

.multi-select-option input[type="checkbox"] {
  width: 1rem !important;
  min-width: 1rem;
  max-width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  flex: 0 0 1rem;
  align-self: center;
  accent-color: var(--navy);
  border-radius: 3px;
  background: #fff;
}

.multi-select-option span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  padding-top: 0.35rem;
  margin-top: 0.2rem;
  border-top: 1px solid var(--border);
}

.ticket-list-filters {
  margin-bottom: var(--space-3);
  padding: 0.85rem 1rem;
}

.ticket-search-field {
  display: block;
  margin-bottom: 0.85rem;
}

.ticket-search-field > span,
.ticket-search-field {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
}

.ticket-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 0.35rem;
}

.ticket-search-wrap input[type="search"] {
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  color: var(--text);
}

.ticket-search-wrap input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.ticket-search-wrap input[type="search"]:focus {
  outline: 2px solid rgba(47, 47, 145, 0.25);
  border-color: var(--indigo);
}

.ticket-search-clear {
  position: absolute;
  right: 0.35rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
}

.ticket-list-filters-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: var(--space-2);
}

.ticket-list-filters-grid > * {
  flex: 1 1 0;
  min-width: 0;
}

.ticket-list-filters-grid .school-filter-select select,
.ticket-list-filters-grid .multi-select {
  min-width: 0;
  width: 100%;
}

.ticket-list-filter-summary {
  margin: -0.5rem 0 var(--space-2);
}

.ticket-list-filters-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.ticket-view-toggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.ticket-view-btn,
.ticket-cal-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}

.ticket-view-btn.active,
.ticket-cal-mode-btn.active {
  background: var(--navy);
  color: #fff;
}

.ticket-cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: var(--space-2);
  padding: 0.85rem 1rem;
}

.ticket-cal-mode {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.15rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.ticket-cal-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
  min-width: 10rem;
}

.ticket-cal-nav-btn {
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.2rem 0.55rem;
}

.ticket-cal-title {
  font-weight: 700;
  color: var(--navy-dark);
  font-size: 0.95rem;
  text-align: center;
  min-width: 9rem;
}

.ticket-cal-body {
  padding: 0.85rem;
  margin-bottom: var(--space-2);
}

.ticket-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.ticket-cal-weekdays span {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-soft);
}

.ticket-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

.ticket-cal-cell {
  min-height: 4.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.35rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ticket-cal-cell:hover {
  border-color: var(--magenta);
  box-shadow: var(--shadow-sm);
}

.ticket-cal-cell--outside {
  opacity: 0.45;
}

.ticket-cal-cell--today {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy);
}

.ticket-cal-cell--has .ticket-cal-day-num {
  font-weight: 800;
}

.ticket-cal-day-num {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy-dark);
}

.ticket-cal-count {
  display: inline-flex;
  min-width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--magenta);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
}

.ticket-cal--followup .ticket-cal-count,
.ticket-cal-count--followup {
  background: #4169e1;
}

.ticket-cal--followup .ticket-cal-week-col--has .ticket-cal-week-count,
.ticket-cal-week-col--followup.ticket-cal-week-col--has .ticket-cal-week-count {
  color: #4169e1;
  font-weight: 800;
}

.ticket-cal-cleared {
  display: inline-flex;
  min-width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #0d7a4e;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.ticket-cal-cell--cleared {
  border-color: #0d7a4e;
  background: rgba(13, 122, 78, 0.08);
}

.ticket-cal-week-col--cleared .ticket-cal-week-count {
  color: #0d7a4e;
  font-weight: 800;
}

.no-concerns-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.no-concerns-modal.hidden {
  display: none;
}

.no-concerns-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.no-concerns-modal-panel {
  position: relative;
  width: min(100%, 28rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 1.25rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.no-concerns-modal-head h3 {
  margin: 0;
  color: var(--navy-dark);
}

.no-concerns-modal-lead {
  margin: 0;
  font-weight: 600;
  color: var(--navy);
}

.no-concerns-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.follow-up-close-section {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.follow-up-close-section--compact {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.follow-up-manage {
  padding: 0.55rem 0.75rem;
}

.follow-up-manage-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.45rem 0.65rem;
}

.follow-up-inline-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.follow-up-inline-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.follow-up-question {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
}

.follow-up-choice-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0;
}

.follow-up-choice {
  flex: 0 0 auto;
  min-height: 1.75rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.follow-up-choice.active {
  border-color: var(--navy);
  background: rgba(0, 51, 102, 0.08);
  color: var(--navy-dark);
}

.follow-up-schedule {
  margin-bottom: 0.35rem;
}

.follow-up-schedule--compact {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.35rem 0.5rem;
  margin: 0;
  flex: 1 1 12rem;
}

.follow-up-field {
  font-size: 0.72rem;
  margin: 0;
  min-width: 6.5rem;
}

.follow-up-field input {
  margin-top: 0.15rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.82rem;
}

.follow-up-inline-hint {
  font-size: 0.72rem;
  line-height: 1.3;
  flex: 1 1 8rem;
  margin: 0;
}

.follow-up-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.follow-up-modal.hidden {
  display: none;
}

.follow-up-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.follow-up-modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(85vh, 720px);
  overflow: auto;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.follow-up-modal-head h3 {
  margin: 0;
  color: var(--navy-dark);
}

.follow-up-modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.follow-up-item .follow-up-timer {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--magenta);
}

.follow-up-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.follow-up-modal-actions {
  display: flex;
  justify-content: flex-end;
}

.otp-closure-modal {
  position: fixed;
  inset: 0;
  z-index: 1350;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.otp-closure-modal.hidden {
  display: none;
}

.otp-closure-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.otp-closure-modal-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.otp-closure-modal-head h3 {
  margin: 0;
  color: var(--navy-dark);
}

.otp-closure-modal-lead {
  margin: 0;
  line-height: 1.45;
}

.otp-closure-code-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
}

.otp-closure-code-label input {
  font-size: 1.25rem;
  letter-spacing: 0.2em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.otp-closure-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.ticket-attachment {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.ticket-attachment-preview img {
  display: block;
  max-width: min(280px, 100%);
  max-height: 200px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: contain;
  background: var(--surface-2, #f8f9fb);
}

.ticket-attachment-video {
  display: block;
  max-width: min(320px, 100%);
  max-height: 220px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #000;
}

.ticket-attachment-link {
  font-weight: 600;
}

.follow-up-count-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.follow-up-count-modal.hidden {
  display: none;
}

.follow-up-count-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.follow-up-count-modal-panel {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  max-height: min(88vh, 640px);
  overflow: auto;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 20px 52px rgba(15, 23, 42, 0.28);
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.follow-up-count-modal-head h3 {
  margin: 0;
  color: var(--navy-dark);
}

.follow-up-count-display {
  margin: 0;
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
  color: #6d28d9;
  text-align: center;
}

.follow-up-count-sub {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
}

.follow-up-count-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 14rem;
  overflow: auto;
  margin-top: 0.25rem;
}

.follow-up-count-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.25rem 0.5rem;
  align-items: center;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.8rem;
}

.follow-up-count-row .grow {
  grid-column: 2 / -1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.follow-up-count-row .follow-up-timer {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--magenta);
}

.follow-up-count-row--today,
.follow-up-count-row--tomorrow {
  border: 1px solid rgba(124, 58, 237, 0.35);
}

.follow-up-count-row--overdue {
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.05);
}

.follow-up-count-more {
  margin: 0.25rem 0 0;
  text-align: center;
}

.follow-up-count-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.15rem;
}

body.follow-up-blocking-open .erp-shell {
  pointer-events: none;
  user-select: none;
}

body.follow-up-blocking-open .follow-up-count-modal {
  pointer-events: auto;
}

@keyframes kpi-followup-flash {
  0%,
  100% {
    background: var(--surface-2);
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: var(--shadow-sm);
  }
  50% {
    background: rgba(124, 58, 237, 0.28);
    border-color: rgba(109, 40, 217, 0.95);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.35), 0 6px 20px rgba(124, 58, 237, 0.25);
  }
}

@keyframes kpi-followup-overdue-flash {
  0%,
  100% {
    background: var(--surface-2);
    border-color: rgba(220, 38, 38, 0.35);
    box-shadow: var(--shadow-sm);
  }
  50% {
    background: rgba(220, 38, 38, 0.22);
    border-color: rgba(185, 28, 28, 0.95);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35), 0 6px 20px rgba(220, 38, 38, 0.22);
  }
}

.kpi-card--followup.kpi-card--flash {
  animation: kpi-followup-flash 1s ease-in-out infinite;
  border: 2px solid rgba(124, 58, 237, 0.45);
}

.kpi-card--followup.kpi-card--flash .kpi-icon {
  animation: kpi-followup-icon-flash 1s ease-in-out infinite;
}

.kpi-card--followup-overdue.kpi-card--flash {
  animation: kpi-followup-overdue-flash 1s ease-in-out infinite;
  border: 2px solid rgba(220, 38, 38, 0.45);
}

.kpi-card--followup-overdue.kpi-card--flash .kpi-icon {
  animation: kpi-followup-overdue-icon-flash 1s ease-in-out infinite;
}

@keyframes kpi-followup-icon-flash {
  0%,
  100% {
    background: rgba(124, 58, 237, 0.12);
    color: #6d28d9;
  }
  50% {
    background: rgba(255, 255, 255, 0.95);
    color: #5b21b6;
  }
}

@keyframes kpi-followup-overdue-icon-flash {
  0%,
  100% {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
  }
  50% {
    background: rgba(255, 255, 255, 0.95);
    color: #991b1b;
  }
}

.kpi-card--clickable {
  cursor: pointer;
}

.kpi-card--clickable:hover,
.kpi-card--clickable:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.kpi-card--followup .kpi-icon {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
}

.kpi-card--followup-overdue .kpi-icon {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.kpi-card--followup-overdue .kpi-value {
  color: #b91c1c;
}

.pill-followup {
  font-size: 0.68rem;
  padding: 0.12rem 0.4rem;
  background: rgba(124, 58, 237, 0.12);
  color: #5b21b6;
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.pill-followup-overdue {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.25);
}

.ticket-followup-banner {
  margin: 0.45rem 0 0;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.18);
  font-size: 0.8rem;
  line-height: 1.35;
}

.ticket-followup-banner-label {
  font-weight: 700;
  color: #5b21b6;
  margin-right: 0.25rem;
}

.ticket-followup-filter {
  margin: 0;
  margin-left: auto;
}

.ticket-followup-alert-banner {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--navy-light);
  border: 1px solid rgba(47, 47, 145, 0.15);
}

.ticket-followup-alert-banner .ghost {
  margin-left: 0.35rem;
  padding: 0.15rem 0.5rem;
  min-height: auto;
  font-size: 0.78rem;
}

.no-concerns-card {
  border-color: #0d7a4e;
  background: linear-gradient(135deg, rgba(13, 122, 78, 0.06), rgba(13, 122, 78, 0.02));
}

.no-concerns-card .card-head {
  margin-bottom: 0.85rem;
}

.card-icon--cleared {
  background: #0d7a4e;
  color: #fff;
}

.ticket-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.ticket-cal-week-col {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 0.65rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.ticket-cal-week-col--today {
  border-color: var(--navy);
}

.ticket-cal-week-col--has .ticket-cal-week-count {
  color: var(--magenta);
  font-weight: 800;
}

.ticket-cal-week-day {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-soft);
}

.ticket-cal-week-date {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy-dark);
}

.ticket-cal-week-count {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.ticket-cal-day-view {
  padding: 0.5rem;
}

.ticket-calendar-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ticket-calendar-modal.hidden {
  display: none;
}

.ticket-calendar-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.ticket-calendar-modal-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(80vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.ticket-calendar-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.ticket-calendar-modal-head h3 {
  margin: 0;
  font-size: 1rem;
}

.ticket-calendar-modal-body {
  padding: 0.85rem 1rem 1rem;
  overflow: auto;
}

.ticket-calendar-empty {
  text-align: center;
  padding: 1.5rem 0.5rem;
}

.dashboard-scope-note {
  margin: -0.25rem 0 var(--space-3);
}

.ticket-status-summary {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: var(--space-3);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.ticket-status-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.ticket-status-summary strong {
  color: var(--navy);
  font-size: 1.05rem;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--navy-dark) 0%, var(--navy) 70%);
  color: #fff;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(180deg, var(--magenta), var(--accent));
}

.dashboard-hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background: radial-gradient(circle at 80% 20%, var(--magenta), transparent 50%);
  pointer-events: none;
}

.dashboard-hero-content, .dashboard-hero-stats { position: relative; z-index: 1; }

.dashboard-hero-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.65rem;
}

.dashboard-hero-stat { position: relative; z-index: 1; }

.dashboard-role-pill {
  display: inline-block;
  margin-bottom: 0.4rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(158, 21, 111, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-hero-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}

.dashboard-hero-date { margin: 0.2rem 0 0.5rem; font-size: 0.82rem; color: rgba(255, 255, 255, 0.8); }
.dashboard-hero-sub { margin: 0; max-width: 480px; font-size: 0.9rem; color: rgba(255, 255, 255, 0.9); line-height: 1.5; }

.dashboard-hero-banner {
  margin-top: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dashboard-hero-banner .hint { margin: 0; color: #fff; }

.dashboard-hero-stat {
  text-align: center;
  min-width: 120px;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dashboard-hero-stat--timing {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.dashboard-hero-stat--timing:nth-child(2) {
  border-left: 3px solid #c4b5fd;
}

.dashboard-hero-stat--timing:nth-child(3) {
  border-left: 3px solid #5eead4;
}

.dashboard-hero-stat--timing .dashboard-hero-stat-value {
  font-size: 1.55rem;
}

.dashboard-hero-stat-value {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.dashboard-hero-stat-label {
  margin: 0.3rem 0 0;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.85);
}

.dashboard-actions-label {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.dashboard-actions-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.action-chip:hover {
  border-color: var(--magenta);
  background: var(--magenta-light);
  filter: none;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.action-chip--primary {
  background: var(--magenta);
  border-color: var(--magenta);
  color: #fff;
  box-shadow: 0 3px 12px rgba(158, 21, 111, 0.25);
}

.action-chip--primary:hover {
  background: var(--magenta-dark);
  border-color: var(--magenta-dark);
  color: #fff;
}

.action-chip-icon { display: inline-flex; position: relative; width: 16px; height: 16px; }
.action-chip-icon svg { width: 16px; height: 16px; }
.action-chip-icon .nav-badge {
  position: absolute;
  top: -7px;
  right: -10px;
  margin-left: 0;
  min-width: 1rem;
  height: 1rem;
  font-size: 0.62rem;
  background: var(--magenta);
  color: #fff;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-3);
}

.kpi-card {
  display: flex;
  gap: 0.85rem;
  padding: 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.kpi-card--open { border-left: 4px solid var(--accent); }
.kpi-card--resolved { border-left: 4px solid var(--magenta); }
.kpi-card--closed { border-left: 4px solid var(--ok); }
.kpi-card--timing-res { border-left: 4px solid #7c3aed; }
.kpi-card--timing-close { border-left: 4px solid #0d9488; }
.kpi-card--featured {
  grid-column: 1 / -1;
  border-left-width: 5px;
}

.dashboard-kpis--single {
  grid-template-columns: 1fr;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--navy-light);
  color: var(--navy);
}

.kpi-icon svg { width: 22px; height: 22px; }

.kpi-card--open .kpi-icon { background: var(--accent-light); color: var(--accent); }
.kpi-card--resolved .kpi-icon { background: var(--magenta-light); color: var(--magenta); }
.kpi-card--closed .kpi-icon { background: #e8f6ee; color: var(--ok); }
.kpi-card--timing-res .kpi-icon { background: #ede9fe; color: #7c3aed; }
.kpi-card--timing-close .kpi-icon { background: #ccfbf1; color: #0d9488; }

.kpi-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
}

.kpi-value {
  margin: 0.15rem 0 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy-dark);
  letter-spacing: -0.04em;
  line-height: 1;
}

.kpi-hint { margin: 0.3rem 0 0; font-size: 0.78rem; color: var(--text-soft); }

.dashboard-turnaround {
  padding: 1rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 2px solid rgba(124, 58, 237, 0.28);
  background: linear-gradient(135deg, #faf5ff 0%, #f0fdf9 100%);
  box-shadow: var(--shadow-sm);
}

.dashboard-turnaround-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.dashboard-turnaround-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #ede9fe;
  color: #7c3aed;
}

.dashboard-turnaround-icon svg {
  width: 22px;
  height: 22px;
}

.dashboard-turnaround-title {
  margin: 0;
  font-size: 1rem;
  color: var(--navy-dark);
}

.dashboard-turnaround-sub {
  margin: 0.15rem 0 0;
}

.dashboard-turnaround-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.dashboard-turnaround-stat {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--border-soft);
}

.dashboard-turnaround-stat--resolution {
  border-left: 4px solid #7c3aed;
}

.dashboard-turnaround-stat--closure {
  border-left: 4px solid #0d9488;
}

.dashboard-turnaround-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}

.dashboard-turnaround-value {
  margin: 0.3rem 0 0.15rem;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--navy-dark);
  line-height: 1.1;
}

.dashboard-turnaround-meta {
  margin: 0;
  line-height: 1.35;
}

.dashboard-timing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.timing-card {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: #fafbff;
}

.timing-card--resolution { border-left: 4px solid var(--magenta); }
.timing-card--closure { border-left: 4px solid var(--ok); }

.timing-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timing-value {
  margin: 0.35rem 0 0.25rem;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}

.timing-hint,
.timing-meta {
  margin: 0.15rem 0 0;
  line-height: 1.4;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.dashboard-card--wide { grid-column: 1 / -1; }

.card-head {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.card-head h3 { margin: 0; }

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--navy-light);
  color: var(--navy);
}

.card-icon svg { width: 20px; height: 20px; }
.card-icon--link { background: var(--accent-light); color: var(--accent); }
.card-icon--flow { background: var(--magenta-light); color: var(--magenta); }
.card-icon--school { background: var(--navy-light); color: var(--navy); }

.dashboard-link-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.dashboard-link {
  flex: 1;
  min-width: 180px;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--navy-light);
  border: 1px solid var(--border-soft);
  word-break: break-all;
}

.dashboard-note {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.process-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }

.process-step { display: flex; gap: 0.7rem; align-items: flex-start; }

.process-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: var(--navy);
  flex-shrink: 0;
}

.process-copy strong { font-size: 0.88rem; color: var(--navy-dark); display: block; }
.process-copy span { font-size: 0.82rem; color: var(--text-soft); }

.count-badge {
  display: inline-flex;
  min-width: 2rem;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.count-badge--open { background: var(--accent-light); color: var(--accent); }
.count-badge--resolved { background: var(--magenta-light); color: var(--magenta); }
.count-badge--closed { background: #e8f6ee; color: var(--ok); }

/* ─── Stats (reports inline) ─── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-2);
}

.stat {
  padding: 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-top: 3px solid var(--magenta);
}

.stat .num {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--navy-dark);
}

.stat span:last-child {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}

/* ─── Tickets & tables ─── */
.ticket-row {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ticket-row:hover {
  border-color: var(--magenta);
  box-shadow: var(--shadow-md);
  background: var(--surface-2);
  transform: none;
  filter: none;
}

.ticket-row .grow { flex: 1; min-width: 0; }
.ticket-row .grow strong {
  display: block;
  font-size: 0.92rem;
  color: var(--navy-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-sla-timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  background: #e8f4ec;
  color: #0d7a3e;
  flex-shrink: 0;
  min-width: 4.75rem;
  text-align: center;
  letter-spacing: 0.02em;
}

.ticket-sla-timer--overdue {
  background: #dc2626;
  color: #fff;
}

.ticket-sla-timer--stopped {
  opacity: 0.82;
}

.pill {
  display: inline-flex;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.pill-blue { background: var(--accent-light); color: var(--accent); }
.pill-purple { background: var(--magenta-light); color: var(--magenta); }
.pill-amber { background: #fef3e2; color: var(--warn); }
.pill-green { background: #e8f6ee; color: var(--ok); }
.pill-gray { background: var(--navy-light); color: var(--text-soft); }
.pill-verified {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  background: #e7f7ef;
  color: #0f7a45;
  border: 1px solid rgba(15, 122, 69, 0.28);
}
.pill-verified-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: #0f7a45;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

.pill-category {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.pill-category--emergency {
  background: #fde8e8;
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.35);
}

.pill-category--academic {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(47, 47, 145, 0.25);
}

.pill-category--transport {
  background: var(--magenta-light);
  color: var(--magenta);
  border-color: rgba(233, 30, 99, 0.25);
}

.pill-category--food {
  background: #e8f6ee;
  color: var(--ok);
  border-color: rgba(13, 122, 78, 0.25);
}

.pill-category--general {
  background: #eef2f7;
  color: var(--navy);
  border-color: rgba(47, 47, 145, 0.15);
}

.ticket-row-meta {
  display: block;
  font-size: 0.78rem;
}

.row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); flex-wrap: wrap; }

.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.4rem 1rem;
  margin-top: 0.75rem;
}

.kv dt {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}

.kv dd { margin: 0; }

.card:has(.table),
.panel:has(.table) {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  min-width: 520px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table th, .table td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
}

.table th {
  background: var(--navy-light);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table tbody tr:hover td { background: #fafbff; }
.table tr:last-child td { border-bottom: none; }
.inline { width: 100%; }

.flow-list { padding-left: 1.1rem; margin: 0.35rem 0 0; }
.flow-list li { margin-bottom: 0.35rem; }
.flow-list li::marker { color: var(--magenta); }

/* ─── Reports ─── */
.report-scope-fixed {
  padding: 0.5rem 0.7rem;
  background: var(--navy-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.report-filter-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-2);
}

.report-filter-grid > * {
  flex: 1 1 11.5rem;
  min-width: 11.5rem;
  max-width: 100%;
}

.report-filter-grid > label,
.report-filter-grid .school-filter-select,
.report-filter-grid .multi-select {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
}

.report-filter-grid > label input,
.report-filter-grid > label select,
.report-filter-grid .multi-select-trigger {
  width: 100%;
  min-height: 2.5rem;
  font-weight: 500;
}

.report-filter-grid .multi-select {
  min-width: 14rem;
  flex: 1.2 1 14rem;
}

.report-filter-actions {
  display: flex;
  align-items: end;
  flex: 0 0 auto;
  min-width: auto;
}

.report-daily-table-wrap {
  overflow-x: auto;
  margin-top: var(--space-2);
}

.report-daily-dates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.report-daily-dates .report-daily-date {
  margin-bottom: 0;
}

.report-daily-date {
  display: block;
  max-width: 16rem;
  margin-bottom: var(--space-2);
}

.report-daily-date input,
.report-daily-date select {
  width: 100%;
  min-height: 2.5rem;
}

.ticket-reopen-banner {
  margin: var(--space-2) 0 var(--space-3);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #f0c36d;
  background: #fff8eb;
}

.ticket-reopen-banner strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #9a5b00;
}

.ticket-reopen-banner p {
  margin: 0;
  white-space: pre-wrap;
}

.resolution-history {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.resolution-history-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.resolution-history-entry {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2, #f8f9fb);
}

.resolution-history-entry--reopen {
  border-color: #f0c36d;
  background: #fff8eb;
}

.resolution-history-entry--resolution {
  border-left: 3px solid var(--magenta);
}

.resolution-history-meta {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.resolution-history-text {
  margin: 0;
  white-space: pre-wrap;
}

.resolution-notes-readonly {
  margin: 0.25rem 0 0.75rem;
}

.report-daily-table th,
.report-daily-table td {
  vertical-align: top;
  min-width: 5rem;
}

.report-daily-table td:nth-child(6),
.report-daily-table td:nth-child(7) {
  min-width: 12rem;
  max-width: 22rem;
  white-space: pre-wrap;
}

.compare-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.compare-kpi {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.compare-kpi-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--text-soft); }
.compare-kpi-value { font-size: 1.35rem; font-weight: 800; color: var(--navy-dark); }
.compare-kpi-delta { font-size: 0.78rem; font-weight: 700; }
.delta-up { color: var(--ok); }
.delta-down { color: var(--danger); }
.delta-flat { color: var(--text-soft); }

.chart-wrap {
  height: 300px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  max-width: 360px;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  background: var(--navy-dark);
  border: 1px solid var(--navy);
  color: #fff;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 1000;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-left: 4px solid var(--ok); }
.toast.warn { border-left: 4px solid var(--warn); }

code {
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
  color: var(--navy);
}

.card ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }

.otp-verify-panel {
  background: var(--accent-light);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin: var(--space-2) 0;
}

.otp-verify-panel h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.05rem;
}

.otp-verify-actions {
  align-items: center;
  gap: var(--space-3);
}

.phone-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 0.65rem;
  background: var(--surface-2);
  min-height: var(--control-h);
}

.phone-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.phone-prefix {
  color: var(--text-soft);
  font-weight: 600;
  white-space: nowrap;
}

.phone-field input {
  border: none !important;
  flex: 1;
  min-width: 0;
  padding-left: 0;
  box-shadow: none !important;
  background: transparent;
}

.phone-field input:focus {
  outline: none;
  box-shadow: none !important;
}

.field-error.mobile-field-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: block;
}

.field-error.mobile-field-error.hidden {
  display: none;
}

#otp-verify-msg {
  color: var(--ok);
  margin: 0;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand-panel { padding: 1.75rem 1.25rem; }
  .auth-form-panel { padding: 1.25rem 1rem; }
  .auth-logo { max-width: 200px; max-height: 220px; }

  .erp-shell {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
  }

  .erp-sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto !important;
    min-height: auto !important;
    z-index: 40;
    padding: var(--space-3) var(--space-3) var(--space-2);
    gap: var(--space-2);
    box-shadow: var(--shadow-md);
  }

  .erp-main-wrap {
    height: auto;
  }

  .brand-block {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-bottom: var(--space-2);
  }

  .brand-logo {
    max-width: 120px;
    max-height: 100px;
    margin: 0;
  }

  .brand-tagline {
    margin: 0;
    flex: 1;
    font-size: 0.62rem;
  }

  .user-chip {
    padding: 0.5rem 0.65rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-section-label {
    display: none;
  }

  .erp-sidebar .nav {
    display: none;
    flex-direction: column;
    flex: none;
    width: 100%;
    gap: 0.35rem;
    padding-top: 0.25rem;
  }

  .erp-sidebar.is-nav-open .nav {
    display: flex;
  }

  .erp-sidebar .nav-btn {
    width: 100%;
  }

  .sidebar-footer {
    margin-top: 0;
    padding-top: var(--space-2);
  }

  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-hero {
    grid-template-columns: 1fr;
    padding: 1.1rem 1rem;
  }

  .dashboard-hero-stat {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .app-topbar {
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .topbar-divider { display: none; }

  .page-title { font-size: 1.1rem; }

  .public-header-inner {
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
  }

  .public-logo { max-width: 180px; }

  .public-main { padding: 1.25rem 1rem 2rem; }

  .panel, .card {
    padding: var(--space-4);
  }
}

@media (max-width: 600px) {
  .main { padding: 0.85rem; }
  .page-body { gap: var(--space-3); }

  .dashboard-kpis,
  .dashboard-turnaround-grid,
  .dashboard-timing-grid,
  .row-2,
  .compare-kpis,
  .stats {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    flex-direction: row;
    align-items: center;
  }

  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 0.35rem; }

  .dashboard-link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-link {
    min-width: 0;
  }

  .action-chip {
    width: 100%;
    justify-content: center;
  }

  .ticket-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .ticket-row .grow {
    flex: 1 1 100%;
    order: 1;
  }

  .ticket-row .mono { order: 0; }
  .ticket-row .pill-category { order: 2; }
  .ticket-row .ticket-sla-timer { order: 3; }
  .ticket-row .pill { order: 4; }
  .ticket-row .pill-blue,
  .ticket-row .pill-amber,
  .ticket-row .pill-green,
  .ticket-row .pill-gray,
  .ticket-row .pill-purple,
  .ticket-row .pill-verified { order: 3; }

  .ticket-cal-week {
    grid-template-columns: repeat(2, 1fr);
  }

  .ticket-cal-grid {
    gap: 0.25rem;
  }

  .ticket-cal-cell {
    min-height: 3.5rem;
  }

  .ticket-cal-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ticket-cal-nav {
    justify-content: space-between;
  }

  .row-head {
    flex-direction: column;
    align-items: stretch;
  }

  .row-head .ghost,
  .row-head button {
    width: 100%;
  }

  .tabs {
    flex-direction: column;
  }

  .tab { width: 100%; }

  .toast {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }

  .chart-wrap { height: 240px; }

  .comparison-controls.row-2 {
    grid-template-columns: 1fr;
  }

  .report-filter-grid {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .report-filter-grid > * {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }

  .ticket-list-filters-grid {
    flex-wrap: wrap;
  }

  .ticket-list-filters-grid > * {
    flex: 1 1 100%;
    min-width: 0;
  }

  .report-filter-actions {
    align-items: stretch;
  }

  .report-filter-actions button {
    width: 100%;
  }

  #add-school.row-2 {
    grid-template-columns: 1fr;
  }

  #add-school button {
    grid-column: 1 / -1;
  }
}

.ticket-log-card {
  margin-top: var(--space-2);
}

.ticket-log-list {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ticket-log-entry {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.ticket-log-step {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--magenta), #b51a82);
}

.ticket-log-body {
  flex: 1;
  min-width: 0;
}

.ticket-log-time {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0.2rem;
}

.ticket-log-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.ticket-log-by {
  margin: 0.25rem 0 0;
}

.users-page-head {
  margin-bottom: 0.35rem;
}

.users-intro {
  margin: 0 0 var(--space-3);
}

.users-filter {
  margin-bottom: var(--space-2);
  padding: 0.85rem 1rem;
}

.users-filter-summary {
  margin: 0 0 var(--space-3);
}

.users-list-section {
  margin-bottom: var(--space-4);
}

.users-list-title {
  margin: 0 0 var(--space-2);
  font-size: 0.95rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.users-card-list {
  display: grid;
  gap: var(--space-2);
}

.user-card {
  padding: 0.95rem 1rem;
}

.user-card--editing {
  border-color: var(--magenta);
  box-shadow: 0 0 0 1px rgba(158, 21, 111, 0.12);
}

.user-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.user-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.user-card-kv {
  margin-bottom: 0.75rem;
}

.user-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.user-edit-btn,
.user-del-btn {
  flex: 1 1 120px;
  justify-content: center;
  min-width: 0;
}

.user-del-btn {
  color: var(--danger);
  border-color: rgba(190, 18, 60, 0.25);
}

.user-table-actions .user-row-actions {
  flex-wrap: nowrap;
}

.user-table-actions .user-edit-btn,
.user-table-actions .user-del-btn {
  flex: 0 0 auto;
}

.users-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.users-table {
  min-width: 720px;
}

.users-empty {
  margin: 0;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ─── Built-in Analytics (Management / Super Admin) ─── */
.analytics-page { display: flex; flex-direction: column; gap: var(--space-4); }

.analytics-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-3);
}

.analytics-metric {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
}

.analytics-metric--open { border-left: 4px solid var(--accent); }
.analytics-metric--resolved { border-left: 4px solid var(--magenta); }
.analytics-metric--closed { border-left: 4px solid var(--ok); }

.analytics-metric-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}

.analytics-metric-value {
  margin: 0.25rem 0 0;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--navy-dark);
}

.analytics-insights-card,
.analytics-ai-card {
  border: 2px solid rgba(3, 105, 161, 0.18);
  background: linear-gradient(135deg, #f0f9ff 0%, #fff 55%);
}

.analytics-ai-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #ede9fe;
  color: #6d28d9;
  vertical-align: middle;
}

.analytics-ai-badge--rules {
  background: #e0f2fe;
  color: #0369a1;
}

.analytics-summary {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--navy-dark);
}

.analytics-bullets {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  line-height: 1.5;
}

.analytics-bullets li { margin: 0.35rem 0; }

.analytics-actions {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-soft);
}

.analytics-actions h4 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}

.analytics-school-table td,
.analytics-school-table th { white-space: nowrap; }

.analytics-school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
  margin-top: 0.75rem;
}

.analytics-school-card {
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
}

.analytics-school-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 0.5rem;
}

.analytics-school-card h4 { margin: 0; }

.analytics-health {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.analytics-health--good { background: #dcfce7; color: #166534; }
.analytics-health--watch { background: #fef9c3; color: #854d0e; }
.analytics-health--attention { background: #ffedd5; color: #c2410c; }
.analytics-health--critical { background: #fee2e2; color: #b91c1c; }

.analytics-table { margin-top: 0.5rem; }

.analytics-deep-section {
  margin-top: 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  background: #fff;
}

.analytics-deep-section summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--navy-dark);
}

.analytics-deep-section[open] summary { margin-bottom: 0.55rem; }

.analytics-severity {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.analytics-severity--critical { background: #fee2e2; color: #b91c1c; }
.analytics-severity--high { background: #ffedd5; color: #c2410c; }
.analytics-severity--medium { background: #fef9c3; color: #854d0e; }
.analytics-severity--low { background: #e0f2fe; color: #0369a1; }

.analytics-trend {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.analytics-trend--up { background: #fee2e2; color: #b91c1c; }
.analytics-trend--down { background: #dcfce7; color: #166534; }
.analytics-trend--flat { background: #f1f5f9; color: #64748b; }

.analytics-lag-list { display: flex; flex-direction: column; gap: 0.55rem; }

.analytics-lag-item {
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
}

.analytics-lag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.analytics-lag-rec {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.analytics-aging { display: flex; flex-direction: column; gap: 0.4rem; }

.analytics-aging-row {
  display: grid;
  grid-template-columns: 72px 1fr 28px;
  align-items: center;
  gap: 0.5rem;
}

.analytics-aging-label { font-size: 0.72rem; color: var(--text-soft); }

.analytics-aging-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.analytics-aging-fill { height: 100%; border-radius: 999px; }
.analytics-aging-fill--ok { background: #22c55e; }
.analytics-aging-fill--watch { background: #eab308; }
.analytics-aging-fill--attention { background: #f97316; }
.analytics-aging-fill--critical { background: #ef4444; }

.analytics-aging-count {
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}
