/* =========================================================
   PORTAL CONTÁBIL — Design System v17
   Fonte: Inter
   Cor primária: #1a6ef5
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300..700;1,14..32,300..700&display=swap');

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:               #f4f7fb;
  --bg-soft:          #edf1f8;
  --bg-white:         #ffffff;

  --sidebar-bg:       #ffffff;
  --sidebar-line:     #eaeff6;

  --card:             #ffffff;
  --card-border:      #e4eaf3;
  --card-border-hover:#c8d6ea;

  --text:             #0f172a;
  --text-soft:        #334155;
  --muted:            #64748b;
  --muted-light:      #94a3b8;

  --primary:          #1a6ef5;
  --primary-dark:     #1458c8;
  --primary-light:    #3b82f6;
  --primary-soft:     #eff6ff;
  --primary-mid:      #dbeafe;
  --primary-glow:     rgba(26,110,245,0.10);

  --success:          #059669;
  --success-soft:     #ecfdf5;
  --success-mid:      #a7f3d0;

  --warning:          #d97706;
  --warning-soft:     #fffbeb;
  --warning-mid:      #fde68a;

  --danger:           #dc2626;
  --danger-soft:      #fef2f2;
  --danger-mid:       #fecaca;

  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04), 0 1px 4px rgba(15,23,42,0.03);
  --shadow-sm: 0 2px 8px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.08), 0 2px 6px rgba(15,23,42,0.04);
  --shadow-lg: 0 8px 32px rgba(15,23,42,0.10), 0 4px 12px rgba(15,23,42,0.05);
  --shadow-blue: 0 4px 16px rgba(26,110,245,0.20);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius:    16px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --sidebar-width:     256px;
  --topbar-h:          60px;
  --container-pad:     24px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* mobile overlay */
  --overlay: rgba(15,23,42,0.40);
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img, svg { display: block; max-width: 100%; }
button { appearance: none; -webkit-appearance: none; border: none; cursor: pointer; background: none; }
input, select, textarea, button { outline: none; }
* { min-width: 0; }

/* ─── UTILITÁRIOS ────────────────────────────────────────── */
.w-full   { width: 100%; }
.small    { font-size: 0.8rem; }
.muted, .text-muted   { color: var(--muted); }
.text-primary         { color: var(--primary); }
.text-success         { color: var(--success); }
.text-warning         { color: var(--warning); }
.text-danger          { color: var(--danger); }
.eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
}

/* ─── BOTÕES ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.17s ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 6px 20px rgba(26,110,245,0.28); }

.btn-soft {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-mid);
}
.btn-soft:hover { background: var(--primary-mid); }

.btn-outline {
  background: #fff;
  color: var(--text-soft);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover { border-color: var(--card-border-hover); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--text-soft); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-mid);
}
.btn-danger:hover { background: var(--danger-mid); }

.btn-small {
  padding: 5px 11px;
  min-height: 30px;
  font-size: 0.775rem;
  border-radius: var(--radius-xs);
}

.btn-full { width: 100%; }

/* ─── INPUTS ─────────────────────────────────────────────── */
label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: -0.01em;
}

input, textarea {
  width: 100%;
  background: var(--bg-white);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-white);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 40px 10px 14px;
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.16s, box-shadow 0.16s;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg fill='%2364748b' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.24 4.5a.75.75 0 01-1.08 0l-4.24-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

input::placeholder, textarea::placeholder { color: var(--muted-light); }

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: #fff;
  outline: none;
}

textarea { min-height: 100px; resize: vertical; }

.form-group { margin-bottom: 16px; }

.input-wrap { position: relative; }
.input-wrap input { padding-right: 88px; }

.password-toggle,
.password-toggle-v2 {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
}
.password-toggle:hover,
.password-toggle-v2:hover { background: var(--primary-soft); }

/* ─── FLASH ──────────────────────────────────────────────── */
.flash, .flash-v2 {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  animation: slideDown 0.22s ease;
  line-height: 1.55;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.flash.success, .flash-v2.success { background: var(--success-soft); color: var(--success); border-color: var(--success-mid); }
.flash.error,   .flash-v2.error   { background: var(--danger-soft);  color: var(--danger);  border-color: var(--danger-mid); }
.flash-v2-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* ─── AUTH ───────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 60% 50% at 10% 0%, rgba(26,110,245,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(26,110,245,0.05) 0%, transparent 55%),
    linear-gradient(160deg, #f8faff 0%, #f0f5fc 100%);
}

.auth-shell-v2 {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr minmax(420px, 460px);
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.auth-shell-v2.auth-shell-center-v2 {
  max-width: 960px;
  grid-template-columns: 1fr minmax(400px, 440px);
}

/* Auth left panel */
.auth-left {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px;
  background: linear-gradient(150deg, #f0f6ff 0%, #e8f0fc 50%, #deeaff 100%);
  border-right: 1px solid var(--card-border);
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(26,110,245,0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(26,110,245,0.08) 0%, transparent 35%);
  pointer-events: none;
}
.auth-left-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26,110,245,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,110,245,0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}
.auth-left-top, .auth-left-footer { position: relative; z-index: 1; }

.auth-left-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 52px;
}
.auth-left-brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: var(--shadow-blue);
  flex-shrink: 0;
}
.auth-left-brand h1 { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--text); }
.auth-left-brand p  { margin: 2px 0 0; font-size: 0.75rem; color: var(--muted); }

.auth-left-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(26,110,245,0.12);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
}
.auth-left-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.15);
}

.auth-left h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 2.8vw, 2.8rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 480px;
}
.auth-left-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: 440px;
}
.auth-left-benefits {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}
.auth-left-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}
.auth-left-benefit-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(26,110,245,0.10);
  font-size: 0.85rem;
  margin-top: 1px;
  box-shadow: var(--shadow-xs);
}
.auth-left-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.auth-stat-item {
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(26,110,245,0.08);
  backdrop-filter: blur(10px);
}
.auth-stat-item strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 5px;
}
.auth-stat-item span { font-size: 0.72rem; color: var(--muted); }

/* Auth right panel */
.auth-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 44px;
  background: #fff;
}
.auth-right::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}
.auth-right-inner {
  width: 100%;
  max-width: 370px;
}
.auth-right-inner.auth-right-inner-wide { max-width: 450px; }
.auth-right-header { margin-bottom: 28px; }
.auth-right-step-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.auth-right-header h2 {
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 2vw, 2.1rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.auth-right-header p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.65; }

.auth-form-v2 .form-group { margin-bottom: 16px; }
.auth-form-v2 label { font-size: 0.8rem; font-weight: 600; color: var(--text-soft); }
.auth-form-v2 input, .auth-form-v2 select, .auth-form-v2 textarea {
  background: #fafbfd;
  border: 1.5px solid #dde5f0;
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.auth-form-v2 input:focus, .auth-form-v2 select:focus, .auth-form-v2 textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.auth-form-v2 select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg fill='%2364748b' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.24 4.5a.75.75 0 01-1.08 0l-4.24-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.auth-form-v2 .btn-primary-v2 {
  width: 100%;
  min-height: 50px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-blue);
  margin-top: 4px;
  letter-spacing: -0.01em;
  transition: all 0.17s ease;
  cursor: pointer;
}
.auth-form-v2 .btn-primary-v2 svg { width: 18px; height: 18px; }
.auth-form-v2 .btn-primary-v2:hover { background: var(--primary-dark); box-shadow: 0 6px 22px rgba(26,110,245,0.30); transform: translateY(-1px); }
.auth-form-v2 .btn-primary-v2:active { transform: translateY(0); }

.auth-links-v2, .auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.auth-links-v2 a, .auth-links a, .auth-back-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  transition: color 0.15s;
}
.auth-links-v2 a:hover, .auth-links a:hover, .auth-back-link:hover { color: var(--primary-dark); }
.auth-back-link { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 24px; color: var(--muted); }
.auth-back-link:hover { color: var(--text); }

.auth-helper-v2, .auth-helper {
  margin-top: 16px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  background: #f8fbff;
  border: 1px solid var(--primary-mid);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}
.auth-security-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--bg-soft);
  color: var(--muted-light);
  font-size: 0.75rem;
}
.auth-security-note svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Steps */
.steps-v2 { display: flex; align-items: center; margin-bottom: 28px; }
.step-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
}
.step-v2::after {
  content: '';
  position: absolute;
  top: 16px; left: 50%;
  width: 100%; height: 2px;
  background: var(--card-border);
  z-index: 0;
}
.step-v2:last-child::after { display: none; }
.step-v2-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  border: 2px solid var(--card-border);
  background: #fff;
  color: var(--muted-light);
  position: relative;
  z-index: 1;
  transition: all 0.22s ease;
}
.step-v2.active .step-v2-circle { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); }
.step-v2.done   .step-v2-circle { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-v2.done::after { background: var(--primary); }
.step-v2-label { font-size: 0.68rem; font-weight: 600; color: var(--muted-light); }
.step-v2.active .step-v2-label, .step-v2.done .step-v2-label { color: var(--primary); }

.auth-step-panel-v2 { display: none; animation: fadeInPanel 0.2s ease; }
.auth-step-panel-v2.active { display: block; }
@keyframes fadeInPanel { from { opacity:0; transform: translateX(6px); } to { opacity:1; transform:translateX(0); } }

.auth-form-grid-v2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 12px; }
.auth-form-grid-v2 .full { grid-column: 1 / -1; }
.auth-step-actions-v2 { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.btn-outline-v2 {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--card-border);
  background: #fff;
  color: var(--text-soft);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.16s;
}
.btn-outline-v2:hover { border-color: var(--card-border-hover); }
.btn-outline-v2-full { flex: 1; }

/* Password strength */
.password-strength { margin-top: 8px; }
.password-strength-bar { display: flex; gap: 4px; margin-bottom: 4px; }
.strength-segment { flex: 1; height: 3px; border-radius: 999px; background: var(--card-border); transition: background 0.2s; }
.strength-segment.filled-weak   { background: var(--danger); }
.strength-segment.filled-medium { background: var(--warning); }
.strength-segment.filled-strong { background: var(--success); }
.password-strength-label { font-size: 0.7rem; font-weight: 600; color: var(--muted); }
.password-strength-label.weak   { color: var(--danger); }
.password-strength-label.medium { color: var(--warning); }
.password-strength-label.strong { color: var(--success); }

/* ─── BRAND ──────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-badge {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: var(--shadow-blue);
  flex-shrink: 0;
}
.brand h1 { margin: 0; font-size: 0.92rem; font-weight: 700; color: var(--text); }
.brand p  { margin: 1px 0 0; font-size: 0.72rem; color: var(--muted); }

/* ─── LAYOUT PRINCIPAL ───────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

/* ─── TOPBAR MOBILE ──────────────────────────────────────── */
.topbar-mobile {
  display: none;
  position: sticky;
  top: 0;
  z-index: 120;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--sidebar-line);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar-mobile-brand { display: flex; align-items: center; gap: 9px; }
.topbar-mobile-brand span { font-size: 0.9rem; font-weight: 700; color: var(--text); }

.mobile-menu-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-soft);
  font-size: 1rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.mobile-menu-btn:hover { background: var(--bg-soft); }

/* ─── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-line);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) transparent;
}

.sidebar .brand {
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--sidebar-line);
  margin-bottom: 6px;
}

.sidebar-user {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.sidebar-user strong { display: block; font-size: 0.84rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.sidebar-user .mini-id { font-size: 0.72rem; color: var(--muted); line-height: 1.4; }

.sidebar nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  transition: all 0.14s;
}
.nav-link:hover { background: var(--bg); color: var(--text-soft); }
.nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-link.active .nav-icon { color: var(--primary); }

.nav-icon { width: 19px; height: 19px; display: grid; place-items: center; font-size: 0.9rem; flex-shrink: 0; }

.sidebar-card {
  margin-top: auto;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-blue);
}
.sidebar-card h4 { margin: 0 0 5px; font-size: 0.82rem; font-weight: 700; line-height: 1.35; }
.sidebar-card p  { margin: 0 0 10px; font-size: 0.74rem; opacity: 0.82; line-height: 1.5; }
.sidebar-card .btn {
  width: 100%;
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-size: 0.76rem;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
}
.sidebar-card .btn:hover { background: rgba(255,255,255,0.26); transform: none; }
.sidebar-foot { font-size: 0.68rem; color: var(--muted-light); padding: 8px 6px 2px; }

/* Overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 149;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: all;
}

/* ─── MAIN / TOPBAR INTERNO ──────────────────────────────── */
.main {
  min-width: 0;
  padding: var(--container-pad);
  background: var(--bg);
  overflow-x: hidden;
}
.main > * { animation: fadeUp 0.26s ease both; }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}
.topbar-dashboard { align-items: center; }

.page-title h2 {
  margin: 0;
  font-size: clamp(1.3rem, 1.8vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}
.page-title p {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 600px;
  line-height: 1.65;
  font-size: 0.865rem;
}
.topbar-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }

.toolbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  box-shadow: var(--shadow-xs);
}
.chip-label { color: var(--muted-light); }
.toolbar-chip strong { color: var(--text-soft); }

/* ─── CARDS ──────────────────────────────────────────────── */
.card, .page-card, .panel, .table-card, .page-section-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.card:hover, .page-card:hover, .panel:hover { border-color: var(--card-border-hover); box-shadow: var(--shadow-sm); }
.page-card, .panel, .table-card, .page-section-card, .feature-panel, .side-card { padding: 20px 22px; }
.page-card + .page-card { margin-top: 14px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head h3 { margin: 0; font-size: 0.9rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.panel-head p  { margin: 3px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }

/* ─── MÉTRICAS ───────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card { padding: 18px; }
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.metric-icon, .icon-box, .shortcut-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  background: var(--primary-soft);
  border: 1px solid var(--primary-mid);
  flex-shrink: 0;
}
.metric-label {
  flex: 1;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.metric-card > strong, .metric-number {
  display: block;
  font-size: clamp(1.5rem, 1.6vw, 1.85rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  margin: 0 0 6px;
}
.metric-desc, .metric-card p {
  margin: 0;
  font-size: 0.775rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ─── GRIDS DE CONTEÚDO ──────────────────────────────────── */
.content-grid-2,
.content-grid-3,
.content-grid-sidebar,
.content-grid-equal {
  display: grid;
  gap: 16px;
  align-items: start;
}
.content-grid-2       { grid-template-columns: repeat(2, minmax(0,1fr)); }
.content-grid-3       { grid-template-columns: repeat(3, minmax(0,1fr)); }
.content-grid-sidebar { grid-template-columns: minmax(0,1.65fr) minmax(280px,0.85fr); }
.content-grid-equal   { grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); }

.section-stack { display: grid; gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 14px; }
.grid > * { min-width: 0; }
.stat   { grid-column: span 4; padding: 18px; }
.half   { grid-column: span 6; }

.stat h3 { margin: 0; font-size: 0.7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.stat strong { display: block; margin-top: 10px; font-size: 2rem; line-height: 1; letter-spacing: -0.04em; color: var(--text); }
.stat-note { margin-top: 5px; color: var(--muted); font-size: 0.775rem; }

/* Dashboard shell */
.dashboard-shell {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 20px;
  align-items: start;
}
.dashboard-main, .dashboard-side { display: grid; gap: 16px; }
.dashboard-bottom { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }

/* ─── ACTION / SHORTCUT / MINI ───────────────────────────── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px,1fr));
  gap: 12px;
}
.action-card {
  padding: 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: all 0.16s;
}
.action-card:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.action-card h4 { margin: 10px 0 5px; font-size: 0.875rem; font-weight: 700; color: var(--text); }
.action-card p  { margin: 0 0 12px; color: var(--muted); font-size: 0.78rem; line-height: 1.55; min-height: 34px; }
.action-card .action-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--card-border); }

.shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.shortcut-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: all 0.16s;
}
.shortcut-card:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.shortcut-body h4 { margin: 0 0 3px; font-size: 0.84rem; font-weight: 700; color: var(--text); }
.shortcut-body p  { margin: 0; color: var(--muted); font-size: 0.76rem; line-height: 1.5; }
.shortcut-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--card-border); margin-top: auto; }
.shortcut-foot strong { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.shortcut-foot span { color: var(--primary); font-weight: 600; font-size: 0.76rem; }

.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 12px; }
.mini-card { padding: 13px; border: 1px solid var(--card-border); border-radius: var(--radius-sm); background: var(--bg); }
.mini-card span  { display: block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.mini-card strong { display: block; margin-top: 5px; font-size: 0.875rem; font-weight: 600; color: var(--text); }

/* ─── LISTAS ─────────────────────────────────────────────── */
.list-card { display: grid; }
.item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
}
.item-row:first-child { padding-top: 0; }
.item-row:last-child  { border-bottom: none; padding-bottom: 0; }
.item-main strong { display: block; margin-bottom: 2px; font-size: 0.875rem; font-weight: 600; color: var(--text); }
.item-main p { margin: 0; color: var(--muted); font-size: 0.775rem; line-height: 1.5; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.item-meta { text-align: right; white-space: nowrap; color: var(--muted); font-size: 0.78rem; flex-shrink: 0; }

/* Side cards */
.side-card h3 { margin: 5px 0 7px; font-size: 0.9rem; font-weight: 700; color: var(--text); }
.side-card p  { margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.65; }
.side-highlight { background: linear-gradient(135deg, #fff 0%, var(--primary-soft) 100%); }
.status-list { display: grid; gap: 0; margin-top: 12px; }
.status-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--card-border); }
.status-item:last-child { border-bottom: none; padding-bottom: 0; }
.status-item span { color: var(--muted); font-size: 0.78rem; }
.status-item strong { font-size: 0.875rem; color: var(--text); font-weight: 700; }

/* ─── TABELAS ────────────────────────────────────────────── */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; min-width: 580px; }

th, td { padding: 10px 12px; text-align: left; vertical-align: middle; }
th {
  border-bottom: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  background: var(--bg);
}
td { border-bottom: 1px solid #f1f5f9; font-size: 0.855rem; color: var(--text-soft); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: var(--primary-soft); color: var(--text); }

/* Tabela card em mobile */
@media (max-width: 600px) {
  .table-card-mobile thead { display: none; }
  .table-card-mobile tbody tr {
    display: block;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    padding: 12px 14px;
    background: var(--card);
  }
  .table-card-mobile tbody tr:hover td { background: transparent; }
  .table-card-mobile tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.84rem;
  }
  .table-card-mobile tbody td:last-child { border-bottom: none; }
  .table-card-mobile tbody td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    padding-top: 2px;
  }
  .table-wrap { overflow-x: visible; }
  table.table-card-mobile { min-width: 0; }
}

/* ─── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}
.badge.ativo, .badge.pago, .badge.autorizado, .badge.receita { background: var(--success-soft); color: var(--success); border: 1px solid var(--success-mid); }
.badge.pendente { background: var(--warning-soft); color: var(--warning); border: 1px solid var(--warning-mid); }
.badge.vencido, .badge.atrasado, .badge.inativo, .badge.arquivado, .badge.rejeitado, .badge.despesa { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-mid); }
.badge.rascunho, .badge.enviado { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-mid); }

.empty { color: var(--muted-light); padding: 16px 0; font-size: 0.855rem; }

/* ─── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  gap: 12px;
}
.empty-state-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  margin-bottom: 4px;
}
.empty-state h4, .empty-state h3 { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--text); }
.empty-state p { margin: 0; font-size: 0.84rem; color: var(--muted); line-height: 1.65; max-width: 300px; }

/* ─── PAGINAÇÃO ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
  margin-top: 4px;
  flex-wrap: wrap;
}
.pagination-info { font-size: 0.78rem; color: var(--muted); }
.pagination-links { display: flex; gap: 4px; align-items: center; }
.page-link, .pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px; height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  border: 1px solid var(--card-border);
  background: #fff;
  text-decoration: none;
  transition: all 0.14s;
}
.page-link:hover, .pagination-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.page-link.active, .pagination-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled, .pagination-link.disabled { opacity: 0.38; pointer-events: none; }

/* ─── UPLOAD ZONE ────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--card-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  background: var(--bg);
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--primary); background: var(--primary-soft); }
.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: none; box-shadow: none; padding: 0; background: transparent; }
.upload-zone-icon { font-size: 1.4rem; display: block; margin-bottom: 8px; }
.upload-zone-label { display: block; font-weight: 600; color: var(--text-soft); font-size: 0.875rem; margin-bottom: 3px; }
.upload-zone-sub { display: block; font-size: 0.75rem; color: var(--muted); }
.upload-zone-filename { display: none; margin-top: 8px; font-size: 0.8rem; font-weight: 600; color: var(--primary); align-items: center; gap: 5px; justify-content: center; }
.upload-zone-filename.visible { display: flex; }
.upload-progress-wrap { display: none; margin-top: 12px; }
.upload-progress-wrap.visible { display: block; }
.upload-progress-bar-bg { height: 5px; background: var(--primary-mid); border-radius: 999px; overflow: hidden; }
.upload-progress-bar { height: 100%; background: var(--primary); border-radius: 999px; width: 0%; transition: width 0.28s ease; }
.upload-progress-label { display: flex; justify-content: space-between; margin-top: 5px; font-size: 0.72rem; color: var(--muted); }

/* ─── MENSAGENS / THREAD ─────────────────────────────────── */
.msg-thread { display: flex; flex-direction: column; gap: 0; }
.msg-bubble-wrap { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.msg-bubble-wrap:first-child { padding-top: 0; }
.msg-bubble-wrap:last-child { border-bottom: none; padding-bottom: 0; }
.msg-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.msg-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary-soft);
  border: 1px solid var(--primary-mid);
  display: grid; place-items: center;
  font-size: 0.66rem; font-weight: 700; color: var(--primary); flex-shrink: 0;
}
.msg-avatar.admin-avatar { background: var(--bg-soft); border-color: var(--card-border); color: var(--text-soft); }
.msg-sender { font-size: 0.8rem; font-weight: 700; color: var(--text); }
.msg-time { font-size: 0.7rem; color: var(--muted); margin-left: auto; }
.msg-subject { font-size: 0.76rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.msg-body {
  font-size: 0.855rem; color: var(--text-soft); line-height: 1.65;
  padding: 11px 14px; background: var(--bg); border-radius: var(--radius-sm);
  border: 1px solid var(--card-border); white-space: pre-wrap; word-break: break-word;
}
.msg-body.msg-body-mine { background: var(--primary-soft); border-color: var(--primary-mid); color: var(--text); }
.msg-unread-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.msg-reply-btn { align-self: flex-end; margin-top: 5px; }

/* Message view */
.message-view { border: 1px solid var(--card-border); background: var(--bg-soft); border-radius: var(--radius); padding: 16px; min-height: 160px; white-space: pre-wrap; color: var(--text-soft); font-size: 0.875rem; }

/* ─── FINANCEIRO ─────────────────────────────────────────── */
.finance-form { display: block; width: 100%; }
.finance-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.finance-form .form-group { margin-bottom: 0; }
.finance-col-span-2 { grid-column: span 2; }
.finance-form-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-light); }
::selection { background: var(--primary-mid); color: var(--primary-dark); }

/* ─── RECENTES / MISC ────────────────────────────────────── */
.recent-clients-card { padding: 20px; }
.recent-clients-head { margin-bottom: 14px; }
.recent-clients-head h3 { margin: 6px 0 0; }
.recent-clients-list { display: flex; flex-direction: column; }
.recent-client-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.recent-client-item:last-child { border-bottom: none; padding-bottom: 0; }
.recent-client-item .item-main strong { font-size: 0.875rem; line-height: 1.35; margin-bottom: 3px; }
.recent-client-item .item-main p { font-size: 0.78rem; color: var(--muted); }
.section-divider { height: 1px; background: var(--card-border); margin: 0 0 20px; }

/* ─── RESPONSIVIDADE ─────────────────────────────────────── */

/* 1280px — dashboard lateral vai para baixo */
@media (max-width: 1280px) {
  .dashboard-shell { grid-template-columns: 1fr; }
  .dashboard-side  { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* 1100px — sidebar vira drawer, auth vira coluna única */
@media (max-width: 1100px) {
  /* Layout */
  .layout { grid-template-columns: 1fr; }
  .topbar-mobile { display: flex; }

  /* Sidebar → drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: min(280px, 80vw);
    height: 100vh;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.26s;
    padding-top: 20px;
    border-right: 1px solid var(--sidebar-line);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main { padding: 18px 16px; }

  /* Auth */
  .auth-shell-v2,
  .auth-shell-v2.auth-shell-center-v2 {
    max-width: 540px;
    grid-template-columns: 1fr;
  }
  .auth-left { border-right: none; border-bottom: 1px solid var(--card-border); padding: 32px 28px 28px; }
  .auth-left::after, .auth-left-grid { display: none; }
  .auth-left-brand { margin-bottom: 24px; }
  .auth-left-stats { grid-template-columns: repeat(3,1fr); }
  .auth-right { padding: 32px 28px; }

  /* Grids */
  .content-grid-2,
  .content-grid-3,
  .content-grid-sidebar { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .finance-form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .finance-col-span-2 { grid-column: auto; }
}

/* 820px — ajustes intermediários */
@media (max-width: 820px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-tools { width: 100%; }
  .toolbar-chip { width: 100%; justify-content: space-between; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-side { grid-template-columns: 1fr; }
  .dashboard-bottom { grid-template-columns: 1fr; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .grid .stat { grid-column: span 6; }
  .grid .half { grid-column: span 6; }
}

/* 600px — mobile pleno */
@media (max-width: 600px) {
  :root { --container-pad: 14px; }

  .auth-page { padding: 12px; }
  .auth-shell-v2, .auth-shell-v2.auth-shell-center-v2 { border-radius: var(--radius-lg); }
  .auth-left { padding: 24px 18px 20px; }
  .auth-left h2 { font-size: 1.75rem; }
  .auth-left-benefits, .auth-left-stats { display: none; }
  .auth-right { padding: 24px 18px 28px; }
  .auth-right-inner, .auth-right-inner.auth-right-inner-wide { max-width: 100%; }
  .auth-form-grid-v2 { grid-template-columns: 1fr; }
  .auth-form-grid-v2 .full { grid-column: auto; }
  .auth-step-actions-v2,
  .auth-links, .auth-links-v2,
  .finance-form-actions { flex-direction: column; align-items: stretch; }
  .btn-outline-v2-full,
  .auth-links a, .auth-links-v2 a,
  .finance-form-actions .btn { width: 100%; }

  .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .action-grid { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: 1fr; }
  .finance-form-grid { grid-template-columns: 1fr; }

  .panel, .page-card, .feature-panel, .side-card, .table-card, .page-section-card { padding: 14px 15px; }

  .item-row { flex-direction: column; align-items: flex-start; }
  .item-meta { text-align: left; white-space: normal; }

  .grid .stat { grid-column: span 12; }
  .grid .half { grid-column: span 12; }

  th, td { padding: 8px 10px; }
  .toolbar-chip { justify-content: center; }

  .pagination { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* 400px — telas muito pequenas */
@media (max-width: 400px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .auth-right-header h2 { font-size: 1.55rem; }
}
