/* ═══════════════════════════════════════════════════════════
   SecureEye — Main Stylesheet (v4 — Orange Theme)
   Christdanrey Construction
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ── CSS Variables — Orange Theme ─────────────────────────── */
:root {
  --primary:        #e87c1e;
  --primary-dark:   #c96a10;
  --primary-light:  #fff4e8;
  --accent:         #f5a623;
  --sidebar-bg:     #1a1008;
  --sidebar-text:   #a89070;
  --sidebar-active: #e87c1e;
  --sidebar-hover:  #2a1a0c;
  --topbar-bg:      #ffffff;
  --body-bg:        #f7f3ef;
  --card-bg:        #ffffff;
  --border:         #e8ddd0;
  --text-primary:   #1a0f00;
  --text-muted:     #7a6050;
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #0ea5e9;
  --radius:         10px;
  --shadow:         0 1px 3px rgba(180,100,0,.08), 0 1px 2px rgba(180,100,0,.05);
  --shadow-md:      0 4px 6px -1px rgba(180,100,0,.1), 0 2px 4px -1px rgba(180,100,0,.06);
  --sidebar-width:  240px;
  --topbar-height:  60px;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--body-bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1008 0%, #3d2208 55%, #e87c1e 100%);
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 430px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.login-logo .logo-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  background: #1a1008;
  padding: 4px;
}

.login-logo .logo-text h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.login-logo .logo-text span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.login-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-card .subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 28px;
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: left .3s ease;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid #2a1a0c;
}

.sidebar-brand .brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: #2a1a0c;
  padding: 3px;
  flex-shrink: 0;
}

.sidebar-brand .brand-name {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-brand .brand-sub {
  color: var(--sidebar-text);
  font-size: 10px;
  font-weight: 400;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section-label {
  color: #4a3020;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 12px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  color: var(--sidebar-text);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #f5d0a0;
  text-decoration: none;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #ffffff;
}

.nav-item .nav-icon {
  width: 22px;
  text-align: center;
  font-size: 17px;
  opacity: .9;
  flex-shrink: 0;
}

/* ── Collapsible nav groups (Canvas-style) ──────────────────── */
.nav-group { display: block; }

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 14.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}

.nav-group-toggle:hover {
  background: var(--sidebar-hover);
  color: #f5d0a0;
}

.nav-group-toggle .nav-icon {
  width: 22px;
  text-align: center;
  font-size: 17px;
  opacity: .9;
  flex-shrink: 0;
}

.nav-group-title { flex: 1; }

.nav-chevron {
  font-size: 12px;
  opacity: .7;
  transition: transform .25s ease;
}

.nav-group.open .nav-chevron { transform: rotate(180deg); }

/* Highlight the parent when one of its children is the active page */
.nav-group.has-active > .nav-group-toggle {
  color: #f5d0a0;
}

/* The collapsible panel */
.nav-subnav {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
  background: rgba(0, 0, 0, .18);
}

.nav-group.open .nav-subnav { max-height: 600px; }

/* Sub-items: slightly indented and smaller */
.nav-subitem {
  padding-left: 30px;
  font-size: 13.5px;
}

.nav-subitem .nav-icon { font-size: 15px; }

.nav-subitem.active {
  background: var(--sidebar-active);
  color: #ffffff;
}

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid #2a1a0c;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .user-avatar {
  width: 34px;
  height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user .user-info .user-name {
  color: #f5d0a0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.sidebar-user .user-info .user-role {
  color: var(--sidebar-text);
  font-size: 11px;
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left .page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-left .breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-time { font-size: 12px; color: var(--text-muted); }

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #fff4e8;
  border: 1px solid #f5d0a0;
  border-radius: 6px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}

.btn-logout:hover { background: #ffe0c0; color: var(--primary-dark); text-decoration: none; }

.page-body { padding: 24px; flex: 1; }

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 20px; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-card .stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-card .stat-icon.blue   { background: #fff4e8; color: var(--primary); }
.stat-card .stat-icon.green  { background: #d1fae5; color: var(--success); }
.stat-card .stat-icon.yellow { background: #fef3c7; color: var(--warning); }
.stat-card .stat-icon.red    { background: #fee2e2; color: var(--danger); }
.stat-card .stat-icon.cyan   { background: #e0f2fe; color: var(--info); }
.stat-card .stat-icon.orange { background: #fff4e8; color: var(--primary); }

/* Calm dashboard: neutral brand-tinted tile by default; a semantic colour
   appears only when that metric needs attention (warn = pending, alert = problem). */
.stat-card .stat-icon.neutral { background: var(--primary-light); color: var(--primary); }
.stat-card.is-warn  .stat-icon  { background: #fef3c7; color: var(--warning); }
.stat-card.is-warn  .stat-value { color: var(--warning); }
.stat-card.is-alert .stat-icon  { background: #fee2e2; color: var(--danger); }
.stat-card.is-alert .stat-value { color: var(--danger); }

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   CCTV MONITOR
   ═══════════════════════════════════════════════════════════ */
.cctv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 20px;
}

.camera-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}

.camera-card:hover { box-shadow: var(--shadow-md); }

.camera-feed {
  width: 100%;
  height: 220px;
  background: #1a1008;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.camera-feed::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,.05) 2px, rgba(0,0,0,.05) 4px);
  pointer-events: none;
}

.camera-feed .feed-placeholder { text-align: center; color: #4a3020; }
.camera-feed .feed-placeholder .cam-icon { font-size: 36px; margin-bottom: 8px; display: block; }
.camera-feed .feed-placeholder .no-signal { font-size: 11px; color: #4a3020; letter-spacing: .05em; }
.camera-feed .feed-placeholder .cam-label { font-size: 13px; color: #7a5030; font-weight: 500; }

.status-indicator {
  position: absolute;
  top: 10px; right: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,.6);
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  color: #fff;
  font-weight: 500;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online  { background: var(--success); animation: pulse 2s infinite; }
.status-dot.offline { background: var(--danger); }
.status-dot.maintenance { background: var(--warning); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

.camera-info { padding: 16px 20px; }
.camera-info .cam-name { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.camera-info .cam-location { font-size: 12px; color: var(--text-muted); }
.camera-info .cam-meta { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; }
.camera-info .cam-meta .last-activity { font-size: 11px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  background: #faf6f2;
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #faf6f2; }

/* ═══════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-pending    { background: #fff4e8; color: #c96a10; }
.badge-verified   { background: #d1fae5; color: #065f46; }
.badge-flagged    { background: #fee2e2; color: #b91c1c; }
.badge-open       { background: #fff4e8; color: #c96a10; }
.badge-progress   { background: #fef3c7; color: #b45309; }
.badge-resolved   { background: #d1fae5; color: #065f46; }
.badge-closed     { background: #f1f5f9; color: #64748b; }
.badge-online     { background: #d1fae5; color: #065f46; }
.badge-offline    { background: #fee2e2; color: #b91c1c; }
.badge-maintenance { background: #fef3c7; color: #b45309; }
.badge-low        { background: #d1fae5; color: #065f46; }
.badge-medium     { background: #fff4e8; color: #c96a10; }
.badge-high       { background: #fee2e2; color: #b91c1c; }
.badge-critical   { background: #450a0a; color: #fca5a5; }
.badge-in_progress { background: #fef3c7; color: #b45309; }

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-primary);
  background: #fff;
  border: 1px solid #d8c8b8;
  border-radius: 7px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,124,30,.15);
}

.form-control.is-invalid { border-color: var(--danger); }
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 20px;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  text-decoration: none;
  line-height: 1;
}

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }

.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover { background: #faf6f2; text-decoration: none; color: var(--text-primary); }

.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; text-decoration: none; color: #fff; }
.btn-warning { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; text-decoration: none; color: #fff; }
.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; text-decoration: none; color: #fff; }
.btn-sm      { padding: 5px 12px; font-size: 12px; }

/* ═══════════════════════════════════════════════════════════
   EVIDENCE REF
   ═══════════════════════════════════════════════════════════ */
.evidence-ref {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  background: #fff4e8;
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #f5d0a0;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: #d1fae5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-error   { background: #fee2e2; border: 1px solid #fca5a5; color: #b91c1c; }
.alert-warning { background: #fef3c7; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: #fff4e8; border: 1px solid #f5d0a0; color: #c96a10; }

/* ═══════════════════════════════════════════════════════════
   AUDIT LOG
   ═══════════════════════════════════════════════════════════ */
.audit-timeline { display: flex; flex-direction: column; gap: 0; }

.audit-entry {
  display: grid;
  grid-template-columns: 140px 140px 1fr;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
}

.audit-entry:last-child { border-bottom: none; }
.audit-entry:hover { background: #faf6f2; }
.audit-time { color: var(--text-muted); font-size: 12px; }
.audit-user { font-weight: 600; color: var(--text-primary); }
.audit-desc { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.empty-state {
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { left: calc(-1 * var(--sidebar-width)); }
  .sidebar.open { left: 0; }
  .main-content { margin-left: 0; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
}

/* Progressive-disclosure "Show technical details" expanders */
details > summary { list-style: none; outline: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary .bi-chevron-right { display: inline-block; transition: transform .2s ease; }
details[open] > summary .bi-chevron-right { transform: rotate(90deg); }
details > summary:hover { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   UI/UX REFRESH — 2026
   Modern "neutral surface + one vivid accent" treatment inspired by a
   smart-home dashboard reference. Keeps SecureEye's orange brand; shifts the
   warm-brown chrome to a cleaner charcoal/neutral base, with softer floating
   cards, rounded sidebar pills, pill toggles and header chips.
   Appended last so it overrides earlier rules via the cascade.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* keep the orange brand accent */
  --primary:        #e87c1e;
  --primary-dark:   #cc6a12;
  --primary-light:  #fff3e6;
  --accent:         #f5a623;

  /* charcoal chrome (was warm brown) */
  --sidebar-bg:     #1c1005;
  --sidebar-text:   #a89070;
  --sidebar-active: #e87c1e;
  --sidebar-hover:  #2a1a0c;

  /* clean neutral surfaces (was warm) */
  --topbar-bg:      #ffffff;
  --body-bg:        #f3f4f6;
  --card-bg:        #ffffff;
  --border:         #e7e9ee;
  --text-primary:   #16181d;
  --text-muted:     #6b7280;

  /* softer, larger, more modern */
  --radius:         14px;
  --radius-sm:      10px;
  --radius-lg:      20px;
  --shadow:         0 1px 2px rgba(17,24,39,.04), 0 4px 14px rgba(17,24,39,.05);
  --shadow-md:      0 6px 22px -6px rgba(17,24,39,.12), 0 2px 8px rgba(17,24,39,.06);
}

body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ── Cards: soft, floating, subtle hover lift ── */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { padding: 18px 22px; }
.card-body { padding: 22px; }

/* ── Sidebar: rounded inset "pill" items like the reference rail ── */
.sidebar { background: var(--sidebar-bg); }
.sidebar-nav { padding: 14px 0; }
.sidebar .nav-item {
  margin: 2px 12px;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 500;
}
.sidebar .nav-item:hover { background: var(--sidebar-hover); color: #f3d9bd; }
.sidebar .nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(232,124,30,.65);
}
.sidebar .nav-subitem {
  margin: 1px 12px 1px 16px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
}
.sidebar .nav-group-toggle {
  margin: 2px 12px;
  padding: 11px 14px;
  border-radius: 12px;
  width: auto;
}
.sidebar .nav-group-toggle:hover { background: var(--sidebar-hover); }

/* ── Topbar: cleaner, lighter ── */
.topbar { border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 rgba(17,24,39,.02); }

/* ── Buttons: rounder, springier ── */
.btn { border-radius: 11px; padding: 10px 18px; transition: background .15s, box-shadow .15s, transform .08s; }
.btn:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 8px 18px -8px rgba(232,124,30,.6); }
.btn-primary:hover { box-shadow: 0 10px 22px -8px rgba(232,124,30,.7); }
.btn-outline { background: #fff; border: 1px solid var(--border); }
.btn-outline:hover { background: #f7f8fa; }
.btn-sm { border-radius: 9px; padding: 6px 12px; }

/* ── Badges: pill, slightly bolder ── */
.badge { border-radius: 999px; font-weight: 600; letter-spacing: .01em; padding: 4px 10px; }

/* ── Inputs: rounder, soft focus ring ── */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,124,30,.15);
  outline: none;
}

/* ── Stat cards: refined ── */
.stat-card { border-radius: var(--radius); }
.stat-card .stat-icon { border-radius: 14px; }

/* ── Page header ── */
.page-header h2 { letter-spacing: -.01em; }

/* ── Info chips (for headers / status strips, like the reference) ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow);
}
.chip i { color: var(--primary); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Pill toggle switch (reference-style) ── */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #cbd0d8; border-radius: 999px; transition: background .2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ── Live "REC/LIVE" pill animation already used on recordings page ── */
@keyframes recpulse2 { 0%,100% { opacity:1 } 50% { opacity:.3 } }

/* ── Evidence ref chip tuned to neutral base ── */
.evidence-ref { background: var(--primary-light); border-color: #f5d0a0; }

/* ═══════════════════════════════════════════════════════════════════════════
   FLOATING ICON RAIL + FLYOUT SUB-MENUS  (reference: image 2)
   Slim rail of circular icon buttons; categories with sub-pages pop out a
   floating panel of sub-links beside the rail. Selectors are scoped to
   `.sidebar` so they win over the generic .sidebar .nav-item refresh rules.
   ═══════════════════════════════════════════════════════════════════════════ */

:root { --sidebar-width: 92px; }

.sidebar { width: var(--sidebar-width); align-items: center; }

.sidebar .sidebar-brand { justify-content: center; padding: 16px 0 10px; }
.sidebar .sidebar-brand .brand-text { display: none; }
.sidebar .sidebar-brand .brand-icon {
  width: 62px; height: 62px; border-radius: 16px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.sidebar .sidebar-nav {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; width: 100%; padding: 6px 0; overflow: visible;
}
.sidebar .rail-spacer { flex: 1 1 auto; min-height: 8px; }

.sidebar .rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 64px; margin: 1px 0; padding: 6px 4px; border-radius: 14px;
  background: transparent; border: none; cursor: pointer;
  color: var(--sidebar-text); font-family: inherit;
  font-size: 9.5px; font-weight: 600; text-align: center; line-height: 1.15;
  text-decoration: none; transition: color .15s;
}
.sidebar .rail-item .nav-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--sidebar-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; opacity: 1;
  transition: background .15s, color .15s, box-shadow .15s;
}
.sidebar .rail-label { white-space: nowrap; }
.sidebar .rail-item:hover { background: transparent; color: #f3d9bd; }
.sidebar .rail-item:hover .nav-icon { background: #2c2f3a; color: #fff; }

.sidebar .rail-item.active .nav-icon,
.sidebar .rail-group.group-active > .rail-toggle .nav-icon,
.sidebar .rail-group.open > .rail-toggle .nav-icon {
  background: var(--sidebar-active); color: #fff;
  box-shadow: 0 8px 18px -6px rgba(232,124,30,.6);
}
.sidebar .rail-item.active,
.sidebar .rail-group.group-active > .rail-toggle { color: #fff; }

.sidebar .rail-group { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }
.sidebar .rail-flyout {
  position: fixed;
  min-width: 216px; max-height: 80vh; overflow-y: auto;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-md); padding: 9px;
  opacity: 0; visibility: hidden; transform: translateX(-6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  z-index: 1200;
}
.sidebar .rail-flyout::before {
  content: ""; position: absolute; left: -6px; top: var(--ptr-top, 22px);
  width: 12px; height: 12px; background: var(--card-bg);
  border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}
.sidebar .rail-group.open .rail-flyout { opacity: 1; visibility: visible; transform: translateX(0); }

.sidebar .flyout-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); padding: 6px 10px 8px;
}
.sidebar .flyout-link {
  display: flex; flex-direction: row; align-items: center; gap: 11px;
  width: auto; margin: 0; padding: 9px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; text-align: left;
  color: var(--text-primary); text-decoration: none; white-space: nowrap;
}
.sidebar .flyout-link i { font-size: 15px; color: var(--text-muted); width: 18px; text-align: center; }
.sidebar .flyout-link:hover { background: var(--body-bg); color: var(--text-primary); text-decoration: none; }
.sidebar .flyout-link.active { background: var(--primary-light); color: var(--primary-dark); }
.sidebar .flyout-link.active i { color: var(--primary); }

.sidebar .sidebar-user { justify-content: center; padding: 12px 0; }
.sidebar .sidebar-user .user-info { display: none; }
.sidebar .sidebar-user .user-avatar { width: 40px; height: 40px; font-size: 14px; }

/* ── Flyout sub-headings + two-line descriptive links ── */
.sidebar .rail-flyout { min-width: 244px; }
.sidebar .flyout-sub {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #9aa0ad; padding: 9px 12px 3px;
}
.sidebar .flyout-sub:first-of-type { padding-top: 2px; }
.sidebar .flyout-link.desc { align-items: flex-start; white-space: normal; }
.sidebar .flyout-link.desc > i { margin-top: 2px; flex-shrink: 0; }
.sidebar .flyout-link .fl-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sidebar .flyout-link .fl-label { font-weight: 600; }
.sidebar .flyout-link .fl-desc { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.sidebar .flyout-link.desc.active .fl-desc { color: var(--primary-dark); }

/* ── Materials tabbed page (Inventory · Allocation · Deliveries) ── */
.materials-head { margin-bottom: 14px; }
.materials-head h2 { font-size: 22px; font-weight: 700; }
.materials-tabs { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.materials-tabs .mtab {
  display: flex; flex-direction: column; gap: 1px;
  padding: 11px 20px 12px; border-radius: 14px; text-decoration: none;
  background: #fff; border: 1px solid var(--border); color: var(--text-primary);
  min-width: 150px; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.materials-tabs .mtab i { font-size: 17px; color: var(--text-muted); margin-bottom: 4px; }
.materials-tabs .mtab .mtab-label { font-weight: 700; font-size: 14.5px; }
.materials-tabs .mtab .mtab-sub { font-size: 11px; color: var(--text-muted); }
.materials-tabs .mtab:hover { border-color: var(--primary); background: var(--primary-light); }
.materials-tabs .mtab.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 10px 22px -8px rgba(232,124,30,.55);
}
.materials-tabs .mtab.active i,
.materials-tabs .mtab.active .mtab-sub { color: rgba(255,255,255,.88); }
.materials-actionbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.materials-actionbar .muted { font-size: 13px; color: var(--text-muted); }
.materials-actionbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Dashboard task launcher (#4) ── */
.task-launcher { padding: 20px 22px; margin-bottom: 24px; }
.task-launcher-head h3 { font-size: 16px; font-weight: 700; margin: 0; }
.task-launcher-head p { font-size: 13px; color: var(--text-muted); margin: 2px 0 16px; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.task-btn {
  display: flex; align-items: center; gap: 13px; text-decoration: none;
  padding: 14px 16px; border-radius: 14px; background: var(--card-bg);
  border: 1px solid var(--border); transition: border-color .15s, box-shadow .15s, transform .1s;
}
.task-btn:hover { border-color: var(--primary); box-shadow: 0 8px 20px -10px rgba(17,24,39,.2); transform: translateY(-1px); }
.task-ico {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.task-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.task-verb { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.task-frs { font-size: 11.5px; color: var(--text-muted); }

/* ── Allocation wizard helpers ── */
.wiz-h { font-size: 16px; font-weight: 700; margin: 0 0 4px; color: var(--text-primary); }
.wiz-p { font-size: 13px; color: var(--text-muted); margin: 0 0 18px; }
.review-box { display: flex; flex-direction: column; gap: 2px; }
.review-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 14px; border-radius: 10px; background: var(--body-bg); font-size: 13.5px;
}
.review-row span { color: var(--text-muted); }
.review-row strong { color: var(--text-primary); text-align: right; }
.input-error { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239,68,68,.12) !important; }

/* ═══════════════════════════════════════════════════════════
   NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */

/* ── Sidebar bell badge ── */
.notif-icon-wrap { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 18px;
  border-radius: 9px; text-align: center;
  box-shadow: 0 0 0 2px var(--sidebar-bg);
  pointer-events: none;
}
.notif-badge-inline {
  display: inline-block;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: #ef4444; color: #fff;
  font-size: 9px; font-weight: 700; line-height: 16px;
  border-radius: 8px; text-align: center;
  vertical-align: middle; margin-left: 4px;
}

/* ── Notification list ── */
.notif-list { display: flex; flex-direction: column; gap: 10px; max-width: 800px; }

.notif-card {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 20px; border-radius: var(--radius);
  background: var(--card-bg); border: 1px solid var(--border);
  box-shadow: var(--shadow); transition: box-shadow .15s;
}
.notif-card:hover { box-shadow: var(--shadow-md); }
.notif-card.notif-unread {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
}

.notif-icon-col { flex-shrink: 0; }
.notif-type-icon {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; font-size: 18px;
}
.notif-type-requested { background: #fff3e0; color: #e87c1e; }
.notif-type-approved  { background: #d1fae5; color: #059669; }
.notif-type-rejected  { background: #fee2e2; color: #dc2626; }
.notif-type-info      { background: #e0f2fe; color: #0369a1; }

.notif-body { flex: 1; min-width: 0; }
.notif-message { font-size: 14px; color: var(--text-primary); line-height: 1.5; margin-bottom: 6px; }
.notif-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notif-time { font-size: 12px; color: var(--text-muted); }
.notif-tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
}
.notif-tag-requested { background: #fff3e0; color: #c96a10; }
.notif-tag-approved  { background: #d1fae5; color: #065f46; }
.notif-tag-rejected  { background: #fee2e2; color: #991b1b; }
.notif-tag-info      { background: #e0f2fe; color: #075985; }

.btn-sm-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--primary); font-weight: 500;
  text-decoration: none; padding: 3px 0;
}
.btn-sm-link:hover { text-decoration: underline; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}

/* ── Notification popup dropdown ── */
.notif-popup-wrap {
  position: relative;
  display: inline-flex;
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  z-index: 1500;
  overflow: hidden;
  animation: notifSlideIn .15s ease;
}
.notif-dropdown.open { display: flex; flex-direction: column; }

@keyframes notifSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.notif-dropdown-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.notif-dropdown-count {
  font-size: 11px; font-weight: 700;
  background: #ef4444; color: #fff;
  padding: 2px 8px; border-radius: 20px;
}

.notif-dropdown-body {
  max-height: 360px; overflow-y: auto;
  display: flex; flex-direction: column;
}

.notif-dropdown-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--body-bg);
  transition: background .1s;
}
.notif-dropdown-item:last-child { border-bottom: none; }
.notif-dropdown-item:hover { background: var(--body-bg); }
.notif-dropdown-item--unread { background: var(--primary-light); }
.notif-dropdown-item--unread:hover { background: #fdebd5; }

/* ── Notification search bar ── */
.notif-search-wrap {
  position: relative;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}
.notif-search-icon {
  position: absolute;
  left: 22px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}
.notif-search-input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12.5px;
  background: var(--body-bg);
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
.notif-search-input:focus { border-color: var(--primary); }

/* ── Sender avatar circle ── */
.notif-avatar {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  letter-spacing: 0.5px;
}
.notif-avatar--requested { background: #e87c1e; }
.notif-avatar--approved  { background: #16a34a; }
.notif-avatar--rejected  { background: #dc2626; }
.notif-avatar--info      { background: #0ea5e9; }

/* ── Item text layout ── */
.notif-dropdown-text { flex: 1; min-width: 0; }

.notif-sender-row {
  display: flex; align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.notif-sender-name {
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.notif-dropdown-msg {
  font-size: 12px; color: var(--text-muted);
  line-height: 1.4;
}
.notif-dropdown-time {
  font-size: 10.5px; color: var(--text-muted);
  white-space: nowrap;
}

/* ── Empty / no-results states ── */
.notif-dropdown-empty,
.notif-no-results {
  text-align: center; padding: 28px 16px;
  color: var(--text-muted); font-size: 13px;
}

.notif-dropdown-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.notif-dropdown-viewall {
  font-size: 13px; font-weight: 600;
  color: var(--primary); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 0;
}
.notif-dropdown-viewall:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   Notifications side drawer (Google-Docs-style right panel)
   ═══════════════════════════════════════════════════════════ */
.notif-drawer-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 2000;
  animation: backdropFadeIn .2s ease;
}
.notif-drawer-backdrop.open { display: block; }

@keyframes backdropFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

.notif-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 400px;
  max-width: 95vw;
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 32px rgba(0,0,0,.18);
  z-index: 2100;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.notif-drawer.open { transform: translateX(0); }

/* Header */
.notif-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-drawer-title {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 7px;
}
.notif-drawer-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px;
  padding: 4px 6px; border-radius: 6px;
  transition: background .15s, color .15s;
  display: flex; align-items: center;
}
.notif-drawer-close:hover { background: var(--body-bg); color: var(--text-primary); }

/* Search */
.notif-drawer-search-wrap {
  position: relative;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-drawer-search-icon {
  position: absolute; left: 27px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px;
  pointer-events: none;
}
.notif-drawer-search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: 22px;
  font-size: 13px;
  background: var(--body-bg);
  color: var(--text-primary);
  outline: none; box-sizing: border-box;
  transition: border-color .15s;
}
.notif-drawer-search-input:focus { border-color: var(--primary); }

/* ── Filter chips bar ── */
.notif-filter-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-wrap: nowrap;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.notif-filter-bar::-webkit-scrollbar { height: 3px; }
.notif-filter-bar::-webkit-scrollbar-track { background: transparent; }
.notif-filter-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.notif-filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 12px; font-weight: 500;
  white-space: nowrap; cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.notif-filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.notif-filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
/* Coloured accent for type chips when active */
.notif-filter-chip--requested.active { background: #e87c1e; border-color: #e87c1e; }
.notif-filter-chip--approved.active  { background: #16a34a; border-color: #16a34a; }
.notif-filter-chip--rejected.active  { background: #dc2626; border-color: #dc2626; }

/* ── Type tag badge inside each drawer item ── */
.notif-drawer-type-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 12px;
  margin-bottom: 4px;
}
.notif-drawer-type-tag--requested { background: #fff3e8; color: #c05c00; }
.notif-drawer-type-tag--approved  { background: #f0fdf4; color: #15803d; }
.notif-drawer-type-tag--rejected  { background: #fef2f2; color: #b91c1c; }
.notif-drawer-type-tag--info      { background: #e0f2fe; color: #075985; }

/* Body / scroll area */
.notif-drawer-body {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
}

/* Each notification row */
.notif-drawer-item {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--body-bg);
  transition: background .12s;
}
.notif-drawer-item:last-child { border-bottom: none; }
.notif-drawer-item:hover { background: var(--body-bg); }
.notif-drawer-item--unread { background: var(--primary-light); }
.notif-drawer-item--unread:hover { background: #fdebd5; }

.notif-drawer-text { flex: 1; min-width: 0; }

.notif-drawer-sender-row {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 8px;
  margin-bottom: 4px;
}
.notif-drawer-sender {
  font-size: 13.5px; font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.notif-drawer-time {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap;
}
.notif-drawer-msg {
  font-size: 12.5px; color: var(--text-muted);
  line-height: 1.45;
}

/* Empty / no-results */
.notif-drawer-empty,
.notif-drawer-no-results {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted); font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM VISUAL LANGUAGE — matches login-page design feel on internal pages.
   Playfair Display headings, richer warm-glowing card shadows, accented stat
   tiles, page entrance animation, upgraded topbar.
   Appended last — overrides all earlier rules via cascade.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Warm parchment body background ── */
body:not(.login-page-body) {
  background: linear-gradient(160deg, #f4f0ec 0%, #f6f3ef 55%, #f3f4f6 100%);
}

/* ── Playfair Display for all page-level headings ── */
.page-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.015em;
  color: var(--text-primary);
}

/* ── Topbar: Playfair Display page title + cleaner shadow ── */
.topbar {
  background: #ffffff;
  box-shadow: 0 1px 0 var(--border), 0 2px 16px rgba(17,24,39,.05);
}
.topbar-left .page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ── Cards: white rim highlight + warm orange micro-glow ── */
.card {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.80),
    0 2px 8px rgba(26,16,8,.06),
    0 6px 20px rgba(26,16,8,.05),
    0 0 40px rgba(232,124,30,.03);
  border-radius: 16px;
}
.card:hover {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.90),
    0 4px 14px rgba(26,16,8,.09),
    0 10px 30px rgba(26,16,8,.07),
    0 0 48px rgba(232,124,30,.06);
}

/* ── Stat cards: orange gradient top accent + Playfair number + hover lift ── */
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 20px;
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.80),
    0 2px 8px rgba(26,16,8,.06),
    0 6px 20px rgba(26,16,8,.05);
  transition: transform .20s ease, box-shadow .20s ease;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59332 0%, #e87c1e 60%, #c96a10 100%);
  border-radius: 16px 16px 0 0;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.90),
    0 6px 20px rgba(26,16,8,.10),
    0 12px 36px rgba(26,16,8,.08),
    0 0 50px rgba(232,124,30,.08);
}
.stat-card .stat-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.stat-card.is-warn  .stat-value { color: var(--warning); }
.stat-card.is-alert .stat-value { color: var(--danger); }
.stat-card .stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.stat-card .stat-icon { border-radius: 14px; }

/* ── Page body: smooth entrance animation on every navigation ── */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-body { animation: pageEnter .38s cubic-bezier(.22,1,.36,1) both; }

/* ── ALL card h3: Playfair Display ── */
.card h3,
.card-header h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
}

/* ── Card headers: orange-tinted divider, variable background ── */
.card-header {
  background: var(--card-bg);
  border-bottom: 1px solid rgba(232, 124, 30, 0.12);
}

/* ── Topbar: warm orange sunrise fade ── */
.topbar {
  background: linear-gradient(180deg, #fffaf6 0%, #ffffff 65%);
  border-bottom: 1px solid rgba(232, 124, 30, 0.14);
  box-shadow: 0 2px 24px rgba(232, 124, 30, 0.07);
}

/* ── Sidebar: orange brand accent strip at very top ── */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #c96a10 0%, #e87c1e 50%, #f59332 100%);
  z-index: 101;
}

/* ── Stat icons (neutral): gradient + warm glow ── */
.stat-card .stat-icon.neutral {
  background: linear-gradient(135deg, #fff3e0 0%, #ffd9a0 100%);
  color: #bf6012;
  box-shadow: 0 4px 14px rgba(232, 124, 30, 0.22);
}

/* ── Task launcher icon circles: warm glow + hover scale ── */
.task-ico {
  box-shadow: 0 4px 12px rgba(232, 124, 30, 0.16);
  transition: transform .18s ease, box-shadow .18s ease;
}
.task-btn:hover .task-ico {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(232, 124, 30, 0.28);
}

/* ── Task launcher h3 label ── */
.task-launcher-head h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
}

/* ── Table: warm header tint + orange accent on hover row ── */
thead th {
  background: linear-gradient(180deg, #fff8f2 0%, #fdf4ee 100%);
  color: #7a5a40;
}
tbody tr:hover { background: #fff8f3; }

/* ── Btn-primary: richer glow ── */
.btn-primary {
  background: linear-gradient(135deg, #f59332 0%, #e87c1e 50%, #c96a10 100%);
  box-shadow: 0 8px 22px -8px rgba(232, 124, 30, 0.60),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #f59d46 0%, #e87c1e 50%, #c05c00 100%);
  box-shadow: 0 10px 26px -6px rgba(232, 124, 30, 0.70),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-decoration: none; color: #fff;
}

/* ── Chips: orange-tinted border, variable background ── */
.chip {
  background: var(--card-bg);
  border-color: rgba(232, 124, 30, 0.22);
  box-shadow: 0 1px 4px rgba(232, 124, 30, 0.08);
  color: var(--text-primary);
}

/* ── Active nav item: stronger glow ── */
.sidebar .rail-item.active .nav-icon,
.sidebar .rail-group.group-active > .rail-toggle .nav-icon {
  box-shadow: 0 6px 20px -4px rgba(232, 124, 30, 0.70);
}

/* ── Logout button: more premium ── */
.btn-logout {
  background: linear-gradient(135deg, #fff8f2 0%, #fff0e4 100%);
  border-color: rgba(232, 124, 30, 0.30);
  box-shadow: 0 2px 8px rgba(232, 124, 30, 0.10);
}
.btn-logout:hover {
  background: linear-gradient(135deg, #fff0e4 0%, #ffe3cc 100%);
  border-color: rgba(232, 124, 30, 0.45);
  color: var(--primary-dark);
}
