@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── THEMES ───────────────────────────────────────────────────────────────
   Three palettes, switched at runtime by setting `data-theme` on <html>.
   Default (no attribute) and `data-theme="midnight"` resolve to the same
   navy-blue palette this app shipped with.
   ──────────────────────────────────────────────────────────────────────── */
:root,
:root[data-theme="midnight"] {
  --bg: #070d1a;
  --surface: #0f1729;
  --surface2: #162038;
  --surface3: #1e2d4a;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-glow: rgba(59,130,246,0.25);
  --accent: #f59e0b;
  --accent-glow: rgba(245,158,11,0.2);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text: #f1f5f9;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(59,130,246,0.4);
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(59,130,246,0.15);
  --topbar-bg: rgba(10,15,30,0.8);
}

/* "Slate" — neutral graphite dark, emerald accent. Easier on the eyes
   for long sessions; high contrast on text without the navy tint. */
:root[data-theme="slate"] {
  --bg: #0a0a0a;
  --surface: #171717;
  --surface2: #262626;
  --surface3: #404040;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99,102,241,0.25);
  --accent: #10b981;
  --accent-glow: rgba(16,185,129,0.2);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text: #fafafa;
  --text-muted: #a3a3a3;
  --text-dim: #d4d4d4;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(99,102,241,0.4);
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px rgba(99,102,241,0.12);
  --topbar-bg: rgba(15,15,15,0.85);
}

/* "Light" — clean light theme for daytime / printing. */
:root[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --surface3: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-glow: rgba(37,99,235,0.18);
  --accent: #d97706;
  --accent-glow: rgba(217,119,6,0.15);
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --border: rgba(15,23,42,0.10);
  --border-hover: rgba(37,99,235,0.4);
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 4px 16px rgba(15,23,42,0.08);
  --shadow-glow: 0 0 30px rgba(37,99,235,0.12);
  --topbar-bg: rgba(255,255,255,0.85);
  --auth-card-bg: rgba(255,255,255,0.92);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 99px; }

/* ── AUTH SCREEN ── */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59,130,246,0.12) 0%, transparent 70%),
              radial-gradient(ellipse 60% 50% at 90% 80%, rgba(245,158,11,0.07) 0%, transparent 60%),
              var(--bg);
}

.auth-grid-bg {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(59,130,246,0.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(59,130,246,0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

.auth-card {
  background: var(--auth-card-bg, rgba(15,23,41,0.85));
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow), var(--shadow-glow);
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  justify-content: center;
}

.auth-logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px var(--primary-glow);
  font-size: 22px;
}

.auth-logo h1 {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-logo span {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  margin-top: -2px;
}

.auth-tabs {
  display: flex;
  background: var(--surface);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 28px;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.auth-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 12px var(--primary-glow);
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 7px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  outline: none;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--surface2);
}

.form-group input::placeholder { color: var(--text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
  width: 100%;
  padding: 14px;
  font-size: 15px;
  margin-top: 8px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--surface3); border-color: var(--border-hover); }

.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-success { background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.btn-success:hover { background: rgba(16,185,129,0.25); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: 8px; }

/* ── APP LAYOUT ── */
#app-screen { display: none; min-height: 100vh; }

#app-screen.visible { display: flex; }

.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 15px var(--primary-glow);
}

.sidebar-logo h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.sidebar-logo small { font-size: 10px; color: var(--accent); font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  position: relative;
}

.nav-item:hover { background: var(--surface2); color: var(--text); }

.nav-item.active {
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(59,130,246,0.1));
  color: var(--primary);
  border-color: rgba(59,130,246,0.25);
}

.nav-item .nav-icon { font-size: 18px; width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}

.nav-badge.danger { background: var(--danger); }

/* ── NAV GROUP (collapsible) ── */
.nav-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  position: relative;
  user-select: none;
}

.nav-group-header:hover { background: var(--surface2); color: var(--text); }

.nav-group-header .nav-icon { font-size: 18px; width: 20px; text-align: center; }

.nav-group-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.25s;
  color: var(--text-muted);
}

.nav-group.open .nav-group-arrow { transform: rotate(90deg); }

.nav-group-children {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  overflow: hidden;
}

.nav-group.open .nav-group-children { display: flex; }

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px 9px 38px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  position: relative;
}

.nav-sub-item::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transform: translateY(-50%);
  transition: background 0.2s;
}

.nav-sub-item:hover { background: var(--surface2); color: var(--text); }
.nav-sub-item:hover::before { background: var(--text); }

.nav-sub-item.active {
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(59,130,246,0.1));
  color: var(--primary);
  border-color: rgba(59,130,246,0.25);
}

.nav-sub-item.active::before { background: var(--primary); }

[dir="rtl"] .nav-sub-item { padding: 9px 38px 9px 14px; }
[dir="rtl"] .nav-sub-item::before { left: auto; right: 22px; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.user-card:hover { border-color: var(--border-hover); }

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info strong { font-size: 13px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { font-size: 11px; color: var(--text-muted); }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: 260px;
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 64px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--text);
}

.topbar-title { font-size: 18px; font-weight: 700; flex: 1; }
.topbar-subtitle { font-size: 12px; color: var(--text-muted); font-weight: 400; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.notif-btn {
  position: relative;
  width: 38px; height: 38px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  color: var(--text-dim);
}

.notif-btn:hover { border-color: var(--border-hover); color: var(--text); }

.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.page-content { padding: 28px; flex: 1; overflow-y: auto; }

/* ── PAGES ── */
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}

.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.1;
}

.stat-card.blue::before { background: var(--primary); }
.stat-card.amber::before { background: var(--accent); }
.stat-card.green::before { background: var(--success); }
.stat-card.red::before { background: var(--danger); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.stat-card.blue .stat-icon { background: rgba(59,130,246,0.15); }
.stat-card.amber .stat-icon { background: rgba(245,158,11,0.15); }
.stat-card.green .stat-icon { background: rgba(16,185,129,0.15); }
.stat-card.red .stat-icon { background: rgba(239,68,68,0.15); }

.stat-value { font-size: 32px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 24px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead tr { border-bottom: 1px solid var(--border); }

th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 12px 16px;
}

td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.td-actions { display: flex; align-items: center; gap: 6px; }
/* Text action buttons in row actions: uniform width so Edit/SJC Creds/Cases
   line up regardless of label length. Icon-only danger button stays compact. */
.td-actions .btn-sm:not(.btn-danger) {
  min-width: 140px;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

/* ── BADGES ── */
/* ── BADGES (Premium Large Scale) ── */
:root {
  --badge-h: 32px;
  --badge-fs: 15px;
  --badge-fw: 700;
  --badge-radius: 6px;
  --badge-bg-op: 0;
  --badge-border-op: 0.4;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--badge-h);
  padding: 0 10px;
  border-radius: var(--badge-radius);
  font-size: var(--badge-fs);
  font-weight: var(--badge-fw);
  white-space: nowrap;
  border: 1px solid currentColor;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 6px;
  box-sizing: border-box;
  line-height: normal;
  background: none;
}

.badge-blue { color: #60a5fa; border-color: rgba(96, 165, 250, 0.4); }
.badge-green { color: #4ade80; border-color: rgba(74, 222, 128, 0.4); }
.badge-amber { color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); }
.badge-red { color: #f87171; border-color: rgba(248, 113, 113, 0.4); }
.badge-purple { color: #c084fc; border-color: rgba(192, 132, 252, 0.4); }
.badge-gray { color: #94a3b8; border-color: rgba(148, 163, 184, 0.4); }
.badge-cyan { color: #22d3ee; border-color: rgba(34, 211, 238, 0.4); }

.badge-update {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid #ef4444;
  font-weight: 700;
  cursor: pointer;
}
.badge-update:hover { transform: translateY(-1px); filter: brightness(1.1); box-shadow: 0 6px 16px rgba(239, 68, 68, 0.15); }

/* ── ACTION BAR (Modern High Density) ── */
.action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.action-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

.btn-icon {
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  font-size: 21px;
}
.btn-icon:hover { border-color: var(--border-hover); color: var(--text); background: var(--surface); }

.btn-icon .count-blob {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-icon.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.btn-pill {
  height: 28px;
  padding: 0 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.2s;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transform: scale(0.96);
  transition: transform 0.2s;
  overflow: hidden;
}

.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}

.modal-header h3 { font-size: 16px; font-weight: 700; }

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
}

.modal-close:hover { background: var(--surface3); color: var(--text); }

.modal-body {
  padding: 24px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

/* ── ACTIVITY FEED ── */
.feed { display: flex; flex-direction: column; gap: 0; }

.feed-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: relative;
}

.feed-item:last-child { border-bottom: none; }

.feed-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.feed-content { flex: 1; }
.feed-title { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.feed-meta { font-size: 12px; color: var(--text-muted); }
.feed-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ── ASSISTANT CHAT FEED ── */
.assistant-feed { display: flex; flex-direction: column; gap: 12px; }

.assistant-msg {
  display: flex;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

.assistant-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.msg-bubble {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px 12px 12px 12px;
  padding: 12px 16px;
  max-width: 600px;
  flex: 1;
}

.msg-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.msg-header strong { font-size: 13px; color: var(--primary); }
.msg-header time { font-size: 11px; color: var(--text-muted); }
.msg-text { font-size: 14px; line-height: 1.6; }
.msg-case-tag { display: inline-block; background: var(--surface3); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; color: var(--accent); margin-top: 6px; }

/* ── STEP WIZARD ── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface3);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.step.done .step-num { background: var(--success); border-color: var(--success); color: white; }
.step.active .step-num { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 0 12px var(--primary-glow); }

.step-label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.step.active .step-label { color: var(--text); }
.step.done .step-label { color: var(--success); }
.step-line { flex: 1; height: 1px; background: var(--border); margin: 0 8px; }
.step.done + .step-line { background: var(--success); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h4 { font-size: 16px; color: var(--text-dim); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── SETTINGS ── */
.settings-section { margin-bottom: 32px; }
.settings-section h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 16px; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: all 0.2s;
}

.setting-row:hover { border-color: var(--border-hover); }
.setting-label strong { font-size: 14px; display: block; margin-bottom: 2px; }
.setting-label span { font-size: 12px; color: var(--text-muted); }

/* ── TOGGLE ── */
.toggle {
  position: relative;
  width: 44px; height: 24px;
  cursor: pointer;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute; inset: 0;
  background: var(--surface3);
  border-radius: 99px;
  transition: background 0.2s;
  border: 1px solid var(--border);
}

.toggle input:checked + .toggle-track { background: var(--primary); border-color: var(--primary); }

.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }

/* ── SELECT ── */
select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* ── GRID LAYOUTS ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ── SEARCH BAR ── */
.search-bar {
  position: relative;
}

.search-bar input {
  padding-left: 38px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  height: 38px;
  outline: none;
  transition: all 0.2s;
  width: 220px;
}

.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; pointer-events: none; }

/* ── SJC LOCK ICON ── */
.sjc-status { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.sjc-lock { font-size: 14px; }

/* ── TOAST ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
  max-width: 320px;
}

@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.info { border-color: rgba(59,130,246,0.4); }

/* ── PROGRESS BAR ── */
.progress-bar { height: 6px; background: var(--surface3); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #7c3aed); border-radius: 99px; transition: width 0.4s ease; }

/* ── CASE CARD ── */
.case-list { display: flex; flex-direction: column; gap: 10px; }

.case-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.case-card:hover { border-color: var(--border-hover); }

/* Per-update-state borders for monitored cases. The colors mirror the
   "Updates" pill / status-dot system used inside the card so the visual
   language is consistent at-a-glance. .monitoring-blocked / .auto-off-danger
   below use the same red but with a stripe pattern, so they always win
   regardless of the update-state class. */
.case-card.has-new {
  border-color: #ef4444;
  border-width: 2px;
  box-shadow: 0 0 0 1px rgba(239,68,68,.18), 0 4px 14px rgba(239,68,68,.18);
}
.case-card.has-new:hover {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239,68,68,.32), 0 6px 18px rgba(239,68,68,.25);
}
.case-card.has-unseen {
  border-color: #eab308;
  border-width: 2px;
  box-shadow: 0 0 0 1px rgba(234,179,8,.14);
}
.case-card.has-unseen:hover { border-color: #eab308; }
.case-card.all-seen {
  border-color: rgba(34,197,94,.55);
}
.case-card.all-seen:hover { border-color: rgba(34,197,94,.85); }

/* ── Accounting add-on disabled state ─────────────────────────────
   When the lawyer's addon_accounting_enabled flag is off, the sidebar
   nav items + the page bodies are visually muted. Click is still
   allowed so the user can land on the page and see the upgrade CTA
   (Subscription → enable Accounting add-on). */
.nav-accounting.acct-disabled {
  opacity: 0.45;
  filter: grayscale(0.6);
}
.nav-accounting.acct-disabled::after {
  content: "🔒";
  margin-inline-start: auto;
  font-size: 11px;
  opacity: 0.8;
}
.acct-stub {
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
  color: var(--text);
}
.acct-stub.disabled .acct-stub-icon,
.acct-stub.disabled .acct-stub-title,
.acct-stub.disabled .acct-stub-sub {
  opacity: 0.55;
  filter: grayscale(0.4);
}
.acct-stub .acct-stub-icon { font-size: 54px; }
.acct-stub .acct-stub-title { font-size: 20px; font-weight: 700; }
.acct-stub .acct-stub-sub { font-size: 13px; color: var(--text-muted); max-width: 460px; line-height: 1.55; }

/* Monitoring-blocked state — case whose auto-check is on but the scheduler
   will skip it (plan expired or missing credentials). The inline style on the
   element sets the red border + diagonal-stripe pattern; this hover rule keeps
   the red border dominant over the generic :hover rule above. */
.case-card.monitoring-blocked,
.case-card.auto-off-danger {
  border-color: #ef4444 !important;
  border-width: 2px !important;
  background:
    repeating-linear-gradient(45deg,
      rgba(239,68,68,.07) 0,
      rgba(239,68,68,.07) 10px,
      transparent 10px,
      transparent 20px),
    var(--surface2);
  box-shadow: 0 0 0 1px rgba(239,68,68,.25), 0 4px 14px rgba(239,68,68,.15);
}
.case-card.monitoring-blocked:hover,
.case-card.auto-off-danger:hover {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px rgba(239,68,68,.35), 0 6px 18px rgba(239,68,68,.22) !important;
}

.case-num { font-size: 15px; font-weight: 700; color: var(--primary); flex-shrink: 0; min-width: 100px; }

.case-info { flex: 1; }
.case-info p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.case-actions { display: flex; align-items: center; gap: 8px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── SPINNER ── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.btn-checking {
  opacity: 0.85;
  cursor: not-allowed;
  pointer-events: none;
}

.spinner-icon {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

/* ── CASE RESULT PANEL ── */
.case-result-panel {
  margin-top: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeIn 0.3s ease;
  font-size: 13px;
  line-height: 1.7;
}

.case-result-panel.found {
  border-color: rgba(16,185,129,0.35);
  background: rgba(16,185,129,0.05);
}

.case-result-panel.not-found {
  border-color: rgba(245,158,11,0.35);
  background: rgba(245,158,11,0.05);
}

.case-result-panel .result-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.case-result-panel .result-row {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.case-result-panel .result-row:last-child { border-bottom: none; }

.case-result-panel .result-label {
  color: var(--text-muted);
  min-width: 130px;
  font-weight: 500;
}

.case-result-panel .result-value {
  color: var(--text);
  font-weight: 400;
  flex: 1;
}

/* -------------------------------------------
   RTL / Arabic Language Support
-------------------------------------------- */
[dir="rtl"] .sidebar {
  border-right: none;
  border-left: 1px solid var(--border);
  left: auto;
  right: 0;
}
[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: 260px;
  direction: rtl;
}
[dir="rtl"] .sidebar-logo,
[dir="rtl"] .nav-item,
[dir="rtl"] .nav-label,
[dir="rtl"] .user-card {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .topbar { direction: rtl; }
[dir="rtl"] .topbar-actions { margin-left: 0; margin-right: auto; flex-direction: row-reverse; }
[dir="rtl"] .case-card { direction: rtl; }
[dir="rtl"] .case-actions { direction: ltr; }  /* buttons stay LTR */
[dir="rtl"] .modal { direction: rtl; }
[dir="rtl"] .modal-header { direction: rtl; }
[dir="rtl"] .form-group label { text-align: right; display: block; }
[dir="rtl"] input, [dir="rtl"] select, [dir="rtl"] textarea { text-align: right; direction: rtl; }
[dir="rtl"] .stat-card { direction: rtl; }
[dir="rtl"] .feed-item { direction: rtl; }
[dir="rtl"] .table-wrap table { direction: rtl; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }
[dir="rtl"] .card-header { direction: rtl; }
[dir="rtl"] .card-header h3, [dir="rtl"] .card-header h4 { text-align: right; }
[dir="rtl"] .setting-row { direction: rtl; }
[dir="rtl"] .setting-label { text-align: right; }
[dir="rtl"] .two-col { direction: rtl; }
[dir="rtl"] .badge { direction: ltr; }
[dir="rtl"] .nav-badge { margin-left: 0; margin-right: auto; }
[dir="rtl"] .sidebar-footer { direction: rtl; }
[dir="rtl"] .topbar-title, [dir="rtl"] .topbar-subtitle { text-align: right; }
[dir="rtl"] .search-bar input { padding-left: 12px; padding-right: 38px; }
[dir="rtl"] .search-icon { left: auto; right: 12px; }
[dir="rtl"] .case-result-panel button[onclick*="closeResultPanel"] { right: auto !important; left: 12px !important; }
[dir="rtl"] .case-result-panel { direction: rtl; }
[dir="rtl"] .case-result-panel .result-label { text-align: right; }

/* Logo sizing for both languages */
.sidebar-logo-icon { width: 64px; height: 64px; font-size: 32px; }
.auth-logo-icon { width: 96px; height: 96px; font-size: 48px; }

@media (max-width: 768px) {
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  [dir="rtl"] .sidebar.open { transform: translateX(0); }
  [dir="rtl"] .main-content { margin-right: 0; }
}

/* Pulsing red animation for new notification badge */
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 8px rgba(239,68,68,.5); }
  50%       { box-shadow: 0 0 18px rgba(239,68,68,.9), 0 0 6px rgba(239,68,68,.4); }
}

/* ══════════════════════════════════════════════════════════════════
   MODERN SETTINGS PAGE
   ══════════════════════════════════════════════════════════════════ */
.settings-shell {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 6px 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.settings-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
}

.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.settings-tab:hover { color: var(--text); background: var(--surface2); }
.settings-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 4px 14px var(--primary-glow);
}
.settings-tab-icon { font-size: 15px; line-height: 1; }

.settings-autosave-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.settings-autosave-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(16,185,129,.6);
}
.settings-autosave-status {
  color: var(--success);
  font-weight: 600;
  opacity: 0;
  transition: opacity .2s;
  min-width: 0;
}

.settings-panel { display: none; animation: settingsFadeIn .18s ease-out; }
.settings-panel.active { display: block; }
@keyframes settingsFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02);
  margin-bottom: 18px;
}
.settings-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-card-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0;
  text-transform: none;
  margin: 0;
}
.settings-card-sub { font-size: 12.5px; color: var(--text-muted); }
.settings-card-body { padding: 20px 22px; }
.settings-card-body-tight { padding: 10px 12px; }
.settings-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
[dir="rtl"] .settings-card-actions { justify-content: flex-start; }

.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(245,158,11,0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.profile-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
  flex-shrink: 0;
}
.profile-hero-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-hero-info strong { font-size: 16px; color: var(--text); }
.profile-hero-info span { font-size: 13px; color: var(--text-muted); word-break: break-all; }

.settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.settings-form .form-group { margin: 0; }
.settings-form .form-group-full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .settings-form { grid-template-columns: 1fr; }
}

.option-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  transition: background .15s;
}
.option-row + .option-row { border-top: 1px solid var(--border); border-radius: 0; }
.option-row:hover { background: var(--surface2); }
.option-row-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.option-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.option-row-text strong { font-size: 14px; color: var(--text); font-weight: 600; }
.option-row-text span { font-size: 12.5px; color: var(--text-muted); }
[dir="rtl"] .option-row { direction: rtl; }

.interval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.interval-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  transition: all .15s;
}
[dir="rtl"] .interval-card { text-align: right; align-items: flex-end; }
.interval-card:hover { border-color: var(--border-hover); background: var(--surface3); }
.interval-card.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.04));
  box-shadow: 0 0 0 1px var(--primary), 0 6px 16px var(--primary-glow);
}
.interval-card-value { font-size: 20px; font-weight: 700; color: var(--text); }
.interval-card.active .interval-card-value { color: var(--primary); }
.interval-card-label { font-size: 12px; color: var(--text-muted); }
.interval-card-test { opacity: 0.75; }
.interval-card-test .interval-card-value::after {
  content: 'TEST';
  margin-left: 8px;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #000;
  vertical-align: middle;
  letter-spacing: 1px;
}

.segmented {
  display: inline-flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.segmented-option {
  padding: 9px 22px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.segmented-option:hover { color: var(--text); }
.segmented-option.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 3px 10px var(--primary-glow);
}

@media (max-width: 640px) {
  .settings-topbar { flex-direction: column; align-items: stretch; }
  .settings-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .settings-autosave-pill { align-self: flex-start; }
}

/* ── How-to-Use printable presentation ─────────────────────────── */
@media print {
  body { background: #fff !important; color: #111 !important; }
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content, .page-content { margin: 0 !important; padding: 0 !important; overflow: visible !important; }
  .page { padding: 0 !important; }
  /* Only the howto deck is printed; hide all other pages */
  .page:not(#page-howto) { display: none !important; }
  #page-howto { display: block !important; }
  .howto-slide {
    page-break-after: always;
    break-after: page;
    background: #fff !important;
    border: none !important;
    box-shadow: none !important;
    color: #111 !important;
    padding: 30px 24px !important;
    margin: 0 !important;
  }
  .howto-slide:last-child { page-break-after: auto; }
  .howto-slide h1, .howto-slide h2 { color: #111 !important; }
  .howto-slide p, .howto-slide li, .howto-slide div { color: #222 !important; }
  .howto-slide [style*="border:1px dashed"],
  .howto-slide [style*="border: 1px dashed"] {
    border: 1px dashed #999 !important;
    background: #f7f7f7 !important;
  }
  .howto-slide [style*="background:var(--surface)"],
  .howto-slide [style*="background: var(--surface)"] { background: #f9fafb !important; }
}

/* ── Add Expense modal — method tile hover state ────────────────────── */
.exp-method-tile:hover { border-color: #3b82f6 !important; background: rgba(59,130,246,.05) !important; }

/* ── New Invoice modal — quick-add chip hover ───────────────────────── */
.acctinv-qk:hover { border-color: #6366f1 !important; color: #6366f1 !important; background: rgba(99,102,241,.06) !important; }
#acctinv-addline:hover { border-color: #6366f1 !important; color: #6366f1 !important; background: rgba(99,102,241,.04) !important; }

/* ── Record Payment modal — method tile hover state ─────────────────── */
.pay-method-tile:hover { border-color: #22c55e !important; background: rgba(34,197,94,.05) !important; }

/* ── Trust transaction modal — type tile hover. Direction-aware colour
   would need extra JS; this neutral purple hover works for both in/out. */
.trust-type-tile:hover { border-color: #a855f7 !important; background: rgba(168,85,247,.06) !important; }

/* ── Log Time modal — quick-duration chip hover ─────────────────────── */
.time-quick:hover { border-color: #f59e0b !important; color: #f59e0b !important; background: rgba(245,158,11,.06) !important; }

/* ── Accountant view-only mode (Phase 5) ────────────────────────────────
   When body.accountant-mode is set, hide every sidebar item that's not
   part of the Accounting group, drop topbar widgets that don't apply,
   and hide Add/Edit/Delete primary buttons inside accounting pages so
   the data is visibly read-only. */
body.accountant-mode .sidebar-nav .nav-item:not(.nav-accounting) { display: none !important; }
body.accountant-mode #admin-nav { display: none !important; }
body.accountant-mode .nav-section-title { display: none !important; }
body.accountant-mode #topbar-balance,
body.accountant-mode #topbar-topup-btn,
body.accountant-mode #acct-timer-widget { display: none !important; }
/* Hide Add/Edit/Delete controls inside the accounting pages. Settings + CSV
   exports use .btn-secondary so they stay visible. */
body.accountant-mode .acct-stub .btn-primary,
body.accountant-mode .acct-stub .btn-danger { display: none !important; }
body.accountant-mode .acct-stub .acct-line-del { display: none !important; }
