/* ============================================
   Academic Ace — App UI v3
   ============================================ */

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

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

:root {
  --primary:      #2563eb;
  --primary-dark: #1d4ed8;
  --accent:       #16a34a;
  --danger:       #dc2626;
  --warning:      #d97706;
  --dark:         #0f172a;
  --gray:         #64748b;
  --light:        #f8fafc;
  --border:       #e2e8f0;
  --white:        #ffffff;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:    0 16px 48px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--dark);
  background: #e8eef5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ── TOPBAR ─────────────────────────────────────────────────────── */
.topbar {
  background: linear-gradient(90deg, #07111f 0%, #0d1f3c 100%);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03), 0 4px 24px rgba(0,0,0,0.4);
  padding: 0 28px;
  height: 62px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.topbar-logo {
  font-size: 1.2rem; font-weight: 800;
  color: #fff; letter-spacing: -0.03em;
  display: flex; align-items: center; gap: 6px;
}
.topbar-logo span { color: #fbbf24; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user {
  font-size: 0.82rem; color: rgba(255,255,255,0.55); font-weight: 500;
  padding-right: 4px;
}
.btn-logout {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  padding: 6px 16px; border-radius: 8px;
  font-size: 0.8rem; color: rgba(255,255,255,0.6); font-weight: 500;
  transition: all 0.15s; cursor: pointer;
}
.btn-logout:hover { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.25); }

/* ── LAYOUT ─────────────────────────────────────────────────────── */
.app-layout {
  display: grid;
  grid-template-columns: 224px 1fr;
  min-height: calc(100vh - 62px);
}

/* ── SIDEBAR ─────────────────────────────────────────────────────── */
.sidebar {
  background: #07111f;
  padding: 16px 0 24px;
  position: sticky; top: 62px;
  height: calc(100vh - 62px);
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar-section { padding: 8px 0 12px; }
.sidebar-section + .sidebar-section {
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 6px; padding-top: 16px;
}
.sidebar-label {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: rgba(255,255,255,0.2);
  padding: 0 20px 8px;
}
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: rgba(255,255,255,0.5);
  font-size: 0.855rem; font-weight: 500;
  transition: all 0.12s; border-left: 2px solid transparent;
  line-height: 1.4;
}
.sidebar a:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.04); }
.sidebar a.active {
  color: #fff; border-left-color: #fbbf24;
  background: rgba(251,191,36,0.07);
  font-weight: 600;
}
.sidebar-icon { font-size: 0.95rem; width: 18px; text-align: center; flex-shrink: 0; opacity: 0.9; }

/* ── MAIN CONTENT ───────────────────────────────────────────────── */
.main-content { padding: 28px 32px 48px; }

/* ── ADMIN NAV RAIL (fixed left, single source via renderAdminRail) ── */
.admin-rail {
  position: fixed; top: 62px; left: 0; bottom: 0; width: 214px;
  background: #07111f; border-right: 1px solid rgba(255,255,255,0.06);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 3px;
  z-index: 90; overflow-y: auto;
}
.admin-rail-label {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: #475569; padding: 0 14px; margin: 4px 0 8px;
}
.admin-rail a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  color: #94a3b8; font-size: 0.88rem; font-weight: 600; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.admin-rail a:hover { background: rgba(255,255,255,0.05); color: #e2e8f0; }
.admin-rail a.active {
  background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,0.32);
}
.admin-rail-ico { width: 18px; height: 18px; flex-shrink: 0; }
.admin-rail a span:first-of-type { flex: 1; }
.rail-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #dc2626; color: #fff; font-size: 0.66rem; font-weight: 800;
  margin-left: auto;
}
.admin-rail-logout { margin-top: auto; color: #f87171; }
.admin-rail-logout:hover { background: rgba(248,113,113,0.1); color: #fca5a5; }
.admin-railed { margin-left: 214px; }
@media (max-width: 880px) {
  .admin-rail {
    position: static; flex-direction: row; width: 100%; height: 52px;
    padding: 0 8px; align-items: center; gap: 2px; overflow-x: auto; overflow-y: hidden;
    border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .admin-rail-label { display: none; }
  .admin-rail a { white-space: nowrap; padding: 8px 11px; font-size: 0.8rem; }
  .admin-rail-logout { margin-top: 0; }
  .admin-railed { margin-left: 0; }
}

/* ── GLOBAL MOBILE POLISH ──────────────────────────────────────── */
@media (max-width: 768px) {
  /* CRITICAL: grid/flex items default to min-width:auto, which makes them expand to fit
     wide children (steppers, tables). That drags the whole layout wider than the phone.
     Forcing min-width:0 lets the layout respect the viewport and lets wide children
     scroll *inside* their own container (table-wrap, overflow-x:auto). */
  .app-layout, .app-layout > *, .main-content, .main-content > * { min-width: 0; }
  .card { max-width: 100%; }
  .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Keep media inside the viewport; allow long emails/IDs to break instead of forcing horizontal scroll */
  img, video, iframe, canvas { max-width: 100%; height: auto; }
  .topbar-user, .conv-email, .ci-conv-email, .msg-bubble, .oi-meta, .ov-row-meta { word-break: break-word; overflow-wrap: anywhere; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 14px; }
  .topbar-logo { font-size: 1.05rem; }
  .topbar-user { display: none; }
  .topbar-right { gap: 8px !important; }
  .main-content { padding: 18px 16px 40px; }
  /* Tighter horizontal sidebar items so they comfortably fit on small phones */
  .sidebar a { padding: 11px 11px; font-size: 0.8rem; }
}

/* ── PAGE HERO (photo slideshow) ────────────────────────────────── */
.page-hero {
  position: relative; overflow: hidden;
  border-radius: 20px;
  padding: 38px 44px;
  min-height: 152px;
  margin-bottom: 28px;
  background: linear-gradient(135deg, #050c1e, #091525);
  box-shadow: 0 10px 40px rgba(8,20,60,0.28), 0 2px 8px rgba(0,0,0,0.1);
}
.page-hero-slides { position: absolute; top:0; left:0; right:0; bottom:0; z-index: 0; }
.page-hero-slide {
  position: absolute; top:0; left:0; right:0; bottom:0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.5s ease;
}
.page-hero-slide.active { opacity: 1; }
.page-hero-overlay {
  position: absolute; top:0; left:0; right:0; bottom:0; z-index: 1;
  background: linear-gradient(105deg, rgba(5,12,30,0.95) 0%, rgba(5,12,30,0.86) 44%, rgba(5,12,30,0.6) 78%, rgba(9,31,64,0.42) 100%);
}
.page-hero-photo { position: absolute; top:0; left:0; right:0; bottom:0; background-size: cover; background-position: center; opacity: 0; pointer-events: none; }
.page-hero-inner {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap;
}
.page-hero-left { flex: 1; min-width: 0; }
.page-hero-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: #fbbf24;
  margin-bottom: 12px;
}
.page-hero-tag::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: #fbbf24; flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(251,191,36,0.18);
}
.page-hero-title {
  font-size: 1.9rem; font-weight: 800; color: #fff;
  letter-spacing: -0.01em; line-height: 1.15; margin-bottom: 9px;
}
.page-hero-sub {
  font-size: 0.9rem; color: rgba(191,219,254,0.82);
  max-width: 540px; line-height: 1.6;
}
.page-hero-badge {
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px; padding: 18px 26px;
  text-align: center; min-width: 118px;
}
.page-hero-badge-val {
  font-size: 2.1rem; font-weight: 800; color: #fff;
  letter-spacing: -0.02em; line-height: 1;
}
.page-hero-badge-lbl {
  font-size: 0.62rem; color: rgba(191,219,254,0.72);
  text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 600; margin-top: 6px;
}
@media (max-width: 640px) {
  .page-hero { padding: 26px 22px; }
  .page-hero-title { font-size: 1.45rem; }
  .page-hero-badge { display: none; }
}

/* ── PAGE HEADER (fallback for pages without hero) ──────────────── */
.page-header { margin-bottom: 24px; }
.page-header h1 {
  font-size: 1.5rem; font-weight: 800;
  letter-spacing: -0.025em; color: var(--dark); line-height: 1.25;
}
.page-header p { color: var(--gray); margin-top: 4px; font-size: 0.875rem; }

/* ── CARDS ──────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid #e8edf5;
  border-radius: 16px; padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
}
.card-title {
  font-size: 0.9rem; font-weight: 700;
  letter-spacing: -0.01em; margin-bottom: 16px; color: var(--dark);
}

/* ── STAT CARDS ─────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.stat-card {
  border-radius: 16px; padding: 22px 24px;
  box-shadow: var(--shadow-md);
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
  bottom: -30px; right: -20px;
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-label {
  font-size: 0.68rem; color: rgba(255,255,255,0.68); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}
.stat-value {
  font-size: 2.2rem; font-weight: 900; color: #fff;
  letter-spacing: -0.05em; line-height: 1;
}
.stat-card.blue   { background: linear-gradient(140deg, #1e3a8a 0%, #2563eb 100%); }
.stat-card.green  { background: linear-gradient(140deg, #14532d 0%, #16a34a 100%); }
.stat-card.yellow { background: linear-gradient(140deg, #78350f 0%, #d97706 100%); }
.stat-card.red    { background: linear-gradient(140deg, #7f1d1d 0%, #dc2626 100%); }
.stat-card.purple { background: linear-gradient(140deg, #4c1d95 0%, #7c3aed 100%); }
.stat-card.teal   { background: linear-gradient(140deg, #164e63 0%, #0891b2 100%); }

/* ── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border-radius: 9px;
  font-size: 0.865rem; font-weight: 600; border: none;
  transition: all 0.15s; letter-spacing: 0.01em;
  white-space: nowrap; line-height: 1.4; cursor: pointer;
}
.btn-primary {
  background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 1px 3px rgba(37,99,235,0.4), 0 4px 12px rgba(37,99,235,0.2);
}
.btn-primary:hover {
  background: linear-gradient(145deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 16px rgba(37,99,235,0.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: none; box-shadow: 0 1px 4px rgba(37,99,235,0.3); }
.btn-success { background: linear-gradient(145deg,#16a34a,#15803d); color:#fff; box-shadow:0 2px 8px rgba(22,163,74,0.3); }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(22,163,74,0.4); }
.btn-danger  { background: linear-gradient(145deg,#dc2626,#b91c1c); color:#fff; box-shadow:0 2px 8px rgba(220,38,38,0.3); }
.btn-danger:hover  { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(220,38,38,0.4); }
.btn-outline {
  background: #fff; color: var(--primary);
  border: 1.5px solid #dbe8ff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.btn-outline:hover { background: #eff6ff; border-color: #93b4f5; }
.btn-sm   { padding: 5px 14px; font-size: 0.78rem; border-radius: 7px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }

/* ── FORMS ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 0.8rem; font-weight: 600;
  margin-bottom: 6px; color: #374151; letter-spacing: 0.01em;
}
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid #d4dae6; border-radius: 9px;
  font-size: 0.9rem; font-family: inherit;
  background: #fff; color: var(--dark);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-control::placeholder { color: #a8b3c4; }
textarea.form-control { resize: vertical; min-height: 110px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint  { font-size: 0.75rem; color: var(--gray); margin-top: 5px; line-height: 1.4; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 5px; }

/* ── TABLES ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
thead th {
  text-align: left; padding: 12px 16px;
  font-size: 0.67rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--gray);
  border-bottom: 1px solid var(--border);
  background: #f8fafc; white-space: nowrap;
}
thead th:first-child { border-radius: 10px 0 0 0; }
thead th:last-child  { border-radius: 0 10px 0 0; }
tbody td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tbody tr:hover td { background: #f8fbff; }
tbody tr:last-child td { border-bottom: none; }

/* ── STATUS BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.69rem; font-weight: 700;
  letter-spacing: 0.03em; white-space: nowrap; border: 1px solid;
}
.badge-pending     { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge-quoted      { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge-paid        { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.badge-in_progress { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }
.badge-revision    { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.badge-completed   { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge-under_review{ background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge-done        { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.badge-cancelled   { background: #f9fafb; color: #6b7280; border-color: #e5e7eb; }

/* ── MESSAGES ───────────────────────────────────────────────────── */
.messages-wrap { display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow-y: auto; padding: 4px; }
.msg { display: flex; gap: 10px; max-width: 80%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble {
  padding: 10px 14px; border-radius: 12px;
  font-size: 0.875rem; line-height: 1.55;
}
.msg.theirs .msg-bubble { background: #f1f5f9; border: 1px solid var(--border); }
.msg.mine   .msg-bubble { background: var(--primary); color: #fff; }
.msg-meta { font-size: 0.67rem; color: var(--gray); margin-top: 3px; }
.msg-input-row { display: flex; gap: 10px; margin-top: 16px; }
.msg-input-row .form-control { border-radius: 999px; }

/* ── FILE LIST ──────────────────────────────────────────────────── */
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--light); font-size: 0.84rem;
}
.file-item-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.file-delivery { border-color: #bbf7d0; background: #f0fdf4; }

/* ── EMPTY STATE ─────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 24px; color: var(--gray); }
.empty-state .icon { font-size: 2.8rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.empty-state p  { font-size: 0.875rem; margin-bottom: 20px; }

/* ── ALERTS ─────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: 10px;
  font-size: 0.86rem; margin-bottom: 16px;
  border: 1px solid; border-left-width: 3px; font-weight: 500;
}
.alert-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; border-left-color: var(--danger); }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; border-left-color: var(--accent); }
.alert-info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; border-left-color: var(--primary); }

/* ── SPINNER ─────────────────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px; border: 3px solid #e2e8f0;
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.6s linear infinite; margin: 48px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MODAL ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(7,17,31,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal {
  background: #fff; border-radius: 20px;
  padding: 32px; width: 100%; max-width: 480px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.28), 0 0 0 1px rgba(0,0,0,0.04);
  animation: modalIn 0.2s cubic-bezier(0.34,1.3,0.64,1);
}
@keyframes modalIn { from { opacity:0; transform:scale(0.95) translateY(8px); } to { opacity:1; transform:none; } }
.modal-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 20px; letter-spacing: -0.02em; }

/* ── BACK BUTTON ─────────────────────────────────────────────────── */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1.5px solid #dde3ee;
  color: var(--gray); font-size: 0.8rem; font-weight: 600;
  font-family: inherit; padding: 7px 14px; border-radius: 8px;
  cursor: pointer; margin-bottom: 20px; transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.back-btn:hover { border-color: var(--primary); color: var(--primary); background: #f0f6ff; }
.back-btn svg { flex-shrink: 0; }

/* ── UNREAD DOT ──────────────────────────────────────────────────── */
.unread-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); display: inline-block;
  margin-left: 5px; vertical-align: middle;
}

/* ── NOTIF DOT (animated) ────────────────────────────────────────── */
.notif-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); margin-left: 5px; vertical-align: middle;
  animation: pulse 1.4s ease infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.5); }
  50%      { box-shadow: 0 0 0 4px rgba(220,38,38,0); }
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; min-height: 0; }
  /* Sidebar becomes a horizontal nav bar so mobile users can still navigate */
  .sidebar {
    position: sticky; top: 62px; z-index: 50; height: auto;
    display: flex; flex-direction: row; align-items: stretch;
    overflow-x: auto; overflow-y: hidden; padding: 0 6px;
    border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06);
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar-section { display: flex; padding: 0; }
  .sidebar-section + .sidebar-section { border-top: none; margin-top: 0; padding-top: 0; }
  .sidebar-label { display: none; }
  .sidebar a {
    white-space: nowrap; padding: 13px 14px;
    border-left: none; border-bottom: 2px solid transparent;
  }
  .sidebar a.active { border-left: none; border-bottom-color: #fbbf24; }
  .main-content { padding: 16px 16px 40px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .page-hero { padding: 24px 22px 20px; border-radius: 14px; }
  .page-hero-title { font-size: 1.45rem; }
  .page-hero-badge { display: none; }
  .page-hero-sub { font-size: 0.82rem; }
}
