/* ════════════════════════════════════════════════════
   Menca Klientu Portāls — Design System
   Brand: #001F3F navy · #007BFF accent · #f0efe9 bg
   ════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@1,400;1,600&display=swap');

/* ── TOKENS ── */
:root {
  --navy:       #001F3F;
  --navy-80:    rgba(0,31,63,0.08);
  --accent:     #007BFF;
  --accent-10:  rgba(0,123,255,0.10);
  --accent-20:  rgba(0,123,255,0.20);
  --bg:         #f0efe9;
  --white:      #ffffff;
  --border:     #e5e3dc;
  --muted:      #6C757D;
  --text:       #001F3F;

  --success:    #1a8f5a;
  --success-bg: #edf7f2;
  --warning:    #b45309;
  --warning-bg: #fff8ed;
  --danger:     #c0392b;
  --danger-bg:  #fff0ef;
  --info:       #0369a1;
  --info-bg:    #eff6ff;

  --sidebar-w:  260px;
  --topbar-h:   64px;
  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 1px 4px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.07);
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);

  --font:       'Montserrat', sans-serif;
  --serif:      'Playfair Display', serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

/* ── LAYOUT ── */
.portal-wrap {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 28px 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-logo a {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.sidebar-logo span { color: var(--accent); }
.sidebar-logo-sub {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-top: 4px;
  font-family: var(--font);
  font-weight: 600;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}
.sidebar-nav-label {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  font-weight: 700;
  padding: 12px 12px 6px;
  margin-top: 8px;
}
.sidebar-nav-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
  margin-bottom: 2px;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
  opacity: 0.8;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}
.nav-item.active {
  background: rgba(0,123,255,0.18);
  color: #fff;
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-client {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-20);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  border: 1px solid var(--accent-20);
}
.sidebar-client-info { min-width: 0; }
.sidebar-client-name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-client-pkg {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  transition: color var(--transition);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.btn-logout:hover { color: rgba(255,255,255,0.7); }
.btn-logout svg { width: 14px; height: 14px; stroke: currentColor; }

/* ── MAIN CONTENT ── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}
.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--navy);
}
.topbar-hamburger svg { width: 22px; height: 22px; stroke: currentColor; }

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  flex: 1;
}
.topbar-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  font-weight: 400;
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-btn-new {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}
.topbar-btn-new:hover { background: #0069d9; }
.topbar-btn-new svg { width: 14px; height: 14px; stroke: currentColor; }

.page-content {
  padding: 32px;
  flex: 1;
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}
.card-title-muted {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}
.card-body { padding: 24px; }
.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── STAT CARDS (dashboard) ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card.status-ok::before    { background: var(--success); }
.stat-card.status-warn::before  { background: #f59e0b; }
.stat-card.status-bad::before   { background: var(--danger); }

.stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card-icon svg { width: 20px; height: 20px; stroke: var(--navy); opacity: 0.7; }
.stat-card-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  margin-top: 6px;
}
.status-ok  .stat-card-status-dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.status-warn .stat-card-status-dot { background: #f59e0b; box-shadow: 0 0 0 3px #fff8ed; }
.status-bad .stat-card-status-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }

.stat-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.stat-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}
.stat-card-value.danger { color: var(--danger); }
.stat-card-detail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.stat-card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
  transition: gap var(--transition);
}
.stat-card-link:hover { gap: 8px; }
.stat-card-link svg { width: 12px; height: 12px; stroke: currentColor; }

/* ── DASHBOARD GREETING ── */
.dash-greeting {
  margin-bottom: 28px;
}
.dash-greeting-hello {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 3vw, 30px);
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 4px;
}
.dash-greeting-sub {
  font-size: 13px;
  color: var(--muted);
}

/* ── DASHBOARD BOTTOM GRID ── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
}

/* ── ACTIVITY FEED ── */
.activity-list { padding: 0; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--bg); }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}
.activity-dot.dot-success { background: var(--success); }
.activity-dot.dot-warning { background: #f59e0b; }
.activity-dot.dot-danger  { background: var(--danger); }
.activity-text {
  flex: 1;
  font-size: 13px;
  color: var(--navy);
  line-height: 1.45;
}
.activity-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── QUICK ACTIONS ── */
.quick-actions { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  text-decoration: none;
}
.quick-action:hover { background: var(--white); border-color: var(--accent); }
.quick-action svg { width: 16px; height: 16px; stroke: var(--accent); flex-shrink: 0; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-muted   { background: #f3f4f6;           color: var(--muted); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  border: 1.5px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; stroke: currentColor; flex-shrink: 0; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,123,255,0.25);
}
.btn-primary:hover { background: #0069d9; border-color: #0069d9; }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-10); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-ghost { background: none; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--navy); background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn:disabled { opacity: 0.55; cursor: default; pointer-events: none; }

/* ── TABLES ── */
.portal-table-wrap { overflow-x: auto; }
.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.portal-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  background: var(--bg);
}
.portal-table th:first-child { border-radius: var(--radius-sm) 0 0 0; padding-left: 24px; }
.portal-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; padding-right: 24px; }
.portal-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--navy);
  vertical-align: middle;
}
.portal-table td:first-child { padding-left: 24px; font-weight: 600; }
.portal-table td:last-child  { padding-right: 24px; }
.portal-table tbody tr:last-child td { border-bottom: none; }
.portal-table tbody tr { transition: background var(--transition); }
.portal-table tbody tr:hover { background: var(--bg); }

.table-num    { font-family: monospace; font-size: 12px; color: var(--muted); }
.table-amount { font-weight: 700; }
.table-date   { color: var(--muted); font-size: 12px; }
.table-actions { display: flex; align-items: center; gap: 8px; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 7px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--navy);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--accent-10);
}
.form-control::placeholder { color: #aab4c1; }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── FILE UPLOAD ── */
.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--bg);
}
.file-drop:hover, .file-drop.dragover {
  border-color: var(--accent);
  background: var(--accent-10);
}
.file-drop svg { width: 28px; height: 28px; stroke: var(--muted); margin: 0 auto 8px; }
.file-drop-text { font-size: 13px; color: var(--muted); }
.file-drop-text strong { color: var(--accent); }
.file-drop-note { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── HEALTH ROWS (website page) ── */
.health-section { margin-bottom: 28px; }
.health-section-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
}
.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.health-row:last-child { border-bottom: none; }
.health-row-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}
.health-row-label svg { width: 15px; height: 15px; stroke: var(--muted); flex-shrink: 0; }
.health-row-value {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--navy);
}
.health-warn {
  font-size: 11px;
  color: var(--warning);
  background: var(--warning-bg);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

/* ── DISK USAGE BAR ── */
.disk-bar-wrap { margin-top: 6px; }
.disk-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}
.disk-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.6s ease;
}
.disk-bar-fill.warn { background: #f59e0b; }
.disk-bar-fill.danger { background: var(--danger); }
.disk-bar-label { font-size: 11px; color: var(--muted); }

/* ── REQUEST THREAD ── */
.request-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-wrap: wrap;
}
.request-meta-item { font-size: 12px; color: var(--muted); }
.request-meta-item strong { color: var(--navy); }

.status-steps {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  gap: 0;
}
.status-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.status-step:last-child { flex: none; }
.status-step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
  transition: all var(--transition);
}
.status-step.done .status-step-dot {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.status-step.active .status-step-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.status-step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.status-step.active .status-step-label,
.status-step.done  .status-step-label { color: var(--navy); }
.status-step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
}
.status-step-line.done { background: var(--success); }

.thread { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.thread-msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 80%;
}
.thread-msg.from-admin {
  flex-direction: row-reverse;
  align-self: flex-end;
}
.thread-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}
.thread-msg.from-admin .thread-avatar {
  background: var(--accent-10);
  color: var(--accent);
  border-color: var(--accent-20);
}
.thread-bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--navy);
  line-height: 1.55;
}
.thread-msg.from-admin .thread-bubble {
  background: var(--navy);
  color: rgba(255,255,255,0.88);
  border-color: var(--navy);
  border-radius: var(--radius) 0 var(--radius) var(--radius);
}
.thread-meta {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  gap: 6px;
}
.thread-msg.from-admin .thread-meta { justify-content: flex-end; }
.thread-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-10);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.thread-attachment svg { width: 13px; height: 13px; stroke: currentColor; }

.thread-reply {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  background: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
}
.thread-reply-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 13px;
  resize: none;
  outline: none;
  min-height: 90px;
  transition: border-color var(--transition);
  margin-bottom: 12px;
}
.thread-reply-input:focus { border-color: var(--accent); }

/* ── REQUEST LIST ── */
.request-row {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: inherit;
}
.request-row:last-child { border-bottom: none; }
.request-row:hover { background: var(--bg); }
.request-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.request-row-icon svg { width: 17px; height: 17px; stroke: var(--navy); opacity: 0.6; }
.request-row-info { flex: 1; min-width: 0; }
.request-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.request-row-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.request-row-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── DOCUMENTS ── */
.doc-row {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  transition: background var(--transition);
}
.doc-row:last-child { border-bottom: none; }
.doc-row:hover { background: var(--bg); }
.doc-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent-10);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-icon svg { width: 18px; height: 18px; stroke: var(--accent); }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 13px; font-weight: 600; color: var(--navy); }
.doc-date { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  border-left: 3px solid;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.alert svg { width: 16px; height: 16px; stroke: currentColor; flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #f59e0b; }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-state svg { width: 48px; height: 48px; stroke: var(--border); margin: 0 auto 16px; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.empty-state-text  { font-size: 13px; color: var(--muted); max-width: 320px; margin: 0 auto 20px; }

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title-wrap { flex: 1; }
.section-page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}
.section-page-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ── FILTER TABS ── */
.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  width: fit-content;
}
.filter-tab {
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 5px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border: none;
  background: none;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.filter-tab:hover { color: var(--navy); background: var(--white); }
.filter-tab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.filter-tab .count {
  background: var(--accent-10);
  color: var(--accent);
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
}
.filter-tab.active .count { background: var(--accent); color: #fff; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: translateY(16px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--navy); }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--muted);
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}
.modal-close:hover { color: var(--navy); background: var(--bg); }
.modal-close svg { width: 18px; height: 18px; stroke: currentColor; display: block; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ── ADMIN BADGE ── */
.admin-bar {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  padding: 6px 32px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-bar svg { width: 12px; height: 12px; stroke: currentColor; }
.admin-bar a { color: var(--accent); font-weight: 600; }

/* ── UTILS ── */
.mt-0  { margin-top: 0 !important; }
.mb-0  { margin-bottom: 0 !important; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-muted   { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm      { font-size: 12px; }
.fw-600       { font-weight: 600; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.flex-1       { flex: 1; }
.text-right   { text-align: right; }

/* ── SPINNER ── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(0,123,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.2);
  }
  .sidebar-overlay { display: block; }
  .sidebar-overlay.open { display: block; }

  .main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .topbar-hamburger { display: flex; }
  .page-content { padding: 16px; }

  .stat-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }

  .thread-msg { max-width: 95%; }

  .health-row { flex-direction: column; align-items: flex-start; gap: 6px; }

  .portal-table th:nth-child(3),
  .portal-table td:nth-child(3) { display: none; }
}

@media (max-width: 480px) {
  .topbar-btn-new span { display: none; }
  .filter-tabs { width: 100%; }
  .filter-tab  { flex: 1; justify-content: center; }
}
