/* ============================================================
   Portal Valadão — Estilos Principais
   Identidade: Navy (#0f1f3d) + Ouro (#b5873a)
   ============================================================ */

/* ── RESET & TOKENS ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Paleta principal */
  --ink:    #0f1f3d;
  --ink2:   #1a3260;
  --gold:   #b5873a;
  --gold2:  #d4ab60;
  --gold3:  #f0c96a;
  --cream:  #f5f6f9;
  --stone:  #edf0f5;
  --muted:  #5a6478;
  --border: #dde2ea;
  --white:  #ffffff;
  --blue:   #1a3260;
  --blue-chat: #2d5be3;
  --green:  #25d366;
  --red:    #e53e3e;

  /* Sombras */
  --shadow-xs:  0 1px 3px rgba(15,31,61,.06), 0 1px 2px rgba(15,31,61,.04);
  --shadow-sm:  0 2px 8px rgba(15,31,61,.08), 0 1px 3px rgba(15,31,61,.05);
  --shadow-md:  0 4px 16px rgba(15,31,61,.10), 0 2px 6px rgba(15,31,61,.06);
  --shadow-lg:  0 12px 40px rgba(15,31,61,.14), 0 4px 12px rgba(15,31,61,.08);
  --shadow-xl:  0 24px 64px rgba(15,31,61,.18), 0 8px 24px rgba(15,31,61,.10);
  --shadow-gold: 0 4px 20px rgba(181,135,58,.30);

  /* Raios */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 24px;

  /* Transições */
  --ease: cubic-bezier(.22,.68,0,1.2);
  --t-fast: 150ms ease;
  --t-mid:  220ms ease;
  --t-slow: 350ms ease;
}

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

/* ── BASE ────────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── TELA DE CARREGAMENTO ────────────────────────────────────── */
#loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--cream);
}
#loading::after {
  content: 'Valadão Advocacia';
  font-family: 'Fraunces', serif;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .7;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:.9} }

/* ── LOGIN & RESET ───────────────────────────────────────────── */
#login-screen, #reset-screen {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  padding: 24px;
  background-image:
    radial-gradient(ellipse at 65% 35%, rgba(181,135,58,.12) 0%, transparent 55%),
    radial-gradient(ellipse at 15% 80%, rgba(181,135,58,.07) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 85%, rgba(26,50,96,.5) 0%, transparent 50%);
}
#app { display: none; min-height: 100vh; }

.login-card {
  background: var(--white);
  border-radius: var(--r-2xl);
  padding: 48px 44px 44px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,.07);
}
@media(max-width:480px) { .login-card { padding: 36px 28px; border-radius: var(--r-xl); } }

.login-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; gap: 0; }
.login-logo img { width: 160px; object-fit: contain; border-radius: var(--r-md); }
.login-logo-nome {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 4px;
  text-align: center;
}
.login-logo-nome span {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3.5px;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 5px;
}
.login-divider {
  width: 40px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 26px;
}
.login-title {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 4px;
  text-align: center;
}
.login-sub { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 28px; line-height: 1.6; }

.fg-login { margin-bottom: 16px; }
.fg-login label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.fg-login input {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 13px 15px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: all var(--t-mid);
}
.fg-login input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(181,135,58,.14);
  background: var(--white);
}

.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 60%, var(--gold3) 100%);
  color: var(--ink);
  border: none;
  padding: 15px;
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  letter-spacing: .4px;
  transition: all var(--t-mid);
  box-shadow: var(--shadow-gold);
  position: relative;
  overflow: hidden;
}
.btn-login::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 60%);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(181,135,58,.45); }
.btn-login:active { transform: translateY(0); box-shadow: var(--shadow-gold); }
.btn-login:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.login-error {
  background: rgba(229,62,62,.07);
  border: 1px solid rgba(229,62,62,.22);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 13px;
  color: var(--red);
  margin-bottom: 14px;
  display: none;
  line-height: 1.5;
}
.login-footer-link { text-align: center; margin-top: 20px; }
.login-footer-link a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color var(--t-fast); }
.login-footer-link a:hover { color: var(--gold); }

/* ── TOPBAR ──────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 60px;
  background: rgba(15,31,61,.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(181,135,58,.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  box-shadow: 0 1px 20px rgba(0,0,0,.25);
}
.topbar-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar-logo img { height: 30px; object-fit: contain; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-user { font-size: 13px; color: rgba(255,255,255,.55); font-weight: 400; }
@media(max-width:600px) { .topbar-user { display: none; } }

.role-badge {
  background: rgba(181,135,58,.18);
  border: 1px solid rgba(181,135,58,.35);
  color: var(--gold2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: 4px 11px;
  border-radius: 99px;
  text-transform: uppercase;
}
.btn-logout {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.65);
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all var(--t-fast);
}
.btn-logout:hover { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.2); }

.hamburger-app { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; background: none; border: none; }
.hamburger-app span { display: block; width: 20px; height: 2px; background: rgba(255,255,255,.8); border-radius: 2px; transition: all var(--t-mid); }
@media(max-width:768px) { .hamburger-app { display: flex; } }

/* ── LAYOUT PRINCIPAL ────────────────────────────────────────── */
.app-layout { display: flex; padding-top: 60px; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: 224px;
  background: var(--white);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 60px; left: 0; bottom: 0;
  padding: 20px 0 24px;
  display: flex;
  flex-direction: column;
  z-index: 90;
  overflow-y: auto;
  transition: transform var(--t-slow);
  box-shadow: var(--shadow-sm);
}
@media(max-width:768px) {
  .sidebar { transform: translateX(-100%); width: 270px; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
}

.sidebar-section {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--border);
  padding: 0 20px;
  margin: 18px 0 6px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  margin: 1px 8px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--t-fast);
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
  text-decoration: none;
  position: relative;
}
.sidebar-item:hover { background: var(--stone); color: var(--ink); }
.sidebar-item.active {
  background: linear-gradient(135deg, rgba(181,135,58,.12), rgba(181,135,58,.06));
  color: var(--gold);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--gold);
}
.sidebar-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-divider { height: 1px; background: var(--stone); margin: 8px 20px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 89; backdrop-filter: blur(2px); }
.sidebar-overlay.show { display: block; }

/* ── CONTEÚDO PRINCIPAL ──────────────────────────────────────── */
.main { flex: 1; margin-left: 224px; padding: 32px; min-height: calc(100vh - 60px); }
@media(max-width:768px) { .main { margin-left: 0; padding: 20px 16px; } }

/* ── PÁGINAS ─────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; animation: fadeIn .28s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-title {
  font-family: 'Fraunces', serif;
  font-size: 27px;
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -.3px;
}
.page-sub { font-size: 14px; color: var(--muted); margin-bottom: 26px; line-height: 1.6; }

/* ── STAT CARDS ──────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(144px, 1fr)); gap: 14px; margin-bottom: 26px; }

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: all var(--t-mid);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.8) 0%, transparent 100%);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 70%, var(--gold3) 100%);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}
.stat-card.gold::before { background: linear-gradient(135deg, rgba(255,255,255,.2) 0%, transparent 60%); }
.stat-num { font-family: 'Fraunces', serif; font-size: 34px; font-weight: 300; color: var(--ink); line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; letter-spacing: .2px; }
.stat-card.gold .stat-label { color: rgba(15,31,61,.65); }
.stat-card.verde { border-left: 3px solid #25a244; }
.stat-card.azul  { border-left: 3px solid var(--gold); }
.stat-card.cinza { border-left: 3px solid var(--muted); }

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-mid);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: linear-gradient(180deg, rgba(247,248,250,.6) 0%, transparent 100%);
}
.card-title {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -.1px;
}

/* ── TABELAS ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 11px 16px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  background: var(--stone);
  border-bottom: 1px solid var(--border);
}
td { padding: 13px 16px; font-size: 14px; color: var(--ink); border-bottom: 1px solid rgba(221,226,234,.5); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(237,240,245,.5); }
tbody tr { transition: background var(--t-fast); }

/* ── BADGES ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
}
.badge-green  { background: rgba(37,162,68,.1);   color: #1e9447; }
.badge-red    { background: rgba(229,62,62,.1);   color: #c53030; }
.badge-blue   { background: rgba(49,130,206,.1);  color: #2b6cb0; }
.badge-gold   { background: rgba(181,135,58,.12); color: #9c6f25; }
.badge-orange { background: rgba(237,137,54,.1);  color: #b7530a; }

/* ── BOTÕES ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-mid);
  border: none;
  white-space: nowrap;
  position: relative;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 100%);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(181,135,58,.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(181,135,58,.40); filter: brightness(1.05); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--stone);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); box-shadow: var(--shadow-xs); }

.btn-danger {
  background: rgba(229,62,62,.09);
  color: var(--red);
  border: 1px solid rgba(229,62,62,.18);
}
.btn-danger:hover { background: rgba(229,62,62,.18); }

.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--r-sm); justify-content: center; }

/* ── FORMULÁRIOS ─────────────────────────────────────────────── */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media(max-width:560px) { .form-grid { grid-template-columns: 1fr; } }

.fg { margin-bottom: 0; }
.fg.full { grid-column: 1 / -1; }
.fg label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.fg input, .fg select, .fg textarea {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: all var(--t-mid);
  -webkit-appearance: none;
  appearance: none;
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(181,135,58,.12);
  background: var(--white);
}
.fg select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6478' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}
.fg textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.optional { font-size: 10px; color: var(--muted); font-weight: 400; text-transform: none; margin-left: 4px; }

.section-divider {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 22px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── INFO BOX ────────────────────────────────────────────────── */
.info-box {
  background: linear-gradient(135deg, rgba(181,135,58,.07), rgba(181,135,58,.04));
  border: 1px solid rgba(181,135,58,.22);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-sm);
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.75;
  margin-bottom: 18px;
}
.info-box strong { color: var(--gold); }

/* ── TIMELINE ────────────────────────────────────────────────── */
.timeline { padding: 0; list-style: none; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 22px; position: relative; }
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13px; top: 28px; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--gold), var(--border));
}
.timeline-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(181,135,58,.3);
}
.timeline-content { flex: 1; padding-top: 4px; }
.timeline-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.timeline-date { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.timeline-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ── ETAPAS DO PROCESSO ──────────────────────────────────────── */
.etapas-container { padding: 22px; display: flex; flex-direction: column; gap: 0; }
.etapa-item { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 0; }
.etapa-track { display: flex; flex-direction: column; align-items: center; gap: 0; flex-shrink: 0; }
.etapa-circulo {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--muted);
  flex-shrink: 0;
  position: relative; z-index: 1;
  transition: all var(--t-mid);
}
.etapa-circulo.concluida { background: linear-gradient(135deg, var(--gold), var(--gold2)); border-color: var(--gold); color: #fff; box-shadow: 0 2px 8px rgba(181,135,58,.3); }
.etapa-circulo.atual { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 0 0 4px rgba(15,31,61,.12); }
.etapa-linha { width: 2px; flex: 1; min-height: 24px; background: var(--border); }
.etapa-linha.concluida { background: linear-gradient(180deg, var(--gold), var(--gold2)); }
.etapa-info { padding: 4px 0 26px; flex: 1; }
.etapa-nome { font-size: 13px; font-weight: 600; color: var(--muted); }
.etapa-nome.concluida { color: var(--ink); }
.etapa-nome.atual { color: var(--ink); font-weight: 700; }
.etapa-obs { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.etapa-badge-atual {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .5px;
  background: var(--ink); color: #fff; padding: 2px 8px; border-radius: 99px;
  margin-left: 6px; text-transform: uppercase; vertical-align: middle;
}

/* ── FILTROS ─────────────────────────────────────────────────── */
.filtros-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filtro-select {
  padding: 8px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}
.filtro-select:focus { border-color: var(--gold); outline: none; }
.filtro-input {
  padding: 8px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  background: var(--white);
  color: var(--ink);
  min-width: 200px;
  transition: border-color var(--t-fast);
  outline: none;
}
.filtro-input:focus { border-color: var(--gold); }
.filtro-btn {
  padding: 8px 15px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--muted);
  transition: all var(--t-fast);
  font-family: 'DM Sans', sans-serif;
}
.filtro-btn:hover { background: var(--stone); color: var(--ink); border-color: var(--muted); }
.filtro-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── AUDIÊNCIAS ──────────────────────────────────────────────── */
.audiencias-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: var(--shadow-xs);
}
.audiencia-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(221,226,234,.6);
  transition: background var(--t-fast);
}
.audiencia-item:last-child { border-bottom: none; }
.audiencia-item:hover { background: var(--stone); }
.audiencia-dia {
  width: 46px; height: 46px;
  border-radius: var(--r-sm);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-weight: 800; flex-shrink: 0; line-height: 1.1;
}
.audiencia-dia.urgente  { background: rgba(220,38,38,.1);  color: #dc2626; }
.audiencia-dia.proxima  { background: rgba(181,135,58,.12); color: var(--gold2); }
.audiencia-dia.normal   { background: var(--stone); color: var(--ink); }
.audiencia-dia-num { font-size: 18px; }
.audiencia-dia-mes { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.audiencia-info { flex: 1; }
.audiencia-cliente { font-size: 14px; font-weight: 600; color: var(--ink); }
.audiencia-detalhe { font-size: 12px; color: var(--muted); margin-top: 2px; }
.audiencia-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; flex-shrink: 0; }
.audiencia-badge.urgente { background: rgba(220,38,38,.1);  color: #dc2626; }
.audiencia-badge.proxima { background: rgba(181,135,58,.12); color: var(--gold2); }

/* ── HISTÓRICO DE DOCS ───────────────────────────────────────── */
.hist-doc-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(221,226,234,.5); }
.hist-doc-item:last-child { border-bottom: none; }
.hist-doc-icon { font-size: 22px; flex-shrink: 0; }
.hist-doc-info { flex: 1; }
.hist-doc-nome { font-size: 13px; font-weight: 600; color: var(--ink); }
.hist-doc-data { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ── TIPO CARD ───────────────────────────────────────────────── */
.tipo-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-mid);
  box-shadow: var(--shadow-xs);
}
.tipo-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(181,135,58,.18); }
.tipo-card.selected { border-color: var(--ink); background: var(--ink); color: #fff; }
.tipo-card.selected div { color: #fff !important; }

/* ── RECORTES DIGITAIS ───────────────────────────────────────── */
.recorte-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
}
.recorte-card-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.recorte-card-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; flex-shrink: 0; }
.recorte-card-badge.novo       { background: rgba(181,135,58,.12); color: #9c6f25; }
.recorte-card-badge.existente  { background: rgba(37,162,68,.1);   color: #1e9447; }
.recorte-card-badge.ignorado   { background: var(--stone); color: var(--muted); }
.recorte-card-titulo { font-size: 14px; font-weight: 700; color: var(--ink); flex: 1; }
.recorte-card-body { padding: 18px 20px; }
.recorte-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.recorte-meta-item { font-size: 12px; }
.recorte-meta-label { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; font-size: 10px; margin-bottom: 2px; }
.recorte-meta-value { color: var(--ink); font-weight: 500; }
.recorte-texto-pub {
  font-size: 12px; color: var(--muted); line-height: 1.7;
  background: var(--stone); border-radius: var(--r-sm);
  padding: 12px 14px; margin-bottom: 16px;
  max-height: 100px; overflow: hidden;
  position: relative; cursor: pointer; transition: max-height .3s ease;
}
.recorte-texto-pub.expandido { max-height: 500px; }
.recorte-texto-pub::after {
  content: 'Ver mais ▾';
  position: absolute; bottom: 0; right: 10px;
  font-size: 11px; font-weight: 700; color: var(--gold2);
  background: linear-gradient(transparent, var(--stone) 60%);
  padding: 4px 0 0; width: 100%; text-align: right;
}
.recorte-texto-pub.expandido::after { content: 'Ver menos ▴'; }
.recorte-partes { margin-bottom: 14px; }
.recorte-partes-titulo { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.recorte-polo { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.recorte-polo-label { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; flex-shrink: 0; margin-top: 1px; }
.recorte-polo-label.ativo   { background: rgba(37,162,68,.1); color: #1e9447; }
.recorte-polo-label.passivo { background: rgba(220,38,38,.08); color: #dc2626; }
.recorte-polo-nomes { font-size: 13px; color: var(--ink); }
.recorte-selecao { background: rgba(181,135,58,.05); border: 1px solid rgba(181,135,58,.2); border-radius: var(--r-sm); padding: 14px; margin-top: 6px; }
.recorte-selecao-titulo { font-size: 12px; font-weight: 700; color: var(--gold2); margin-bottom: 10px; }
.recorte-selecao-label { font-size: 13px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.recorte-partes-select { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--r-sm); font-size: 13px; background: var(--white); color: var(--ink); margin-bottom: 10px; }
.recorte-polo-select { display: flex; gap: 8px; margin-bottom: 12px; }
.recorte-polo-btn { flex: 1; padding: 9px; border-radius: var(--r-sm); border: 1.5px solid var(--border); background: var(--white); font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--t-fast); text-align: center; }
.recorte-polo-btn:hover { border-color: var(--gold); color: var(--gold2); }
.recorte-polo-btn.selected { background: var(--ink); color: #fff; border-color: var(--ink); }
.recorte-acoes { display: flex; gap: 8px; margin-top: 6px; }
.recorte-ok { background: rgba(37,162,68,.07); border: 1px solid rgba(37,162,68,.2); border-radius: var(--r-sm); padding: 12px 16px; font-size: 13px; color: #1e9447; font-weight: 500; }

/* ── MENORES ─────────────────────────────────────────────────── */
.menores-section { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.menores-section-title { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.menor-card { background: var(--stone); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px; margin-bottom: 10px; position: relative; }
.menor-card-nome { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.menor-card-info { font-size: 12px; color: var(--muted); line-height: 1.5; }
.menor-card-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }
.menor-card-badge.absoluto { background: rgba(220,38,38,.1);  color: #dc2626; }
.menor-card-badge.relativo { background: rgba(181,135,58,.12); color: var(--gold2); }
.menor-card-del { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 6px; transition: color var(--t-fast); }
.menor-card-del:hover { color: var(--red); }
.form-menor { background: var(--stone); border: 1.5px dashed var(--border); border-radius: var(--r-sm); padding: 14px; margin-top: 8px; }

/* ── WHATSAPP FLOAT ──────────────────────────────────────────── */
.whatsapp-float { position: fixed; bottom: 28px; right: 28px; z-index: 9999; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.whatsapp-float-btn {
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, #25d366, #128c3c);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(37,211,102,.5);
  cursor: pointer; border: none; text-decoration: none;
  transition: all var(--t-mid);
}
.whatsapp-float-btn:hover { transform: scale(1.1); box-shadow: 0 8px 32px rgba(37,211,102,.65); }
.whatsapp-float-btn svg { width: 30px; height: 30px; fill: #fff; }
.whatsapp-float-label {
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  color: #fff; font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 99px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translateX(8px);
  transition: all var(--t-mid);
}
.whatsapp-float:hover .whatsapp-float-label { opacity: 1; transform: translateX(0); }
@media(max-width:600px) { .whatsapp-float { bottom: 18px; right: 16px; } .whatsapp-float-btn { width: 52px; height: 52px; } }

/* ── DRIVE CARD ──────────────────────────────────────────────── */
.drive-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; box-shadow: var(--shadow-xs); }
.drive-icon { width: 48px; height: 48px; background: #e8f0fe; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.drive-info h3 { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.drive-info p { font-size: 13px; color: var(--muted); }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty { text-align: center; padding: 52px 28px; }
.empty-icon { font-size: 44px; margin-bottom: 14px; opacity: .7; }
.empty-title { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 300; color: var(--ink); margin-bottom: 7px; }
.empty-desc { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ── MODAIS ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,31,61,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  animation: overlayIn .2s ease;
}
.modal-overlay.show { display: flex; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 28px;
  width: 100%; max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn .25s var(--ease);
  border: 1px solid rgba(221,226,234,.5);
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-title { font-family: 'Fraunces', serif; font-size: 21px; font-weight: 400; color: var(--ink); margin-bottom: 18px; letter-spacing: -.2px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* ── TOAST ───────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  background: rgba(15,31,61,.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff; padding: 13px 18px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: none; align-items: center; gap: 10px;
  max-width: 340px;
  border: 1px solid rgba(255,255,255,.08);
}
.toast.show { display: flex; animation: slideUp .28s var(--ease); }
.toast.success { border-left: 3px solid #25a244; }
.toast.error   { border-left: 3px solid var(--red); }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── LOADER ──────────────────────────────────────────────────── */
.loader {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading .loader { width: 32px; height: 32px; border-color: rgba(181,135,58,.25); border-top-color: var(--gold); }

/* ── DOCUMENTOS ──────────────────────────────────────────────── */
.docs-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.doc-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  transition: all var(--t-mid);
  box-shadow: var(--shadow-xs);
}
.doc-card:hover { box-shadow: var(--shadow-sm); border-color: rgba(181,135,58,.3); }
.doc-card.enviado { border-color: rgba(37,162,68,.3); background: rgba(37,162,68,.03); }
.doc-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.doc-icon { font-size: 22px; flex-shrink: 0; }
.doc-label { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.doc-status { font-size: 12px; color: var(--muted); }
.doc-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ── FINANCEIRO ──────────────────────────────────────────────── */
.fin-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 10px;
  transition: all var(--t-mid);
  box-shadow: var(--shadow-xs);
}
.fin-card:hover { box-shadow: var(--shadow-sm); transform: translateX(2px); }
.fin-card.status-pago     { border-left: 4px solid #25a244; background: rgba(37,162,68,.025); }
.fin-card.status-atrasado { border-left: 4px solid var(--red); background: rgba(229,62,62,.025); }
.fin-card.status-pendente { border-left: 4px solid var(--gold); background: rgba(181,135,58,.025); }
.fin-card-left  { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.fin-card-icon  { width: 44px; height: 44px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.fin-card-icon.pago     { background: rgba(37,162,68,.1); }
.fin-card-icon.atrasado { background: rgba(229,62,62,.1); }
.fin-card-icon.pendente { background: rgba(181,135,58,.1); }
.fin-card-desc  { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-card-meta  { font-size: 12px; color: var(--muted); }
.fin-card-right { text-align: right; flex-shrink: 0; }
.fin-card-valor { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 400; color: var(--ink); }
.fin-card-status { font-size: 11px; font-weight: 700; margin-top: 2px; }
.status-pago     .fin-card-status { color: #1e9447; }
.status-atrasado .fin-card-status { color: var(--red); }
.status-pendente .fin-card-status { color: var(--gold); }

/* ── ABAS FINANCEIRO ─────────────────────────────────────────── */
.fin-tab {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  font-family: 'DM Sans', sans-serif;
}
.fin-tab:hover { color: var(--ink); }
.fin-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── NOTIFICAÇÕES ────────────────────────────────────────────── */
.notif-btn {
  position: relative;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.75);
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.notif-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.notif-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  width: 17px; height: 17px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink);
  display: none;
}
.notif-panel {
  position: fixed; top: 60px; right: 0;
  width: 340px;
  background: var(--white);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 0 var(--r-lg);
  box-shadow: -4px 8px 32px rgba(0,0,0,.14);
  z-index: 150; display: none;
  max-height: 480px; overflow-y: auto;
  animation: panelIn .2s var(--ease);
}
.notif-panel.open { display: block; }
@keyframes panelIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@media(max-width:400px) { .notif-panel { width: 100%; border-radius: 0; } }
.notif-panel-header { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.notif-panel-title { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 400; color: var(--ink); }
.notif-marcar-tudo { font-size: 12px; color: var(--gold); cursor: pointer; font-weight: 600; border: none; background: none; }
.notif-item { padding: 13px 20px; border-bottom: 1px solid rgba(221,226,234,.5); display: flex; gap: 10px; align-items: flex-start; transition: background var(--t-fast); cursor: pointer; }
.notif-item:last-child { border-bottom: none; }
.notif-item.nao-lida { background: rgba(181,135,58,.04); }
.notif-item:hover { background: var(--stone); }
.notif-item-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.notif-item-body { flex: 1; }
.notif-item-titulo { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.notif-item-msg { font-size: 12px; color: var(--muted); line-height: 1.5; }
.notif-item-tempo { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; margin-top: 6px; }
.notif-empty { text-align: center; padding: 36px 20px; color: var(--muted); font-size: 14px; }

/* ── FAQ ─────────────────────────────────────────────────────── */
.faq-filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.faq-filtro {
  padding: 7px 18px; border-radius: 99px;
  font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--white); color: var(--muted);
  cursor: pointer; transition: all var(--t-mid);
}
.faq-filtro.active, .faq-filtro:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border-color: var(--gold); color: var(--ink);
  box-shadow: 0 2px 10px rgba(181,135,58,.25);
}
.faq-item { border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 10px; overflow: hidden; background: var(--white); box-shadow: var(--shadow-xs); }
.faq-pergunta { padding: 16px 20px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; transition: background var(--t-fast); }
.faq-pergunta:hover { background: var(--stone); }
.faq-pergunta .faq-arrow { font-size: 12px; color: var(--muted); transition: transform var(--t-mid); flex-shrink: 0; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-resposta { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq-item.open .faq-resposta { max-height: 500px; }
.faq-resposta-inner { padding: 4px 20px 18px; font-size: 13.5px; color: var(--muted); line-height: 1.8; }

/* ── PWA BANNER ──────────────────────────────────────────────── */
.pwa-banner {
  display: none;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink2) 100%);
  border: 1px solid rgba(181,135,58,.3);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  align-items: center; gap: 14px; flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}
.pwa-banner.show { display: flex; }
.pwa-banner-icon { font-size: 28px; flex-shrink: 0; }
.pwa-banner-text { flex: 1; min-width: 180px; }
.pwa-banner-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.pwa-banner-sub { font-size: 12px; color: rgba(255,255,255,.6); }
.pwa-banner-actions { display: flex; gap: 8px; }
.btn-pwa-install { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: var(--ink); border: none; padding: 8px 18px; border-radius: var(--r-sm); font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(181,135,58,.3); }
.btn-pwa-dismiss { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.7); padding: 8px 14px; border-radius: var(--r-sm); font-family: 'DM Sans', sans-serif; font-size: 13px; cursor: pointer; }

/* ── RODAPÉ SEGURANÇA ────────────────────────────────────────── */
.security-footer { background: var(--ink); margin-top: auto; overflow: hidden; }
@media(max-width:768px) { .security-footer { margin-left: 0; } }
.security-footer-alert {
  background: linear-gradient(160deg, #6b0f0f 0%, #b01e1e 45%, #8c1717 100%);
  padding: 28px 32px;
  display: flex; flex-direction: column;
  align-items: center; gap: 18px;
  text-align: center;
  border-top: 3px solid #e74c3c;
  box-shadow: inset 0 -4px 20px rgba(0,0,0,.3);
}
.security-footer-header { display: flex; align-items: center; gap: 12px; justify-content: center; }
.security-footer-shield { font-size: 36px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.security-footer-title { font-size: 20px; font-weight: 900; letter-spacing: 3px; text-transform: uppercase; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.5); line-height: 1.1; }
.security-footer-title small { display: block; font-size: 11px; font-weight: 600; letter-spacing: 2px; color: rgba(255,255,255,.75); margin-top: 2px; }
.security-footer-warning { background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.15); border-radius: var(--r-sm); padding: 14px 20px; max-width: 700px; width: 100%; }
.security-footer-warning p { font-size: 13px; color: #fff; line-height: 1.65; margin: 0; }
.security-footer-warning p strong { color: #ffcdd2; font-weight: 700; }
.security-footer-warning p + p { margin-top: 8px; }
.security-footer-divider { width: 100%; max-width: 700px; border: none; border-top: 1px solid rgba(255,255,255,.15); margin: 0; }
.security-footer-contacts-label { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: 4px; }
.security-footer-contacts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.security-footer-contact { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #fff; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.18); padding: 6px 14px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.security-footer-bottom { padding: 12px 28px; text-align: center; border-top: 1px solid rgba(255,255,255,.06); }
.security-footer-bottom-text { font-size: 11px; color: rgba(255,255,255,.25); }
@media(max-width:600px) { .security-footer-alert { padding: 20px 16px; gap: 14px; } .security-footer-title { font-size: 16px; letter-spacing: 2px; } .security-footer-contact { font-size: 12px; } .security-footer-warning p { font-size: 12px; } }

/* ── PRAZOS ──────────────────────────────────────────────────── */
.prazo-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 20px; display: flex; align-items: center; gap: 14px;
  margin-bottom: 10px; transition: all var(--t-mid); flex-wrap: wrap;
  box-shadow: var(--shadow-xs);
}
.prazo-card:hover { box-shadow: var(--shadow-sm); transform: translateX(2px); }
.prazo-card.urgente  { border-left: 4px solid var(--red);  background: rgba(229,62,62,.025); }
.prazo-card.proximo  { border-left: 4px solid #dd6b20; background: rgba(237,137,54,.025); }
.prazo-card.normal   { border-left: 4px solid var(--gold); background: rgba(181,135,58,.025); }
.prazo-card.cumprido { border-left: 4px solid #25a244; background: rgba(37,162,68,.025); opacity: .75; }
.prazo-badge-dias { width: 54px; height: 54px; border-radius: var(--r-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; }
.prazo-badge-dias.urgente { background: rgba(229,62,62,.12); color: var(--red); }
.prazo-badge-dias.proximo { background: rgba(237,137,54,.12); color: #dd6b20; }
.prazo-badge-dias.normal  { background: rgba(181,135,58,.12); color: var(--gold); }
.prazo-badge-dias.cumprido{ background: rgba(37,162,68,.1);  color: #25a244; }
.prazo-badge-num   { font-size: 20px; line-height: 1; }
.prazo-badge-label { font-size: 9px; letter-spacing: .5px; text-transform: uppercase; margin-top: 1px; }
.prazo-info    { flex: 1; min-width: 0; }
.prazo-titulo  { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.prazo-meta    { font-size: 12px; color: var(--muted); }
.prazo-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

/* ── GOV.BR ASSINADOR ────────────────────────────────────────── */
.govbr-doc-card { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow-xs); }
.govbr-doc-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.govbr-doc-icon { width: 42px; height: 42px; background: #e8f0fe; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.govbr-doc-info { flex: 1; min-width: 0; }
.govbr-doc-nome { font-size: 14px; font-weight: 600; color: var(--ink); }
.govbr-doc-data { font-size: 12px; color: var(--muted); margin-top: 2px; }
.govbr-doc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-govbr { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--r-sm); font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; border: none; background: #1351b4; color: #fff; transition: all var(--t-mid); }
.btn-govbr:hover { background: #0c326f; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(19,81,180,.3); }
.btn-govbr svg { flex-shrink: 0; }
.govbr-upload-area { border: 2px dashed var(--border); border-radius: var(--r-sm); padding: 14px 18px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: all var(--t-mid); background: var(--cream); }
.govbr-upload-area:hover { border-color: var(--gold); background: rgba(181,135,58,.04); }
.govbr-upload-area.has-file { border-color: #25a244; background: rgba(37,162,68,.04); }
.govbr-upload-icon { font-size: 22px; flex-shrink: 0; }
.govbr-upload-text { flex: 1; font-size: 13px; color: var(--muted); }
.govbr-upload-text strong { color: var(--ink); display: block; margin-bottom: 2px; }
.badge-assinado { background: rgba(37,162,68,.1); color: #1e9447; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; display: inline-flex; align-items: center; gap: 4px; }

/* ── POP / CHECKLIST ─────────────────────────────────────────── */
.pop-checklist { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.pop-item { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; transition: all var(--t-mid); box-shadow: var(--shadow-xs); }
.pop-item:hover { border-color: rgba(181,135,58,.3); }
.pop-item.enviado { border-color: rgba(37,162,68,.3); background: rgba(37,162,68,.03); }
.pop-item-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.pop-item-icon { font-size: 18px; flex-shrink: 0; }
.pop-item-nome { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pop-item-status { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pop-item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pop-section-title { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin: 22px 0 9px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }

/* ── UPLOAD MODAL ────────────────────────────────────────────── */
.upload-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); z-index: 300; display: none; align-items: flex-end; justify-content: center; padding: 0; }
.upload-modal-overlay.show { display: flex; }
.upload-modal { background: var(--white); border-radius: var(--r-xl) var(--r-xl) 0 0; width: 100%; max-width: 560px; padding: 28px; max-height: 85vh; overflow-y: auto; box-shadow: 0 -12px 50px rgba(0,0,0,.25); animation: sheetUp .3s var(--ease); }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media(min-width:600px) { .upload-modal-overlay { align-items: center; padding: 24px; } .upload-modal { border-radius: var(--r-xl); max-height: 90vh; animation: modalIn .28s var(--ease); } }
.upload-modal-title { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 400; color: var(--ink); margin-bottom: 4px; }
.upload-modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.upload-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; margin-bottom: 18px; }
.upload-preview-item { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; border: 1.5px solid var(--border); background: var(--stone); }
.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview-item .pdf-icon { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 28px; }
.upload-preview-item .pdf-label { font-size: 10px; color: var(--muted); text-align: center; padding: 0 4px; }
.upload-preview-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; background: var(--red); color: #fff; border: none; border-radius: 50%; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.upload-add-btn { border: 2px dashed var(--border); border-radius: var(--r-sm); aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-size: 24px; color: var(--muted); background: none; transition: all var(--t-mid); }
.upload-add-btn:hover { border-color: var(--gold); color: var(--gold); }
.upload-progress { background: var(--stone); border-radius: 99px; height: 6px; overflow: hidden; margin-bottom: 14px; display: none; }
.upload-progress-bar { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 99px; transition: width .3s ease; }

/* ── PHOTO VIEWER ────────────────────────────────────────────── */
.photo-viewer { position: fixed; inset: 0; background: rgba(0,0,0,.96); z-index: 400; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
.photo-viewer.show { display: flex; }
.photo-viewer img { max-width: 95vw; max-height: 75vh; object-fit: contain; border-radius: var(--r-sm); }
.photo-viewer-actions { display: flex; gap: 12px; }
.photo-quality-badge { position: absolute; bottom: 6px; left: 6px; padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; }
.quality-ok   { background: rgba(37,162,68,.9);  color: #fff; }
.quality-warn { background: rgba(237,137,54,.9); color: #fff; }
.quality-bad  { background: rgba(229,62,62,.9);  color: #fff; }

/* ── DOC VIEWER INLINE ───────────────────────────────────────── */
.doc-viewer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 500; display: none; flex-direction: column; }
.doc-viewer-overlay.show { display: flex; }
.doc-viewer-bar { height: 54px; background: rgba(15,31,61,.98); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0; border-bottom: 1px solid rgba(181,135,58,.2); }
.doc-viewer-nome { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; margin-right: 12px; }
.doc-viewer-body { flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 12px; }
.doc-viewer-body iframe { width: 100%; height: 100%; border: none; border-radius: var(--r-sm); background: #fff; }
.doc-viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-sm); }

/* ── CADASTRO ────────────────────────────────────────────────── */
#cadastro-screen { min-height: 100vh; display: none; align-items: flex-start; justify-content: center; background: var(--ink); padding: 80px 20px 40px; background-image: radial-gradient(ellipse at 70% 20%, rgba(181,135,58,.1) 0%, transparent 60%); }
.cadastro-card { background: var(--white); border-radius: var(--r-xl); padding: 38px; width: 100%; max-width: 600px; box-shadow: var(--shadow-xl); }
.cadastro-steps { display: flex; gap: 8px; margin-bottom: 30px; }
.cadastro-step { flex: 1; height: 4px; border-radius: 99px; background: var(--border); transition: background var(--t-mid); }
.cadastro-step.active { background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.cadastro-step.done   { background: #25a244; }
.qualificacao-box { background: var(--stone); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 18px 20px; font-size: 13.5px; line-height: 2; color: var(--ink); font-family: 'Times New Roman', serif; margin-top: 14px; }
.qualificacao-box strong { color: var(--gold); }

/* ── DOCS RECENTES ───────────────────────────────────────────── */
.doc-recente-item { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid rgba(221,226,234,.5); transition: background var(--t-fast); }
.doc-recente-item:last-child { border-bottom: none; }
.doc-recente-item:hover { background: var(--stone); }
.doc-recente-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold2)); color: var(--ink); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(181,135,58,.25); }
.doc-recente-info { flex: 1; min-width: 0; }
.doc-recente-nome { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-recente-doc  { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-recente-data { font-size: 11px; color: var(--muted); flex-shrink: 0; text-align: right; }
.doc-recente-new  { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }

/* ── AGENDA / CALENDÁRIO ─────────────────────────────────────── */
.agenda-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
@media(max-width:700px) { .agenda-grid { grid-template-columns: 1fr; } }
.cal-widget { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.cal-header { background: linear-gradient(135deg, var(--ink), var(--ink2)); color: #fff; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; }
.cal-header-title { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 300; letter-spacing: .5px; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button { background: rgba(255,255,255,.12); border: none; color: #fff; width: 30px; height: 30px; border-radius: var(--r-sm); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: background var(--t-fast); }
.cal-nav button:hover { background: rgba(255,255,255,.24); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--stone); }
.cal-weekday { text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding: 9px 0; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; border-radius: 50%; cursor: pointer; position: relative; margin: 2px; transition: all var(--t-fast); }
.cal-day:hover { background: var(--stone); }
.cal-day.today { background: linear-gradient(135deg, var(--ink), var(--ink2)); color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(15,31,61,.25); }
.cal-day.has-event::after { content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.cal-day.today.has-event::after { background: rgba(255,255,255,.8); }
.cal-day.other-month { color: var(--border); }
.cal-day.has-audiencia { background: rgba(181,135,58,.14); color: var(--gold); font-weight: 700; }
.cal-day.has-audiencia:hover { background: rgba(181,135,58,.26); }
.alertas-widget { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.alertas-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.alertas-header-title { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 400; color: var(--ink); }
.alerta-item { padding: 14px 20px; border-bottom: 1px solid rgba(221,226,234,.5); display: flex; gap: 12px; align-items: flex-start; cursor: pointer; transition: background var(--t-fast); }
.alerta-item:last-child { border-bottom: none; }
.alerta-item:hover { background: var(--stone); }
.alerta-urgente { border-left: 3px solid var(--red); }
.alerta-proximo { border-left: 3px solid var(--gold); }
.alerta-normal  { border-left: 3px solid var(--border); }
.alerta-icon  { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.alerta-info  { flex: 1; }
.alerta-cliente { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.alerta-tipo    { font-size: 12px; color: var(--muted); margin-top: 1px; }
.alerta-data    { font-size: 12px; font-weight: 600; margin-top: 4px; }
.alerta-data.urgente { color: var(--red); }
.alerta-data.proximo { color: var(--gold); }
.alerta-data.normal  { color: var(--muted); }
.cal-empty { text-align: center; padding: 36px; color: var(--muted); font-size: 13px; }

/* ── ATENDIMENTOS ────────────────────────────────────────────── */
.btn-tipo-atend {
  background: var(--white); border: 2px solid var(--border);
  border-radius: var(--r-md); padding: 26px 18px;
  cursor: pointer; transition: all var(--t-mid);
  text-align: center; font-family: 'DM Sans', sans-serif; color: var(--ink); width: 100%;
  box-shadow: var(--shadow-xs);
}
.btn-tipo-atend:hover { border-color: var(--gold); background: rgba(181,135,58,.04); box-shadow: var(--shadow-sm); }
.btn-tipo-atend.active { border-color: var(--gold); background: rgba(181,135,58,.08); color: var(--gold); }
.doc-gerado-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(37,162,68,.06); border: 1px solid rgba(37,162,68,.2); border-radius: var(--r-sm); margin-bottom: 8px; font-size: 14px; }
.doc-gerado-item a { color: var(--gold); font-weight: 600; text-decoration: none; margin-left: auto; transition: color var(--t-fast); }
.doc-gerado-item a:hover { color: var(--gold2); }

/* ── PROCESSO DETALHE GRID (mobile) ─────────────────────────── */
@media(max-width:768px) { #proc-det-grid { grid-template-columns: 1fr; } }

/* ── PAGINAÇÃO ───────────────────────────────────────────────── */
.paginacao { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 8px 0; }
.paginacao-btn {
  min-width: 34px; height: 34px; padding: 0 10px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 13px; font-weight: 500;
  color: var(--ink); cursor: pointer;
  transition: all var(--t-fast);
  display: flex; align-items: center; justify-content: center;
}
.paginacao-btn:hover { border-color: var(--gold); color: var(--gold); }
.paginacao-btn.active {
  background: linear-gradient(135deg, var(--ink), var(--ink2));
  color: #fff; border-color: transparent;
  box-shadow: var(--shadow-sm);
}
.paginacao-btn:disabled { opacity: .4; pointer-events: none; }
.paginacao-info { font-size: 12px; color: var(--muted); padding: 0 6px; }

/* ── CHAT / MENSAGENS ────────────────────────────────────────── */
.msg-conversa-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid rgba(221,226,234,.4);
  transition: background var(--t-fast);
}
.msg-conversa-item:hover { background: var(--stone); }
.msg-conversa-item.ativo { background: rgba(181,135,58,.08); }
.msg-conversa-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ink), var(--ink2));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0; color: #fff;
}
.msg-conversa-info { flex: 1; min-width: 0; }
.msg-conversa-nome { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.msg-conversa-preview { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-conversa-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.msg-conversa-hora { font-size: 11px; color: var(--muted); }
.msg-unread-badge {
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
  min-width: 18px; text-align: center;
}
.msg-balao {
  max-width: 72%; padding: 10px 14px;
  border-radius: var(--r-lg); font-size: 14px;
  line-height: 1.5; word-break: break-word;
}
.msg-balao-enviado {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--ink), var(--ink2));
  color: #fff; border-bottom-right-radius: 4px;
}
.msg-balao-recebido {
  align-self: flex-start;
  background: var(--stone); color: var(--ink);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg-balao-hora { font-size: 11px; opacity: .6; margin-top: 4px; display: block; text-align: right; }
.msg-empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; }

/* ── HORAS / TIME-TRACKING ───────────────────────────────────── */
.horas-total-chip {
  background: rgba(181,135,58,.12); color: var(--gold);
  font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  border: 1px solid rgba(181,135,58,.25);
}

/* ── SKELETON LOADING ────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--stone) 25%, var(--border) 50%, var(--stone) 75%);
  background-size: 1200px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
  display: block;
}
.skeleton-line  { height: 14px; margin-bottom: 10px; }
.skeleton-line:last-child { width: 60%; }
.skeleton-title { height: 20px; margin-bottom: 14px; width: 55%; }
.skeleton-card  {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.skeleton-card .skeleton-title  { border-radius: var(--r-sm); }
.skeleton-card .skeleton-line   { border-radius: var(--r-sm); }
.skeleton-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── DARK MODE (Dark Luxury — igual ao site institucional) ─────── */
[data-theme="dark"] {
  /* Palette exato do site institucional */
  --ink:    #e8ddc8;              /* cream — texto principal */
  --ink2:   #ffffff;
  --gold:   #c4913f;              /* gold institucional */
  --gold2:  #e0b155;
  --gold3:  #f0d080;
  --cream:  rgba(255,255,255,.04);/* fundo de inputs */
  --stone:  #111e35;              /* hover / elemento */
  --muted:  rgba(232,221,200,.45);
  --border: rgba(255,255,255,.07);
  --white:  #0c1526;              /* fundo dos cards */
  --blue:   #2d5be3;
  --blue-chat: #3d6ef5;
  --green:  #25d366;
  --red:    #f87171;

  --shadow-xs:  0 1px 3px rgba(0,0,0,.40), 0 1px 2px rgba(0,0,0,.30);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.50), 0 1px 3px rgba(0,0,0,.30);
  --shadow-md:  0 4px 16px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.30);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.65), 0 4px 12px rgba(0,0,0,.35);
  --shadow-xl:  0 24px 64px rgba(0,0,0,.75), 0 8px 24px rgba(0,0,0,.40);
  --shadow-gold: 0 4px 20px rgba(196,145,63,.25);
}

/* ── DARK MODE — overrides globais ──────────────────────────── */
[data-theme="dark"] body {
  background: #070d1a;
  color: var(--ink);
}
/* Grain overlay igual ao site */
[data-theme="dark"] body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999; opacity: .03;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px;
}
[data-theme="dark"] #loading { background: #070d1a; }
[data-theme="dark"] .topbar {
  background: rgba(7,13,26,.92);
  border-bottom-color: rgba(196,145,63,.2);
  box-shadow: 0 1px 24px rgba(0,0,0,.4);
}
[data-theme="dark"] .sidebar {
  background: #0c1526;
  border-right: 1px solid rgba(255,255,255,.06);
}
[data-theme="dark"] .sidebar-section { color: rgba(196,145,63,.4); }
[data-theme="dark"] .sidebar-item { color: rgba(232,221,200,.5); }
[data-theme="dark"] .sidebar-item:hover { background: rgba(255,255,255,.05); color: var(--ink); }
[data-theme="dark"] .sidebar-item.active {
  background: linear-gradient(135deg, rgba(196,145,63,.14), rgba(196,145,63,.06));
  color: var(--gold);
  box-shadow: inset 2px 0 0 var(--gold);
}
[data-theme="dark"] .sidebar-divider { background: rgba(255,255,255,.06); }
[data-theme="dark"] .main { background: #070d1a; }
[data-theme="dark"] .page-title { color: var(--ink); }
[data-theme="dark"] .page-sub { color: var(--muted); }

/* Cards */
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .doc-card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .fin-card,
[data-theme="dark"] .prazo-card,
[data-theme="dark"] .recorte-card,
[data-theme="dark"] .audiencias-widget,
[data-theme="dark"] .alertas-widget,
[data-theme="dark"] .cal-widget,
[data-theme="dark"] .tipo-card,
[data-theme="dark"] .pop-item,
[data-theme="dark"] .govbr-doc-card,
[data-theme="dark"] .drive-card,
[data-theme="dark"] .paginacao-btn,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .modal,
[data-theme="dark"] .notif-panel,
[data-theme="dark"] .upload-modal,
[data-theme="dark"] .cadastro-card {
  background: var(--white);
  border-color: var(--border);
}
[data-theme="dark"] .card-header { background: rgba(255,255,255,.02); }
[data-theme="dark"] .card-title { color: var(--ink); }

/* Tabelas */
[data-theme="dark"] th { background: #111e35; color: var(--muted); border-bottom-color: var(--border); }
[data-theme="dark"] td { color: var(--ink); border-bottom-color: rgba(255,255,255,.04); }
[data-theme="dark"] tr:hover td { background: rgba(196,145,63,.04); }

/* Inputs — usa background-color para não resetar background-image dos selects */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .fg input,
[data-theme="dark"] .fg select,
[data-theme="dark"] .fg textarea,
[data-theme="dark"] .fg-login input,
[data-theme="dark"] .filtro-select,
[data-theme="dark"] .filtro-input {
  background-color: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.1);
  color: var(--ink);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: rgba(232,221,200,.25); }
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  border-color: var(--gold);
  background-color: rgba(255,255,255,.06);
  box-shadow: 0 0 0 3px rgba(196,145,63,.12);
}
/* Seta dourada nos selects — preserva background-repeat e background-position do base CSS */
[data-theme="dark"] .fg select,
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23e0b155' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

/* Botões secundários */
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .filtro-btn,
[data-theme="dark"] .filtro-btn:not(.active) {
  background: rgba(255,255,255,.05);
  color: var(--ink);
  border-color: var(--border);
}
[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .filtro-btn:hover { background: rgba(255,255,255,.1); border-color: var(--gold); }
[data-theme="dark"] .filtro-btn.active { background: var(--gold); color: #070d1a; border-color: var(--gold); }

/* Paginação */
[data-theme="dark"] .paginacao-btn { color: var(--ink); }
[data-theme="dark"] .paginacao-btn:hover { border-color: var(--gold); color: var(--gold); }
[data-theme="dark"] .paginacao-btn.active { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #070d1a; border-color: transparent; }

/* Tipo card selecionado */
[data-theme="dark"] .tipo-card.selected { background: linear-gradient(135deg, rgba(196,145,63,.2), rgba(196,145,63,.1)); border-color: var(--gold); color: var(--gold); }
[data-theme="dark"] .tipo-card.selected div { color: var(--gold) !important; }

/* Etapas */
[data-theme="dark"] .etapa-circulo { background: #111e35; border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .etapa-circulo.atual { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(196,145,63,.2); }
[data-theme="dark"] .etapa-nome.concluida,
[data-theme="dark"] .etapa-nome.atual { color: var(--ink); }
[data-theme="dark"] .etapa-badge-atual { background: var(--gold); color: #070d1a; }

/* FAQ */
[data-theme="dark"] .faq-pergunta { color: var(--ink); }
[data-theme="dark"] .faq-pergunta:hover { background: rgba(255,255,255,.04); }
[data-theme="dark"] .faq-filtro { background: rgba(255,255,255,.04); color: var(--muted); border-color: var(--border); }

/* Notificações */
[data-theme="dark"] .notif-panel-title { color: var(--ink); }
[data-theme="dark"] .notif-item:hover { background: rgba(255,255,255,.04); }
[data-theme="dark"] .notif-item-titulo { color: var(--ink); }
[data-theme="dark"] .notif-item.nao-lida { background: rgba(196,145,63,.06); }
[data-theme="dark"] .notif-panel-header { border-bottom-color: var(--border); }

/* Chat */
[data-theme="dark"] .msg-conversa-item:hover { background: rgba(255,255,255,.04); }
[data-theme="dark"] .msg-conversa-nome { color: var(--ink); }
[data-theme="dark"] .msg-balao-enviado { background: linear-gradient(135deg, #0c1526, #111e35); border: 1px solid rgba(196,145,63,.2); }
[data-theme="dark"] .msg-balao-recebido { background: #111e35; border-color: var(--border); color: var(--ink); }

/* Calendário */
[data-theme="dark"] .cal-weekdays { background: #111e35; }
[data-theme="dark"] .cal-day:hover { background: rgba(255,255,255,.06); }
[data-theme="dark"] .cal-day.today { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #070d1a; }

/* Finanças */
[data-theme="dark"] .fin-card-desc,
[data-theme="dark"] .fin-card-valor { color: var(--ink); }

/* Login / Auth screens — sempre escuros */
[data-theme="dark"] #login-screen,
[data-theme="dark"] #reset-screen,
[data-theme="dark"] #cadastro-screen {
  background: #070d1a;
  background-image:
    radial-gradient(ellipse at 65% 35%, rgba(196,145,63,.1) 0%, transparent 55%),
    radial-gradient(ellipse at 15% 80%, rgba(196,145,63,.06) 0%, transparent 50%);
}
[data-theme="dark"] .login-card,
[data-theme="dark"] .cadastro-card { background: #0c1526; border: 1px solid rgba(255,255,255,.07); }
[data-theme="dark"] .login-logo-nome { color: var(--ink); }
[data-theme="dark"] .login-title { color: var(--ink); }

/* Skeleton */
[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #111e35 25%, #1a2d4a 50%, #111e35 75%);
  background-size: 1200px 100%;
}
[data-theme="dark"] .skeleton-card { background: #0c1526; border-color: rgba(255,255,255,.07); }

/* Scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(196,145,63,.4); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* Misc */
[data-theme="dark"] .section-divider { color: var(--muted); border-bottom-color: var(--border); }
[data-theme="dark"] .empty-title { color: var(--ink); }
[data-theme="dark"] .modal-title { color: var(--ink); }
[data-theme="dark"] .upload-modal-title { color: var(--ink); }
[data-theme="dark"] .modal { border-color: rgba(255,255,255,.07); }
[data-theme="dark"] #btn-dark-mode { color: var(--gold); }
[data-theme="dark"] .qualificacao-box { background: #111e35; border-color: var(--border); color: var(--ink); }
[data-theme="dark"] .menor-card { background: #111e35; border-color: var(--border); }
[data-theme="dark"] .menor-card-nome { color: var(--ink); }
[data-theme="dark"] .recorte-meta-value { color: var(--ink); }
[data-theme="dark"] .recorte-polo-nomes { color: var(--ink); }
[data-theme="dark"] .recorte-texto-pub { background: #111e35; }
[data-theme="dark"] .recorte-texto-pub::after { background: linear-gradient(transparent, #111e35 60%); }
[data-theme="dark"] .prazo-titulo { color: var(--ink); }
[data-theme="dark"] .audiencia-cliente { color: var(--ink); }
[data-theme="dark"] .alerta-cliente { color: var(--ink); }
[data-theme="dark"] .alertas-header-title { color: var(--ink); }
[data-theme="dark"] .doc-recente-nome { color: var(--ink); }
[data-theme="dark"] .drive-info h3 { color: var(--ink); }
[data-theme="dark"] .hist-doc-nome { color: var(--ink); }
[data-theme="dark"] .govbr-upload-area { background: rgba(255,255,255,.03); }
[data-theme="dark"] .govbr-upload-text strong { color: var(--ink); }
[data-theme="dark"] .pop-item-nome { color: var(--ink); }
[data-theme="dark"] .doc-label { color: var(--ink); }

/* Transição suave ao trocar tema */
*, *::before, *::after {
  transition: background-color .25s ease, border-color .25s ease, color .15s ease;
}
/* Excluir elementos que NÃO devem transicionar (evita flash em animações) */
.skeleton, .skeleton *, canvas, img, video,
.btn, button, a, input, select, textarea {
  transition: background .15s, border-color .15s, color .1s, box-shadow var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
}

/* ── Acordos e Repasses ── */
.cal-day.has-parcela { box-shadow: inset 0 0 0 2px rgba(181,135,58,.55); font-weight: 700; }
.cal-day.has-parcela-atrasada { box-shadow: inset 0 0 0 2px rgba(229,62,62,.65); color: var(--red); font-weight: 700; }
.acordo-table, #proc-det-acordos table { border-collapse: collapse; font-size: 13px; }
#proc-det-acordos th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
#proc-det-acordos td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
#proc-det-acordos tr:last-child td { border-bottom: none; }

/* ── Dashboard: agenda mais compacta e listas com rolagem ── */
.agenda-grid { gap: 16px; margin-bottom: 16px; }
.cal-widget .cal-days { padding: 5px; }
.cal-widget .cal-day { font-size: 12px; margin: 1px; }
/* "Próximos 7 dias" (audiências) — mostra ~4 itens e rola o restante */
#alertas-lista { max-height: 264px; overflow-y: auto; }
/* "Vencimentos — próximos 7 dias" (financeiro) — idem */
#vencimentos-semana { max-height: 264px; overflow-y: auto; }
/* Clientes em atraso — mesma altura para alinhar a linha */
#ranking-inadimplentes { max-height: 264px; overflow-y: auto; }

/* ── Calendário da Agenda: dias em círculos compactos (não ocupar a coluna toda) ── */
.cal-day { aspect-ratio: auto !important; width: 34px; height: 34px; margin: 3px auto !important; font-size: 12px; }
.cal-days { padding: 6px 4px; }
.cal-header { padding: 12px 16px; }
/* Gráfico de 6 meses um pouco mais baixo */
#chart-6meses-inadimpl { max-height: 200px; }

/* ── Ajuste fino v2: agenda ~5 linhas + gráfico preenchendo o card ── */
.cal-widget, .alertas-widget { height: 344px; }
#alertas-lista { max-height: 292px; overflow-y: auto; }
.cal-widget .cal-days { padding: 4px; }
.cal-day { width: 30px !important; height: 30px !important; margin: 2px auto !important; font-size: 12px; }
/* gráfico de 6 meses agora acompanha a altura das duas colunas (sem limite fixo) */
#chart-6meses-inadimpl { max-height: none !important; }

/* ── Ajuste fino v3: itens de audiência compactos (2 linhas) p/ caber ~5 ── */
.alerta-item { align-items: flex-start; }
.alerta-tipo { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.cal-widget, .alertas-widget { height: 400px; }
#alertas-lista { max-height: 352px; overflow-y: auto; }
.cal-day { width: 32px !important; height: 32px !important; }

/* ── Ajuste fino v4: dias do calendário preenchem o quadro ── */
.cal-widget { display: flex; flex-direction: column; }
.cal-widget .cal-days { flex: 1; align-content: space-evenly; }
.cal-day { width: 40px !important; height: 40px !important; font-size: 13px; margin: 0 auto !important; }

/* =====================================
   ACESSIBILIDADE — indicador de foco (WCAG 2.2 AA)
   Não usa :focus puro para não exibir o anel em cliques de mouse;
   :focus-visible cobre navegação por teclado.
===================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.sidebar-item:focus-visible,
.hamburger-app:focus-visible,
.modal-close:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid var(--gold2);
  outline-offset: 2px;
  border-radius: 6px;
}
.modal:focus-visible { outline: none; } /* recebe foco programático ao abrir, sem anel visual no container */

/* =====================================
   UTILITÁRIOS — espaçamento e tipografia
   Substituem os padrões de style="" mais repetidos no HTML,
   mantendo os valores idênticos (nenhuma mudança visual).
===================================== */
.u-hidden { display: none; }
.u-mb-8  { margin-bottom: 8px; }
.u-mb-10 { margin-bottom: 10px; }
.u-mb-12 { margin-bottom: 12px; }
.u-mb-14 { margin-bottom: 14px; }
.u-mb-16 { margin-bottom: 16px; }
.u-mb-18 { margin-bottom: 18px; }
.u-mb-20 { margin-bottom: 20px; }
.u-mt-14 { margin-top: 14px; }
.u-mt-16 { margin-top: 16px; }
.u-m-0   { margin: 0; }
.u-pad-16-20 { padding: 16px 20px; }
.u-pad-14-18 { padding: 14px 18px; }
.u-pad-18    { padding: 18px; }
.u-pad-18-20 { padding: 18px 20px; }
.u-pad-12-20 { padding: 12px 20px; }
.u-grid-full { grid-column: 1/-1; }
.u-text-muted-sm { font-size: 12px; color: var(--muted); }
.u-text-muted-sm.u-mt-4 { margin-top: 4px; }
.u-text-muted-sm.u-mt-3 { margin-top: 3px; }
.u-mt-4 { margin-top: 4px; }
.u-mt-3 { margin-top: 3px; }
.u-fw700-14 { font-weight: 700; font-size: 14px; }
.u-empty-state { text-align: center; color: var(--muted); padding: 24px; }
