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

:root {
  --primary: #1B4F8A;
  --primary-dark: #0D2137;
  --primary-light: #2563EB;
  --primary-muted: #EFF6FF;
  --accent: #00B4D8;
  --success: #059669;
  --success-light: #ECFDF5;
  --warning: #D97706;
  --warning-light: #FFFBEB;
  --danger: #DC2626;
  --danger-light: #FEF2F2;
  --info: #0891B2;
  --info-light: #ECFEFF;

  --sidebar-w: 260px;
  --sidebar-bg: #0D2137;
  --sidebar-text: #94A3B8;
  --sidebar-active: #1B4F8A;
  --sidebar-hover: rgba(255,255,255,0.06);

  --bg: #F0F4F8;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --border-dark: #CBD5E1;

  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* =========================================
   LAYOUT
   ========================================= */
.app-layout { display: flex; min-height: 100vh; }

/* --- SIDEBAR --- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text { color: #F8FAFC; }
.sidebar-logo .logo-text strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.sidebar-logo .logo-text span { font-size: 10px; color: var(--sidebar-text); text-transform: uppercase; letter-spacing: 1px; }

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

.nav-section { margin-bottom: 8px; }
.nav-section-title {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(148,163,184,.5);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  position: relative;
  margin: 1px 8px;
  border-radius: 8px;
}

.nav-item:hover { background: var(--sidebar-hover); color: #E2E8F0; }

.nav-item.active {
  background: var(--primary);
  color: #fff;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

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

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

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

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}
.user-info:hover { background: var(--sidebar-hover); }

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

.user-details { flex: 1; min-width: 0; }
.user-details .user-name { color: #E2E8F0; font-size: 12px; font-weight: 600; truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.user-details .user-role { color: var(--sidebar-text); font-size: 10px; }

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

/* --- TOP BAR --- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

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

.page-title { font-size: 16px; font-weight: 600; color: var(--text); }
.page-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

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

.btn-icon {
  width: 36px; height: 36px;
  border: none;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: all .15s;
  position: relative;
  font-size: 15px;
}
.btn-icon:hover { background: var(--border); color: var(--text); }

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

/* --- PAGE BODY --- */
.page-body { padding: 24px; flex: 1; }

/* =========================================
   COMPONENTS
   ========================================= */

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

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

.card-title { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg); }

/* --- STAT CARDS --- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-muted); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }

.stat-info { flex: 1; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }
.stat-change { font-size: 11px; margin-top: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-outline { background: transparent; color: var(--text-secondary); border-color: var(--border-dark); }
.btn-outline:hover { background: var(--bg); color: var(--text); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- BADGES --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}

.badge-ativo, .badge-success { background: var(--success-light); color: var(--success); }
.badge-suspenso, .badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-encerrado, .badge-secondary { background: #F1F5F9; color: #64748B; }
.badge-arquivado { background: #F1F5F9; color: #94A3B8; }
.badge-urgente, .badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-intimacao { background: #EEF2FF; color: #4338CA; }
.badge-sentenca { background: #FDF4FF; color: #9333EA; }
.badge-despacho { background: var(--info-light); color: var(--info); }

.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

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

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: #FAFCFF; }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 12px 16px;
  color: var(--text);
  vertical-align: middle;
}

.td-muted { color: var(--text-muted); font-size: 12px; }
.td-actions { display: flex; gap: 6px; align-items: center; }

/* --- FORMS --- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-required::after { content: ' *'; color: var(--danger); }

.form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,79,138,.12);
}

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

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.form-error { color: var(--danger); font-size: 11px; margin-top: 4px; }
.form-hint { color: var(--text-muted); font-size: 11px; margin-top: 4px; }

/* --- SEARCH BAR --- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 0 12px;
}
.search-bar i { color: var(--text-muted); font-size: 13px; }
.search-bar input {
  border: none;
  background: transparent;
  padding: 8px 0;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  width: 100%;
}
.search-bar input::placeholder { color: var(--text-muted); }

/* --- TOOLBAR --- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }

/* --- PAGINATION --- */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 12px 0 4px;
}

.page-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .15s;
}
.page-btn:hover { background: var(--bg); border-color: var(--border-dark); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* --- EMPTY STATE --- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-text { font-size: 13px; color: var(--text-muted); max-width: 300px; margin: 0 auto 16px; }

/* --- TIMELINE --- */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 18px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 0 0 20px 0;
  position: relative;
}

.timeline-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  z-index: 1;
  position: relative;
}

.timeline-dot.intimacao { border-color: #4338CA; color: #4338CA; background: #EEF2FF; }
.timeline-dot.sentenca { border-color: #9333EA; color: #9333EA; background: #FDF4FF; }
.timeline-dot.despacho { border-color: var(--info); color: var(--info); background: var(--info-light); }
.timeline-dot.decisao { border-color: var(--warning); color: var(--warning); background: var(--warning-light); }
.timeline-dot.acordao { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }
.timeline-dot.outro { border-color: var(--border-dark); color: var(--text-muted); }

.timeline-content { flex: 1; padding-top: 4px; }
.timeline-date { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.timeline-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.timeline-ai { margin-top: 8px; padding: 8px 12px; background: var(--primary-muted); border-radius: 6px; font-size: 12px; }
.timeline-ai strong { color: var(--primary); }

/* --- DEADLINE ITEMS --- */
.deadline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.deadline-item:last-child { border-bottom: none; }

.deadline-urgency {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}
.deadline-urgency.urgente { background: var(--danger); }
.deadline-urgency.alta { background: var(--warning); }
.deadline-urgency.media { background: var(--info); }
.deadline-urgency.baixa { background: var(--success); }

.deadline-info { flex: 1; }
.deadline-type { font-size: 13px; font-weight: 500; color: var(--text); }
.deadline-process { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.deadline-days { text-align: right; }
.deadline-days .days-num { font-size: 18px; font-weight: 800; }
.deadline-days .days-label { font-size: 10px; color: var(--text-muted); }
.deadline-days.urgente .days-num { color: var(--danger); }
.deadline-days.alta .days-num { color: var(--warning); }
.deadline-days.media .days-num { color: var(--info); }
.deadline-days.baixa .days-num { color: var(--success); }

/* --- NOTIFICATIONS --- */
.notification-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.notification-item:hover { background: var(--bg); }
.notification-item.unread { background: #FAFCFF; }
.notification-item:last-child { border-bottom: none; }

.notification-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.notification-icon.nova_movimentacao { background: var(--primary-muted); color: var(--primary); }
.notification-icon.intimacao { background: #EEF2FF; color: #4338CA; }
.notification-icon.sentenca { background: #FDF4FF; color: #9333EA; }
.notification-icon.prazo_proximo { background: var(--warning-light); color: var(--warning); }
.notification-icon.prazo_vencendo { background: var(--danger-light); color: var(--danger); }
.notification-icon.sistema { background: #F1F5F9; color: #64748B; }

.notification-body { flex: 1; }
.notification-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; }
.notification-msg { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.notification-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notification-unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}

/* --- MODAL --- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: all .2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

.btn-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 16px; padding: 4px; border-radius: 4px; }
.btn-close:hover { background: var(--bg); color: var(--text); }

/* --- ALERTS --- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-info { background: var(--info-light); color: #0E7490; border-left: 3px solid var(--info); }
.alert-success { background: var(--success-light); color: #065F46; border-left: 3px solid var(--success); }
.alert-warning { background: var(--warning-light); color: #92400E; border-left: 3px solid var(--warning); }
.alert-danger { background: var(--danger-light); color: #991B1B; border-left: 3px solid var(--danger); }

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

.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
  max-width: 340px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

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

/* --- LOADING --- */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
.spinner-dark {
  border-color: rgba(0,0,0,.1);
  border-top-color: var(--primary);
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

/* --- AI PANEL --- */
.ai-panel {
  background: linear-gradient(135deg, #EFF6FF 0%, #F5F3FF 100%);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}
.ai-panel-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ai-panel-header i { color: var(--primary); }
.ai-panel-header strong { font-size: 13px; color: var(--primary); }
.ai-badge { background: #DBEAFE; color: var(--primary); font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.ai-strategy { margin-bottom: 8px; }
.ai-strategy .action { font-size: 13px; font-weight: 600; color: var(--text); }
.ai-strategy .basis { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.ai-jurisprudence { margin-top: 10px; padding-top: 10px; border-top: 1px solid #BFDBFE; }
.ai-juri-item { font-size: 12px; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,.04); }
.ai-juri-item:last-child { border-bottom: none; }
.ai-juri-title { font-weight: 600; color: var(--text); }
.ai-juri-text { color: var(--text-secondary); margin-top: 2px; }

/* --- MISC --- */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 12px; }
.font-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

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

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .page-body { padding: 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
