/* ============================================================
   KJ Advogados — Design System v5 "Exclusivo" — grafite, grão e molduras hairline
   Inter (UI) + Bricolage Grotesque (títulos de destaque).
   Sidebar escura grafite neutro, grafite monocromático, cor só nos status.
   Todas as cores vivem AQUI, em tokens.
   ============================================================ */

:root {
  --primary:        #212529;
  --primary-2:      #33383f;              /* topo do gradiente dourado */
  --primary-hover:  #0d0f12;
  --primary-soft:   rgba(33, 37, 41, .11);
  --primary-claro:  #e8eaed;
  --grad-ouro:      linear-gradient(135deg, #33383f 0%, #212529 55%, #101215 100%);

  --bg:             #f2f3f7;
  --bg-2:           #e9ebf1;
  --card:           #ffffff;
  --text:           #171d2b;
  --text-2:         #6b7385;
  --border:         #e5e7ee;
  --borda-suave:    rgba(23, 29, 43, .05);

  --escuro-1:       #0e0f12;
  --escuro-2:       #141519;
  --escuro-3:       #212329;
  --escuro-borda:   rgba(143, 147, 156, .13);
  --escuro-texto:   #8f939c;
  --escuro-texto-2: #e6eaf2;

  --danger:         #d64545;
  --danger-soft:    rgba(214, 69, 69, .09);
  --warn:           #d9822b;
  --warn-soft:      rgba(217, 130, 43, .11);
  --ok:             #2f9e5f;
  --ok-soft:        rgba(47, 158, 95, .11);
  --info:           #3b6fd4;
  --info-soft:      rgba(59, 111, 212, .09);
  --roxo:           #5e6b85;
  --roxo-soft:      rgba(94, 107, 133, .1);

  --shadow:         0 1px 2px rgba(23, 29, 43, .03), 0 10px 30px -12px rgba(23, 29, 43, .1);
  --shadow-hover:   0 2px 4px rgba(23, 29, 43, .04), 0 18px 44px -14px rgba(23, 29, 43, .18);
  --shadow-lg:      0 30px 80px -20px rgba(14, 15, 18, .4);
  --radius:         18px;
  --radius-sm:      12px;
  --radius-lg:      22px;
  --sidebar-w:      252px;
  --mola:           cubic-bezier(.32, 1.4, .5, 1);   /* curva "springy" estilo Apple */
  --realce:         inset 0 1px 0 rgba(255, 255, 255, .65);   /* luz de cima nos cards */

  --serif: 'Bricolage Grotesque', 'Manrope', 'Inter', sans-serif;   /* fonte de destaque (títulos) */
}

[data-theme="dark"] {
  --primary:        #e8eaed;
  --primary-2:      #ffffff;
  --primary-hover:  #ffffff;
  --primary-soft:   rgba(210, 214, 220, .13);
  --grad-ouro:      linear-gradient(135deg, #ffffff 0%, #e8eaed 55%, #c9ccd2 100%);

  --bg:             #0e0f12;
  --bg-2:           #121316;
  --card:           #191b1f;
  --text:           #e6eaf2;
  --text-2:         #8f939c;
  --border:         #2a2d34;
  --borda-suave:    rgba(230, 234, 242, .04);

  --danger:         #f08a8a;
  --danger-soft:    rgba(240, 138, 138, .12);
  --warn:           #f0b464;
  --warn-soft:      rgba(240, 180, 100, .12);
  --ok:             #6fd39c;
  --ok-soft:        rgba(111, 211, 156, .12);
  --info:           #85a9f0;
  --info-soft:      rgba(133, 169, 240, .11);
  --roxo:           #9aa8c7;
  --roxo-soft:      rgba(154, 168, 199, .12);

  --shadow:         0 1px 2px rgba(0, 0, 0, .35), 0 8px 28px -8px rgba(0, 0, 0, .45);
  --shadow-hover:   0 2px 4px rgba(0, 0, 0, .4), 0 16px 40px -10px rgba(0, 0, 0, .6);
  --shadow-lg:      0 24px 70px -18px rgba(0, 0, 0, .7);
  --realce:         inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* ============================================================
   Temas de cor (Configurações → Aparência)
   O grafite é o padrão, definido acima em :root / [data-theme="dark"].
   Os 4 temas abaixo só trocam o acento --primary*; superfícies,
   status e o preto da sidebar continuam os mesmos em todos.
   ============================================================ */
[data-tema="dourado"] {
  --primary: #b08d57; --primary-2: #c9a76b; --primary-hover: #8f7142;
  --primary-soft: rgba(176, 141, 87, .11); --primary-claro: #d6b878;
  --grad-ouro: linear-gradient(135deg, #c9a76b 0%, #b08d57 55%, #9a7947 100%);
}
[data-theme="dark"][data-tema="dourado"] {
  --primary: #d6b878; --primary-2: #e4cd94; --primary-hover: #ecd8a6;
  --primary-soft: rgba(214, 184, 120, .13);
  --grad-ouro: linear-gradient(135deg, #e4cd94 0%, #d6b878 55%, #bfa05e 100%);
}

[data-tema="esmeralda"] {
  --primary: #1e7a5a; --primary-2: #2a9270; --primary-hover: #166046;
  --primary-soft: rgba(30, 122, 90, .11); --primary-claro: #38b287;
  --grad-ouro: linear-gradient(135deg, #2a9270 0%, #1e7a5a 55%, #155c43 100%);
}
[data-theme="dark"][data-tema="esmeralda"] {
  --primary: #38b287; --primary-2: #4cc79a; --primary-hover: #5fd3ab;
  --primary-soft: rgba(56, 178, 135, .13);
  --grad-ouro: linear-gradient(135deg, #4cc79a 0%, #38b287 55%, #2f9e77 100%);
}

[data-tema="safira"] {
  --primary: #3457a6; --primary-2: #5b7dcf; --primary-hover: #28437f;
  --primary-soft: rgba(52, 87, 166, .11); --primary-claro: #7e9fe0;
  --grad-ouro: linear-gradient(135deg, #5b7dcf 0%, #3457a6 55%, #28437f 100%);
}
[data-theme="dark"][data-tema="safira"] {
  --primary: #8aa8e6; --primary-2: #a8c0f0; --primary-hover: #b9cdf5;
  --primary-soft: rgba(138, 168, 230, .13);
  --grad-ouro: linear-gradient(135deg, #a8c0f0 0%, #8aa8e6 55%, #6f92d8 100%);
}

[data-tema="bordo"] {
  --primary: #8a3344; --primary-2: #a8465a; --primary-hover: #6c2837;
  --primary-soft: rgba(138, 51, 68, .11); --primary-claro: #c17f8c;
  --grad-ouro: linear-gradient(135deg, #a8465a 0%, #8a3344 55%, #6c2837 100%);
}
[data-theme="dark"][data-tema="bordo"] {
  --primary: #d99aa8; --primary-2: #e6b7c1; --primary-hover: #edc7ce;
  --primary-soft: rgba(217, 154, 168, .13);
  --grad-ouro: linear-gradient(135deg, #e6b7c1 0%, #d99aa8 55%, #c17f8c 100%);
}

[data-tema="ametista"] {
  --primary: #7c3aed; --primary-2: #9560f0; --primary-hover: #6425c9;
  --primary-soft: rgba(124, 58, 237, .11); --primary-claro: #b498f0;
  --grad-ouro: linear-gradient(135deg, #9560f0 0%, #7c3aed 55%, #6425c9 100%);
}
[data-theme="dark"][data-tema="ametista"] {
  --primary: #b79df5; --primary-2: #c9b6f8; --primary-hover: #d6c8fa;
  --primary-soft: rgba(183, 157, 245, .14);
  --grad-ouro: linear-gradient(135deg, #c9b6f8 0%, #b79df5 55%, #9f7ff0 100%);
}

[data-tema="ambar"] {
  --primary: #c2790a; --primary-2: #e0921d; --primary-hover: #9c6008;
  --primary-soft: rgba(194, 121, 10, .12); --primary-claro: #e8b45f;
  --grad-ouro: linear-gradient(135deg, #e0921d 0%, #c2790a 55%, #9c6008 100%);
}
[data-theme="dark"][data-tema="ambar"] {
  --primary: #ecb44f; --primary-2: #f2c66f; --primary-hover: #f6d38a;
  --primary-soft: rgba(236, 180, 79, .14);
  --grad-ouro: linear-gradient(135deg, #f2c66f 0%, #ecb44f 55%, #dda23a 100%);
}

[data-tema="turquesa"] {
  --primary: #0d9488; --primary-2: #16b3a4; --primary-hover: #0a726a;
  --primary-soft: rgba(13, 148, 136, .11); --primary-claro: #5fcec2;
  --grad-ouro: linear-gradient(135deg, #16b3a4 0%, #0d9488 55%, #0a726a 100%);
}
[data-theme="dark"][data-tema="turquesa"] {
  --primary: #4fd1c4; --primary-2: #72dcd1; --primary-hover: #93e5dc;
  --primary-soft: rgba(79, 209, 196, .14);
  --grad-ouro: linear-gradient(135deg, #72dcd1 0%, #4fd1c4 55%, #34bdaf 100%);
}

[data-tema="rubi"] {
  --primary: #be123c; --primary-2: #e11d48; --primary-hover: #9a0f31;
  --primary-soft: rgba(190, 18, 60, .1); --primary-claro: #e8607f;
  --grad-ouro: linear-gradient(135deg, #e11d48 0%, #be123c 55%, #9a0f31 100%);
}
[data-theme="dark"][data-tema="rubi"] {
  --primary: #f2758f; --primary-2: #f596a9; --primary-hover: #f8b0bf;
  --primary-soft: rgba(242, 117, 143, .14);
  --grad-ouro: linear-gradient(135deg, #f596a9 0%, #f2758f 55%, #ec5876 100%);
}

[data-tema="indigo"] {
  --primary: #4f46e5; --primary-2: #6a63ea; --primary-hover: #3f38c4;
  --primary-soft: rgba(79, 70, 229, .1); --primary-claro: #9a94f0;
  --grad-ouro: linear-gradient(135deg, #6a63ea 0%, #4f46e5 55%, #3f38c4 100%);
}
[data-theme="dark"][data-tema="indigo"] {
  --primary: #a5a0f5; --primary-2: #bcb8f8; --primary-hover: #cfccfa;
  --primary-soft: rgba(165, 160, 245, .14);
  --grad-ouro: linear-gradient(135deg, #bcb8f8 0%, #a5a0f5 55%, #8b84f0 100%);
}

[data-tema="rosa"] {
  --primary: #db2777; --primary-2: #ec4d93; --primary-hover: #b31c60;
  --primary-soft: rgba(219, 39, 119, .1); --primary-claro: #f483b6;
  --grad-ouro: linear-gradient(135deg, #ec4d93 0%, #db2777 55%, #b31c60 100%);
}
[data-theme="dark"][data-tema="rosa"] {
  --primary: #f0a0c5; --primary-2: #f6b8d3; --primary-hover: #f9cbde;
  --primary-soft: rgba(240, 160, 197, .14);
  --grad-ouro: linear-gradient(135deg, #f6b8d3 0%, #f0a0c5 55%, #e87fb0 100%);
}

[data-tema="cobre"] {
  --primary: #b45309; --primary-2: #d97516; --primary-hover: #8f4207;
  --primary-soft: rgba(180, 83, 9, .11); --primary-claro: #e89a52;
  --grad-ouro: linear-gradient(135deg, #d97516 0%, #b45309 55%, #8f4207 100%);
}
[data-theme="dark"][data-tema="cobre"] {
  --primary: #eca86a; --primary-2: #f0b688; --primary-hover: #f4c7a1;
  --primary-soft: rgba(236, 168, 106, .14);
  --grad-ouro: linear-gradient(135deg, #f0b688 0%, #eca86a 55%, #de914a 100%);
}

[data-tema="oliva"] {
  --primary: #5f7a1e; --primary-2: #79982c; --primary-hover: #4a6016;
  --primary-soft: rgba(95, 122, 30, .12); --primary-claro: #a3c05a;
  --grad-ouro: linear-gradient(135deg, #79982c 0%, #5f7a1e 55%, #4a6016 100%);
}
[data-theme="dark"][data-tema="oliva"] {
  --primary: #b3cc6f; --primary-2: #c5da8c; --primary-hover: #d3e4a4;
  --primary-soft: rgba(179, 204, 111, .14);
  --grad-ouro: linear-gradient(135deg, #c5da8c 0%, #b3cc6f 55%, #9cba52 100%);
}

[data-tema="petroleo"] {
  --primary: #0e7490; --primary-2: #1793b5; --primary-hover: #0a5a70;
  --primary-soft: rgba(14, 116, 144, .11); --primary-claro: #55b7d4;
  --grad-ouro: linear-gradient(135deg, #1793b5 0%, #0e7490 55%, #0a5a70 100%);
}
[data-theme="dark"][data-tema="petroleo"] {
  --primary: #62c3dd; --primary-2: #84d1e6; --primary-hover: #a0dcee;
  --primary-soft: rgba(98, 195, 221, .14);
  --grad-ouro: linear-gradient(135deg, #84d1e6 0%, #62c3dd 55%, #41aecb 100%);
}

[data-tema="floresta"] {
  --primary: #166534; --primary-2: #1f8445; --primary-hover: #104d27;
  --primary-soft: rgba(22, 101, 52, .11); --primary-claro: #4dab6f;
  --grad-ouro: linear-gradient(135deg, #1f8445 0%, #166534 55%, #104d27 100%);
}
[data-theme="dark"][data-tema="floresta"] {
  --primary: #6ec492; --primary-2: #8cd1a9; --primary-hover: #a5dcbc;
  --primary-soft: rgba(110, 196, 146, .14);
  --grad-ouro: linear-gradient(135deg, #8cd1a9 0%, #6ec492 55%, #52b27a 100%);
}

[data-tema="marinho"] {
  --primary: #1e3a8a; --primary-2: #2c4fae; --primary-hover: #172c6b;
  --primary-soft: rgba(30, 58, 138, .1); --primary-claro: #6a83cf;
  --grad-ouro: linear-gradient(135deg, #2c4fae 0%, #1e3a8a 55%, #172c6b 100%);
}
[data-theme="dark"][data-tema="marinho"] {
  --primary: #92a8e8; --primary-2: #aebff0; --primary-hover: #c2cff5;
  --primary-soft: rgba(146, 168, 232, .14);
  --grad-ouro: linear-gradient(135deg, #aebff0 0%, #92a8e8 55%, #7590de 100%);
}

/* ============================================================
   Bases escuras (Configurações → Aparência → "O preto")
   Trocam a sidebar, os heros e — em modo escuro — o fundo geral.
   Grafite é o padrão, já definido em :root / [data-theme="dark"].
   ============================================================ */
[data-base="preto"] {
  --escuro-1: #000000; --escuro-2: #0a0a0a; --escuro-3: #161616;
  --escuro-borda: rgba(160, 160, 160, .14); --escuro-texto: #8a8a8a; --escuro-texto-2: #f2f2f2;
}
[data-theme="dark"][data-base="preto"] {
  --bg: #000000; --bg-2: #0a0a0a; --card: #131313; --border: #262626; --text-2: #8a8a8a;
}

[data-base="noturno"] {
  --escuro-1: #05070f; --escuro-2: #0a0e1a; --escuro-3: #141b2e;
  --escuro-borda: rgba(148, 163, 199, .15); --escuro-texto: #8892ab; --escuro-texto-2: #e8ecf7;
}
[data-theme="dark"][data-base="noturno"] {
  --bg: #05070f; --bg-2: #0a0e1a; --card: #121a2c; --border: #232f47; --text-2: #8892ab;
}

[data-base="cafe"] {
  --escuro-1: #150f0c; --escuro-2: #1c1410; --escuro-3: #2b1f18;
  --escuro-borda: rgba(196, 168, 140, .16); --escuro-texto: #a3907e; --escuro-texto-2: #f0e6dc;
}
[data-theme="dark"][data-base="cafe"] {
  --bg: #150f0c; --bg-2: #1c1410; --card: #241a15; --border: #3a2a20; --text-2: #a3907e;
}

[data-base="chumbo"] {
  --escuro-1: #0c0f14; --escuro-2: #12161d; --escuro-3: #1f2731;
  --escuro-borda: rgba(148, 163, 184, .14); --escuro-texto: #8794a3; --escuro-texto-2: #e5eaf0;
}
[data-theme="dark"][data-base="chumbo"] {
  --bg: #0c0f14; --bg-2: #12161d; --card: #1a2029; --border: #2c3542; --text-2: #8794a3;
}

[data-base="marinho"] {
  --escuro-1: #081226; --escuro-2: #0c1930; --escuro-3: #16264a;
  --escuro-borda: rgba(140, 165, 220, .16); --escuro-texto: #8296bd; --escuro-texto-2: #e8eefb;
}
[data-theme="dark"][data-base="marinho"] {
  --bg: #081226; --bg-2: #0c1930; --card: #12203d; --border: #22345c; --text-2: #8296bd;
}

[data-base="azul"] {
  --escuro-1: #071a2e; --escuro-2: #0a2440; --escuro-3: #123a63;
  --escuro-borda: rgba(120, 170, 220, .18); --escuro-texto: #7d9cbd; --escuro-texto-2: #e6f0fb;
}
[data-theme="dark"][data-base="azul"] {
  --bg: #071a2e; --bg-2: #0a2440; --card: #0f2c4d; --border: #1c4472; --text-2: #7d9cbd;
}

[data-base="vinho"] {
  --escuro-1: #1c0a10; --escuro-2: #260e16; --escuro-3: #3b1622;
  --escuro-borda: rgba(220, 150, 170, .15); --escuro-texto: #b08794; --escuro-texto-2: #f7e8ec;
}
[data-theme="dark"][data-base="vinho"] {
  --bg: #1c0a10; --bg-2: #260e16; --card: #301219; --border: #4a1f2c; --text-2: #b08794;
}

[data-base="verde"] {
  --escuro-1: #06130c; --escuro-2: #0a1c12; --escuro-3: #122e1e;
  --escuro-borda: rgba(140, 200, 165, .15); --escuro-texto: #7fa48d; --escuro-texto-2: #e7f5ec;
}
[data-theme="dark"][data-base="verde"] {
  --bg: #06130c; --bg-2: #0a1c12; --card: #0f2418; --border: #1d3a29; --text-2: #7fa48d;
}

[data-base="roxo"] {
  --escuro-1: #130a24; --escuro-2: #1a0f30; --escuro-3: #2a1c4a;
  --escuro-borda: rgba(180, 160, 230, .16); --escuro-texto: #9a8bbd; --escuro-texto-2: #efe9fb;
}
[data-theme="dark"][data-base="roxo"] {
  --bg: #130a24; --bg-2: #1a0f30; --card: #21143c; --border: #35245c; --text-2: #9a8bbd;
}

/* Bases claras — sidebar e hero passam a ser claros (texto escuro) */
[data-base="branco"] {
  --escuro-1: #ffffff; --escuro-2: #fbfbfc; --escuro-3: #f0f1f3;
  --escuro-borda: rgba(15, 23, 42, .09); --escuro-texto: #6b7280; --escuro-texto-2: #16181d;
}
[data-base="perola"] {
  --escuro-1: #faf7f2; --escuro-2: #f4eee3; --escuro-3: #e9ddc9;
  --escuro-borda: rgba(90, 70, 40, .14); --escuro-texto: #8a7d68; --escuro-texto-2: #2b2620;
}
/* A marca-d'água (balança) é branca fixa no SVG — inverte para ficar visível nas bases claras */
[data-base="branco"] .hero::after, [data-base="perola"] .hero::after,
[data-base="branco"] .login-hero::after, [data-base="perola"] .login-hero::after {
  filter: invert(1);
}

/* ============================================================
   Estilo "Minimalista" (Apple) — Configurações → Estilo
   Superfícies muito claras, sombras discretas, sem textura de grão,
   bordas suaves e cantos mais generosos. Combina com qualquer cor.
   ============================================================ */
[data-estilo="minimal"] {
  --bg:             #fbfbfd;
  --bg-2:           #f2f2f5;
  --card:           #ffffff;
  --text:           #1d1d1f;
  --text-2:         #86868b;
  --border:         #e5e5ea;
  --borda-suave:    rgba(0, 0, 0, .045);
  --shadow:         0 1px 2px rgba(0, 0, 0, .03), 0 8px 24px -14px rgba(0, 0, 0, .12);
  --shadow-hover:   0 2px 6px rgba(0, 0, 0, .05), 0 16px 40px -18px rgba(0, 0, 0, .18);
  --shadow-lg:      0 24px 60px -18px rgba(0, 0, 0, .22);
  --realce:         none;
  --radius:         20px;
  --radius-sm:      13px;
  --radius-lg:      24px;
  /* Superfícies escuras (sidebar/hero) ficam grafite sóbrio no minimal */
  --escuro-1:       #1d1d1f;
  --escuro-2:       #262628;
  --escuro-3:       #303032;
  --escuro-borda:   rgba(255, 255, 255, .1);
  --escuro-texto:   #a1a1a6;
  --escuro-texto-2: #f5f5f7;
}
[data-theme="dark"][data-estilo="minimal"] {
  --bg:             #000000;
  --bg-2:           #1c1c1e;
  --card:           #1c1c1e;
  --text:           #f5f5f7;
  --text-2:         #98989d;
  --border:         #2c2c2e;
  --borda-suave:    rgba(255, 255, 255, .06);
  --escuro-1:       #000000;
  --escuro-2:       #1c1c1e;
  --escuro-3:       #2c2c2e;
}
/* Remove a textura de grão e usa fundos lisos no minimalista */
[data-estilo="minimal"] body { background: var(--bg); }
[data-estilo="minimal"] .sidebar,
[data-estilo="minimal"] .hero,
[data-estilo="minimal"] .login-hero { background-image: none; }
/* No minimal o hero do financeiro mantém o gradiente (sem grão) — senão o
   card fica sem fundo e o "Recebido no mês" desaparece */
[data-estilo="minimal"] .fin-hero { background: var(--grad-ouro); }
[data-estilo="minimal"] .sidebar {
  background: linear-gradient(180deg, var(--escuro-2), var(--escuro-1));
}
[data-estilo="minimal"] .hero {
  background: linear-gradient(140deg, var(--escuro-3), var(--escuro-1));
}
[data-estilo="minimal"] .hero::after,
[data-estilo="minimal"] .hero::before,
[data-estilo="minimal"] .login-hero::after,
[data-estilo="minimal"] .login-hero::before { display: none; }
/* Botões mais lisos (sem brilho passante) e tipografia de títulos mais neutra */
[data-estilo="minimal"] .btn::after { display: none; }
[data-estilo="minimal"] .pagina-titulo,
[data-estilo="minimal"] .hero h1,
[data-estilo="minimal"] .stat-card .valor,
[data-estilo="minimal"] .fin-hero .valor,
[data-estilo="minimal"] .cal-header .mes-nome,
[data-estilo="minimal"] .acordo-progresso-topo strong,
[data-estilo="minimal"] .modal h2 {
  font-family: 'Inter', -apple-system, sans-serif;
  letter-spacing: -.4px;
}
[data-estilo="minimal"] .pagina-titulo::after { display: none; }
[data-estilo="minimal"] .stat-card::before { opacity: .55; }
[data-estilo="minimal"] .stat-card { background: var(--card); }

/* ------------------------------------------------------------
   A base escolhida SEMPRE vence o estilo minimalista.
   (Corrige: bases claras/escuras não mudavam a sidebar no minimal)
   ------------------------------------------------------------ */
[data-estilo="minimal"][data-base="preto"]   { --escuro-1: #000000; --escuro-2: #0a0a0a; --escuro-3: #161616; --escuro-borda: rgba(160,160,160,.14); --escuro-texto: #8a8a8a; --escuro-texto-2: #f2f2f2; }
[data-estilo="minimal"][data-base="noturno"] { --escuro-1: #05070f; --escuro-2: #0a0e1a; --escuro-3: #141b2e; --escuro-borda: rgba(148,163,199,.15); --escuro-texto: #8892ab; --escuro-texto-2: #e8ecf7; }
[data-estilo="minimal"][data-base="cafe"]    { --escuro-1: #150f0c; --escuro-2: #1c1410; --escuro-3: #2b1f18; --escuro-borda: rgba(196,168,140,.16); --escuro-texto: #a3907e; --escuro-texto-2: #f0e6dc; }
[data-estilo="minimal"][data-base="chumbo"]  { --escuro-1: #0c0f14; --escuro-2: #12161d; --escuro-3: #1f2731; --escuro-borda: rgba(148,163,184,.14); --escuro-texto: #8794a3; --escuro-texto-2: #e5eaf0; }
[data-estilo="minimal"][data-base="marinho"] { --escuro-1: #081226; --escuro-2: #0c1930; --escuro-3: #16264a; --escuro-borda: rgba(140,165,220,.16); --escuro-texto: #8296bd; --escuro-texto-2: #e8eefb; }
[data-estilo="minimal"][data-base="azul"]    { --escuro-1: #071a2e; --escuro-2: #0a2440; --escuro-3: #123a63; --escuro-borda: rgba(120,170,220,.18); --escuro-texto: #7d9cbd; --escuro-texto-2: #e6f0fb; }
[data-estilo="minimal"][data-base="vinho"]   { --escuro-1: #1c0a10; --escuro-2: #260e16; --escuro-3: #3b1622; --escuro-borda: rgba(220,150,170,.15); --escuro-texto: #b08794; --escuro-texto-2: #f7e8ec; }
[data-estilo="minimal"][data-base="verde"]   { --escuro-1: #06130c; --escuro-2: #0a1c12; --escuro-3: #122e1e; --escuro-borda: rgba(140,200,165,.15); --escuro-texto: #7fa48d; --escuro-texto-2: #e7f5ec; }
[data-estilo="minimal"][data-base="roxo"]    { --escuro-1: #130a24; --escuro-2: #1a0f30; --escuro-3: #2a1c4a; --escuro-borda: rgba(180,160,230,.16); --escuro-texto: #9a8bbd; --escuro-texto-2: #efe9fb; }
[data-estilo="minimal"][data-base="branco"]  { --escuro-1: #ffffff; --escuro-2: #fbfbfc; --escuro-3: #f0f1f3; --escuro-borda: rgba(15,23,42,.09); --escuro-texto: #6b7280; --escuro-texto-2: #16181d; }
[data-estilo="minimal"][data-base="perola"]  { --escuro-1: #faf7f2; --escuro-2: #f4eee3; --escuro-3: #e9ddc9; --escuro-borda: rgba(90,70,40,.14); --escuro-texto: #8a7d68; --escuro-texto-2: #2b2620; }

/* Nas bases claras o acento claro (usado na sidebar) vira o acento escuro,
   senão logo, seção ativa e títulos ficam invisíveis sobre fundo branco. */
[data-base="branco"], [data-base="perola"],
[data-estilo="minimal"][data-base="branco"], [data-estilo="minimal"][data-base="perola"] {
  --primary-claro: var(--primary);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv11';
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(rgba(23, 29, 43, .05) 1px, transparent 1.4px),
    radial-gradient(900px 480px at 100% -10%, var(--primary-soft), transparent 60%),
    radial-gradient(700px 420px at -8% 108%, var(--roxo-soft), transparent 55%),
    var(--bg);
  background-size: 26px 26px, auto, auto, auto;
  background-attachment: fixed;
}
[data-theme="dark"] body {
  background:
    radial-gradient(rgba(230, 234, 242, .03) 1px, transparent 1.4px),
    radial-gradient(900px 480px at 100% -10%, var(--primary-soft), transparent 60%),
    var(--bg);
  background-size: 26px 26px, auto, auto;
  background-attachment: fixed;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

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

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 0 34px 56px;
  min-width: 0;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: var(--sidebar-w);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E"),
    radial-gradient(340px 220px at 50% -60px, color-mix(in srgb, var(--primary-claro) 10%, transparent), transparent 70%),
    linear-gradient(180deg, var(--escuro-2) 0%, var(--escuro-1) 100%);
  border-right: 1px solid var(--escuro-borda);
  padding: 20px 14px 16px;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--escuro-texto-2);
  padding: 2px 10px 20px;
}
.sidebar .logo .logo-icone {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--grad-ouro);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.logo-icone svg { width: 19px; height: 19px; }
.sidebar .logo span { color: var(--primary-claro); }


.sidebar a.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--escuro-texto);
  font-weight: 500;
  font-size: 13.5px;
  transition: background .16s, color .16s;
  position: relative;
}
.sidebar a.nav-item:hover { background: color-mix(in srgb, var(--primary-claro) 7%, transparent); color: var(--escuro-texto-2); }
.sidebar a.nav-item.active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary-claro) 17%, transparent), color-mix(in srgb, var(--primary-claro) 4%, transparent));
  color: var(--primary-claro);
  font-weight: 600;
}
.sidebar a.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 9px; bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: var(--grad-ouro);
}
.sidebar a.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.sidebar a.nav-item.active svg { opacity: 1; }
.sidebar a.nav-item .nav-badge {
  margin-left: auto;
  background: var(--grad-ouro);
  color: #101114;
  font-size: 10.5px; font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
}
[data-base="branco"] .sidebar a.nav-item .nav-badge,
[data-base="perola"] .sidebar a.nav-item .nav-badge { color: #fff; }
/* Alertas (itens que exigem atenção) ficam vermelhos */
.sidebar a.nav-item .nav-badge.alerta { background: var(--danger); color: #fff; }

.sidebar .spacer { flex: 1; }

.sidebar .user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(143, 147, 156, .06);
  border: 1px solid var(--escuro-borda);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 10px;
  color: var(--escuro-texto-2);
  transition: border-color .16s, background .16s;
}
.sidebar .user-card:hover { border-color: color-mix(in srgb, var(--primary-claro) 50%, transparent); background: color-mix(in srgb, var(--primary-claro) 6%, transparent); }
.sidebar .user-card .info { min-width: 0; }
.sidebar .user-card .nome { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user-card .oab { font-size: 11px; color: var(--escuro-texto); letter-spacing: .3px; }

.sidebar .btn-tema-sb {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--escuro-borda);
  border-radius: var(--radius-sm);
  color: var(--escuro-texto);
  font: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  transition: color .16s, border-color .16s;
}
.sidebar .btn-tema-sb:hover { color: var(--primary-claro); border-color: color-mix(in srgb, var(--primary-claro) 50%, transparent); }

/* ---------------- Topbar (vidro, fixa) ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0 12px;
  margin: 0 -34px 16px;
  padding-left: 34px;
  padding-right: 34px;
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--borda-suave);
}

.busca-wrap { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.busca-wrap input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font: inherit; font-size: 13.5px;
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color .16s, box-shadow .16s;
}
.busca-wrap input::placeholder { color: var(--text-2); }
.busca-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.busca-wrap .lupa { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); width: 16px; height: 16px; flex-shrink: 0; pointer-events: none; z-index: 1; }
/* Reforço: nenhum estilo genérico de input pode encostar o texto na lupa */
.topbar .busca-wrap input { padding-left: 40px !important; }
.busca-wrap .lupa path, .busca-wrap .lupa circle { vector-effect: non-scaling-stroke; }
.busca-wrap input { padding-right: 34px; }
.busca-atalho {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--text-2);
  font: 600 12px/1 'Inter', sans-serif;
  pointer-events: none;
  z-index: 1;
}
.busca-wrap input:focus ~ .busca-atalho { opacity: 0; }
@media (max-width: 860px) { .busca-atalho { display: none; } }

.busca-res {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 90;
}
.busca-res.aberto { display: block; }
.busca-res .grupo { padding: 9px 15px 3px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--primary); }
.busca-res a { display: block; padding: 8px 15px; color: var(--text); font-size: 13.5px; }
.busca-res a:hover, .busca-res a.sel { background: var(--primary-soft); }
.busca-res a .sub { font-size: 11.5px; color: var(--text-2); }
.busca-res .vazio { padding: 16px; text-align: center; color: var(--text-2); font-size: 13px; }

.topbar .acoes-topo { display: flex; align-items: center; gap: 10px; }
.icone-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: color .16s, border-color .16s, transform .1s;
}
.icone-btn:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.icone-btn svg { width: 17px; height: 17px; }
.icone-btn .ponto {
  position: absolute; top: 3px; right: 3px;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 9.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  box-shadow: 0 0 0 2px var(--card);
}

.pagina-titulo {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.4px;
  margin: 10px 0 20px;
}
.pagina-titulo::after {
  content: '';
  display: block;
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: var(--grad-ouro);
  margin-top: 7px;
}

.avatar {
  width: 37px; height: 37px;
  border-radius: 50%;
  background: var(--grad-ouro);
  color: #101114;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 0 1px var(--borda-suave);
}
img.avatar { object-fit: cover; box-shadow: 0 0 0 1px var(--borda-suave); }
.avatar.pequeno { width: 30px; height: 30px; font-size: 11px; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E"),
    radial-gradient(640px 320px at 88% -30%, color-mix(in srgb, var(--primary-claro) 14%, transparent), transparent 62%),
    radial-gradient(420px 280px at -8% 130%, rgba(94, 107, 133, .18), transparent 60%),
    linear-gradient(130deg, var(--escuro-3) 0%, var(--escuro-1) 62%);
  border: 1px solid var(--escuro-borda);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  color: var(--escuro-texto-2);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero::before {
  /* moldura hairline interna — assinatura visual (referência a certificado) */
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid color-mix(in srgb, var(--escuro-texto-2) 9%, transparent);
  border-radius: calc(var(--radius-lg) - 7px);
  pointer-events: none;
}
.hero::after {
  /* balança da justiça em marca-d'água (SVG, sem emoji) */
  content: '';
  position: absolute;
  right: 14px; bottom: -30px;
  width: 190px; height: 190px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1'%3E%3Cpath d='m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='M7 21h10'/%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2'/%3E%3C/svg%3E") no-repeat center / contain;
  opacity: .06;
  pointer-events: none;
}
.hero .data-chip {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--primary-claro);
  border: 1px solid color-mix(in srgb, var(--primary-claro) 30%, transparent);
  background: color-mix(in srgb, var(--primary-claro) 8%, transparent);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 14px;
}
.hero h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 800;
  color: var(--escuro-texto-2);
  letter-spacing: -.6px;
}
.hero .resumo { font-size: 14px; color: var(--escuro-texto); }
.hero .resumo strong.alerta { color: #f6a5a5; }
/* Frase do dia (painel) */
.hero-frase {
  margin-top: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--escuro-texto-2);
  opacity: .78;
  max-width: 560px;
  line-height: 1.6;
}
.hero-frase span { font-style: normal; font-size: 11.5px; opacity: .75; letter-spacing: .3px; }
/* Nas bases claras o hero é claro — vermelho clarinho sumia */
[data-base="branco"] .hero .resumo strong.alerta,
[data-base="perola"] .hero .resumo strong.alerta { color: var(--danger); }
.hero .frase {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--escuro-texto);
  border-left: 2px solid var(--primary-claro);
  padding-left: 14px;
}
.hero .hero-acoes { position: absolute; top: 26px; right: 26px; display: flex; gap: 10px; }
@media (max-width: 700px) { .hero .hero-acoes { position: static; margin-top: 16px; } }

/* ---------------- Hero do painel (repaginado) ---------------- */
.hero-painel { padding: 30px 34px; }
.hero-conteudo { min-width: 0; }
.hero-painel h1 { font-size: 30px; margin-bottom: 6px; }
.hero-painel .resumo { font-size: 14.5px; }
.hero-acoes-linha { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 22px; }


/* Botão de vidro (secundário no hero escuro) */
.btn-vidro {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--escuro-texto-2) 22%, transparent);
  background: color-mix(in srgb, var(--escuro-texto-2) 8%, transparent);
  color: var(--escuro-texto-2);
  font: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.btn-vidro svg { width: 15px; height: 15px; }
.btn-vidro:hover { background: color-mix(in srgb, var(--escuro-texto-2) 15%, transparent); border-color: color-mix(in srgb, var(--primary-claro) 55%, transparent); }

/* ---------------- Abas do painel (Visão geral / Alertas) ---------------- */
.painel-abas {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-2);
  border-radius: 999px;
  margin: 18px 0 16px;
}
.painel-aba {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer;
  transition: all .18s;
}
.painel-aba:hover { color: var(--text); }
.painel-aba.ativa {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}
.painel-aba-badge {
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------------- Central de Alertas ---------------- */
.alertas-lista { display: flex; flex-direction: column; gap: 10px; }
.alerta-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--stat-cor, var(--text-2));
  border-radius: var(--radius-sm);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .2s;
}
.alerta-item:hover { transform: translateX(2px); box-shadow: var(--shadow-hover); color: var(--text); }
.alerta-item.cor-vermelho { --stat-cor: var(--danger); }
.alerta-item.cor-laranja  { --stat-cor: var(--warn); }
.alerta-item.cor-azul     { --stat-cor: var(--info); }
.alerta-ic {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--stat-cor, var(--text-2)) 13%, transparent);
  color: var(--stat-cor, var(--text-2));
}
.alerta-ic svg { width: 18px; height: 18px; }
.alerta-hora {
  flex-shrink: 0;
  font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--stat-cor, var(--text-2)) 12%, transparent);
  color: var(--stat-cor, var(--text-2));
}
.alerta-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.alerta-titulo { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alerta-sub { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alerta-seta { width: 16px; height: 16px; color: var(--text-2); flex-shrink: 0; }

/* ---------------- Publicações (widget do painel) ---------------- */
.pub-lista-nova { display: flex; flex-direction: column; gap: 8px; }
.pub-card-mini {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  transition: background .15s;
}
.pub-card-mini:hover { background: var(--primary-soft); color: var(--text); }
.pub-card-mini.lida { opacity: .6; }
.pub-mini-marca { width: 7px; height: 7px; border-radius: 50%; background: var(--info); flex-shrink: 0; }
.pub-mini-marca.prazo { background: var(--danger); }
.pub-mini-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pub-mini-corpo strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-mini-prazo, .pub-mini-nova {
  flex-shrink: 0;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.pub-mini-prazo { background: var(--danger-soft); color: var(--danger); }
.pub-mini-nova { background: var(--info-soft); color: var(--info); }

/* ---------------- Cobranças (widget do painel) ---------------- */
.cobranca-lista { display: flex; flex-direction: column; gap: 10px; }
.cobranca-item { display: flex; align-items: center; gap: 10px; }
.cobranca-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cobranca-info a { font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cobranca-info a:hover { color: var(--primary); }
.cobranca-valor { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cobranca-valor strong { font-size: 13px; white-space: nowrap; }
.cobranca-rodape { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--borda-suave); font-size: 12px; color: var(--text-2); }

/* Movimentações do financeiro — lista */
.mov-lista { display: flex; flex-direction: column; gap: 3px; }
.mov-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 6px;
  border-bottom: 1px solid var(--borda-suave);
  transition: background .12s;
}
.mov-item:last-child { border-bottom: none; }
.mov-item:hover { background: var(--bg); border-radius: var(--radius-sm); }
.mov-icone {
  flex-shrink: 0; width: 34px; height: 34px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.mov-icone svg { width: 16px; height: 16px; }
.mov-icone.rec { background: var(--ok-soft); color: var(--ok); }
.mov-icone.desp { background: var(--danger-soft); color: var(--danger); }
.mov-corpo { flex: 1; min-width: 0; }
.mov-titulo { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-sub { margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-status { flex-shrink: 0; }
.mov-valor { flex-shrink: 0; font-size: 14px; min-width: 92px; text-align: right; }
.mov-acoes { flex-shrink: 0; display: flex; gap: 6px; }
@media (max-width: 760px) {
  .mov-item { flex-wrap: wrap; }
  .mov-status { order: 4; margin-left: 46px; }
  .mov-valor { margin-left: auto; }
}

/* ---------------- Aniversariantes (widget do painel) ---------------- */
.aniv-lista { display: flex; flex-direction: column; gap: 6px; }
.aniv-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.aniv-item:hover { background: var(--primary-soft); }
.aniv-item.aniv-hoje { background: var(--primary-soft); }
.aniv-dia {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 12.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.aniv-item.aniv-hoje .aniv-dia { background: var(--grad-ouro); color: #fff; }
[data-theme="dark"] .aniv-item.aniv-hoje .aniv-dia { color: #101114; }
.aniv-nome { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 640px) {
  .painel-abas { display: flex; width: 100%; }
  .painel-aba { flex: 1; justify-content: center; }
}

.banner-alerta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  margin-top: 18px;
}
.banner-alerta .titulo { font-weight: 700; color: var(--danger); font-size: 13.5px; }
.banner-alerta .sub { font-size: 12.5px; color: var(--text-2); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--realce);
  padding: 22px;
  transition: box-shadow .2s;
}
.card + .card { margin-top: 18px; }
.card h2 {
  font-size: 14.5px;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -.1px;
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1250px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px)  { .grid-2, .grid-4, .grid-5 { grid-template-columns: 1fr; } }

/* Cards de estatística */
.stat-card {
  position: relative;
  background:
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--stat-cor, var(--primary)) 6%, transparent), transparent 60%),
    var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--realce);
  padding: 18px 20px 16px;
  overflow: hidden;
  transition: box-shadow .22s, transform .18s var(--mola), border-color .2s;
}
.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: color-mix(in srgb, var(--stat-cor, var(--primary)) 30%, var(--border)); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--stat-cor, var(--primary)), color-mix(in srgb, var(--stat-cor, var(--primary)) 35%, transparent));
}
.stat-card:hover .topo .icone { transform: scale(1.08) rotate(-4deg); }
.stat-card .topo .icone { transition: transform .25s var(--mola); }
.stat-card.dourado  { --stat-cor: var(--primary); }
.stat-card.vermelho { --stat-cor: var(--danger); }
.stat-card.laranja  { --stat-cor: var(--warn); }
.stat-card.verde    { --stat-cor: var(--ok); }
.stat-card.azul     { --stat-cor: var(--info); }
.stat-card.roxo     { --stat-cor: var(--roxo); }

.stat-card .topo {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--text-2);
  margin-bottom: 12px;
}
.stat-card .topo .icone {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--stat-cor) 12%, transparent);
  color: var(--stat-cor);
}
.stat-card .topo .icone svg { width: 17px; height: 17px; }
.stat-card .valor {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}
.stat-card .valor.alerta { color: var(--danger); }
.stat-card .valor.positivo { color: var(--ok); }
.stat-card .sub { font-size: 12px; color: var(--text-2); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.stat-card .sub .ponto-cor { width: 7px; height: 7px; border-radius: 50%; background: var(--stat-cor); display: inline-block; }

/* Ações rápidas */
.acoes-rapidas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.acoes-rapidas a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 17px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow);
  transition: border-color .16s, color .16s, transform .12s, box-shadow .2s;
}
.acoes-rapidas a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.acoes-rapidas a svg { width: 15px; height: 15px; opacity: .75; }

/* ============================================================
   Botões / chips / badges
   ============================================================ */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px;
  border-radius: 11px;
  border: none;
  background: var(--primary);
  color: #fff;
  font: inherit; font-weight: 600; font-size: 13px;
  letter-spacing: .1px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 4px 12px -4px color-mix(in srgb, var(--primary) 40%, transparent);
  transition: background .15s, transform .18s var(--mola), box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
[data-theme="dark"] .btn { color: #101114; }
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 8px 18px -6px color-mix(in srgb, var(--primary) 50%, transparent); }
.btn:active { transform: scale(.97); }
.btn.secundario {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.btn.secundario:hover { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.btn.perigo { background: var(--danger); color: #fff; box-shadow: none; }
.btn.perigo:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn.pequeno { padding: 6px 12px; font-size: 12px; border-radius: 9px; }
/* Texto sempre escuro fixo — var(--escuro-1) vira branco nas bases claras e o botão sumia */
.btn.claro { background: #fff; color: #16181d; box-shadow: 0 3px 12px rgba(0, 0, 0, .25); }
.btn.claro:hover { background: #e9eaee; color: #16181d; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6.5px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all .16s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.ativo {
  border-color: transparent;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent);
}
[data-theme="dark"] .chip.ativo { color: #101114; }

.badge {
  display: inline-flex; align-items: center;
  padding: 2.5px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .1px;
  white-space: nowrap;
}
.badge.dourado  { background: var(--primary-soft); color: var(--primary); }
.badge.vermelho { background: var(--danger-soft);  color: var(--danger); }
.badge.laranja  { background: var(--warn-soft);    color: var(--warn); }
.badge.verde    { background: var(--ok-soft);      color: var(--ok); }
.badge.azul     { background: var(--info-soft);    color: var(--info); }
.badge.roxo     { background: var(--roxo-soft);    color: var(--roxo); }
.badge.cinza    { background: var(--bg-2);         color: var(--text-2); }

/* ============================================================
   Formulários
   ============================================================ */
label.campo { display: block; margin-bottom: 13px; }
label.campo > span { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; letter-spacing: .2px; }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=datetime-local], input[type=number], input[type=tel], input[type=file],
select, textarea {
  width: 100%;
  padding: 9.5px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 3.5px var(--primary-soft);
}
textarea { resize: vertical; min-height: 76px; }

.form-linha { display: flex; gap: 12px; flex-wrap: wrap; }
.form-linha > label.campo { flex: 1; min-width: 130px; }
@media (max-width: 520px) {
  .form-linha { flex-direction: column; gap: 0; }
  .form-linha > label.campo { max-width: none !important; }
}

/* ============================================================
   Tabelas
   ============================================================ */
table.tabela { width: 100%; border-collapse: collapse; }
.tabela th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-2);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.tabela td { padding: 12px; border-bottom: 1px solid var(--borda-suave); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: none; }
.tabela tr.clicavel { cursor: pointer; transition: background .14s; }
.tabela tr.clicavel:hover td { background: var(--primary-soft); }
.tabela tr.clicavel td:first-child { border-radius: 8px 0 0 8px; box-shadow: inset 3px 0 0 transparent; transition: box-shadow .14s; }
.tabela tr.clicavel:hover td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.tabela tr.clicavel td:last-child { border-radius: 0 8px 8px 0; }

.criado-por { font-size: 11px; color: var(--text-2); }

/* ============================================================
   Kanban
   ============================================================ */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 700px)  { .kanban { grid-template-columns: 1fr !important; } }

.kanban-col {
  background: color-mix(in srgb, var(--card) 55%, var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px;
  min-height: 130px;
}
.kanban-col > h3 {
  margin: 0 4px 12px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-2);
  display: flex; justify-content: space-between; align-items: center;
}
.kanban-col.drag-over { outline: 2px dashed var(--primary); outline-offset: -5px; }

.kcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  margin-bottom: 10px;
  cursor: grab;
  box-shadow: var(--shadow);
  transition: box-shadow .16s, transform .12s;
}
.kcard:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.kcard.arrastando { opacity: .45; }
.kcard .titulo { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.kcard .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--text-2); }
.kcard.vencida { border-left: 3px solid var(--danger); }
.kcard.hoje    { border-left: 3px solid var(--warn); }

/* Kanban de processos com rolagem horizontal (muitas fases) */
.kanban-scroll { overflow-x: auto; padding-bottom: 10px; margin: 0 -4px; }
.kanban-scroll::-webkit-scrollbar { height: 10px; }
.kanban-proc {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 14px;
  padding: 0 4px;
  align-items: start;
  min-width: min-content;
}
@media (min-width: 1400px) {
  .kanban-proc { grid-auto-columns: 1fr; }   /* cabe tudo sem rolar em telas largas */
}

/* Numeração da fase no cabeçalho da coluna */
.kanban-col > h3 .fase-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  font-size: 10px; font-weight: 700;
  margin-right: 2px;
}
/* Rodapé de próximo prazo no card de caso */
.caso-prazo {
  display: flex; align-items: center; gap: 5px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--borda-suave);
  font-size: 11px; color: var(--text-2);
}
.caso-prazo svg { width: 12px; height: 12px; flex-shrink: 0; }
.caso-prazo strong { color: var(--text); }

/* Busca inline (casos / clientes) */
.busca-inline { position: relative; flex: 1; min-width: 220px; max-width: 360px; margin: 0; }
.busca-inline svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; max-width: 16px; max-height: 16px;
  color: var(--text-2);
  pointer-events: none;
  z-index: 1;
}
.busca-inline input { padding-left: 38px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }
.busca-inline.sem-icone input { padding-left: 16px; }

/* Barra de progresso de fase (lista de casos) */
.fase-progresso { height: 4px; border-radius: 999px; background: var(--bg-2); margin-top: 6px; overflow: hidden; }
.fase-progresso div { height: 100%; border-radius: 999px; background: var(--grad-ouro); }

/* ============================================================
   Processos — pipeline + lista (sem kanban)
   ============================================================ */
.pipeline {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.pipeline::-webkit-scrollbar { height: 6px; }
.pipe-etapa {
  position: relative;
  flex: 1 0 auto;
  min-width: 108px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  transition: all .16s;
}
.pipe-etapa:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); color: var(--text); transform: translateY(-1px); }
.pipe-etapa.ativa {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent);
}
[data-theme="dark"] .pipe-etapa.ativa { color: #101114; }
.pipe-etapa.vazia:not(.ativa) { opacity: .5; }
.pipe-passo {
  font-size: 9.5px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; opacity: .75;
}
.pipe-nome { font-size: 12px; font-weight: 600; line-height: 1.2; }
.pipe-cont { font-family: var(--serif); font-size: 20px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }

/* Lista de processos */
.lista-proc { display: flex; flex-direction: column; }
.proc-linha {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 14px 22px;
  border-bottom: 1px solid var(--borda-suave);
  transition: background .14s;
}
.proc-linha:last-child { border-bottom: none; }
.proc-linha:hover { background: var(--primary-soft); }
/* barrinha lateral que indica o quão avançado está (--pp = % do fluxo) */
.proc-barra {
  position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 4px; border-radius: 999px;
  background: linear-gradient(var(--primary) var(--pp), var(--border) var(--pp));
}
.proc-corpo { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.proc-info { flex: 1; min-width: 0; }
.proc-titulo { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.proc-titulo, .proc-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proc-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.proc-prazo { text-align: right; min-width: 92px; display: flex; flex-direction: column; gap: 1px; }
.proc-prazo strong { font-size: 13px; }
.proc-parado { min-width: 92px; text-align: right; }
.proc-fase-sel {
  width: auto; min-width: 130px; max-width: 150px;
  padding: 7px 10px; font-size: 12px; font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
}
@media (max-width: 900px) {
  .proc-prazo, .proc-parado { display: none; }
  .proc-fase-sel { min-width: 110px; }
}

/* ============================================================
   Agenda — calendário mensal
   ============================================================ */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.cal-header .mes-nome {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.05;
}
.cal-header .mes-nome small { display: block; font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 500; color: var(--text-2); letter-spacing: .4px; }

/* Barra de controle da agenda */
.agenda-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin-bottom: 18px;
}

.seg {
  display: inline-flex;
  background: var(--bg-2);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.seg a {
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.seg a:hover { color: var(--text); }
.seg a.ativo {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 35%, transparent);
}
[data-theme="dark"] .seg a.ativo { color: #101114; }

.agenda-nav { display: flex; align-items: center; gap: 8px; }
.nav-seta {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.nav-seta:hover { color: var(--primary); border-color: var(--primary); }
.nav-seta svg { width: 16px; height: 16px; }
.agenda-nav .periodo {
  text-align: center;
  min-width: 150px;
  line-height: 1.15;
}
.agenda-nav .periodo strong {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.agenda-nav .periodo span { font-size: 11.5px; color: var(--text-2); }

.calendario {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));   /* minmax(0,..) impede coluna esticar com texto longo */
  grid-template-rows: auto;                            /* 1ª linha (cabeçalho Dom–Sáb) fica baixa */
  grid-auto-rows: minmax(112px, auto);                 /* linhas de dias com altura uniforme */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-dow {
  padding: 10px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--text-2);
  text-align: center;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.cal-dow.fds { color: var(--danger); }
.cal-dia {
  min-width: 0;            /* essencial: célula não estica com título longo */
  overflow: hidden;
  padding: 8px;
  border-right: 1px solid var(--borda-suave);
  border-bottom: 1px solid var(--borda-suave);
  background: var(--card);
  transition: background .15s;
}
.cal-dia:nth-child(7n) { border-right: none; }
.cal-dia:hover { background: color-mix(in srgb, var(--card) 80%, var(--primary-soft)); }
.cal-dia:hover .cal-add { opacity: 1; }
.cal-dia.fora { background: var(--bg); opacity: .5; }
.cal-dia.hoje { background: var(--primary-soft); box-shadow: inset 0 2px 0 var(--primary); }
.cal-dia.drag-alvo { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.cal-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.cal-add {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 16px; line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.cal-add:hover { background: var(--primary-soft); }
.cal-dia .num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 25px; height: 25px;
  border-radius: 50%;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.cal-dia.hoje .num { background: var(--grad-ouro); color: #fff; font-weight: 700; box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 40%, transparent); }
[data-theme="dark"] .cal-dia.hoje .num { color: #101114; }

.cal-evento {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px;
  padding: 3.5px 8px;
  border-radius: 7px;
  margin-bottom: 3px;
  cursor: grab;
  white-space: nowrap; overflow: hidden;
  background: var(--primary-soft); color: var(--text);
  transition: filter .12s, transform .12s, box-shadow .12s;
  border-left: 2.5px solid var(--primary);
}
.cal-evento-txt { overflow: hidden; text-overflow: ellipsis; }
.cal-evento:hover { filter: brightness(.96); transform: translateX(1px); box-shadow: var(--shadow); }
[data-theme="dark"] .cal-evento:hover { filter: brightness(1.15); }
.cal-evento.arrastando { opacity: .4; }
.cal-evento .hora { font-weight: 700; font-size: 10.5px; flex-shrink: 0; color: var(--primary); }
.cal-evento.tipo-prazo_fatal { background: var(--danger-soft); border-left-color: var(--danger); }
.cal-evento.tipo-prazo_fatal .hora { color: var(--danger); }
.cal-evento.tipo-audiencia { background: var(--info-soft); border-left-color: var(--info); }
.cal-evento.tipo-audiencia .hora { color: var(--info); }
.cal-evento.tipo-reuniao { background: var(--warn-soft); border-left-color: var(--warn); }
.cal-evento.tipo-reuniao .hora { color: var(--warn); }
.cal-evento.concluida { opacity: .45; text-decoration: line-through; }
.cal-check {
  flex-shrink: 0; margin-left: auto;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1.3px solid currentColor;
  background: transparent;
  color: inherit; opacity: .55;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: all .15s var(--mola);
}
.cal-check svg { width: 9px; height: 9px; }
.cal-check:hover { opacity: 1; border-color: var(--ok); color: var(--ok); background: var(--ok-soft); transform: scale(1.15); }
.cal-check.feito { opacity: 1; border-color: var(--ok); background: var(--ok); color: #fff; }

/* Legenda do calendário */
.cal-legenda {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--borda-suave);
  font-size: 11.5px; color: var(--text-2);
}
.cal-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-legenda .p-prazo_fatal { background: var(--danger); }
.cal-legenda .p-audiencia { background: var(--info); }
.cal-legenda .p-reuniao { background: var(--warn); }
.cal-legenda .p-tarefa { background: var(--primary); }

.cal-mais {
  font-size: 11px; font-weight: 700;
  color: var(--info);
  cursor: pointer;
  padding: 2px 8px;
}
.cal-dia.expandido .cal-evento.extra { display: flex; }
.cal-dia .cal-evento.extra { display: none; }

@media (max-width: 900px) {
  .calendario { grid-template-columns: 1fr; border: none; }
  .cal-dow { display: none; }
  .cal-dia { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; min-height: 0; }
  .cal-dia.fora { display: none; }
}

/* ---------------- Agenda semanal ---------------- */
.semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1200px) { .semana { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .semana { grid-template-columns: 1fr; } }
.dia-col { min-width: 0; overflow: hidden; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 11px; min-height: 140px; }
.dia-col h4 { margin: 0 0 9px; font-size: 11.5px; color: var(--text-2); text-align: center; text-transform: uppercase; letter-spacing: .5px; }
.dia-col.hoje-col { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.dia-col.hoje-col h4 { color: var(--primary); font-weight: 700; }
.evento {
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 12px;
  margin-bottom: 6px;
  cursor: grab;
  transition: filter .12s, box-shadow .12s;
  overflow-wrap: break-word;   /* título longo quebra em vez de estourar a coluna */
  min-width: 0;
}
.evento:hover { filter: brightness(.96); box-shadow: var(--shadow); }
.evento.arrastando { opacity: .4; }
.evento.concluida { opacity: .5; text-decoration: line-through; }
.dia-col.drag-alvo { box-shadow: inset 0 0 0 2px var(--primary); background: var(--primary-soft); }
.evento-check {
  float: right; margin-left: 6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.3px solid currentColor;
  background: transparent;
  color: inherit; opacity: .55;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: all .15s var(--mola);
}
.evento-check svg { width: 10px; height: 10px; }
.evento-check:hover { opacity: 1; border-color: var(--ok); color: var(--ok); background: var(--ok-soft); transform: scale(1.15); }
.evento-check.feito { opacity: 1; border-color: var(--ok); background: var(--ok); color: #fff; }
.evento.tipo-prazo_fatal { background: var(--danger-soft); border-left-color: var(--danger); }
.evento.tipo-audiencia   { background: var(--info-soft);   border-left-color: var(--info); }
.evento.tipo-reuniao     { background: var(--warn-soft);   border-left-color: var(--warn); }

/* ============================================================
   Próximas audiências (painel)
   ============================================================ */
.aud-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 9px;
  cursor: pointer;
  transition: border-color .16s, transform .12s, box-shadow .2s;
}
.aud-item:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.aud-item:last-child { margin-bottom: 0; }
.aud-data {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 50px; height: 52px;
  border-radius: var(--radius-sm);
  background: var(--info-soft);
  color: var(--info);
  flex-shrink: 0;
}
.aud-data .dia { font-size: 20px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.aud-data .mes { font-size: 9.5px; font-weight: 700; letter-spacing: 1.2px; margin-top: 2px; }
.aud-info { min-width: 0; flex: 1; }
.aud-info .titulo { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aud-info .sub { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   Painel personalizável (widgets)
   ============================================================ */
.dash {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}
.widget { position: relative; min-width: 0; }
.w-6 { grid-column: span 6; }
.w-4 { grid-column: span 4; }
.w-2 { grid-column: span 2; }
@media (max-width: 1100px) { .w-4, .w-2 { grid-column: span 6; } }

.widget.w-oculto { display: none; }

.w-controles {
  display: none;
  position: absolute;
  top: -12px; right: 10px;
  z-index: 5;
  gap: 6px;
}
.w-controles .w-handle,
.w-controles button {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: grab;
  box-shadow: var(--shadow);
  padding: 0;
}
.w-controles button { cursor: pointer; }
.w-controles svg { width: 15px; height: 15px; }
.w-controles button:hover { color: var(--danger); border-color: var(--danger); }

.dash.editando .widget {
  outline: 2px dashed var(--primary);
  outline-offset: 5px;
  border-radius: var(--radius);
  cursor: grab;
}
.dash.editando .w-controles { display: flex; }
.dash.editando .widget.arrastando { opacity: .4; }

.dash-tray {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--primary-soft);
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 16px;
}

.h2-icone {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.h2-icone svg { width: 14px; height: 14px; }

/* ============================================================
   Agenda — visão diária
   ============================================================ */
.dia-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--borda-suave);
}
.dia-item:last-child { border-bottom: none; }
.dia-item.concluida { opacity: .55; }
.dia-item.concluida .titulo { text-decoration: line-through; }
.dia-hora {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 58px;
  text-align: center;
  padding: 9px 6px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.dia-hora.tipo-prazo_fatal { background: var(--danger-soft); color: var(--danger); }
.dia-hora.tipo-audiencia   { background: var(--info-soft);   color: var(--info); }
.dia-hora.tipo-reuniao     { background: var(--warn-soft);   color: var(--warn); }
.dia-info { flex: 1; min-width: 0; }
.dia-info .titulo { font-weight: 600; font-size: 14px; }
.dia-info .sub { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 3px; }

.evento.concluida { opacity: .5; }
.evento.concluida strong { text-decoration: line-through; }

/* ============================================================
   Painel v2 — hero compacto, progresso, ações rápidas
   ============================================================ */
/* ============================================================
   Tela de carregamento (splash pós-login)
   ============================================================ */
body.carregando { overflow: hidden; }
.splash {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(700px 500px at 50% 30%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 60%),
    linear-gradient(160deg, var(--escuro-3) 0%, var(--escuro-1) 70%);
  opacity: 1;
  transition: opacity .5s ease;
}
.splash.saindo { opacity: 0; pointer-events: none; }
.splash-conteudo { text-align: center; animation: splash-sobe .6s var(--mola) both; }
@keyframes splash-sobe { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.splash-logo {
  width: 76px; height: 76px;
  margin: 0 auto 20px;
  border-radius: 22px;
  background: var(--grad-ouro);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 44px color-mix(in srgb, var(--primary) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
  animation: splash-pulso 1.6s ease-in-out infinite;
}
.splash-logo svg { width: 40px; height: 40px; }
@keyframes splash-pulso { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.splash-nome {
  font-family: var(--serif);
  font-size: 26px; font-weight: 800; letter-spacing: -.5px;
  color: var(--escuro-texto-2);
}
.splash-nome span { color: var(--primary-claro); }
.splash-saudacao { color: var(--escuro-texto); font-size: 14px; margin-top: 4px; }
.splash-barra {
  width: 180px; height: 4px;
  margin: 24px auto 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--escuro-texto-2) 12%, transparent);
  overflow: hidden;
}
.splash-barra span {
  display: block; height: 100%;
  border-radius: 999px;
  background: var(--grad-ouro);
  animation: splash-carrega 1.8s ease-in-out infinite;
}
@keyframes splash-carrega {
  0% { width: 0; margin-left: 0; }
  50% { width: 70%; margin-left: 15%; }
  100% { width: 0; margin-left: 100%; }
}

.hero.hero-compacto { padding: 22px 26px; }
.hero.hero-compacto h1 { font-size: 23px; margin-bottom: 4px; }
.hero.hero-compacto .data-chip { margin-bottom: 10px; }

.hero-progresso { display: flex; align-items: center; gap: 12px; margin-top: 14px; max-width: 420px; }
.hero-progresso .trilha {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(230, 234, 242, .14);
  overflow: hidden;
}
.hero-progresso .feito {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 65%, #fff));
  transition: width .6s var(--mola);
}
.hero-progresso .rotulo { font-size: 11.5px; color: var(--escuro-texto); white-space: nowrap; }

/* Stat cards clicáveis */
a.stat-card { display: block; color: var(--text); }
a.stat-card:hover { color: var(--text); }
a.stat-card .valor { color: var(--text); }
a.stat-card .valor.alerta { color: var(--danger); }

/* Check de conclusão rápida (agenda prioritária) */
.check-circulo {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all .18s var(--mola);
}
.check-circulo svg { width: 12px; height: 12px; }
.check-circulo:hover { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); transform: scale(1.12); }
.check-circulo.feito { border-color: var(--ok); background: var(--ok); color: #fff; }

/* Linhas compactas (publicações / cobranças) */
.pub-linha {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--borda-suave);
  color: var(--text);
  min-width: 0;
}
.pub-linha:last-of-type { border-bottom: none; }
.pub-linha:hover { color: var(--text); background: var(--primary-soft); border-radius: 8px; }
.pub-ponto {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--info);
  flex-shrink: 0;
}
.pub-ponto.lida { background: var(--border); }
.pub-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pub-texto strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

/* ============================================================
   Clientes / Publicações (redesign)
   ============================================================ */
.avatar.grande { width: 52px; height: 52px; font-size: 19px; border-radius: 16px; }

/* Avatares padrão (sem foto) — silhueta por gênero / prédio para PJ */
.avatar.avatar-padrao { border-radius: 16px; }
.avatar.avatar-padrao svg { width: 100%; height: 100%; }
.avatar.avatar-padrao.m  { background: color-mix(in srgb, var(--info) 14%, transparent);  color: var(--info); }
.avatar.avatar-padrao.f  { background: color-mix(in srgb, #c65b9a 16%, transparent);       color: #c65b9a; }
.avatar.avatar-padrao.pj { background: color-mix(in srgb, var(--warn) 15%, transparent);  color: var(--warn); }
[data-theme="dark"] .avatar.avatar-padrao.f { color: #e79ac6; }

/* Lista de clientes (compacta) */
.lista-clientes { display: flex; flex-direction: column; }
.cliente-linha {
  display: grid;
  grid-template-columns: 36px 1.6fr 1.2fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--borda-suave);
  cursor: pointer;
  transition: background .14s;
  min-width: 0;
}
.cliente-linha:last-child { border-bottom: none; }
.cliente-linha:hover { background: var(--primary-soft); }
.cliente-linha .cl-nome { min-width: 0; }
.cliente-linha .cl-nome .nome { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cliente-linha .cl-contato { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cliente-linha .cl-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cliente-linha .cl-acoes { display: flex; gap: 6px; }
@media (max-width: 760px) {
  .cliente-linha { grid-template-columns: 36px 1fr auto; }
  .cliente-linha .cl-contato, .cliente-linha .cl-badges { display: none; }
}

.chip-advogado { padding-left: 8px; }

.pub-card {
  display: flex;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--realce);
  padding: 16px 18px;
  transition: box-shadow .2s, transform .15s;
}
.pub-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.pub-card.lida { opacity: .66; }
.pub-card.tem-selo { padding-left: 14px; }
.pub-faixa {
  width: 4px;
  border-radius: 4px;
  background: var(--info);
  flex-shrink: 0;
  align-self: stretch;
}
.pub-faixa.neutra { background: var(--border); }

/* Selo de prazo em destaque (contagem regressiva) */
.pub-selo {
  flex-shrink: 0;
  width: 82px;
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  text-align: center;
  align-self: stretch;
  border: 1px solid transparent;
}
.pub-selo-num { font-family: var(--serif); font-size: 17px; font-weight: 800; line-height: 1.05; }
.pub-selo-txt { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
.pub-selo-data { font-size: 10.5px; font-weight: 600; margin-top: 5px; padding-top: 5px; border-top: 1px solid currentColor; opacity: .7; }
.pub-selo.vermelho { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.pub-selo.laranja  { background: var(--warn-soft);   color: var(--warn);   border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.pub-selo.azul     { background: var(--info-soft);   color: var(--info);   border-color: color-mix(in srgb, var(--info) 22%, transparent); }
/* Pulso sutil no selo vencido/urgente */
.pub-selo.vermelho { animation: selo-pulso 2.4s ease-in-out infinite; }
@keyframes selo-pulso { 0%,100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 12%, transparent); } }

/* Refino visual das publicações */
.pub-card { padding: 18px 20px; }
.pub-card > div > .flex-entre strong { font-size: 14px; letter-spacing: -.1px; }
.pub-card .pub-acoes {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--borda-suave);
}
.pub-card details { margin-top: 10px; }
.pub-card details summary {
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  color: var(--primary);
  list-style: none;
  user-select: none;
}
.pub-card details summary::-webkit-details-marker { display: none; }
.pub-card details summary::before { content: '+'; font-weight: 800; }
.pub-card details[open] summary::before { content: '–'; }
.pub-card details p {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--borda-suave);
  max-height: 300px;
  overflow-y: auto;
}

/* ============================================================
   Financeiro
   ============================================================ */
.grid-fin { grid-template-columns: 1.2fr 1fr; }
@media (max-width: 900px) { .grid-fin { grid-template-columns: 1fr; } }

.fin-hero {
  position: relative;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E"),
    radial-gradient(420px 240px at 90% -20%, rgba(255, 255, 255, .14), transparent 60%),
    var(--grad-ouro);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 16px 40px -12px color-mix(in srgb, var(--primary) 50%, transparent);
}
[data-theme="dark"] .fin-hero { color: #101114; }
.fin-hero .rotulo {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  opacity: .85;
  margin-bottom: 8px;
}
.fin-hero .valor {
  font-family: var(--serif);
  font-size: 30px; font-weight: 800;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
}
.fin-hero .sub { font-size: 12.5px; opacity: .85; margin-top: 6px; display: flex; align-items: center; gap: 7px; }
.fin-hero .ponto { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.fin-hero-claro { display: flex; flex-direction: column; justify-content: center; }
.fin-hero-claro .rotulo {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.fin-hero-claro .valor {
  font-family: var(--serif);
  font-size: 26px; font-weight: 800;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
}
.fin-hero-claro .sub { font-size: 12.5px; margin-top: 6px; }

/* Botões de ação em miniatura (linhas de movimentação) */
.acao-mini {
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .15s;
  padding: 0;
}
.acao-mini svg { width: 14px; height: 14px; }
.acao-mini:hover { border-color: var(--primary); color: var(--primary); }
.acao-mini.ok:hover { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.acao-mini.perigo:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

/* Gráfico de barras (CSS puro) */
.grafico { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 6px; }
.grafico-mes { flex: 1; display: flex; flex-direction: column; height: 100%; min-width: 0; }
.grafico-mes .barras { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 5px; }
.grafico-mes .barra {
  width: 22px;
  border-radius: 6px 6px 2px 2px;
  transition: height .5s var(--mola);
  min-height: 3px;
}
.grafico-mes .barra.rec  { background: linear-gradient(180deg, var(--ok), color-mix(in srgb, var(--ok) 60%, transparent)); }
.grafico-mes .barra.desp { background: linear-gradient(180deg, var(--danger), color-mix(in srgb, var(--danger) 60%, transparent)); }
.grafico-mes .rotulo { text-align: center; font-size: 11px; color: var(--text-2); margin-top: 8px; text-transform: capitalize; }
.ponto-legenda { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* Barra de progresso (acordos) */
.progresso {
  height: 9px;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
}
.progresso-barra {
  height: 100%;
  border-radius: 999px;
  background: var(--grad-ouro);
  transition: width .6s var(--mola);
}

/* Preview do parcelamento (modal de acordo) */
.acordo-preview {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: var(--bg-2);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.acordo-preview.ok { border-style: solid; border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); background: var(--primary-soft); color: var(--text); }
.acordo-preview.erro { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.acordo-preview strong { color: var(--text); }
.acordo-preview.erro strong { color: var(--danger); }
.acordo-preview-total { margin-top: 6px; font-size: 11.5px; color: var(--text-2); }

/* ---------------- Acordos: lista minimalista de controle ---------------- */
.acordo-resumo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .acordo-resumo { grid-template-columns: 1fr; } }
.ar-tile {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--realce);
  padding: 16px 18px;
  transition: box-shadow .2s, transform .16s;
}
.ar-tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.ar-tile.alerta { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.ar-ic {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.ar-ic svg { width: 19px; height: 19px; }
.ar-ic.vermelho { background: var(--danger-soft); color: var(--danger); }
.ar-ic.laranja  { background: var(--warn-soft);   color: var(--warn); }
.ar-ic.azul     { background: var(--info-soft);   color: var(--info); }
.ar-ic.dourado  { background: var(--primary-soft); color: var(--primary); }
.acao-mini.dourado { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.ar-valor {
  font-family: var(--serif);
  font-size: 19px; font-weight: 800;
  letter-spacing: -.4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.ar-rotulo { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }

.lista-acordos { display: flex; flex-direction: column; }
.ac-linha {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--borda-suave);
  transition: background .14s;
}
.ac-linha:last-child { border-bottom: none; }
.ac-linha:hover { background: var(--primary-soft); }
.ac-linha.atrasada { box-shadow: inset 3px 0 0 var(--danger); }
.ac-cab { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 260px; cursor: pointer; }
.ac-status { flex-shrink: 0; width: 84px; justify-content: center; }
.ac-info { flex: 1; min-width: 0; }
.ac-titulo { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-barra-mini {
  flex-shrink: 0;
  width: 90px; height: 6px;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
}
.ac-barra-mini div { height: 100%; border-radius: 999px; background: var(--ok); }
.ac-linha.atrasada .ac-barra-mini div { background: var(--danger); }
.ac-valores { flex-shrink: 0; min-width: 120px; text-align: right; display: flex; flex-direction: column; line-height: 1.25; }
.ac-valores strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ac-acoes { flex-shrink: 0; display: flex; gap: 6px; }
.ac-parcelas { width: 100%; padding-top: 8px; }
@media (max-width: 760px) {
  .ac-barra-mini { display: none; }
  .ac-valores { text-align: left; }
}

/* ---------------- Acordos: cards em grid com donut ---------------- */
.acordo-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--realce);
  padding: 18px;
  transition: box-shadow .2s, transform .16s;
}
.acordo-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.acordo-card.atrasado { border-left: 3px solid var(--danger); }
.acordo-card.quitado { opacity: .82; }

.acordo-top { display: flex; align-items: flex-start; gap: 12px; }
.acordo-ic {
  flex-shrink: 0; width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.acordo-ic svg { width: 19px; height: 19px; }
.acordo-card.atrasado .acordo-ic { background: var(--danger-soft); color: var(--danger); }
.acordo-card.quitado .acordo-ic { background: var(--ok-soft); color: var(--ok); }
.acordo-cab { min-width: 0; flex: 1; }
.acordo-titulo { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acordo-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.acordo-cliente { font-size: 12.5px; color: var(--text-2); }
.acordo-cliente:hover { color: var(--primary); }

.acordo-progresso { margin: 14px 0 12px; }
.acordo-progresso-topo { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.acordo-progresso-topo span { font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; }
.acordo-progresso-topo strong { font-size: 13px; color: var(--primary); font-variant-numeric: tabular-nums; }
.acordo-barra { height: 7px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.acordo-barra-in { height: 100%; border-radius: 99px; background: var(--primary); transition: width .5s var(--mola); }
.acordo-card.quitado .acordo-barra-in { background: var(--ok); }
.acordo-card.atrasado .acordo-barra-in { background: var(--danger); }

.acordo-valores {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.acordo-valores > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acordo-valores .rot { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); }
.acordo-valores strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.acordo-rodape { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acordo-acoes { display: flex; gap: 6px; }
.acordo-parcelas { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--borda-suave); }

/* Lista de parcelas a vencer (acordos) — foco em lembrar/cobrar */
.lista-parc { display: flex; flex-direction: column; }
.parc-linha {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--borda-suave);
}
.parc-linha:last-child { border-bottom: none; }
.parc-data {
  flex-shrink: 0;
  width: 46px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--info-soft); color: var(--info);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.parc-linha.vencida .parc-data { background: var(--danger-soft); color: var(--danger); }
.parc-data .parc-dia { font-size: 18px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.parc-data .parc-mes { font-size: 9px; font-weight: 700; letter-spacing: 1px; margin-top: 2px; }
.parc-info { flex: 1; min-width: 0; }
.parc-info .parc-titulo { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.parc-valor { font-weight: 700; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.parc-acoes { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 680px) {
  .parc-linha { flex-wrap: wrap; }
  .parc-valor { order: 3; }
  .parc-acoes { order: 4; width: 100%; }
}

/* ============================================================
   Calculadoras (prazos / verbas)
   ============================================================ */
.pz-hero {
  position: relative;
  background:
    radial-gradient(420px 240px at 90% -20%, rgba(255, 255, 255, .14), transparent 60%),
    var(--grad-ouro);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 16px 40px -12px color-mix(in srgb, var(--primary) 50%, transparent);
}
[data-theme="dark"] .pz-hero { color: #101114; }
.pz-hero .rotulo {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  opacity: .85;
  margin-bottom: 8px;
}
.pz-data-grande {
  font-family: var(--serif);
  font-size: 27px; font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.15;
  text-transform: capitalize;
  font-variant-numeric: tabular-nums;
}
.pz-falta {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px; font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
}
[data-theme="dark"] .pz-falta { background: rgba(0, 0, 0, .14); }
.pz-falta.urgente { background: var(--danger); color: #fff; }

/* ============================================================
   Modal / Toast
   ============================================================ */
.modal-fundo {
  position: fixed; inset: 0;
  background: rgba(14, 15, 18, .62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 6vh 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal-fundo.aberto { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 590px;
  margin: auto 0;
  padding: 28px;
  animation: modal-entrar .22s cubic-bezier(.2, .9, .3, 1.2) both;
}
@media (max-width: 560px) {
  .modal-fundo { padding: 3vh 10px; }
  .modal { padding: 20px; }
}
@keyframes modal-entrar {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.modal h2 {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 700;
  font-family: var(--serif);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--borda-suave);
}
.modal .acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------------- Modal de tarefa (redesenhado) ---------------- */
.modal-tarefa { max-width: 620px; }
.modal-cabecalho {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--borda-suave);
}
.modal-cabecalho-icone {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.modal-cabecalho-icone svg { width: 21px; height: 21px; }
.modal-fechar {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: all .16s;
}
.modal-fechar:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.modal-fechar svg { width: 17px; height: 17px; }

/* Seletor visual de tipo de tarefa */
.mt-tipos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.mt-tipo {
  padding: 9px 6px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: all .16s;
}
.mt-tipo:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.mt-tipo.ativo { color: #fff; border-color: transparent; }
[data-theme="dark"] .mt-tipo.ativo { color: #101114; }
.mt-tipo.tipo-prazo_fatal.ativo { background: var(--danger); }
.mt-tipo.tipo-audiencia.ativo { background: var(--info); }
.mt-tipo.tipo-reuniao.ativo { background: var(--warn); }
.mt-tipo.tipo-tarefa.ativo { background: var(--primary); }
@media (max-width: 560px) { .mt-tipos { grid-template-columns: repeat(2, 1fr); } }

.mt-avancado { margin: 4px 0 0; }
.mt-avancado > summary {
  cursor: pointer;
  font-size: 12.5px; font-weight: 600;
  color: var(--primary);
  padding: 6px 0;
  list-style: none;
  user-select: none;
}
.mt-avancado > summary::-webkit-details-marker { display: none; }
.mt-avancado > summary::before { content: '+ '; font-weight: 700; }
.mt-avancado[open] > summary::before { content: '– '; }

#toast {
  position: fixed; bottom: 26px; right: 26px;
  display: flex; align-items: center; gap: 10px;
  background: var(--escuro-1);
  color: var(--escuro-texto-2);
  padding: 12px 20px 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--escuro-borda);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(12px) scale(.96);
  transition: opacity .3s var(--mola), transform .3s var(--mola);
  pointer-events: none;
  z-index: 200;
}
#toast.mostrar { opacity: 1; transform: none; }
#toast .toast-ic {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--ok);
  color: #06210f;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#toast .toast-ic svg { width: 15px; height: 15px; }
#toast.erro { background: var(--danger); border-color: transparent; }
#toast.erro .toast-ic { background: rgba(255,255,255,.25); color: #fff; }

/* ============================================================
   Login split-screen
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(760px 520px at 6% 8%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 55%),
    radial-gradient(760px 520px at 94% 92%, color-mix(in srgb, var(--roxo) 16%, transparent), transparent 55%),
    var(--escuro-1);
}
.login-split {
  display: flex;
  width: 100%; max-width: 1000px;
  min-height: 580px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .55);
  border: 1px solid var(--escuro-borda);
}
.login-hero {
  flex: 1.15;
  position: relative;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E"),
    radial-gradient(520px 320px at 92% -6%, color-mix(in srgb, var(--primary-claro) 12%, transparent), transparent 60%),
    linear-gradient(158deg, var(--escuro-3) 0%, var(--escuro-1) 62%);
  color: var(--escuro-texto-2);
  padding: 50px 46px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.login-hero::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid color-mix(in srgb, var(--escuro-texto-2) 8%, transparent);
  border-radius: 14px;
  pointer-events: none;
}
.login-hero::after {
  content: '';
  position: absolute;
  right: -20px; bottom: -50px;
  width: 300px; height: 300px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1'%3E%3Cpath d='m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='M7 21h10'/%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2'/%3E%3C/svg%3E") no-repeat center / contain;
  opacity: .05;
  pointer-events: none;
}
.login-hero .logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 18px; font-weight: 700; color: var(--escuro-texto-2);
  margin-bottom: 44px;
}
.login-hero .logo .logo-icone {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: var(--grad-ouro);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.login-hero .logo .logo-icone svg { width: 23px; height: 23px; }
.login-hero .logo span { color: var(--primary-claro); }
.login-hero .selo {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--primary-claro);
  margin-bottom: 16px;
}
.login-hero h1 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: 40px; font-weight: 800;
  line-height: 1.1; letter-spacing: -1.2px;
  color: var(--escuro-texto-2);
}
.login-hero h1 em { font-style: normal; font-weight: 600; color: #8f939c; }
.login-hero p { color: #8f939c; font-size: 14.5px; max-width: 350px; line-height: 1.65; }
.login-hero .recursos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 30px; }
.login-hero .recursos span {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7.5px 15px;
  border-radius: 999px;
  border: 1px solid rgba(143, 147, 156, .16);
  background: rgba(143, 147, 156, .05);
  font-size: 12.5px; font-weight: 500;
  color: #cbd5e6;
}
.login-hero .recursos svg { width: 14px; height: 14px; color: var(--primary-claro); }
.login-hero .rodape { margin-top: 24px; font-size: 11.5px; color: #5d6b85; letter-spacing: .3px; }

.login-form {
  flex: 1;
  background: var(--card);
  padding: 50px 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-form .selo {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.login-form h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 27px; font-weight: 800; letter-spacing: -.7px;
}
.login-form .sub { color: var(--text-2); font-size: 13.5px; margin-bottom: 28px; }
.login-form .btn { width: 100%; justify-content: center; padding: 12.5px; font-size: 14px; margin-top: 4px; }
.login-form .rodape { text-align: center; margin-top: 24px; font-size: 12px; color: var(--text-2); }

@media (max-width: 860px) {
  .login-hero { display: none; }
  .login-split { max-width: 430px; min-height: 0; }
}

.alerta {
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}
.alerta.erro { background: var(--danger-soft); color: var(--danger); border-left: 3px solid var(--danger); }
.alerta.ok   { background: var(--ok-soft); color: var(--ok); border-left: 3px solid var(--ok); }

/* ============================================================
   Seletor de tema (Configurações)
   ============================================================ */
.tema-grade {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}

/* Permissões da equipe */
.perm-bloco { padding: 14px 0; border-top: 1px solid var(--borda-suave); }
.perm-bloco:first-of-type { border-top: none; }
.perm-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.perm-cab strong { font-size: 14px; }
.perm-modulos { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-check {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.perm-check:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.perm-check input { width: auto; margin: 0; accent-color: var(--primary); cursor: pointer; }
.perm-check:has(input:checked) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.tema-opcao {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s var(--mola);
}
.tema-opcao:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); transform: translateY(-1px); }
.tema-opcao.ativo { border-color: var(--primary); color: var(--text); background: var(--primary-soft); }
.tema-amostra {
  width: 34px; height: 34px;
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 8px rgba(0, 0, 0, .15);
}
.tema-opcao.ativo .tema-amostra { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 0 3px var(--primary-soft), 0 2px 8px rgba(0, 0, 0, .15); }

/* ============================================================
   Utilidades
   ============================================================ */
.flex { display: flex; align-items: center; gap: 10px; }
.flex-entre { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt { margin-top: 18px; }
.texto-2 { color: var(--text-2); }
.texto-perigo { color: var(--danger); }
.pequeno { font-size: 12px; }
.sem-registros { text-align: center; color: var(--text-2); padding: 34px 16px; font-size: 13.5px; }
.sem-registros .vazio-ic {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: var(--bg-2);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  opacity: .8;
}
.sem-registros .vazio-ic svg { width: 26px; height: 26px; }
.sem-registros strong { display: block; color: var(--text); font-size: 15px; font-weight: 600; margin-bottom: 3px; }

/* Resumo do cliente (número grande + rótulo) — classe usada em cliente.php */
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat .valor {
  font-family: var(--serif);
  font-size: 24px; font-weight: 800;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
}
.stat .rotulo { font-size: 12px; color: var(--text-2); }

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: linear-gradient(var(--primary-soft), var(--border)); }
.timeline .item { position: relative; padding-bottom: 17px; }
.timeline .item::before {
  content: ''; position: absolute; left: -21.5px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--grad-ouro);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Animação de entrada e detalhes */
.main > * { animation: entrar .35s cubic-bezier(.2, .8, .3, 1) both; }
.main > *:nth-child(2) { animation-delay: .03s; }
.main > *:nth-child(3) { animation-delay: .06s; }
.main > *:nth-child(4) { animation-delay: .09s; }
.main > *:nth-child(5) { animation-delay: .12s; }
@keyframes entrar {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-2); }

::selection { background: var(--primary-soft); color: var(--text); }

html { scroll-behavior: smooth; }
.chip, .icone-btn, .seg a, .acoes-rapidas a { -webkit-tap-highlight-color: transparent; }
.chip:active, .icone-btn:active { transform: scale(.94); }
.chip, .icone-btn { transition: all .25s var(--mola); }

/* Toggle de tema no topo: mostra lua no claro, sol no escuro */
#btn-tema .ic-sol { display: none; }
[data-theme="dark"] #btn-tema .ic-lua { display: none; }
[data-theme="dark"] #btn-tema .ic-sol { display: block; }

@media (max-width: 1100px) {
  .grid[style*="1.6fr"] { grid-template-columns: 1fr !important; }
}

/* ---------------- Navegação mobile ---------------- */
.menu-mobile { display: none; flex-shrink: 0; }
.sidebar-fundo {
  display: none;
  position: fixed; inset: 0;
  background: rgba(14, 15, 18, .55);
  backdrop-filter: blur(2px);
  z-index: 110;
}
.sidebar-fundo.aberto { display: block; }

@media (max-width: 860px) {
  .menu-mobile { display: inline-flex; }
  .sidebar {
    transform: translateX(-105%);
    transition: transform .28s var(--mola);
    z-index: 120;
    box-shadow: var(--shadow-lg);
    width: 272px;
  }
  .sidebar.aberta { transform: none; }
  .main { margin-left: 0; padding: 0 16px 36px; }
  .topbar { margin: 0 -16px 14px; padding-left: 16px; padding-right: 16px; }
}

/* Botão de desfazer conclusão (agenda) — sempre visível nos itens concluídos */
.cal-check.desfazer, .evento-check.desfazer { opacity: .75; }
.cal-evento.concluida .cal-check.desfazer,
.evento.concluida .evento-check.desfazer { display: inline-flex; }

/* ---------------- Publicações: modo consulta de colega ---------------- */
.pub-aviso-colega {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--info) 35%, transparent);
  border-radius: var(--radius);
  background: var(--info-soft);
  color: var(--text);
}
.pub-aviso-colega svg { width: 20px; height: 20px; color: var(--info); flex-shrink: 0; }
.pub-card.de-colega {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--info) 45%, var(--border));
  background: color-mix(in srgb, var(--info) 4%, var(--card));
}

/* ---------------- Filtro alfabético (clientes) ---------------- */
.letras-filtro {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 16px;
}
.letras-filtro .letra {
  min-width: 25px; height: 25px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  transition: all .14s;
}
.letras-filtro .letra:hover { border-color: var(--primary); color: var(--primary); }
.letras-filtro .letra.ativo { background: var(--primary); border-color: transparent; color: #fff; }
[data-theme="dark"] .letras-filtro .letra.ativo { color: #101114; }

/* Bloco que só existe na impressão (ex.: audiências do mês) */
.so-imprimir { display: none; }

@media print {
  .sidebar, .topbar, .hero-acoes, .btn, .chip, .acoes-rapidas, .seg, .nav-seta, .agenda-bar .flex { display: none !important; }
  .main { margin: 0; padding: 0; }
  body { background: #fff; }
  .main > * { animation: none; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

  /* Modos de impressão dedicados: esconde tudo e mostra só o bloco pedido */
  body.print-aud .main > *:not(#print-audiencias) { display: none !important; }
  body.print-aud #print-audiencias { display: block; }
  body.print-ag .main > *:not(#print-agenda) { display: none !important; }
  body.print-ag #print-agenda { display: block; }

  #print-audiencias h1, #print-agenda h1 { font-size: 20px; margin: 0 0 2px; }
  #print-audiencias .sub-impressao, #print-agenda .sub-impressao { color: #555; font-size: 12px; margin-bottom: 14px; }

  /* Agenda da semana */
  #print-agenda .pr-dia { margin-bottom: 14px; break-inside: avoid; }
  #print-agenda .pr-dia-cab {
    font-weight: 700; font-size: 13px;
    border-bottom: 2px solid #000;
    padding-bottom: 3px; margin-bottom: 4px;
    text-transform: capitalize;
  }
  #print-agenda .pr-hoje { font-size: 10px; border: 1px solid #000; border-radius: 3px; padding: 1px 6px; margin-left: 6px; }
  #print-agenda .pr-vazio { color: #777; font-size: 12px; padding: 3px 0 6px; }
  #print-agenda table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  #print-agenda td { border-bottom: 1px solid #ddd; padding: 5px 8px 5px 0; vertical-align: top; }
  #print-agenda small { color: #555; }

  /* Audiências da semana: um bloco por audiência, com checklist */
  .pr-aud { border: 1.5px solid #000; border-radius: 6px; padding: 12px 14px; margin-bottom: 14px; break-inside: avoid; }
  .pr-aud-cab { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 14px; margin-bottom: 4px; }
  .pr-aud-data { font-weight: 700; text-transform: capitalize; }
  .pr-aud-meta { font-size: 12px; color: #333; margin-bottom: 4px; }
  .pr-checklist { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 10px 0 8px; }
  .pr-checklist .chk { font-size: 12px; display: inline-flex; align-items: center; gap: 7px; }
  .pr-checklist .chk::before {
    content: '';
    width: 13px; height: 13px;
    border: 1.5px solid #000; border-radius: 3px;
    display: inline-block;
  }
  .pr-anotacoes .rotulo { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #555; margin-bottom: 2px; }
  .pr-anotacoes .linha { border-bottom: 1px solid #999; height: 24px; }
}
