/* ============================================================
   Advocatus - Design System
   Padrão: Advocacia / Direito
   Mobile First | Responsivo
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Paleta Jurídica */
  --primary:        #1a3a6b;   /* Azul marinho institucional */
  --primary-dark:   #0f2347;
  --primary-light:  #2d5a9e;
  --accent:         #c9a84c;   /* Dourado prestige */
  --accent-dark:    #a8872f;
  --accent-light:   #e8c97a;

  /* Neutros */
  --gray-50:  #f8f9fb;
  --gray-100: #f1f3f7;
  --gray-200: #e4e8f0;
  --gray-300: #c8d0e0;
  --gray-400: #9aaabe;
  --gray-500: #6b7c99;
  --gray-600: #4a5568;
  --gray-700: #2d3748;
  --gray-800: #1a202c;
  --gray-900: #0f1623;

  /* Semânticas */
  --success:  #1a7a4a;
  --warning:  #b7800a;
  --danger:   #9b1c1c;
  --info:     #1a5a8b;

  /* Layout */
  --sidebar-w: 260px;
  --header-h:  64px;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(15,35,71,.08), 0 1px 2px rgba(15,35,71,.06);
  --shadow:    0 4px 12px rgba(15,35,71,.1), 0 2px 6px rgba(15,35,71,.07);
  --shadow-md: 0 8px 24px rgba(15,35,71,.12), 0 4px 10px rgba(15,35,71,.08);
  --shadow-lg: 0 20px 48px rgba(15,35,71,.16);

  /* Transições */
  --transition: all .22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .9375rem;
  color: var(--gray-700);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5,h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ════════════════════════════════════════════════════════════
   LAYOUT DO PAINEL (Admin / Advogado / Cliente / Atendente)
   ════════════════════════════════════════════════════════════ */

.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(175deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: var(--transition);
  box-shadow: 4px 0 20px rgba(15,35,71,.25);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo-icon {
  width: 42px; height: 42px;
  background: var(--accent);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: var(--primary-dark);
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-logo-text { color: #fff; }
.sidebar-logo-text .brand { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700; letter-spacing: .5px; }
.sidebar-logo-text .tagline { font-size: .7rem; opacity: .65; letter-spacing: .5px; }

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-info .name { color: #fff; font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info .role { font-size: .72rem; color: rgba(255,255,255,.55); text-transform: capitalize; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section { padding: 8px 16px 4px; }
.nav-section-label { font-size: .68rem; font-weight: 600; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: 1px; }
.nav-item a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  font-size: .825rem;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-item a:hover { color: #fff; background: rgba(255,255,255,.1); }
.nav-item a.active {
  color: var(--accent);
  background: rgba(255,255,255,.12);
  border-right: 3px solid var(--accent);
}
.nav-item a i { width: 18px; text-align: center; font-size: .95rem; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.6);
  font-size: .825rem;
  padding: 8px 0;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar-footer a:hover { color: #fff; }

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

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
  color: var(--gray-600);
  font-size: 1.1rem;
  transition: var(--transition);
}
.topbar-toggle:hover { background: var(--gray-100); }
.topbar-title { font-size: 1.05rem; font-weight: 600; color: var(--primary); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  font-size: 1rem;
  background: var(--gray-100);
  transition: var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--gray-200); color: var(--primary); }
.topbar-notif-count {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* ── Notifications Dropdown ─────────────────────────────── */
.notif-dropdown {
  position: absolute;
  right: 0; top: calc(100% + 12px);
  width: 340px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  border: 1px solid var(--gray-200);
  overflow: hidden;
  display: none;
  animation: slideInUp .25s ease-out;
}
.notif-dropdown.show { display: block; }
.notif-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; justify-content: space-between; align-items: center;
  background: white;
}
.notif-header h4 { font-size: .9rem; margin: 0; color: var(--primary); }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item {
  display: block;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-50);
  transition: var(--transition);
  text-decoration: none !important;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: #f0f7ff; }
.notif-item-title { font-size: .85rem; font-weight: 600; color: var(--gray-800); margin-bottom: 2px; }
.notif-item-text { font-size: .78rem; color: var(--gray-500); line-height: 1.4; }
.notif-item-time { font-size: .7rem; color: var(--gray-400); margin-top: 4px; }
.notif-footer { padding: 10px; text-align: center; background: var(--gray-50); border-top: 1px solid var(--gray-100); }
.notif-footer a { font-size: .78rem; font-weight: 600; color: var(--gray-600); }

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Page Content ───────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 24px;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { font-size: 1.5rem; color: var(--primary); }
.breadcrumb { font-size: .8rem; color: var(--gray-500); margin-top: 4px; }
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--gray-400); margin: 0 6px; }

/* ════════════════════════════════════════════════════════════
   CARDS e STATS
   ════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #e8f0fd; color: var(--primary); }
.stat-icon.gold   { background: #fdf5e0; color: var(--accent-dark); }
.stat-icon.green  { background: #e0f4ec; color: var(--success); }
.stat-icon.red    { background: #fde8e8; color: var(--danger); }
.stat-icon.purple { background: #ede8fd; color: #6b46c1; }
.stat-info .label { font-size: .8rem; color: var(--gray-500); font-weight: 500; }
.stat-info .value { font-size: 1.6rem; font-weight: 700; color: var(--primary); line-height: 1.1; font-family: 'Inter', sans-serif; }
.stat-info .sub   { font-size: .75rem; color: var(--gray-400); }

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h2, .card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}
.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* ════════════════════════════════════════════════════════════
   TABELAS
   ════════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--gray-50); }
.table .actions { display: flex; gap: 6px; }

/* ════════════════════════════════════════════════════════════
   FORMULÁRIOS
   ════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: .83rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 3px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: .9rem;
  font-family: 'Inter', sans-serif;
  color: var(--gray-700);
  background: #fff;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  outline: none;
  transition: var(--transition);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,107,.1);
}
.form-control::placeholder { color: var(--gray-400); }
.form-control[readonly] { background: var(--gray-50); }
.form-control.is-invalid { border-color: var(--danger); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .78rem; color: var(--gray-500); margin-top: 4px; }
.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ════════════════════════════════════════════════════════════
   BOTÕES
   ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: .875rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn i { font-size: .9rem; }

.btn-primary    { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-accent     { background: var(--accent); color: var(--primary-dark); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); color: var(--primary-dark); }
.btn-success    { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { filter: brightness(.9); }
.btn-danger     { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(.88); color: #fff; }
.btn-warning    { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-secondary  { background: var(--gray-200); color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-300); color: var(--gray-800); }
.btn-outline    { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-outline-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn-icon { padding: 9px; width: 36px; height: 36px; justify-content: center; }
.btn-block { width: 100%; justify-content: center; }

/* ════════════════════════════════════════════════════════════
   BADGES
   ════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-success    { background: #d1fae5; color: #065f46; }
.badge-warning    { background: #fef3c7; color: #92400e; }
.badge-danger     { background: #fee2e2; color: #991b1b; }
.badge-info       { background: #dbeafe; color: #1e40af; }
.badge-secondary  { background: var(--gray-100); color: var(--gray-600); }
.badge-primary    { background: #dbeafe; color: var(--primary); }
.badge-gold       { background: #fdf5e0; color: var(--accent-dark); }

/* ════════════════════════════════════════════════════════════
   ALERTAS FLASH
   ════════════════════════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: .885rem;
  margin-bottom: 20px;
  border-left: 4px solid;
  animation: slideDown .3s ease;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: #10b981; }
.alert-error   { background: #fee2e2; color: #991b1b; border-color: #ef4444; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: #3b82f6; }
.alert-close   { margin-left: auto; cursor: pointer; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════
   TIMELINE (Andamentos)
   ════════════════════════════════════════════════════════════ */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 20px; top: 0; bottom: 0;
  width: 2px;
  background: var(--gray-200);
}
.timeline-item {
  display: flex;
  gap: 16px;
  padding-bottom: 24px;
  position: relative;
}
.timeline-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
  z-index: 1;
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
}
.timeline-dot.audiencia  { background: #7c3aed; }
.timeline-dot.despacho   { background: var(--info); }
.timeline-dot.peticao    { background: var(--primary); }
.timeline-dot.sentenca   { background: var(--accent-dark); }
.timeline-dot.recurso    { background: var(--warning); }
.timeline-dot.diligencia { background: var(--success); }
.timeline-body {
  flex: 1;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}
.timeline-body h4 { font-size: .9rem; color: var(--primary); margin-bottom: 4px; }
.timeline-meta { font-size: .75rem; color: var(--gray-500); margin-bottom: 8px; }
.timeline-body p { font-size: .875rem; color: var(--gray-600); }

/* ════════════════════════════════════════════════════════════
   UTILITÁRIOS
   ════════════════════════════════════════════════════════════ */
.section { padding: 100px 0; position: relative; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 2.5rem; margin-top: 10px; margin-bottom: 20px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 20px; }
.grid-5 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; gap: 20px; }
.flex   { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.mt-1   { margin-top: 4px; }
.mt-2   { margin-top: 8px; }
.mt-3   { margin-top: 12px; }
.mt-4   { margin-top: 16px; }
.mt-6   { margin-top: 24px; }
.mb-4   { margin-bottom: 16px; }
.mb-6   { margin-bottom: 24px; }
.text-sm    { font-size: .85rem; }
.text-xs    { font-size: .75rem; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.hidden { display: none; }
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 20px 0; }

/* Padding & Margin Utilities */
.p-0 { padding: 0 !important; }
.p-1 { padding: 4px !important; }
.p-2 { padding: 8px !important; }
.p-3 { padding: 12px !important; }
.p-4 { padding: 16px !important; }
.p-5 { padding: 20px !important; }
.p-6 { padding: 24px !important; }
.p-8 { padding: 32px !important; }

.pt-0 { padding-top: 0 !important; }
.pt-4 { padding-top: 16px !important; }
.pb-4 { padding-bottom: 16px !important; }

.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; }
.mt-6 { margin-top: 24px !important; }
.mt-8 { margin-top: 32px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-6 { margin-bottom: 24px !important; }
.mb-8 { margin-bottom: 32px !important; }
.mb-10 { margin-bottom: 40px !important; }
.mx-auto { margin-left: auto; margin-right: auto; }

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; }
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray-400);
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; }
.empty-state p { font-size: .9rem; }

/* Overlay sidebar em mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 190;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVO
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .form-row-4 { grid-template-columns: 1fr 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.3);
  }
  .sidebar-overlay.active { display: block; }
  .main-content { margin-left: 0; }
  .topbar-toggle { display: flex; }
  .page-content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .section-header { margin-bottom: 40px; }
  .section-header h2 { font-size: 2rem; }
  .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .table { font-size: .8rem; }
  .btn { font-size: .82rem; padding: 8px 14px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 16px; }
}
@media (min-width: 1921px) {
  .container { width: 1632px !important; }
}
