/* ═══════════════════════════════════════════
   LexAI — Legal Intelligence Platform
   Red & White Professional Theme
═══════════════════════════════════════════ */

:root {
  --red:         #C41E3A;
  --red-dark:    #8B0000;
  --red-light:   #E53E5A;
  --red-pale:    #FFF0F2;
  --red-muted:   #FEE2E2;
  --white:       #FFFFFF;
  --off-white:   #F8F9FA;
  --surface:     #F1F3F5;
  --border:      #E5E7EB;
  --border-dark: #D1D5DB;
  --text:        #111827;
  --text-mid:    #374151;
  --text-muted:  #6B7280;
  --text-light:  #9CA3AF;
  --sidebar-bg:  #1A0A0D;
  --sidebar-w:   240px;
  --topbar-h:    64px;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-xs:   6px;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 12px rgba(0,0,0,.1);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
}

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

html { font-size: 15px; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--off-white);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ════════════════════════════════════
   SIDEBAR
════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

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

.logo-icon {
  width: 36px; height: 36px;
  background: var(--red);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(196,30,58,.4);
}

.logo-name {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
}

.logo-tagline {
  display: block;
  font-size: 10px;
  color: rgba(255,255,255,.4);
  letter-spacing: .8px;
  text-transform: uppercase;
}

.sidebar-toggle {
  display: none;
  background: none; border: none;
  color: rgba(255,255,255,.5);
  font-size: 18px; cursor: pointer;
}

.sidebar-nav { flex: 1; padding: 16px 12px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(255,255,255,.25);
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.55);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.85);
}

.nav-item.active {
  background: var(--red);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(196,30,58,.35);
}

.nav-icon { font-size: 16px; width: 18px; text-align: center; }
.nav-label { flex: 1; }

.nav-badge {
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
}

.nav-item.active .nav-badge { background: rgba(255,255,255,.25); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.user-card:hover { background: rgba(255,255,255,.07); }

.user-avatar {
  width: 34px; height: 34px;
  background: var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: rgba(255,255,255,.4); }

.user-status-dot {
  width: 8px; height: 8px;
  background: #10B981;
  border-radius: 50%;
  border: 2px solid var(--sidebar-bg);
  margin-left: auto;
  flex-shrink: 0;
}

/* ════════════════════════════════════
   MAIN WRAPPER
════════════════════════════════════ */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* ════════════════════════════════════
   TOPBAR
════════════════════════════════════ */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 80;
  box-shadow: var(--shadow);
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.mobile-menu-btn {
  display: none;
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  color: var(--text-mid);
}

.breadcrumb {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

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

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  width: 320px;
}

.search-bar input {
  border: none; background: none;
  font-size: 13px; color: var(--text);
  flex: 1; outline: none;
}

.search-icon { font-size: 14px; color: var(--text-muted); }

.search-bar kbd {
  font-family: inherit;
  font-size: 10px;
  background: var(--border);
  color: var(--text-muted);
  padding: 2px 5px;
  border-radius: 4px;
}

.icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--white);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: background .15s;
}
.icon-btn:hover { background: var(--surface); }

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

.avatar-sm {
  width: 36px; height: 36px;
  background: var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

/* ─── Notification Panel ─── */
.notif-panel {
  display: none;
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  right: 20px;
  width: 340px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}
.notif-panel.open { display: block; }

.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}
.notif-header button {
  font-size: 12px;
  color: var(--red);
  background: none; border: none; cursor: pointer;
}

.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.notif-item:hover { background: var(--off-white); }
.notif-item.unread { background: var(--red-pale); }
.notif-item.unread:hover { background: #FFE4E8; }

.notif-dot-item {
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.notif-title { font-size: 13px; font-weight: 500; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ════════════════════════════════════
   PAGE CONTENT
════════════════════════════════════ */
.page-content { flex: 1; padding: 28px; overflow-y: auto; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ════════════════════════════════════
   BUTTONS
════════════════════════════════════ */
.btn-primary {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: var(--white);
  color: var(--text-mid);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.btn-outline:hover { border-color: var(--red); color: var(--red); }

.btn-red-outline {
  background: var(--white);
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-red-outline:hover { background: var(--red); color: #fff; }

.btn-white {
  background: #fff;
  color: var(--red);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-white:hover { background: var(--red-pale); }

.btn-full { width: 100%; }
.btn-lg { padding: 12px 20px; font-size: 15px; }

.btn-sm-outline {
  background: var(--white);
  color: var(--text-mid);
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.btn-sm-outline:hover { border-color: var(--red); color: var(--red); }

.btn-sm-red {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-sm-red:hover { background: var(--red-dark); }

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

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.card-link {
  font-size: 12px;
  color: var(--red);
  cursor: pointer;
  font-weight: 500;
}
.card-link:hover { text-decoration: underline; }

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.card-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* ════════════════════════════════════
   KPI GRID
════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.kpi-card.kpi-red {
  background: var(--red);
  color: #fff;
  border-color: var(--red-dark);
}

.kpi-icon { font-size: 22px; margin-bottom: 8px; }

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.kpi-card.kpi-red .kpi-label { color: rgba(255,255,255,.7); }

.kpi-trend {
  font-size: 11px;
  color: #10B981;
  margin-top: 6px;
  font-weight: 500;
}
.kpi-card.kpi-red .kpi-trend { color: rgba(255,255,255,.8); }

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

/* Quick Actions */
.quick-actions-card { grid-column: 1 / -1; }

.action-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.action-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  padding: 18px 12px;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-mid);
}

.action-tile:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-pale);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-tile.action-red {
  background: var(--red);
  color: #fff;
  border-color: var(--red-dark);
  box-shadow: 0 2px 8px rgba(196,30,58,.3);
}
.action-tile.action-red:hover {
  background: var(--red-dark);
  color: #fff;
  transform: translateY(-2px);
}

.action-icon { font-size: 22px; }
.action-label { text-align: center; }

/* ─── Deadlines ─── */
.deadline-list { display: flex; flex-direction: column; gap: 10px; }

.deadline-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--off-white);
  border-radius: var(--radius-sm);
}

.deadline-bar {
  width: 3px; height: 36px;
  background: var(--border-dark);
  border-radius: 2px;
  flex-shrink: 0;
}
.deadline-item.deadline-urgent .deadline-bar { background: var(--red); }
.deadline-item.deadline-warn .deadline-bar { background: #F59E0B; }

.deadline-info { flex: 1; }
.deadline-name { font-size: 13px; font-weight: 600; }
.deadline-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.deadline-date { text-align: right; }
.deadline-days {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -1px;
}
.deadline-days.urgent { color: var(--red); }
.deadline-days.warn { color: #F59E0B; }
.deadline-days.ok { color: #10B981; }
.deadline-abs { font-size: 11px; color: var(--text-muted); }

/* ─── Activity ─── */
.activity-list { display: flex; flex-direction: column; gap: 14px; }

.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
}

.activity-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.ai-red { background: var(--red-muted); }
.ai-green { background: #D1FAE5; }
.ai-blue { background: #DBEAFE; }
.ai-orange { background: #FEF3C7; }

.activity-body { flex: 1; }
.activity-title { font-size: 13px; font-weight: 600; }
.activity-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.activity-time { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ─── AI Insights ─── */
.ai-insights-card { background: linear-gradient(135deg, #1A0A0D 0%, #2D0810 100%); color: #fff; border-color: #3D1020; }
.ai-insights-card .card-title { color: #fff; }

.insight-list { display: flex; flex-direction: column; gap: 12px; }

.insight-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.insight-icon {
  width: 32px; height: 32px;
  background: #FEE2E2;
  color: #C41E3A;
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.insight-body { flex: 1; }
.insight-title { font-size: 13px; font-weight: 600; color: #fff; }
.insight-desc { font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: 3px; line-height: 1.4; }

.insight-btn {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.insight-btn:hover { background: var(--red); border-color: var(--red); }

/* ════════════════════════════════════
   BADGES
════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-info    { background: #DBEAFE; color: #1E40AF; }
.badge-red     { background: var(--red); color: #fff; }

.risk-badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.risk-high   { background: #FEE2E2; color: #991B1B; }
.risk-medium { background: #FEF3C7; color: #92400E; }
.risk-low    { background: #D1FAE5; color: #065F46; }

/* ════════════════════════════════════
   FILTER BAR
════════════════════════════════════ */
.filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-tabs { display: flex; gap: 4px; }

.filter-tab {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}
.filter-tab.active {
  background: var(--red); color: #fff; border-color: var(--red);
  font-weight: 600;
}
.filter-tab:not(.active):hover { border-color: var(--red); color: var(--red); }

.filter-right { display: flex; gap: 8px; }

.select-sm, .input-sm {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border .15s;
}
.select-sm:focus, .input-sm:focus { border-color: var(--red); }

/* ════════════════════════════════════
   TABLE
════════════════════════════════════ */
.table-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

.data-table thead tr {
  background: var(--off-white);
  border-bottom: 2px solid var(--border);
}

.data-table th {
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  text-align: left;
}

.table-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: var(--off-white); }

.data-table td {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text-mid);
}

.matter-name { font-weight: 600; color: var(--text); }
.matter-id { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.type-tag {
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.type-corp { background: #DBEAFE; color: #1E40AF; }
.type-lit  { background: #FEE2E2; color: #991B1B; }
.type-re   { background: #D1FAE5; color: #065F46; }
.type-est  { background: #EDE9FE; color: #4C1D95; }

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot.active  { background: #10B981; }
.status-dot.pending { background: #F59E0B; }
.status-dot.closed  { background: var(--text-light); }

.text-danger  { color: var(--red); font-weight: 600; }
.text-warning { color: #D97706; font-weight: 600; }

.icon-btn-sm {
  width: 28px; height: 28px;
  border: none; background: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn-sm:hover { background: var(--surface); }

/* ════════════════════════════════════
   MODAL
════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  margin: 20px;
}
.modal-sm { max-width: 420px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; font-weight: 700; }

.modal-close {
  width: 32px; height: 32px;
  border: none; background: var(--surface);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: background .15s;
}
.modal-close:hover { background: var(--red-muted); color: var(--red); }

.modal-body { padding: 24px; }

.modal-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 16px;
}
.modal-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.modal-value { font-size: 14px; font-weight: 500; }
.modal-notes { margin-top: 16px; }

/* ════════════════════════════════════
   ANALYZE
════════════════════════════════════ */
.analyze-grid {
  display: grid; grid-template-columns: 1fr 340px; gap: 20px;
}
.analyze-left, .analyze-right { display: flex; flex-direction: column; gap: 0; }

.upload-zone {
  text-align: center;
  cursor: pointer;
  border: 2px dashed var(--border-dark);
  transition: all .2s;
  padding: 48px 24px;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--red);
  background: var(--red-pale);
}

.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.upload-sub { font-size: 13px; color: var(--text-muted); }

.clause-list { display: flex; flex-direction: column; gap: 12px; }

.clause-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px;
  background: var(--off-white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.clause-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.clause-red    { background: #FEE2E2; color: var(--red); }
.clause-yellow { background: #FEF3C7; color: #D97706; }
.clause-green  { background: #D1FAE5; color: #065F46; }

.clause-body { flex: 1; }
.clause-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.clause-text { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.confidence-badge {
  background: #D1FAE5;
  color: #065F46;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

/* Intelligence Hub */
.intel-hub {}

.intel-score {
  display: flex; justify-content: center;
  margin: 8px 0 16px;
}

.score-ring {
  width: 140px; height: 140px;
  position: relative;
}
.score-ring svg { width: 100%; height: 100%; }

.score-label {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-number { font-size: 24px; font-weight: 800; color: var(--red); }
.score-text { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }

.intel-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.intel-stat { text-align: center; }
.intel-stat-val { font-size: 20px; font-weight: 800; }
.intel-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }

.recent-analysis-list { display: flex; flex-direction: column; gap: 8px; }

.recent-analysis-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: var(--off-white);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.recent-analysis-item:hover { background: var(--red-pale); }

.ra-icon { font-size: 20px; }
.ra-body { flex: 1; }
.ra-name { font-size: 13px; font-weight: 500; }
.ra-time { font-size: 11px; color: var(--text-muted); }

/* ════════════════════════════════════
   DRAFTING
════════════════════════════════════ */
.draft-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }

.template-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.template-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-mid);
  transition: all .15s;
}
.template-btn:hover { border-color: var(--red); color: var(--red); }
.template-btn.active { border-color: var(--red); background: var(--red-pale); color: var(--red); font-weight: 700; }
.template-icon { font-size: 18px; }

.tone-buttons { display: flex; gap: 8px; }
.tone-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-muted);
}
.tone-btn.active { border-color: var(--red); background: var(--red); color: #fff; }

.draft-preview { height: 100%; }

.doc-preview {
  height: 500px;
  overflow-y: auto;
  background: var(--off-white);
  border-radius: var(--radius-sm);
  padding: 24px;
  border: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.doc-placeholder {
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}
.doc-placeholder-icon { font-size: 48px; opacity: .3; }

/* ════════════════════════════════════
   RESEARCH
════════════════════════════════════ */
.research-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }

.research-suggestions { display: flex; flex-direction: column; gap: 10px; }

.suggestion-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
}
.suggestion-card:hover { border-color: var(--red); background: var(--red-pale); }

.suggestion-icon { font-size: 20px; flex-shrink: 0; }
.suggestion-title { font-size: 13px; font-weight: 600; }
.suggestion-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.research-chat-card {
  display: flex; flex-direction: column;
  height: 600px;
  padding: 0;
  overflow: hidden;
}

.research-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}

.res-message {
  display: flex; gap: 10px; align-items: flex-start;
}

.res-avatar {
  width: 34px; height: 34px;
  background: var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.res-bubble {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 80%;
}

.res-user-bubble {
  background: var(--red);
  color: #fff;
  border-radius: var(--radius) 0 var(--radius) var(--radius);
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  margin-left: auto;
  max-width: 80%;
}

.research-input-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.research-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  outline: none;
  transition: border .15s;
}
.research-input:focus { border-color: var(--red); }

.send-btn {
  width: 40px; height: 40px;
  background: var(--red);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.send-btn:hover { background: var(--red-dark); }

.attach-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.attach-btn:hover { border-color: var(--red); color: var(--red); }

/* ════════════════════════════════════
   INTAKE
════════════════════════════════════ */
.intake-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; }

.matter-type-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.matter-type-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  background: var(--white);
  transition: all .15s;
}
.matter-type-btn:hover { border-color: var(--red); color: var(--red); }
.matter-type-btn.active {
  border-color: var(--red); background: var(--red-pale);
  color: var(--red);
}
.mt-icon { font-size: 20px; }

.conflict-check-box {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.conflict-icon { font-size: 24px; }
.conflict-body { flex: 1; }
.conflict-title { font-size: 13px; font-weight: 700; }
.conflict-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.conflict-status {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.generated-link-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.link-text { flex: 1; font-size: 12px; color: var(--red); word-break: break-all; }
.copy-btn {
  padding: 4px 10px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.link-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

.active-link-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.active-link-item:last-child { border-bottom: none; }
.al-dot { width: 8px; height: 8px; background: #10B981; border-radius: 50%; flex-shrink: 0; }
.al-body { flex: 1; }
.al-name { font-size: 13px; font-weight: 600; }
.al-expires { font-size: 11px; color: var(--text-muted); }

.recent-intake-list { display: flex; flex-direction: column; gap: 10px; }
.intake-item-row { display: flex; align-items: center; gap: 12px; }
.intake-avatar {
  width: 34px; height: 34px;
  background: var(--surface);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--text-mid);
}
.intake-body { flex: 1; }
.intake-name { font-size: 13px; font-weight: 600; }
.intake-type { font-size: 11px; color: var(--text-muted); }

/* ════════════════════════════════════
   BILLING
════════════════════════════════════ */
.billing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }

.time-entry {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.time-entry:last-child { border-bottom: none; }
.te-matter { font-weight: 700; font-size: 13px; width: 140px; flex-shrink: 0; }
.te-desc { flex: 1; font-size: 12.5px; color: var(--text-muted); }
.te-time { font-size: 13px; font-weight: 600; width: 40px; text-align: right; }
.te-amount { font-size: 13px; font-weight: 700; color: var(--red); width: 60px; text-align: right; }

.te-total {
  display: flex; justify-content: space-between;
  padding: 12px 0 0;
  font-size: 13px;
  font-weight: 600;
  border-top: 2px solid var(--border);
  margin-top: 4px;
}
.te-total-val { font-size: 15px; font-weight: 800; color: var(--red); }

.invoice-list { display: flex; flex-direction: column; gap: 10px; }
.invoice-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.invoice-row:last-child { border-bottom: none; }
.inv-num { font-size: 12px; color: var(--text-muted); width: 48px; }
.inv-client { flex: 1; font-size: 13px; font-weight: 600; }
.inv-amount { font-size: 14px; font-weight: 700; }

/* Timer */
.timer-display {
  text-align: center;
  font-size: 42px;
  font-weight: 800;
  font-family: monospace;
  color: var(--red);
  margin: 8px 0 16px;
}

.timer-controls { display: flex; gap: 12px; justify-content: center; }

/* ════════════════════════════════════
   CONTACTS
════════════════════════════════════ */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.contact-card:hover {
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.contact-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 800;
  margin: 0 auto 12px;
}
.contact-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.contact-role { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.contact-email { font-size: 11.5px; color: var(--red); margin-bottom: 12px; }
.contact-actions { display: flex; gap: 8px; justify-content: center; }

/* ════════════════════════════════════
   CALENDAR
════════════════════════════════════ */
.calendar-layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; }

.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-month { font-size: 17px; font-weight: 700; }
.cal-nav-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  font-size: 20px;
  color: var(--text-mid);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.cal-nav-btn:hover { border-color: var(--red); color: var(--red); }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.cal-day-label {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px;
  text-transform: uppercase;
}

.cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: all .15s;
  gap: 2px;
}
.cal-day:hover { background: var(--off-white); }
.cal-day.other-month { color: var(--text-light); }
.cal-day.today {
  background: var(--red-pale);
  color: var(--red);
  font-weight: 800;
  border: 2px solid var(--red);
}
.cal-day.has-event::after {
  content: '';
  width: 4px; height: 4px;
  background: var(--red);
  border-radius: 50%;
  position: absolute;
  bottom: 3px;
}

.event-list { display: flex; flex-direction: column; gap: 12px; }
.event-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--off-white);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-dark);
}
.event-item.event-urgent { border-left-color: var(--red); }
.event-item.event-warn   { border-left-color: #F59E0B; }

.event-date-block { text-align: center; min-width: 40px; }
.event-day { font-size: 20px; font-weight: 800; line-height: 1; }
.event-mon { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }

.event-body { flex: 1; }
.event-title { font-size: 13px; font-weight: 600; }
.event-matter { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ════════════════════════════════════
   PLANS
════════════════════════════════════ */
.plans-current {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 28px;
}

.current-plan-card {}
.plan-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: var(--red); text-transform: uppercase;
  margin-bottom: 6px;
}
.plan-name-big {
  font-family: 'Playfair Display', serif;
  font-size: 28px; font-weight: 700;
  color: var(--red); margin-bottom: 6px;
}
.plan-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.plan-stats { display: flex; gap: 32px; margin-bottom: 16px; }
.ps-val { font-size: 18px; font-weight: 800; }
.ps-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }

.usage-label { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.usage-bar { height: 8px; background: var(--surface); border-radius: 99px; overflow: hidden; }
.usage-fill { height: 100%; background: var(--red); border-radius: 99px; }
.usage-remaining { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

.upgrade-card {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff; border-color: var(--red-dark);
}
.upgrade-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.upgrade-desc { font-size: 13.5px; opacity: .85; margin-bottom: 20px; line-height: 1.5; }

.plans-label {
  text-align: center;
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  color: var(--text-muted); text-transform: uppercase;
  margin-bottom: 16px;
}

.plans-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.plan-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.plan-card.plan-featured {
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red), var(--shadow-md);
  transform: scale(1.03);
  position: relative;
}

.plan-recommended {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  padding: 4px 14px;
  border-radius: 99px;
  white-space: nowrap;
}

.plan-tier { font-size: 14px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.plan-price { font-size: 36px; font-weight: 900; color: var(--text); margin-bottom: 20px; letter-spacing: -2px; }
.plan-price span { font-size: 15px; font-weight: 500; color: var(--text-muted); }

.plan-features { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.plan-feature { font-size: 13px; color: var(--text-mid); }
.plan-feature.muted { color: var(--text-light); }

.plan-card.plan-featured .btn-white { background: var(--red); color: #fff; }
.plan-card.plan-featured .btn-white:hover { background: var(--red-dark); }

/* ════════════════════════════════════
   SETTINGS
════════════════════════════════════ */
.settings-grid { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }

.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all .15s;
}
.settings-nav-item:hover { background: var(--off-white); color: var(--text); }
.settings-nav-item.active { background: var(--red-pale); color: var(--red); font-weight: 700; }

.settings-content { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.settings-section-title { font-size: 17px; font-weight: 700; margin-bottom: 24px; }

.profile-avatar-section { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.profile-avatar-lg {
  width: 64px; height: 64px;
  background: var(--red); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
}

.toggle-group { display: flex; flex-direction: column; gap: 0; }
.toggle-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-item:last-child { border-bottom: none; }
.toggle-title { font-size: 13.5px; font-weight: 600; }
.toggle-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-dark);
  border-radius: 24px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--red); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.checkbox-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check-label input[type="checkbox"] { accent-color: var(--red); width: 15px; height: 15px; }

.radio-group { display: flex; gap: 20px; }
.radio-label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.radio-label input[type="radio"] { accent-color: var(--red); width: 15px; height: 15px; }

.integration-list { display: flex; flex-direction: column; gap: 14px; }
.integration-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.integration-item:last-child { border-bottom: none; }
.int-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.int-body { flex: 1; }
.int-name { font-size: 13.5px; font-weight: 600; }
.int-desc { font-size: 12px; color: var(--text-muted); }

/* ════════════════════════════════════
   FORM ELEMENTS
════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-mid); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .3px; }
.form-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.form-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(196,30,58,.08);
}

.textarea-field {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--white);
  resize: vertical;
  font-family: inherit;
  outline: none;
  transition: border .15s;
}
.textarea-field:focus { border-color: var(--red); }

/* ════════════════════════════════════
   TOAST
════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: all .25s;
  z-index: 999;
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ════════════════════════════════════
   RESPONSIVE
════════════════════════════════════ */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .action-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-actions-card { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform .25s;
    z-index: 500;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: block; }
  .search-bar { width: 200px; }
  .dash-grid { grid-template-columns: 1fr; }
  .analyze-grid, .draft-grid, .research-grid, .intake-grid,
  .billing-grid, .plans-current, .settings-grid,
  .calendar-layout { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: 1fr; }
  .plan-card.plan-featured { transform: none; }
}

@media (max-width: 600px) {
  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .modal-grid { grid-template-columns: 1fr; }
  .search-bar { display: none; }
}
