/* ============================================================
   components.css — Reusable UI components (Ledger system)
   Load after base.css
   ============================================================ */

/* ── App Header (dashboard/admin) ───────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--header-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(16px, 4vw, 32px);
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.app-header .logo { height: 34px; width: auto; object-fit: contain; cursor: pointer; transition: opacity var(--transition); }
.app-header .logo:hover { opacity: 0.85; }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* ── App Footer ──────────────────────────────────────────── */
.app-footer {
  background: var(--header-bg);
  border-top: 1px solid var(--border);
  padding: 18px clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
}
.app-footer img  { height: 28px; }
.app-footer small { color: var(--muted); font-size: 12px; }

/* ── Auth Layout — Split Card ────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: #fff;
}
.auth-brand {
  width: 42%;
  min-width: 280px;
  position: relative;
  background: #17211D;
  background-image: var(--ruled), linear-gradient(155deg, #17211D 0%, var(--emerald-dark) 130%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  color: #fff;
  gap: 22px;
  overflow: hidden;
}
.auth-brand .brand-logo { height: 48px; opacity: 0.95; }
.auth-brand h2 { font-family: var(--font-display); color: #fff; font-size: clamp(20px,2.5vw,27px); text-align: center; margin: 0; font-weight: 500; }
.auth-brand p  { color: rgba(255,255,255,0.68); font-size: 14px; text-align: center; line-height: 1.8; margin: 0; max-width: 320px; }
.auth-brand .brand-divider { width: 40px; height: 2px; background: var(--brass); border-radius: 2px; }

.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 5vw, 64px) clamp(24px, 6vw, 80px);
  background: #fff;
  overflow-y: auto;
}
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { font-size: clamp(21px,2.5vw,27px); margin-bottom: 6px; }
.auth-box .auth-subtitle { color: var(--muted); font-size: 14px; margin-bottom: 32px; }
.auth-links { margin-top: 20px; font-size: 13px; color: var(--muted); text-align: center; line-height: 2; }



@media (max-width: 768px) {
  .auth-shell { flex-direction: column; }
  .auth-brand {
    width: 100%;
    min-width: unset;
    min-height: unset;
    padding: 26px 20px;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
  .auth-brand p, .auth-brand .brand-divider { display: none; }
  .auth-brand .brand-logo { height: 30px; }
  .auth-brand h2 { font-size: 15px; margin: 0; }
  .auth-form-side { padding: 28px 20px; }
}

/* ── Page Header Row ─────────────────────────────────────── */
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}
.page-heading h1, .page-heading h2 { margin: 0; }
.page-heading .page-meta { font-size: 13px; color: var(--muted); margin-top: 4px; font-family: var(--font-mono); }

/* ── Stat Cards Row ──────────────────────────────────────── */
.stat-row, .admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card .stat-icon { font-size: 22px; margin-bottom: 4px; color: var(--muted); }
.stat-card .stat-value, .stat-card .stat-val { font-family: var(--font-mono); font-size: 27px; font-weight: 600; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-card .stat-label, .stat-card .stat-title { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.stat-card.accent-blue::before  { background: var(--emerald); }
.stat-card.accent-orange::before{ background: var(--brass); }
.stat-card.accent-green::before { background: var(--success); }

/* ── Tab Bar ─────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.tab-btn:hover   { color: var(--ink); }
.tab-btn.active  { color: var(--emerald); border-bottom-color: var(--brass); font-weight: 600; }
.tab-panel       { display: none; }
.tab-panel.active{ display: block; animation: fadeIn 0.25s ease; }

/* ── User Card (Admin Dashboard) ─────────────────────────── */
.user-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}
.user-card:hover  { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #cfc7ad; }
.click-layer      { position: absolute; inset: 0; z-index: 0; }
.user-top         { display: flex; align-items: center; gap: 14px; min-width: 0; }
.user-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--emerald);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff;
  flex-shrink: 0; font-family: var(--font-display);
}
.user-info          { min-width: 0; flex: 1; }
.user-info .u-name  { font-weight: 600; color: var(--ink); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .u-email { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.user-bottom        { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 10; flex-wrap: wrap; }

/* ── Role Controls ───────────────────────────────────────── */
.role-controls  { display: flex; align-items: center; gap: 8px; position: relative; z-index: 10; }
.role-select    { padding: 6px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: var(--font-body); cursor: pointer; background: #fff; flex: 1; transition: border-color var(--transition); }
.role-select:focus { outline: none; border-color: var(--emerald); }
.role-save-btn  { padding: 6px 14px; background: var(--emerald); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; cursor: pointer; transition: background var(--transition); white-space: nowrap; }
.role-save-btn:hover { background: var(--emerald-dark); }

/* ── Info Card (User Detail) ─────────────────────────────── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
@media (max-width: 640px) { .info-grid { grid-template-columns: 1fr; } }
.info-item { display: flex; flex-direction: column; gap: 3px; }
.info-item .info-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); font-weight: 600; }
.info-item .info-value { font-size: 15px; font-weight: 500; color: var(--ink); }

/* ── Document Row ────────────────────────────────────────── */
.doc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
  margin-bottom: 10px;
}
.doc-row:hover    { border-color: #cfc7ad; background: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(23,33,29,0.06); }
.doc-row-left     { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.doc-row-name     { font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-row-type     { font-size: 12px; color: var(--muted); }
.doc-row-actions  { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── Drop Zone ───────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed #cfc7ad;
  border-radius: var(--radius-md);
  padding: 36px 24px;
  text-align: center;
  color: var(--muted);
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--emerald);
  background: var(--emerald-light);
  color: var(--emerald);
}
.drop-zone .drop-icon { font-size: 34px; margin-bottom: 10px; }
.drop-zone .drop-title { font-weight: 600; font-size: 15px; color: var(--ink); }
.drop-zone .drop-hint  { font-size: 13px; margin-top: 4px; }

/* ── Search Bar ──────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  transition: border-color var(--transition), box-shadow var(--transition);
  max-width: 360px;
}
.search-bar:focus-within { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(31,93,70,0.10); }
.search-bar input { border: none; outline: none; font-family: inherit; font-size: 14px; width: 100%; background: transparent; }
.search-bar .search-icon { color: var(--muted); font-size: 16px; flex-shrink: 0; }

/* ── Timeline Stepper ────────────────────────────────────── */
.timeline-control {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  width: fit-content;
}
.timeline-control .tl-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition), background var(--transition);
}
.timeline-control .tl-btn:hover { border-color: var(--emerald); background: var(--emerald-light); color: var(--emerald); }
.timeline-control .tl-value { font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--ink); min-width: 32px; text-align: center; }
.timeline-control .tl-label { font-size: 12px; color: var(--muted); }

/* ── Approval Table ──────────────────────────────────────── */
.approval-table { width: 100%; border-collapse: collapse; }
.approval-table th, .approval-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.approval-table th { background: var(--paper); font-weight: 600; color: var(--muted); text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; }
.approval-table tr:last-child td { border-bottom: none; }
.approval-table tr:hover td { background: var(--paper); }

/* ── Toggle Switch (approve/reject) ─────────────────────── */
.review-toggle { display: flex; gap: 6px; }
.review-toggle label {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.review-toggle input[type=checkbox] { display: none; }
.review-toggle .approve-lbl { color: var(--success); }
.review-toggle .approve-lbl:has(input:checked),
.review-toggle input.approve:checked + label { background: var(--success-bg); border-color: var(--success); }
.review-toggle .reject-lbl  { color: var(--error); }

/* ── Engagement Banner ───────────────────────────────────── */
.engagement-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--emerald-light);
  border: 1px solid rgba(31,93,70,0.2);
  margin-bottom: 24px;
}
.engagement-banner .banner-icon { font-size: 26px; flex-shrink: 0; color: var(--emerald); }
.engagement-banner .banner-text { flex: 1; }
.engagement-banner .banner-text strong { display: block; font-size: 14px; color: var(--ink); }
.engagement-banner .banner-text span   { font-size: 13px; color: var(--muted); }
.engagement-banner.acknowledged { background: var(--success-bg); border-color: rgba(31,93,70,0.25); }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; color: var(--muted); }
.empty-state .empty-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.empty-state .empty-hint  { font-size: 13px; }

.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.admin-table th { background: var(--paper); font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.5px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--paper); }

/* ── Chatbot Footer ─────────────────────────────────────── */
.chatbot-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--paper);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.search-wrap { position: relative; display: flex; align-items: center; }

/* ── JS-extracted components (upload/review) ─────────────── */
.doc-row-wrapper { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.btn-approve { background: var(--success-bg); color: var(--success); border: 1px solid rgba(31,93,70,0.3); border-radius: var(--radius-sm); }
.btn-reject  { background: var(--error-bg); color: var(--error); border: 1px solid rgba(166,58,58,0.3); border-radius: var(--radius-sm); }
.reject-box  { display: none; margin-top: 10px; }
.reject-textarea { width: 100%; padding: 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font-family: inherit; font-size: 13px; resize: vertical; }
.admin-doc-actions { display: flex; gap: 8px; flex-shrink: 0; }
.admin-docs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-docs-td { padding: 10px 12px; color: #3E463F; }
.admin-docs-th { padding: 10px 12px; color: var(--muted); font-weight: 600; text-align: left; border-bottom: 2px solid var(--border); }
.btn-download-pill { background: var(--emerald); color: #fff; border: none; border-radius: var(--radius-sm); font-weight: 500; }
.btn-download-pill:hover { opacity: 0.9; }
.btn-upload-pill { background: var(--brass); color: #fff; border: none; border-radius: var(--radius-sm); font-weight: 500; cursor: pointer; padding: 8px 16px; display: inline-flex; align-items: center; gap: 8px; }
.btn-upload-pill:hover { opacity: 0.9; }




/* ============================================================
   RESPONSIVE IMPROVEMENTS — Multi-screen support
   Breakpoints: 480px (xs), 640px (sm), 768px (md), 1024px (lg)
   ============================================================ */

/* ── Admin Dashboard — users grid ───────────────────────── */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 4px;
}
@media (max-width: 640px) {
  .users-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ── Admin Stats — 4 cards on desktop, 2x2 on tablet, 1 col on mobile ── */
@media (max-width: 900px) {
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .admin-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 14px 16px;
  }
  .stat-card .stat-value,
  .stat-card .stat-val {
    font-size: 22px;
  }
}

/* ── App Header — collapse actions on small screens ─────── */
@media (max-width: 480px) {
  .app-header {
    padding: 0 14px;
    height: 58px;
    gap: 10px;
  }
  .app-header .logo {
    height: 28px;
  }
  .header-actions {
    gap: 6px;
  }
  .header-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .header-actions .btn-sm {
    padding: 5px 8px;
    font-size: 11px;
  }
}

/* ── Page Heading — stack on mobile ─────────────────────── */
@media (max-width: 640px) {
  .page-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
  }
  .page-heading h1 {
    font-size: clamp(20px, 5vw, 26px);
  }
}

/* ── Tab Bar — tighten padding on small screens ──────────── */
@media (max-width: 640px) {
  .tab-btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}
@media (max-width: 400px) {
  .tab-btn {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* ── User Card bottom badges — wrap cleanly ─────────────── */
.user-bottom {
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Document slots — reflow on mobile ──────────────────── */
@media (max-width: 640px) {
  .doc-slot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }
  .doc-slot-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ── Admin Table — readable on small screens ─────────────── */
@media (max-width: 768px) {
  .admin-table th,
  .admin-table td {
    padding: 10px 10px;
    font-size: 12px;
  }
}
@media (max-width: 480px) {
  .admin-table th,
  .admin-table td {
    padding: 8px 8px;
    font-size: 11px;
  }
  /* Hide less-important columns on very small screens */
  .admin-table .col-hide-xs {
    display: none;
  }
}

/* ── Card & Card-flat — reduce padding on mobile ────────── */
@media (max-width: 480px) {
  .card {
    padding: 16px;
  }
  .card-flat {
    padding: 14px;
  }
}

/* ── Page main widths — full bleed on small screens ──────── */
@media (max-width: 640px) {
  .page-main,
  .page-main-wide {
    padding: 0 12px;
    margin-top: 20px;
    margin-bottom: 20px;
  }
}

/* ── Admin User Detail — user info bar ──────────────────── */
@media (max-width: 768px) {
  /* the user info bar flex row */
  .card > div[style*="justify-content:space-between"] {
    flex-direction: column;
    align-items: flex-start !important;
  }
}

/* ── Upload pages — tax year selector row ────────────────── */
@media (max-width: 640px) {
  /* page-heading flex row with year selector */
  .page-heading > div:last-child {
    align-self: flex-start;
  }
}

/* ── Timeline control — center on mobile ────────────────── */
@media (max-width: 640px) {
  .timeline-control {
    width: 100%;
    justify-content: center;
  }
}

/* ── Toast — full width on mobile ───────────────────────── */
@media (max-width: 480px) {
  .toast-container {
    left: 12px;
    right: 12px;
    transform: none;
    bottom: 16px;
  }
  .toast {
    min-width: unset;
    width: 100%;
  }
}

/* ── Chatbot FAB — smaller on mobile ────────────────────── */
@media (max-width: 480px) {
  .chatbot-fab {
    width: 50px;
    height: 50px;
    bottom: 16px;
    right: 16px;
    font-size: 20px;
  }
  .chatbot-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 76px;
  }
}

/* ── Auth shell — improve narrow portrait phones ────────── */
@media (max-width: 400px) {
  .auth-form-side {
    padding: 20px 16px;
  }
  .auth-box {
    max-width: 100%;
  }
}

/* ── Marketing Navbar — tighter on 768px tablets ────────── */
@media (max-width: 768px) {
  .nav-container {
    padding: 14px 12px;
  }
}

/* ── Services / About page blocks — better mobile spacing ── */
@media (max-width: 640px) {
  .about-wrapper,
  .services-wrapper {
    margin: 48px auto;
    gap: 28px;
  }
  .about-block,
  .service-block {
    padding: 18px;
  }
}

/* ── Contact page — full-width form on mobile ───────────── */
@media (max-width: 640px) {
  .contact-container {
    flex-direction: column;
  }
  .contact-info,
  .contact-form {
    flex: 1 1 100%;
    width: 100%;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* ── Footer — stack on mobile ───────────────────────────── */
@media (max-width: 640px) {
  .footer-top,
  .mkt-footer-top {
    flex-direction: column;
    gap: 28px;
    padding: 36px 0 28px;
  }
}

/* ── Expandable summary block (AI summaries) ─────────────── */
@media (max-width: 640px) {
  /* give AI summary blocks full width */
  div[style*="blue-light"] {
    padding: 10px !important;
  }
}

/* ── Global touch targets — ensure 44px min on mobile ───── */
@media (max-width: 768px) {
  .btn-sm {
    min-height: 36px;
  }
  .tab-btn {
    min-height: 42px;
  }
  select,
  .select-input,
  .input {
    min-height: 42px;
  }
}


/* ============================================================
   ADMIN USER DETAIL — Responsive layout classes
   Replaces all inline flex styles that couldn't be overridden
   ============================================================ */

/* ── User info bar ───────────────────────────────────────── */
.aud-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.aud-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.aud-bar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.aud-year-picker {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

@media (max-width: 640px) {
  .aud-bar-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .aud-bar-left {
    width: 100%;
  }
  .aud-bar-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .aud-year-picker {
    align-items: flex-start;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 10px;
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .aud-year-picker label {
    white-space: nowrap;
  }
  .aud-year-picker select {
    flex: 1;
  }
}

/* ── Doc review layout (main + sidebar) ─────────────────── */
.doc-review-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.doc-review-main {
  flex: 2;
  min-width: 0;        /* prevents flex child from overflowing */
}
.doc-review-sidebar {
  flex: 0 0 240px;     /* fixed 240px sidebar, doesn't shrink */
  width: 240px;
}

@media (max-width: 768px) {
  .doc-review-layout {
    flex-direction: column;
  }
  .doc-review-sidebar {
    flex: unset;
    width: 100%;
    order: -1;          /* show Filing Timeline ABOVE the doc list on mobile */
  }
  .doc-review-sidebar .card-flat {
    flex-direction: row !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
  }
  .doc-review-sidebar h3 {
    width: 100%;
    margin-bottom: 0 !important;
  }
  .doc-review-sidebar .timeline-control {
    flex: 1;
  }
  .doc-review-sidebar .btn {
    flex: 1;
    min-width: 180px;
  }
}

/* ── Individual doc review row ──────────────────────────── */
.doc-review-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.doc-review-row:last-child {
  border-bottom: none;
}
.doc-review-row-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.doc-review-info {
  flex: 1;
  min-width: 0;
}
.doc-review-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .doc-review-row-top {
    flex-direction: column;
    gap: 10px;
  }
  .doc-review-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .doc-review-actions .btn {
    flex: 1;
    min-width: 70px;
    justify-content: center;
  }
}

/* ── AI Summary block ────────────────────────────────────── */
.ai-summary-block {
  padding: 12px;
  background-color: var(--blue-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  width: 100%;
  margin-top: 4px;
}
.ai-summary-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--emerald);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

/* ── Doc count chips — user info bar ────────────────────── */
.doc-count-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-family: var(--font-mono);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  white-space: nowrap;
}
