/* ============================================================
   ASPI Website Request Management Portal — Dashboard Styles
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --navy: #0f172a;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --info-bg: #eff6ff;
  --purple: #7c3aed;
  --purple-bg: #f5f3ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .07), 0 6px 20px rgba(15, 23, 42, .05);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sidebar-w: 244px;
  --topbar-h: 62px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font);
  background: var(--slate-100);
  color: var(--slate-700);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .25s ease;
}
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand .logo-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #1e3a8a);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.sidebar .brand strong { color: #fff; font-size: 15px; display: block; letter-spacing: -.01em; }
.sidebar .brand span { font-size: 11.5px; color: #64748b; }

.sidebar nav { padding: 14px 10px; flex: 1; overflow-y: auto; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px;
  border-radius: 9px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
  transition: all .15s;
}
.sidebar nav a .ico { width: 20px; text-align: center; font-size: 15px; }
.sidebar nav a:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.sidebar nav a.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.4); }
.sidebar .side-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; color: #475569; }

/* ---------- Topbar ---------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar .page-title { font-size: 17px; font-weight: 700; color: var(--navy); letter-spacing: -.02em; }
.topbar .spacer { flex: 1; }
.global-search { position: relative; width: 300px; max-width: 34vw; }
.global-search input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1.5px solid var(--slate-200);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 13.5px;
  background: var(--slate-50);
  color: var(--navy);
}
.global-search input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.global-search .s-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--slate-400); font-size: 14px; }

.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--slate-200);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  color: var(--slate-500);
  transition: all .15s;
}
.icon-btn:hover { background: var(--slate-50); color: var(--navy); }
.icon-btn .badge-dot {
  position: absolute; top: 7px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid #fff;
  display: none;
}
.icon-btn .badge-dot.show { display: block; }

.profile-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border: 1px solid var(--slate-200); border-radius: 999px; background: #fff; }
.profile-chip .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.profile-chip .p-name { font-size: 13px; font-weight: 600; color: var(--navy); }
.profile-chip .p-role { font-size: 11px; color: var(--slate-400); display: block; line-height: 1.1; }

/* ---------- Content ---------- */
.content { padding: 26px 28px 60px; flex: 1; }
.content-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.content-head h2 { font-size: 21px; color: var(--navy); letter-spacing: -.02em; font-weight: 800; }
.content-head .sub { color: var(--slate-500); font-size: 13.5px; margin-top: 2px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards & grids ---------- */
.card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .card-head { padding: 16px 20px; border-bottom: 1px solid var(--slate-100); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card .card-head h3 { font-size: 15px; font-weight: 700; color: var(--navy); }
.card .card-body { padding: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); cursor: pointer; transition: all .15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,23,42,.1); }
.stat-card .st-label { font-size: 12px; font-weight: 600; color: var(--slate-400); text-transform: uppercase; letter-spacing: .05em; }
.stat-card .st-value { font-size: 27px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; margin-top: 2px; }
.stat-card .st-icon { float: right; font-size: 17px; width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.st-ico-blue { background: var(--info-bg); color: var(--primary); }
.st-ico-green { background: var(--success-bg); color: var(--success); }
.st-ico-red { background: var(--danger-bg); color: var(--danger); }
.st-ico-amber { background: var(--warning-bg); color: var(--warning); }
.st-ico-purple { background: var(--purple-bg); color: var(--purple); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.chart-box { position: relative; height: 280px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3.5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}
.bg-new { background: var(--info-bg); color: var(--primary); }
.bg-review { background: var(--purple-bg); color: var(--purple); }
.bg-progress { background: #fff7ed; color: #ea580c; }
.bg-waiting { background: #fdf4ff; color: #a21caf; }
.bg-hold { background: var(--slate-100); color: var(--slate-600); }
.bg-completed { background: var(--success-bg); color: var(--success); }
.bg-closed { background: var(--slate-100); color: var(--slate-500); }
.bg-rejected { background: var(--danger-bg); color: var(--danger); }
.bg-overdue { background: var(--danger); color: #fff; }
.bg-low { background: var(--slate-100); color: var(--slate-600); }
.bg-normal { background: var(--info-bg); color: var(--primary); }
.bg-high { background: var(--warning-bg); color: var(--warning); }
.bg-urgent { background: var(--danger); color: #fff; }
.bg-active { background: var(--success-bg); color: var(--success); }
.bg-inactive { background: var(--slate-100); color: var(--slate-500); }
.bg-sent { background: var(--success-bg); color: var(--success); }
.bg-failed { background: var(--danger-bg); color: var(--danger); }
.bg-pending { background: var(--warning-bg); color: var(--warning); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--slate-600); border: 1.5px solid var(--slate-300); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { padding: 6px 9px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.data-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--slate-400);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1.5px solid var(--slate-200);
  background: var(--slate-50);
  white-space: nowrap;
  user-select: none;
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: var(--primary); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--slate-100); font-size: 13.5px; color: var(--slate-600); vertical-align: middle; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: var(--slate-50); }
.data-table .cell-id { font-family: 'JetBrains Mono', 'Consolas', monospace; font-size: 12.5px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.data-table .cell-title { font-weight: 600; color: var(--navy); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table .actions-cell { display: flex; gap: 6px; }

.row-actions { display: flex; gap: 5px; }

/* ---------- Filters ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 16px 20px; border-bottom: 1px solid var(--slate-100); }
.filter-bar .f-group { display: flex; flex-direction: column; gap: 4px; }
.filter-bar label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-400); }
.filter-bar select, .filter-bar input {
  padding: 8px 11px;
  border: 1.5px solid var(--slate-200);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--navy);
  background: #fff;
  min-width: 130px;
}
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: var(--primary); }

/* ---------- Forms / modals ---------- */
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="date"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--navy);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
textarea { resize: vertical; min-height: 90px; }
label.f-label { display: block; font-size: 13px; font-weight: 600; color: var(--slate-700); margin-bottom: 5px; }
.f-req { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; display: none; }
.field-error.show { display: block; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 18px;
  overflow-y: auto;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  box-shadow: 0 25px 70px rgba(15, 23, 42, .3);
  animation: modalIn .2s ease;
}
.modal.modal-lg { max-width: 860px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.modal-head { padding: 18px 24px; border-bottom: 1px solid var(--slate-100); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { font-size: 16.5px; color: var(--navy); font-weight: 700; }
.modal-close { border: none; background: var(--slate-100); width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 15px; color: var(--slate-500); }
.modal-close:hover { background: var(--slate-200); color: var(--navy); }
.modal-body { padding: 22px 24px; max-height: 68vh; overflow-y: auto; }
.modal-foot { padding: 15px 24px; border-top: 1px solid var(--slate-100); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- Detail view ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.detail-item { padding: 9px 0; border-bottom: 1px solid var(--slate-100); }
.detail-item.full { grid-column: 1 / -1; }
.detail-item .d-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--slate-400); }
.detail-item .d-val { font-size: 13.5px; color: var(--navy); margin-top: 2px; word-break: break-word; white-space: pre-wrap; }
.detail-item .d-val a { color: var(--primary); text-decoration: none; font-weight: 600; }
.detail-item .d-val a:hover { text-decoration: underline; }

.file-chip { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border: 1px solid var(--slate-200); border-radius: 9px; margin-bottom: 8px; background: var(--slate-50); }
.file-chip .f-ico { width: 30px; height: 30px; border-radius: 7px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.file-chip .f-name { font-size: 13px; font-weight: 600; color: var(--navy); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .f-sub { font-size: 11.5px; color: var(--slate-400); }

/* ---------- Notes / timeline ---------- */
.note-item { background: var(--warning-bg); border: 1px solid #fde68a; border-radius: 10px; padding: 12px 15px; margin-bottom: 10px; }
.note-item .n-meta { font-size: 11.5px; color: var(--warning); font-weight: 700; margin-bottom: 3px; }
.note-item .n-text { font-size: 13.5px; color: var(--slate-700); white-space: pre-wrap; }

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--slate-200); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
  content: '';
  position: absolute; left: -22px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--primary);
}
.timeline-item .t-action { font-size: 13.5px; font-weight: 600; color: var(--navy); }
.timeline-item .t-meta { font-size: 12px; color: var(--slate-400); }

/* ---------- Loading / empty / toast ---------- */
.loading-block { text-align: center; padding: 46px 20px; color: var(--slate-400); font-size: 14px; }
.loading-block .spin {
  width: 28px; height: 28px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-block { text-align: center; padding: 46px 20px; color: var(--slate-400); }
.empty-block .e-ico { font-size: 34px; margin-bottom: 8px; }

.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 400; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--navy); color: #fff;
  padding: 13px 18px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(15,23,42,.35);
  display: flex; align-items: center; gap: 9px;
  animation: toastIn .25s ease;
  max-width: 380px;
}
.toast.success { background: #14532d; }
.toast.error { background: #7f1d1d; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 12px; flex-wrap: wrap; }
.pagination .pg-info { font-size: 13px; color: var(--slate-400); }
.pagination .pg-btns { display: flex; gap: 6px; }
.pg-btn { border: 1.5px solid var(--slate-200); background: #fff; min-width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--slate-600); font-family: var(--font); }
.pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pg-btn.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Auth gate ---------- */
.auth-gate {
  position: fixed; inset: 0;
  background:
    radial-gradient(1000px 400px at 70% -10%, rgba(37,99,235,.25), transparent 60%),
    var(--sidebar-bg);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-gate.hidden { display: none; }
.auth-card { background: #fff; border-radius: 18px; padding: 40px 36px; width: 100%; max-width: 400px; box-shadow: 0 30px 80px rgba(0,0,0,.4); text-align: center; }
.auth-card .logo-mark { width: 52px; height: 52px; border-radius: 13px; background: linear-gradient(135deg, var(--primary), #1e3a8a); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; margin: 0 auto 16px; font-size: 18px; }
.auth-card h2 { color: var(--navy); font-size: 20px; letter-spacing: -.02em; }
.auth-card p { color: var(--slate-500); font-size: 13.5px; margin: 6px 0 22px; }
.auth-card input { text-align: center; letter-spacing: .2em; font-weight: 700; }
.auth-card .btn { width: 100%; margin-top: 14px; }
.auth-note { font-size: 11.5px; color: var(--slate-400); margin-top: 16px; }

/* ---------- Responsive ---------- */
.mobile-toggle { display: none; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .main { margin-left: 0; }
  .mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 50px; }
  .global-search { width: 100%; max-width: none; order: 10; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; row-gap: 10px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .profile-chip .p-info { display: none; }
  .topbar .page-title { font-size: 15px; }
}

/* Mobile drawer backdrop */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 95; display: none; }
.drawer-backdrop.show { display: block; }

/* ============================================================
   Form utilities used across dashboard pages
   ============================================================ */
.field { margin-bottom: 4px; }
.field .hint, .hint { font-size: 12px; color: var(--slate-400); margin-top: 5px; line-height: 1.5; }
.f-req { color: var(--danger); }
.btn-lg { padding: 12px 22px; font-size: 14.5px; }
.spinner {
  display: inline-block; width: 13px; height: 13px; vertical-align: -1px;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  border-radius: 50%; animation: aspi-spin .7s linear infinite;
}
.btn-outline .spinner, .btn-ghost .spinner { border-color: rgba(37,99,235,.3); border-top-color: var(--primary); }
@keyframes aspi-spin { to { transform: rotate(360deg); } }

.alert { display: none; padding: 12px 15px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; margin-bottom: 16px; }
.alert.show { display: block; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #fde68a; }
.alert-info { background: var(--info-bg); color: #1e40af; border: 1px solid #bfdbfe; }

.check-inline { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--slate-600); margin: 14px 0; cursor: pointer; }
.check-inline input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Toggle switch for on/off settings */
.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--slate-100); }
.switch-row:last-child { border-bottom: none; }
.switch-row .sw-text strong { display: block; font-size: 13.5px; color: var(--navy); font-weight: 600; }
.switch-row .sw-text span { font-size: 12px; color: var(--slate-400); }
.switch { position: relative; flex: 0 0 44px; width: 44px; height: 25px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track { position: absolute; inset: 0; background: var(--slate-300); border-radius: 999px; transition: background .18s; cursor: pointer; }
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px;
  background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(19px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(37,99,235,.2); }

/* Settings tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--slate-200); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  border: none; background: none; padding: 11px 15px; font-size: 13.5px; font-weight: 600;
  color: var(--slate-500); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button:hover { color: var(--primary); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.settings-section-title { font-size: 13px; font-weight: 700; color: var(--navy); margin: 0 0 14px; }

/* ============================================================
   Notifications dropdown
   ============================================================ */
.notif-wrap { position: relative; }
.notif-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 10px); width: 360px; max-width: 86vw;
  background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius);
  box-shadow: 0 22px 60px rgba(15,23,42,.18); z-index: 120; overflow: hidden;
}
.notif-panel.show { display: block; }
.np-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--slate-100);
  font-size: 13px; font-weight: 700; color: var(--navy);
}
.np-head span { font-size: 11.5px; color: var(--slate-400); font-weight: 600; }
.np-list { max-height: 380px; overflow-y: auto; }
.np-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--slate-100); text-decoration: none; }
.np-item:last-child { border-bottom: none; }
.np-item:hover { background: var(--slate-50); }
.np-tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; margin-bottom: 5px; }
.np-red { background: var(--danger-bg); color: var(--danger); }
.np-amber { background: var(--warning-bg); color: var(--warning); }
.np-blue { background: var(--primary-light); color: var(--primary-dark); }
.np-purple { background: var(--purple-bg); color: var(--purple); }
.np-green { background: var(--success-bg); color: var(--success); }
.np-text { display: block; font-size: 13px; color: var(--slate-700); font-weight: 500; line-height: 1.4; }
.np-meta { display: block; font-size: 11.5px; color: var(--slate-400); margin-top: 3px; }
.np-empty { padding: 26px 16px; text-align: center; font-size: 13px; color: var(--slate-400); }

/* ============================================================
   Sign-in page (login.html)
   ============================================================ */
.login-body { background: var(--slate-50); min-height: 100vh; }
.login-shell { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.login-brand {
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(37,99,235,.35), transparent 62%),
    var(--sidebar-bg);
  color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-brand .lb-top { display: flex; align-items: center; gap: 12px; }
.login-brand .logo-mark {
  width: 44px; height: 44px; border-radius: 12px; font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #1e3a8a);
  display: flex; align-items: center; justify-content: center;
}
.login-brand .lb-name strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.login-brand .lb-name span { font-size: 12px; color: #94a3b8; }
.login-brand .lb-mid { max-width: 30ch; }
.login-brand h1 { font-size: 31px; line-height: 1.2; letter-spacing: -.03em; font-weight: 700; margin-bottom: 22px; }
.lb-list { list-style: none; display: grid; gap: 11px; }
.lb-list li { font-size: 14px; color: #cbd5e1; padding-left: 24px; position: relative; line-height: 1.5; }
.lb-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: #60a5fa; font-weight: 700;
}
.login-brand .lb-foot { font-size: 12px; color: #64748b; max-width: 40ch; line-height: 1.6; }
.login-brand .lb-foot a { color: #93c5fd; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 24px; color: var(--navy); letter-spacing: -.025em; }
.login-card .lp-sub { font-size: 13.5px; color: var(--slate-500); margin: 6px 0 24px; }
.login-card .field { margin-bottom: 16px; }
.login-card input[type="text"], .login-card input[type="password"] { width: 100%; }
.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; font-size: 14px; padding: 6px 8px; opacity: .6;
}
.pw-toggle:hover { opacity: 1; }
.login-foot { margin-top: 22px; border-top: 1px solid var(--slate-200); padding-top: 16px; }
.login-foot .auth-note { text-align: left; margin-top: 8px; line-height: 1.6; }

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 24px; gap: 26px; }
  .login-brand h1 { font-size: 24px; margin-bottom: 16px; }
  .login-brand .lb-foot { display: none; }
  .notif-panel { position: fixed; right: 10px; left: 10px; width: auto; top: 64px; }
}

/* Dashboard pages stay hidden until the session check passes */
body.dash-guard .sidebar, body.dash-guard .main { visibility: hidden; }
body.dash-guard.authed .sidebar, body.dash-guard.authed .main { visibility: visible; }

/* Read-only mode (Viewer role): action buttons are removed, not just greyed */
.cap-hidden { display: none !important; }

/* ---- Client conversation thread (request detail) ---- */
.client-thread { display: grid; gap: 10px; margin-bottom: 14px; max-height: 300px; overflow-y: auto; padding: 2px; }
.ct-msg { max-width: 88%; padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.ct-team { background: var(--primary-light); border: 1px solid #bfdbfe; justify-self: start; border-bottom-left-radius: 4px; }
.ct-client { background: var(--slate-100); border: 1px solid var(--slate-200); justify-self: end; border-bottom-right-radius: 4px; }
.ct-meta { font-size: 11px; font-weight: 600; color: var(--slate-400); margin-bottom: 3px; }
.ct-text { color: var(--slate-700); white-space: pre-wrap; }

/* ---- Change log ---- */
.cl-entry {
  border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 16px; background: #fff;
  display: grid; gap: 10px; margin-bottom: 12px;
}
.cl-top { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.cl-school { font-weight: 700; color: var(--navy); font-size: 14px; }
.cl-date { font-size: 12px; color: var(--slate-400); margin-left: auto; }
.cl-summary { font-size: 14px; color: var(--slate-700); font-weight: 500; }
.cl-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; font-size: 13px; }
.cl-row .cl-lbl { color: var(--slate-400); font-weight: 600; font-size: 12px; }
.cl-row .cl-val { color: var(--slate-600); white-space: pre-wrap; }
.cl-missing { color: var(--warning); font-style: italic; }
.cl-actions { display: flex; gap: 8px; }
@media (max-width: 640px) { .cl-row { grid-template-columns: 1fr; gap: 2px; } }

/* ---- Segmented choice control (settings) ---- */
.seg { display: inline-flex; background: var(--slate-100); border-radius: 10px; padding: 3px; gap: 3px; }
.seg-btn {
  border: none; background: none; padding: 8px 16px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--slate-500); transition: background .15s, color .15s;
}
.seg-btn:hover:not(:disabled) { color: var(--primary); }
.seg-btn.active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.seg-btn:disabled { cursor: not-allowed; opacity: .6; }

/* ---- Announcement banners and popups ---- */
.notice-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.notice {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px;
  border-radius: var(--radius); border: 1px solid; font-size: 13.5px; line-height: 1.5;
}
.notice-body { flex: 1; }
.notice-body strong { display: block; margin-bottom: 2px; }
.notice-info { background: var(--primary-light); border-color: #bfdbfe; color: #1e40af; }
.notice-success { background: var(--success-bg); border-color: #bbf7d0; color: #15803d; }
.notice-warning { background: var(--warning-bg); border-color: #fde68a; color: #b45309; }
.notice-urgent { background: var(--danger-bg); border-color: #fecaca; color: #b91c1c; }
.notice-x {
  border: none; background: none; cursor: pointer; font-size: 12px;
  color: inherit; opacity: .55; padding: 2px 4px; line-height: 1;
}
.notice-x:hover { opacity: 1; }
.notice-pop-top {
  display: flex; align-items: center; gap: 12px; padding: 20px 24px;
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--slate-100);
}
.notice-pop-top h3 { margin: 0; font-size: 16px; }
.notice-pop-top .np-icon {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 14px; background: rgba(255,255,255,.7);
}

/* ---- Time zone clocks ---- */
.clock-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.clock { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; }
.clock-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--slate-300); flex: 0 0 6px;
}
.clock-dot.on { background: #22c55e; }
.clock-zone { color: var(--slate-400); font-weight: 600; }
.clock-time { font-family: "JetBrains Mono", monospace; font-weight: 700; color: var(--slate-500); letter-spacing: .02em; }
.clock-sep { width: 1px; height: 11px; background: var(--slate-200); }
.side-foot .clock-bar { margin-bottom: 10px; }
.side-foot .clock-zone { color: #64748b; }
.side-foot .clock-time { color: #cbd5e1; }
.side-foot .clock-sep { background: rgba(148,163,184,.3); }
.side-foot-text { line-height: 1.5; }

/* ---- Completion evidence ---- */
.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0 18px; }
.ev-card { border: 1px solid var(--slate-200); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.ev-card .ev-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--slate-400); padding: 8px 11px; border-bottom: 1px solid var(--slate-100);
}
.ev-card img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: contain; background: var(--slate-50); }
.ev-empty { padding: 26px 12px; text-align: center; color: var(--slate-400); font-size: 12.5px; }
.ev-meta { font-size: 13px; color: var(--slate-600); margin-bottom: 10px; }
.ev-meta a { color: var(--primary); font-weight: 600; }
@media (max-width: 640px) { .evidence-grid { grid-template-columns: 1fr; } }

/* ---- Team account badges ---- */
.acct-badge {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}
.acct-set { background: var(--success-bg); color: var(--success); }
.acct-none { background: var(--warning-bg); color: var(--warning); }
.acct-reset { background: var(--primary-light); color: var(--primary-dark); }

/* ---- Announcement popup (self-contained: no dependency on modal styles) ---- */
.np-backdrop {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, .55);
  opacity: 0; transition: opacity .18s ease;
}
.np-backdrop.show { opacity: 1; }
.np-card {
  width: 100%; max-width: 460px; background: #fff; border-radius: 16px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, .35); overflow: hidden;
  transform: translateY(10px) scale(.98); transition: transform .18s ease;
}
.np-backdrop.show .np-card { transform: none; }
.np-card-top { display: flex; align-items: center; gap: 12px; padding: 20px 24px 16px; }
.np-card-top h3 { margin: 0; font-size: 17px; line-height: 1.3; letter-spacing: -.01em; }
.np-badge {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}
.np-card-body {
  padding: 0 24px 20px; font-size: 14.5px; line-height: 1.6;
  color: #475569; white-space: pre-wrap;
}
.np-card-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 14px 24px; border-top: 1px solid #e2e8f0; background: #f8fafc;
}
.np-count { margin-right: auto; font-size: 12px; color: #94a3b8; font-weight: 600; }
.np-btn {
  border: none; cursor: pointer; padding: 10px 22px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: #fff; background: #2563eb;
  font-family: inherit;
}
.np-btn:hover { background: #1d4ed8; }
.np-btn:focus-visible { outline: 3px solid rgba(37, 99, 235, .4); outline-offset: 2px; }

/* tone colours on the header strip */
.np-info .np-card-top { background: #eff6ff; }
.np-info .np-badge { background: #dbeafe; color: #1d4ed8; }
.np-info .np-card-top h3 { color: #1e3a8a; }
.np-success .np-card-top { background: #f0fdf4; }
.np-success .np-badge { background: #dcfce7; color: #15803d; }
.np-success .np-card-top h3 { color: #14532d; }
.np-warning .np-card-top { background: #fffbeb; }
.np-warning .np-badge { background: #fef3c7; color: #b45309; }
.np-warning .np-card-top h3 { color: #78350f; }
.np-urgent .np-card-top { background: #fef2f2; }
.np-urgent .np-badge { background: #fee2e2; color: #b91c1c; }
.np-urgent .np-card-top h3 { color: #7f1d1d; }
.np-urgent .np-btn { background: #dc2626; }
.np-urgent .np-btn:hover { background: #b91c1c; }

/* stop the page scrolling behind the popup */
body.np-locked { overflow: hidden; }

@media (max-width: 480px) {
  .np-backdrop { padding: 14px; align-items: flex-end; }
  .np-card { max-width: none; border-radius: 16px 16px 12px 12px; }
  .np-card-top h3 { font-size: 16px; }
  .np-btn { width: 100%; padding: 12px; }
  .np-card-foot { flex-wrap: wrap; }
}
