/* ─── Variables ─────────────────────────────────────────────── */
:root {
    --bg:             #f5f5f0;
    --sidebar-bg:     #1a1f2e;
    --sidebar-text:   #e8e8e0;
    --sidebar-accent: #d4a574;
    --column-bg:      #ffffff;
    --column-header:  #2c3344;
    --card-bg:        #fafaf5;
    --card-border:    #e0ddd0;
    --text-primary:   #1a1f2e;
    --text-secondary: #6b6b5e;
    --accent:         #c8956d;
    --accent-dark:    #a67550;
    --inactive-bg:    #ededea;
    --inactive-text:  #9a9a90;
    --master-gold:    #b8860b;
    --shadow:         0 1px 3px rgba(26,31,46,0.08), 0 1px 2px rgba(26,31,46,0.04);
    --shadow-hover:   0 4px 12px rgba(26,31,46,0.12), 0 2px 4px rgba(26,31,46,0.06);
    --shadow-modal:   0 20px 60px rgba(26,31,46,0.25);
}

/* ─── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--bg);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
}
a { color: inherit; text-decoration: none; }

/* ─── Layout ───────────────────────────────────────────────── */
.layout {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ─── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid #0d1119;
    height: 100vh;
    overflow: hidden;
}

.scramble-toggle {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(232, 232, 224, 0.16);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}
.scramble-toggle::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}
.scramble-toggle:hover { color: rgba(232, 232, 224, 0.4); }
.scramble-toggle.active { color: var(--sidebar-accent); }

.logo {
    padding: 28px 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.logo-mark {
    font-family: 'Georgia', serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--sidebar-text);
    line-height: 1;
}
.logo-mark .accent { color: var(--sidebar-accent); }
.logo-sub {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: rgba(232,232,224,0.5);
    margin-top: 6px;
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
}

/* ─── Nav ──────────────────────────────────────────────────── */
.nav {
    padding: 16px 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(232,232,224,0.18) transparent;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb {
    background: rgba(232,232,224,0.10);
    border-radius: 3px;
    transition: background 0.2s ease;
}
.nav:hover::-webkit-scrollbar-thumb { background: rgba(232,232,224,0.22); }
.nav::-webkit-scrollbar-thumb:hover { background: rgba(232,232,224,0.34); }

/* Section labels */
.nav-section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(232,232,224,0.4);
    padding: 8px 24px;
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    margin-top: 16px;
    border-top: 1px solid rgba(232,232,224,0.08);
    padding-top: 16px;
}
.nav-section-label:first-child { margin-top: 0; border-top: none; padding-top: 8px; }

/* Nav items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 15px;
    font-family: 'Georgia', serif;
    transition: background 0.15s ease;
    border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.04); text-decoration: none; }
.nav-item.active {
    background: rgba(212,165,116,0.08);
    border-left-color: var(--sidebar-accent);
    color: var(--sidebar-accent);
}

/* Locked nav items */
.nav-item.locked { opacity: 0.5; cursor: not-allowed; }
.nav-item.locked:hover { background: rgba(255,255,255,0.02); }
.nav-item .lock-tag {
    margin-left: auto;
    font-size: 14px;
    opacity: 0.7;
    color: rgba(232,232,224,0.5);
    display: flex;
    align-items: center;
}

/* Nav badge (red counter) */
.nav-item .nav-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #c0392b;
    color: white;
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 600;
}

/* ─── Nav icons (CSS mask — color via background-color) ─────── */
.nav-icon {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
    background-color: rgba(232,232,224,0.85);
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    transition: background-color 0.15s ease;
}
.nav-item:hover .nav-icon  { background-color: rgba(232,232,224,0.95); }
.nav-item.active .nav-icon { background-color: var(--sidebar-accent); }

/* Fallback for any unknown icon name: small circle dot */
[class*='ni-'] {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3C/svg%3E");
}

/* Icon definitions — add .ni-{key} matching your nav/nav.go icon keys */
.ni-tarefas {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
}
.ni-calendario {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cline x1='8' y1='3' x2='8' y2='7'/%3E%3Cline x1='16' y1='3' x2='16' y2='7'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cline x1='8' y1='3' x2='8' y2='7'/%3E%3Cline x1='16' y1='3' x2='16' y2='7'/%3E%3C/svg%3E");
}
.ni-email {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E");
}
.ni-conhecimento {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5a2 2 0 0 1 2-2h11v16H6a2 2 0 0 0-2 2V5z'/%3E%3Cpath d='M4 19a2 2 0 0 0 2 2h11'/%3E%3Cpath d='M9 7h5'/%3E%3Cpath d='M9 11h5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5a2 2 0 0 1 2-2h11v16H6a2 2 0 0 0-2 2V5z'/%3E%3Cpath d='M4 19a2 2 0 0 0 2 2h11'/%3E%3Cpath d='M9 7h5'/%3E%3Cpath d='M9 11h5'/%3E%3C/svg%3E");
}
.ni-financeiro {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.5 9a2.5 2.5 0 0 1 5 0c0 1.5-1.5 2-2.5 2.5M12 16h.01'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.5 9a2.5 2.5 0 0 1 5 0c0 1.5-1.5 2-2.5 2.5M12 16h.01'/%3E%3C/svg%3E");
}
.ni-estoque {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8l-9-5-9 5 9 5 9-5z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8'/%3E%3Cpath d='M12 13v8'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8l-9-5-9 5 9 5 9-5z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8'/%3E%3Cpath d='M12 13v8'/%3E%3C/svg%3E");
}
.ni-simuladores {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Cline x1='8' y1='9' x2='16' y2='9'/%3E%3Cline x1='8' y1='13' x2='11' y2='13'/%3E%3Cline x1='13' y1='13' x2='16' y2='13'/%3E%3Cline x1='8' y1='17' x2='11' y2='17'/%3E%3Cline x1='13' y1='17' x2='16' y2='17'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Cline x1='8' y1='9' x2='16' y2='9'/%3E%3Cline x1='8' y1='13' x2='11' y2='13'/%3E%3Cline x1='13' y1='13' x2='16' y2='13'/%3E%3Cline x1='8' y1='17' x2='11' y2='17'/%3E%3Cline x1='13' y1='17' x2='16' y2='17'/%3E%3C/svg%3E");
}
.ni-templates {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cline x1='3' y1='9' x2='21' y2='9'/%3E%3Cline x1='9' y1='9' x2='9' y2='20'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cline x1='3' y1='9' x2='21' y2='9'/%3E%3Cline x1='9' y1='9' x2='9' y2='20'/%3E%3C/svg%3E");
}
.ni-painel, .ni-adminpanel {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='3' y='3' width='8' height='8' rx='1'/%3E%3Crect x='13' y='3' width='8' height='5' rx='1'/%3E%3Crect x='13' y='10' width='8' height='11' rx='1'/%3E%3Crect x='3' y='13' width='8' height='8' rx='1'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='3' y='3' width='8' height='8' rx='1'/%3E%3Crect x='13' y='3' width='8' height='5' rx='1'/%3E%3Crect x='13' y='10' width='8' height='11' rx='1'/%3E%3Crect x='3' y='13' width='8' height='8' rx='1'/%3E%3C/svg%3E");
}
.ni-sourcing {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='15' r='3.5'/%3E%3Ccircle cx='18' cy='15' r='3.5'/%3E%3Cpath d='M6 11.5V6.5A1.5 1.5 0 0 1 7.5 5h1A1.5 1.5 0 0 1 10 6.5V12'/%3E%3Cpath d='M18 11.5V6.5A1.5 1.5 0 0 0 16.5 5h-1A1.5 1.5 0 0 0 14 6.5V12'/%3E%3Cpath d='M10 8h4'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='15' r='3.5'/%3E%3Ccircle cx='18' cy='15' r='3.5'/%3E%3Cpath d='M6 11.5V6.5A1.5 1.5 0 0 1 7.5 5h1A1.5 1.5 0 0 1 10 6.5V12'/%3E%3Cpath d='M18 11.5V6.5A1.5 1.5 0 0 0 16.5 5h-1A1.5 1.5 0 0 0 14 6.5V12'/%3E%3Cpath d='M10 8h4'/%3E%3C/svg%3E");
}
.ni-comercial {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17l6-6 4 4 8-8'/%3E%3Cpath d='M14 7h7v7'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17l6-6 4 4 8-8'/%3E%3Cpath d='M14 7h7v7'/%3E%3C/svg%3E");
}
.ni-compras {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1.4'/%3E%3Ccircle cx='17' cy='20' r='1.4'/%3E%3Cpath d='M3 4h2l2.5 11h12l2-7H7'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1.4'/%3E%3Ccircle cx='17' cy='20' r='1.4'/%3E%3Cpath d='M3 4h2l2.5 11h12l2-7H7'/%3E%3C/svg%3E");
}
.ni-contabil {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h13l3 3v13H4z'/%3E%3Cpath d='M8 9h8'/%3E%3Cpath d='M8 13h8'/%3E%3Cpath d='M8 17h5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h13l3 3v13H4z'/%3E%3Cpath d='M8 9h8'/%3E%3Cpath d='M8 13h8'/%3E%3Cpath d='M8 17h5'/%3E%3C/svg%3E");
}
.ni-controladoria {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 20h18'/%3E%3Crect x='5' y='10' width='3' height='10'/%3E%3Crect x='10.5' y='6' width='3' height='14'/%3E%3Crect x='16' y='13' width='3' height='7'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 20h18'/%3E%3Crect x='5' y='10' width='3' height='10'/%3E%3Crect x='10.5' y='6' width='3' height='14'/%3E%3Crect x='16' y='13' width='3' height='7'/%3E%3C/svg%3E");
}
.ni-estoque {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='8' height='9'/%3E%3Crect x='13' y='11' width='8' height='9'/%3E%3Crect x='8' y='3' width='8' height='8'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='8' height='9'/%3E%3Crect x='13' y='11' width='8' height='9'/%3E%3Crect x='8' y='3' width='8' height='8'/%3E%3C/svg%3E");
}
.ni-financeiro {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='3' y='6' width='18' height='13' rx='1'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Ccircle cx='8' cy='14' r='1.2'/%3E%3Cline x1='11.5' y1='14' x2='17' y2='14'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='3' y='6' width='18' height='13' rx='1'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Ccircle cx='8' cy='14' r='1.2'/%3E%3Cline x1='11.5' y1='14' x2='17' y2='14'/%3E%3C/svg%3E");
}
.ni-simulador {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cline x1='8' y1='7' x2='16' y2='7'/%3E%3Cline x1='8' y1='11' x2='9' y2='11'/%3E%3Cline x1='12' y1='11' x2='13' y2='11'/%3E%3Cline x1='8' y1='15' x2='9' y2='15'/%3E%3Cline x1='12' y1='15' x2='13' y2='15'/%3E%3Cline x1='16' y1='11' x2='16' y2='15'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cline x1='8' y1='7' x2='16' y2='7'/%3E%3Cline x1='8' y1='11' x2='9' y2='11'/%3E%3Cline x1='12' y1='11' x2='13' y2='11'/%3E%3Cline x1='8' y1='15' x2='9' y2='15'/%3E%3Cline x1='12' y1='15' x2='13' y2='15'/%3E%3Cline x1='16' y1='11' x2='16' y2='15'/%3E%3C/svg%3E");
}
.ni-fiscal {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3v18l2-1.5L9 21l2-1.5L13 21l2-1.5L17 21l2-1.5V3z'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='16' y2='12'/%3E%3Cline x1='8' y1='16' x2='13' y2='16'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3v18l2-1.5L9 21l2-1.5L13 21l2-1.5L17 21l2-1.5V3z'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='16' y2='12'/%3E%3Cline x1='8' y1='16' x2='13' y2='16'/%3E%3C/svg%3E");
}
.ni-juridico {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='3' x2='12' y2='21'/%3E%3Cpath d='M7 6h10'/%3E%3Cpath d='M7 6l-3 7h6z'/%3E%3Cpath d='M17 6l-3 7h6z'/%3E%3Cpath d='M2 13a4 4 0 0 0 8 0'/%3E%3Cpath d='M14 13a4 4 0 0 0 8 0'/%3E%3Cpath d='M8 21h8'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='3' x2='12' y2='21'/%3E%3Cpath d='M7 6h10'/%3E%3Cpath d='M7 6l-3 7h6z'/%3E%3Cpath d='M17 6l-3 7h6z'/%3E%3Cpath d='M2 13a4 4 0 0 0 8 0'/%3E%3Cpath d='M14 13a4 4 0 0 0 8 0'/%3E%3Cpath d='M8 21h8'/%3E%3C/svg%3E");
}
.ni-time {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c0-3.5 3-6 6.5-6s6.5 2.5 6.5 6'/%3E%3Ccircle cx='17' cy='9' r='2.8'/%3E%3Cpath d='M15 14.5c2.8 0.3 6.5 2 6.5 5.5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c0-3.5 3-6 6.5-6s6.5 2.5 6.5 6'/%3E%3Ccircle cx='17' cy='9' r='2.8'/%3E%3Cpath d='M15 14.5c2.8 0.3 6.5 2 6.5 5.5'/%3E%3C/svg%3E");
}
.ni-bu,
.ni-businessunit {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Cpath d='M3 21V8l9-5 9 5v13'/%3E%3Cpath d='M9 21v-7h6v7'/%3E%3Cpath d='M3 21h18'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Cpath d='M3 21V8l9-5 9 5v13'/%3E%3Cpath d='M9 21v-7h6v7'/%3E%3Cpath d='M3 21h18'/%3E%3C/svg%3E");
}
.ni-empresas {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='4' y='3' width='16' height='18' rx='1'/%3E%3Cline x1='8' y1='7' x2='10' y2='7'/%3E%3Cline x1='14' y1='7' x2='16' y2='7'/%3E%3Cline x1='8' y1='11' x2='10' y2='11'/%3E%3Cline x1='14' y1='11' x2='16' y2='11'/%3E%3Cline x1='8' y1='15' x2='10' y2='15'/%3E%3Cline x1='14' y1='15' x2='16' y2='15'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Crect x='4' y='3' width='16' height='18' rx='1'/%3E%3Cline x1='8' y1='7' x2='10' y2='7'/%3E%3Cline x1='14' y1='7' x2='16' y2='7'/%3E%3Cline x1='8' y1='11' x2='10' y2='11'/%3E%3Cline x1='14' y1='11' x2='16' y2='11'/%3E%3Cline x1='8' y1='15' x2='10' y2='15'/%3E%3Cline x1='14' y1='15' x2='16' y2='15'/%3E%3C/svg%3E");
}
.ni-config {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E");
}

.ni-monitor {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5'%3E%3Crect x='3' y='4' width='18' height='13' rx='1'/%3E%3Cline x1='8' y1='20' x2='16' y2='20'/%3E%3Cline x1='12' y1='17' x2='12' y2='20'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5'%3E%3Crect x='3' y='4' width='18' height='13' rx='1'/%3E%3Cline x1='8' y1='20' x2='16' y2='20'/%3E%3Cline x1='12' y1='17' x2='12' y2='20'/%3E%3C/svg%3E");
}
.ni-relacionamentos {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7' cy='10' r='3'/%3E%3Ccircle cx='17' cy='10' r='3'/%3E%3Cpath d='M2.5 20c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5'/%3E%3Cpath d='M12.5 20c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7' cy='10' r='3'/%3E%3Ccircle cx='17' cy='10' r='3'/%3E%3Cpath d='M2.5 20c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5'/%3E%3Cpath d='M12.5 20c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5'/%3E%3C/svg%3E");
}

/* ─── Chip do usuário ──────────────────────────────────────── */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.user-chip:hover { background: rgba(255,255,255,0.05); text-decoration: none; }
.user-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-accent);
    color: var(--sidebar-bg);
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.user-name {
    font-size: 13px;
    color: var(--sidebar-text);
    font-family: 'Georgia', serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(232,232,224,0.4);
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
}
.user-logout {
    flex-shrink: 0;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(232,232,224,0.5);
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    padding: 6px 8px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.user-logout:hover {
    color: var(--sidebar-accent);
    background: rgba(255,255,255,0.05);
    text-decoration: none;
}

.sidebar-footer {
    padding: 14px 24px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 11px;
    color: rgba(232,232,224,0.4);
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* ─── Main area ────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ─── Topbar ───────────────────────────────────────────────── */
.topbar {
    padding: 16px 32px 18px;
    border-bottom: 1px solid rgba(26,31,46,0.08);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
    min-height: 72px;
}
.topbar-subtitle {
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}
.topbar-subtitle a { color: inherit; transition: color 0.15s; }
.topbar-subtitle a:hover { color: var(--accent); }
.topbar-title {
    font-family: 'Georgia', serif;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    line-height: 1.1;
}

/* ─── Messages ─────────────────────────────────────────────── */
/* Stack flutuante no canto superior direito, acima do modal (100) e do
   login (1000). O container não captura cliques; cada toast sim (dismiss). */
.messages {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    width: min(380px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    pointer-events: none;
}
.msg {
    pointer-events: auto;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    background: #e0f2fe;
    border-left: 3px solid #0284c7;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    animation: msg-in 0.18s ease-out;
}
@keyframes msg-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* Aceita tanto os códigos curtos do template server-side (ok/wr/er/if)
   quanto os nomes completos usados pelo msgadd no cliente (ok/warning/error/info). */
.msg-ok, .msg-success { background: #dcfce7; border-left-color: #16a34a; }
.msg-wr, .msg-warning { background: #fef9c3; border-left-color: #ca8a04; }
.msg-er, .msg-error   { background: #fee2e2; border-left-color: #dc2626; }
.msg-if, .msg-info    { background: #e0f2fe; border-left-color: #0284c7; }

/* ─── Content ──────────────────────────────────────────────── */
.content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(26,31,46,0.10) transparent;
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: rgba(26,31,46,0.10); border-radius: 3px; }

/* ─── Typography ───────────────────────────────────────────── */
code {
    background: rgba(26,31,46,0.06);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-family: "Fira Code", "Cascadia Code", monospace;
    font-size: 0.88em;
    color: var(--accent-dark);
    border: 1px solid var(--card-border);
}

/* ─── Page: Home ───────────────────────────────────────────── */
.page-home { max-width: 600px; }
.page-home h1 { font-size: 1.75rem; margin-bottom: 0.5rem; font-weight: 400; }
.page-home p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 14px;
}

/* ─── Login ────────────────────────────────────────────────── */
.login-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #f5f1e8 0%, #ebe4d2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}
.login-card {
    background: white;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(50,40,20,0.12);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-mark {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.login-logo-mark .accent { color: var(--accent-dark); }
.login-logo-sub {
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 6px;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 5px; }
.login-field label {
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    font-weight: 600;
}
.login-field input {
    padding: 10px 12px;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s ease;
    background: white;
}
.login-field input:focus { border-color: var(--accent-dark); }
.login-error {
    background: #fdecea;
    color: #b13a2c;
    border: 1px solid #f0c2bb;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 12px;
}
.login-submit {
    margin-top: 6px;
    padding: 12px 16px;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.login-submit:hover { background: var(--accent-dark); }
.login-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--card-border);
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
}
.login-accent { color: var(--accent-dark); }

/* ─── Page: Adminpanel ─────────────────────────────────────── */
.page-adminpanel { max-width: 900px; }

.painel-intro { margin-bottom: 28px; }
.painel-intro p {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 700px;
}

.painel-grupo { margin-bottom: 32px; }

.painel-grupo-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--card-border);
}

.painel-grupo-icon {
    width: 24px;
    height: 24px;
    display: block;
    flex-shrink: 0;
    background-color: var(--accent-dark);
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}

.painel-grupo-title {
    font-family: 'Georgia', serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--text-primary);
}

.painel-grupo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.painel-item {
    background: white;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    color: inherit;
}
.painel-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.painel-item.locked {
    opacity: 0.55;
    cursor: not-allowed;
    background: var(--bg);
}
.painel-item.locked:hover {
    border-color: var(--card-border);
    box-shadow: none;
}

.painel-item-label {
    flex: 1;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.painel-item-arrow {
    color: var(--accent-dark);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.painel-item:not(.locked):hover .painel-item-arrow { opacity: 1; }

.painel-item-lock { font-size: 13px; opacity: 0.6; }

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
    padding: 9px 18px;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    border: none;
    border-radius: 3px;
    transition: all 0.15s ease;
}
.btn-primary { background: var(--sidebar-bg); color: white; }
.btn-primary:hover { background: #2c3344; }
.btn-primary:disabled { background: #888; cursor: not-allowed; }
.btn-secondary { background: white; color: var(--text-primary); border: 1px solid var(--card-border); }
.btn-secondary:hover { background: var(--card-bg); border-color: var(--text-secondary); }
.btn-danger { background: transparent; color: #a04040; border: 1px solid transparent; }
.btn-danger:hover { border-color: #a04040; }
.btn-danger:disabled { color: #ccc; cursor: not-allowed; }

/* ─── Form inputs (shared) ──────────────────────────────────── */
.modal-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    font-family: 'Helvetica Neue', sans-serif;
    margin-bottom: 8px;
    display: block;
}
.modal-input, .modal-textarea {
    width: 100%;
    border: 1px solid var(--card-border);
    border-radius: 3px;
    padding: 10px 12px;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    background: var(--card-bg);
}
.modal-input { height: 38px; }
.modal-textarea { min-height: 140px; line-height: 1.6; resize: vertical; }
.modal-input:focus, .modal-textarea:focus { border-color: var(--accent); background: white; }
.modal-input.invalid { border-color: #c5482e; background: #fdf2ef; }
.modal-input.valid { border-color: #5a8a4e; }

/* ─── Page: People ──────────────────────────────────────────── */
.painel-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.painel-title {
    font-family: 'Georgia', serif;
    font-size: 26px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.painel-subtitle {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 760px;
}
.painel-subtitle strong { color: var(--text-primary); }
.painel-empty {
    text-align: center;
    color: var(--text-secondary);
    font-family: 'Helvetica Neue', sans-serif;
    font-style: italic;
    padding: 48px 40px;
}

.ext-resumo-multi { margin-bottom: 18px; }
.ext-resumo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.ext-resumo-card {
    background: white;
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    padding: 12px 14px;
}
.ext-resumo-card.neutro  { border-left-color: var(--text-secondary); }
.ext-resumo-card.entrada { border-left-color: #3a7d44; }
.ext-resumo-card.saida   { border-left-color: #a04040; }
.ext-resumo-label {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.ext-resumo-valor {
    font-family: 'Georgia', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}
.ext-resumo-card.entrada .ext-resumo-valor { color: #3a7d44; }
.ext-resumo-card.saida   .ext-resumo-valor { color: #a04040; }

.ext-filtros {
    background: white;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 16px 18px;
    margin-bottom: 18px;
}
.ext-filtros-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.ext-filtro { display: flex; flex-direction: column; gap: 4px; }
.ext-filtro .modal-label { margin-bottom: 0; }

.ext-table-wrap {
    background: white;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    overflow-x: auto;
}
.ext-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 13px;
}
.ext-table thead th {
    background: var(--bg);
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--card-border);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}
.ext-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-primary);
    vertical-align: middle;
}
.ext-row { cursor: pointer; transition: background 0.1s ease; }
.ext-row:hover { background: #fafaf5; }
.ext-row:last-child td { border-bottom: none; }
.ext-categoria { font-size: 11px; color: var(--text-secondary); margin-top: 2px; font-style: italic; }

.rel-classif-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Helvetica Neue', sans-serif;
    white-space: nowrap;
}
.rel-tag-q5-pj       { background: rgba(58,125,68,0.12);  color: #2e5d36; border: 1px solid rgba(58,125,68,0.30); }
.rel-tag-q5-pf       { background: rgba(60,100,140,0.12); color: #2d5377; border: 1px solid rgba(60,100,140,0.30); }
.rel-tag-terceiro-pj { background: rgba(120,120,120,0.10); color: #6b6b6b; border: 1px solid rgba(120,120,120,0.30); }
.rel-tag-terceiro-pf { background: rgba(120,120,120,0.10); color: #6b6b6b; border: 1px solid rgba(120,120,120,0.30); }
.rel-readonly-lock { display: inline-block; margin-left: 5px; font-size: 10px; opacity: 0.55; cursor: help; }

.aus-del-btn {
    background: none;
    border: 1px solid transparent;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1;
}
.aus-del-btn:hover { background: #f5d4cc; border-color: #c0392b; color: #c0392b; }

/* ─── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; display: none;
    align-items: center; justify-content: center;
    z-index: 100;
    background: rgba(26, 31, 46, 0.5);
    backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }
.modal {
    background: white; width: 90%; max-width: 640px;
    max-height: 88vh; border-radius: 4px;
    box-shadow: var(--shadow-modal);
    display: flex; flex-direction: column; overflow: hidden;
}
.modal.modal-tarefa { height: 78vh; max-height: 78vh; }
.modal-header {
    padding: 24px 28px 16px; border-bottom: 1px solid var(--card-border);
    display: flex; justify-content: space-between;
    align-items: flex-start; gap: 16px; flex-shrink: 0;
}
.modal-title-input {
    font-family: 'Georgia', serif; font-size: 22px; font-weight: 400;
    color: var(--text-primary); border: none; outline: none;
    width: 100%; background: transparent; padding: 4px 0;
    border-bottom: 1px dashed transparent;
}
.modal-title-input:focus { border-bottom-color: var(--accent); }
.modal-close {
    background: none; border: none; font-size: 24px;
    color: var(--text-secondary); cursor: pointer; line-height: 1; padding: 0 4px;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px 28px; overflow-y: auto; flex: 1; }
.modal-body-tabs { display: flex; overflow: hidden; flex: 1; min-height: 0; }
.modal-section { margin-bottom: 22px; }
.modal-section:last-child { margin-bottom: 0; }
.modal-footer {
    padding: 16px 28px; border-top: 1px solid var(--card-border);
    display: flex; justify-content: space-between;
    align-items: center; background: var(--bg); flex-shrink: 0;
}
.modal-footer-right { display: flex; align-items: center; gap: 8px; }

/* ─── Modal tabs ─────────────────────────────────────────────── */
.modal-tabs {
    display: flex; flex-direction: column; gap: 2px;
    padding: 16px 0; border-right: 1px solid var(--card-border);
    width: 56px; flex-shrink: 0; background: var(--bg);
}
.modal-tab {
    background: none; border: none; cursor: pointer;
    padding: 12px 14px; display: flex; align-items: center;
    justify-content: center; color: var(--text-secondary);
    border-left: 3px solid transparent; transition: all 0.15s ease;
}
.modal-tab:hover { background: white; color: var(--text-primary); }
.modal-tab.active { background: white; color: var(--accent-dark); border-left-color: var(--accent-dark); }
.modal-tab-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.modal-tab-icon svg { width: 18px; height: 18px; display: block; }
.modal-tab-label { display: none; }
.modal-tab-content { flex: 1; padding: 16px 24px; overflow-y: auto; min-width: 0; }

/* ─── Modal extras ───────────────────────────────────────────── */
.input-hint { font-size: 11px; color: var(--text-secondary); margin-top: 4px; font-family: 'Helvetica Neue', sans-serif; }
.input-hint.error { color: #c5482e; }
.input-hint.success { color: #5a8a4e; }
.checkbox-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; cursor: pointer;
    font-size: 13px; font-family: 'Helvetica Neue', sans-serif;
    line-height: 16px; font-family: 'Helvetica Neue', sans-serif;
    border: 1px solid var(--card-border); border-radius: 3px;
    background: var(--card-bg); transition: background 0.1s ease;
}
.checkbox-item:hover { background: var(--bg); }
.checkbox-item input[type="checkbox"] { accent-color: var(--accent-dark); cursor: pointer; flex-shrink: 0; }
.checkbox-item.checked { background: rgba(58, 125, 68, 0.06); }
.q5-block {
    background: var(--bg); padding: 10px 12px;
    border-radius: 4px; border-left: 3px solid #c4c4be;
}
.q5-block.q5-on { background: rgba(58, 125, 68, 0.06); border-left-color: #3a7d44; }
.q5-label { font-weight: 600; font-size: 13px; font-family: 'Helvetica Neue', sans-serif; }
.q5-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.5; margin-top: 2px; font-family: 'Helvetica Neue', sans-serif; }

/* ─── Modal: aba Mais detalhes (people) ──────────────────────── */
.btn-small { padding: 4px 10px; font-size: 11px; }

/* Lista de checkboxes (BUs, CNPJs) — itens viram linhas dentro de um container */
.checkbox-list {
    border: 1px solid var(--card-border); border-radius: 3px;
    background: var(--card-bg); max-height: 220px; overflow-y: auto;
}
.checkbox-list-empty {
    padding: 16px; text-align: center; font-size: 13px;
    color: var(--text-secondary); font-style: italic; font-family: 'Helvetica Neue', sans-serif;
}
.checkbox-list .checkbox-item {
    border: none; border-radius: 0; background: transparent;
    border-bottom: 1px solid var(--card-border);
}
.checkbox-list .checkbox-item:last-child { border-bottom: none; }
.checkbox-item .item-sub { font-size: 11px; color: var(--text-secondary); margin-left: auto; }

/* ─── Grid de permissões RBAC (people → aba Acesso) ──────────────────────── */
.access-grid {
    border: 1px solid var(--card-border); border-radius: 3px;
    background: var(--card-bg); max-height: 320px; overflow-y: auto;
}
.access-mod { padding: 10px 12px; border-bottom: 1px solid var(--card-border); }
.access-mod:last-child { border-bottom: none; }
.access-mod-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--accent-dark); margin-bottom: 6px; font-family: 'Helvetica Neue', sans-serif;
}
.access-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.access-action {
    padding: 5px 9px; gap: 6px; font-size: 12px; line-height: 14px; border-radius: 3px;
}
.access-action input[type="checkbox"]:disabled { cursor: not-allowed; }

/* Uploader de foto */
.foto-uploader { display: flex; align-items: center; gap: 12px; }
.foto-preview { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.foto-preview img {
    width: 56px; height: 56px; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--accent); display: block;
}
.foto-remove {
    position: absolute; top: -4px; right: -4px;
    width: 18px; height: 18px; border-radius: 50%;
    background: white; border: 1px solid #d4d4cc; color: var(--text-secondary);
    font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.foto-remove:hover { background: #c0392b; color: white; border-color: #c0392b; }
.foto-placeholder {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--bg); border: 2px dashed var(--card-border);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Helvetica Neue', sans-serif; font-size: 9px;
    color: var(--text-secondary); text-transform: uppercase;
    letter-spacing: 0.5px; flex-shrink: 0; text-align: center; padding: 4px;
}

/* Cargos (histórico) */
.cargos-add-btn {
    background: none; border: 1px dashed var(--card-border); border-radius: 4px;
    padding: 4px 10px; font-family: 'Helvetica Neue', sans-serif; font-size: 11px;
    color: var(--accent-dark); cursor: pointer; transition: all 0.15s ease;
}
.cargos-add-btn:hover:not(:disabled) { border-style: solid; background: var(--bg); }
.cargos-add-btn:disabled { color: var(--text-secondary); cursor: not-allowed; opacity: 0.7; }
.cargos-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.cargos-empty {
    color: var(--text-secondary); font-style: italic; font-size: 12px;
    padding: 12px; text-align: center; background: var(--bg); border-radius: 4px;
}
.cargo-item {
    display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--card-border); border-radius: 4px; padding: 8px 10px;
}
.cargo-item-main { flex: 1; display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; }
.cargo-item-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.cargo-item-date { font-size: 11px; color: var(--text-secondary); }

/* Mini-modal de cargo (overlay próprio, acima do modal de pessoa) */
.cargo-modal-overlay {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(20,22,30,0.45);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.cargo-modal {
    background: #fff; border-radius: 8px; width: 100%; max-width: 560px;
    max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.cargo-modal-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--card-border); }
.cargo-modal-title {
    flex: 1; border: none; border-bottom: 1px dashed var(--card-border);
    font-family: 'Georgia', serif; font-size: 20px; color: var(--text-primary);
    padding: 2px 0; background: transparent; outline: none;
}
.cargo-modal-title:focus { border-bottom-color: var(--accent-dark); }
.cargo-modal-close {
    background: none; border: none; font-size: 22px; line-height: 1; color: var(--text-secondary);
    cursor: pointer; padding: 0 4px;
}
.cargo-modal-body { padding: 16px 20px; overflow-y: auto; }
.cargo-modal-foot { display: flex; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--card-border); }

/* CNPJs vinculados (somente leitura) */
.cnpjs-list { display: flex; flex-direction: column; gap: 4px; }
.cnpj-item {
    font-size: 13px; color: var(--text-primary);
    padding: 6px 10px; background: var(--bg); border-radius: 4px;
}

/* ─── Page: Profile ────────────────────────────────────────── */
.page-profile { max-width: 480px; display: flex; flex-direction: column; gap: 1.5rem; }
.profile-section {
    background: #fff;
    border: 1px solid #e0ddd0;
    border-radius: 8px;
    padding: 24px;
}
.profile-section h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6b6b5e;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0ece0;
}
.profile-form { display: flex; flex-direction: column; gap: 12px; }
.profile-field { display: flex; flex-direction: column; gap: 5px; }
.profile-field label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #6b6b5e;
    font-weight: 600;
}
.profile-field input {
    padding: 10px 12px;
    border: 1px solid #e0ddd0;
    border-radius: 4px;
    font-size: 14px;
    color: #1a1f2e;
    outline: none;
    transition: border-color 0.15s ease;
    background: #fff;
}
.profile-field input:focus { border-color: #a67550; }
.profile-error {
    background: #fdecea;
    color: #b13a2c;
    border: 1px solid #f0c2bb;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
}
.profile-submit {
    align-self: flex-start;
    margin-top: 4px;
    padding: 10px 20px;
    background: #1a1f2e;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.profile-submit:hover { background: #a67550; }

/* ─── HTMX loading indicator ───────────────────────────────── */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; }

/* ─── Empresas: cabeçalho + alternador de modos (compartilhado index/regime) ── */
.emp-top { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.emp-eyebrow { font-family:'Helvetica Neue',sans-serif; font-size:11px; letter-spacing:.15em; text-transform:uppercase; color:var(--text-secondary); margin-bottom:2px; }
.emp-modes { display:inline-flex; background:#fff; border:1px solid var(--card-border); border-radius:4px; overflow:hidden; }
.emp-mode { display:inline-flex; align-items:center; background:#fff; color:var(--text-secondary); border:0; border-right:1px solid var(--card-border); padding:8px 14px; font-family:'Helvetica Neue',sans-serif; font-size:11px; text-transform:uppercase; letter-spacing:.13em; cursor:pointer; transition:all .15s ease; white-space:nowrap; }
.emp-mode:last-child { border-right:0; }
.emp-mode:hover { background:var(--bg); color:var(--text-primary); }
.emp-mode.active { background:var(--sidebar-bg); color:var(--sidebar-text); }
.emp-mode.soon { color:#b9b4a9; cursor:not-allowed; }
.emp-mode.soon:hover { background:#fff; color:#b9b4a9; }
.emp-mode .emp-mode-badge { display:inline-flex; align-items:center; justify-content:center; min-width:16px; height:16px; padding:0 4px; margin-left:6px; border-radius:8px; background:#c0392b; color:#fff; font-size:9px; font-weight:600; }

/* ─── Scrollbar global ─────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(26,31,46,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(26,31,46,0.3); }

/* ════════════════════════════════════════════════════════════
   MÓDULO CONTÁBIL (plano de contas) — prefixo pc-*
   ════════════════════════════════════════════════════════════ */
/* fonte: UI em Helvetica Neue (sans), títulos em Georgia — como no exemplo */
#contabilRoot, #contabilPlanos, #contabilEditor, #contabilDeParaEditor {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* cards de índice de ERP (Plano de contas / Consolidador / Budget) — espelha o
   exemplo. Vale para Contábil (financeiro-item-*) e Controladoria (ctrl-item-*). */
.financeiro-item-big, .ctrl-item-big { align-items: flex-start !important; padding: 18px 20px !important; }
.financeiro-item-icon, .ctrl-item-icon { width: 36px; height: 36px; flex-shrink: 0; color: var(--accent-dark); }
.financeiro-item-icon svg, .ctrl-item-icon svg { width: 100%; height: 100%; }
.financeiro-item-content, .ctrl-item-content { flex: 1; min-width: 0; }
.financeiro-item-desc, .ctrl-item-desc { font-family: 'Helvetica Neue', sans-serif; font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-top: 4px; }
.pc-intro-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pc-intro-row p { margin: 0; flex: 1; }

.ctrl-flash-err { background: #fdecea; border: 1px solid #f5c6c2; color: #8a2c22; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }

/* aviso de empresas sem plano */
.pc-pending-box { background: #fff7e6; border: 1px solid #e8c068; border-radius: 4px; padding: 12px 16px; margin: 16px 0; }
.pc-pending-title { font-weight: 600; color: #8a6d1f; font-size: 12px; margin-bottom: 10px; }
.pc-pending-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-pending-chip { background: #fff; border: 1px solid #e0b878; border-radius: 12px; padding: 3px 10px; font-size: 11px; color: #6b4818; display: inline-flex; align-items: center; gap: 6px; }
.pc-emp-flag { font-size: 14px; line-height: 1; }

/* cards de plano */
.pc-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 8px; }
.pc-card { display: block; background: #fff; border: 1px solid var(--card-border); border-radius: 4px; padding: 14px 16px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.pc-card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.pc-card-default { border-color: var(--accent); background: linear-gradient(180deg, #fffaf2, #fff); }
.pc-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pc-card-name { font-family: Georgia, serif; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.pc-card-default-badge { font-size: 10px; font-weight: 700; letter-spacing: .5px; color: #8a6d1f; background: #f5e6bf; border-radius: 10px; padding: 2px 8px; }
.pc-card-langs { display: flex; gap: 4px; }
.pc-lang-chip { font-size: 10px; font-weight: 600; color: var(--accent-dark); background: #f6ece1; border-radius: 6px; padding: 2px 6px; }
.pc-card-meta { display: flex; gap: 14px; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin: 10px 0; }
.pc-flag-gerencial { color: #2e7d4f; }
.pc-card-empresas { font-size: 12px; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 6px; }
.pc-card-empresas em { color: var(--text-secondary); }
.pc-emp-chip { background: #f3f1e7; border-radius: 12px; padding: 2px 8px; display: inline-flex; align-items: center; gap: 5px; }
.pc-empty { grid-column: 1/-1; text-align: center; color: var(--text-secondary); padding: 40px 20px; display: flex; flex-direction: column; gap: 8px; }
.pc-empty small { font-size: 12px; }

/* picker de empresas */
.pc-emp-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; max-height: 240px; overflow: auto; margin-top: 6px; }
.pc-emp-opt { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 6px; border-radius: 6px; margin: 0; }
.pc-emp-opt:hover { background: #f7f5ec; }
.pc-emp-opt.disabled { opacity: .5; }
.pc-emp-opt label { display: flex; align-items: center; gap: 6px; cursor: pointer; margin: 0; }

.pc-info-box { background: #f3f6fb; border: 1px solid #d8e2ef; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #45556b; }
.pc-info-warn { background: #fcf6e8; border-color: #ecd9a8; color: #8a6d1f; }

/* editor */
.pc-editor-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; }
.pc-editor-name-form { flex: 1; }
.pc-editor-title { font-family: Georgia, serif; font-size: 22px; border: none; background: transparent; width: 100%; padding: 2px 0; }
.pc-editor-title:focus { outline: none; border-bottom: 1px dashed var(--accent); }
.pc-editor-head form:last-child { margin-left: auto; }
.pc-editor-meta { display: grid; gap: 12px; background: #fff; border: 1px solid var(--card-border); border-radius: 10px; padding: 14px 16px; margin: 10px 0 16px; }
.pc-meta-row { margin: 0; }

/* tabs */
.pc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--card-border); margin-bottom: 14px; }
.pc-tab { padding: 8px 14px; font-size: 13px; color: var(--text-secondary); text-decoration: none; border-bottom: 2px solid transparent; }
.pc-tab:hover { color: var(--text-primary); }
.pc-tab.active { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 600; }
.pc-tab-count { font-size: 11px; background: #f3f1e7; border-radius: 8px; padding: 1px 6px; }

/* toolbar da árvore */
.pc-tree-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.pc-toolbar-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-toolbar-right { display: flex; align-items: center; gap: 10px; }
.pc-view-seg { display: inline-flex; border: 1px solid var(--card-border); border-radius: 8px; overflow: hidden; }
.pc-view-seg-btn { padding: 5px 12px; font-size: 12px; color: var(--text-secondary); background: #fff; border: none; border-right: 1px solid var(--card-border); cursor: pointer; }
.pc-view-seg-btn:last-child { border-right: none; }
.pc-view-seg-btn:hover { background: var(--bg); }
.pc-view-seg-btn.active { background: var(--accent); color: #fff; }
.pc-search-input { padding: 5px 10px; font-size: 12px; border: 1px solid var(--card-border); border-radius: 8px; min-width: 180px; font-family: 'Helvetica Neue', sans-serif; }
.pc-search-input:focus { outline: none; border-color: var(--accent); }
.pc-chevron { width: 18px; height: 18px; flex-shrink: 0; border: none; background: none; cursor: pointer; color: var(--text-secondary); font-size: 10px; padding: 0; transition: transform 0.15s ease; }
.pc-chevron.collapsed { transform: rotate(-90deg); }
.pc-chevron-ph { width: 18px; flex-shrink: 0; display: inline-block; }
.pc-lang-toggle { display: inline-flex; border: 1px solid var(--card-border); border-radius: 8px; overflow: hidden; }
.pc-lang-toggle a { padding: 5px 12px; font-size: 12px; color: var(--text-secondary); text-decoration: none; border-right: 1px solid var(--card-border); }
.pc-lang-toggle a:last-child { border-right: none; }
.pc-lang-toggle a.active { background: var(--accent); color: #fff; }
.pc-tree-hint { font-size: 12px; color: var(--text-secondary); }

/* árvore de contas */
.pc-tree { border: 1px solid var(--card-border); border-radius: 10px; overflow: hidden; background: #fff; }
.pc-tree-header { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-secondary); border-bottom: 1px solid var(--card-border); background: #faf8f0; }
.pc-tree-header-numero { min-width: 92px; }
.pc-tree-header-nome { flex: 1; }
.pc-tree-header-bus { width: 280px; }
.pc-tree-header-actions { width: 96px; }
.pc-conta-row { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-bottom: 1px solid #f1efe6; font-size: 13px; }
.pc-conta-row:last-child { border-bottom: none; }
.pc-conta-row.sintetica { font-weight: 600; background: #fff; }
.pc-conta-row.analitica { background: rgba(200,149,109,.04); font-weight: 400; }
.pc-conta-row.inativa { opacity: .45; }
.pc-conta-row:hover { background: #faf5e8; }
.pc-conta-row[draggable="true"] { cursor: grab; }
.pc-conta-row[draggable="true"]:active { cursor: grabbing; }
.pc-conta-row.locked .pc-conta-numero { color: var(--accent-dark); }
.pc-conta-numero { min-width: 92px; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.pc-conta-nome { flex: 1; }
.pc-conta-nome.is-fallback { color: var(--text-secondary); font-style: italic; }
.pc-conta-nome-fallback-mark { color: var(--accent-dark); }
.pc-conta-badge-lock { font-size: 12px; opacity: .65; }
.pc-conta-badge-auto { font-size: 11px; font-weight: 700; color: var(--accent-dark); background: #f6ece1; border-radius: 8px; padding: 1px 6px; }
.pc-conta-bus { width: 280px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pc-conta-bus-na { color: var(--text-secondary); opacity: .5; font-size: 12px; }
.pc-conta-bu-chip { font-size: 11px; background: #eef2f7; color: #45556b; border-radius: 8px; padding: 1px 7px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-conta-actions { width: 96px; display: flex; gap: 4px; justify-content: flex-end; }
.pc-conta-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--card-border); border-radius: 6px; background: #fff; color: var(--text-secondary); text-decoration: none; cursor: pointer; font-size: 12px; padding: 0; }
.pc-conta-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.pc-conta-btn-danger:hover { border-color: #e0a39a; color: #c0392b; }

/* elos / de-paras */
.pc-tab-pane { background: #fff; border: 1px solid var(--card-border); border-radius: 10px; padding: 16px; }
.pc-elos-grid, .pc-depara-grid { display: flex; flex-direction: column; gap: 8px; }
.pc-elo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--card-border); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.pc-elo-tipo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--accent-dark); background: #f6ece1; border-radius: 8px; padding: 2px 8px; }
.pc-elo-pair { display: inline-flex; gap: 6px; align-items: center; }
.pc-elo-row small { color: var(--text-secondary); }
.pc-elo-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.pc-depara-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--card-border); border-radius: 8px; padding: 12px 14px; }
.pc-depara-row.obrigatorio { border-left: 3px solid var(--accent); }
.pc-depara-row-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-depara-row-info small { color: var(--text-secondary); }
.pc-depara-row-status { font-size: 12px; font-weight: 600; border-radius: 8px; padding: 3px 10px; }
.pc-depara-row-status.completo { color: #2e7d4f; background: #e8f5ee; }
.pc-depara-row-status.incompleto { color: #b06a16; background: #fcf2e2; }
.pc-depara-row-status.incompleto-obrigatorio { color: #c0392b; background: #fdecea; }

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

/* contábil: BU cell clicável + de-para editor */
.pc-conta-bus-link { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; text-decoration: none; cursor: pointer; }
.pc-conta-bus-link:hover .pc-conta-bus-na { color: var(--accent-dark); }
.pc-depara-actions { display: flex; align-items: center; gap: 10px; }
.pc-depara-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; font-size: 13px; }
.pc-depara-map-row { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-bottom: 1px solid #f1efe6; font-size: 13px; }
.pc-depara-map-row.sintetica { font-weight: 600; background: #fff; }
.pc-depara-conta-src { flex: 1; display: flex; align-items: center; gap: 8px; }
.pc-depara-conta-dst { flex: 1; }
.pc-depara-arrow { color: var(--text-secondary); }
.pc-depara-select { width: 100%; max-width: 360px; padding: 5px 8px; border: 1px solid var(--card-border); border-radius: 6px; font-size: 12px; background: #fff; }

/* ===================== Jurídico ===================== */
.jur-page { padding: 4px 2px 40px; }
.jur-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--card-border); margin-bottom: 18px; }
.jur-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 14px; color: var(--text-secondary); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 500; }
.jur-tab:hover { color: var(--text-primary); }
.jur-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.jur-tab-count { font-size: 11px; background: var(--card-border); color: var(--text-secondary); border-radius: 10px; padding: 1px 8px; }
.jur-tab.active .jur-tab-count { background: var(--accent); color: #fff; }

.jur-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.jur-toolbar-spacer { flex: 1; }
.jur-search { flex: 0 1 320px; padding: 8px 12px; border: 1px solid var(--card-border); border-radius: 8px; font-size: 13px; background: var(--card-bg); color: var(--text-primary); }
.jur-add-btn { padding: 8px 14px; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.jur-add-btn:hover { background: var(--accent-dark, var(--accent)); }

.jur-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.jur-filter-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.jur-filter-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); width: 64px; flex-shrink: 0; }
.jur-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.jur-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--card-border); border-radius: 16px; font-size: 12px; cursor: pointer; color: var(--text-secondary); background: var(--card-bg); user-select: none; }
.jur-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.jur-chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.jur-chip-block { display: inline-flex; }

.jur-list { display: flex; flex-direction: column; gap: 8px; }
.jur-card { display: flex; align-items: center; gap: 14px; padding: 13px 16px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.jur-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.jur-card.is-inactive { opacity: .55; }
.jur-card-body { flex: 1; min-width: 0; }
.jur-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.jur-card-flag { font-size: 11px; color: var(--text-secondary); font-weight: 400; }
.jur-card-sub { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.jur-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.jur-tag { font-size: 11px; padding: 2px 8px; border-radius: 5px; background: var(--card-border); color: var(--text-secondary); }
.jur-muted { color: var(--text-secondary); }

.jur-status { flex-shrink: 0; font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 14px; white-space: nowrap; }
.jur-status.s-amarelo { background: #fef3c7; color: #92400e; }
.jur-status.s-verde { background: #dcfce7; color: #166534; }
.jur-status.s-vermelho { background: #fee2e2; color: #991b1b; }
.jur-status.s-azul { background: #dbeafe; color: #1e40af; }
.jur-status.s-neutro { background: var(--card-border); color: var(--text-secondary); }

.jur-empty { text-align: center; color: var(--text-secondary); padding: 48px 20px; font-size: 14px; }
.jur-empty-emoji { display: block; font-size: 34px; margin-bottom: 10px; }

/* Modal */
.jur-modal { max-width: 680px; width: 92vw; max-height: 90vh; display: flex; flex-direction: column; }
.jur-modal-body { overflow: auto; }
.jur-section { margin: 16px 0; }
.jur-section-head { display: flex; justify-content: space-between; align-items: center; }
.jur-form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.jur-form-row-end { align-items: flex-end; }
.jur-field { flex: 1; min-width: 180px; }
.jur-field-narrow { flex: 0 0 120px; min-width: 100px; }
.jur-hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.jur-mini-btn { padding: 4px 10px; border: 1px solid var(--card-border); border-radius: 7px; background: var(--card-bg); font-size: 12px; cursor: pointer; color: var(--text-primary); }
.jur-mini-btn:hover { border-color: var(--accent); color: var(--accent); }

.jur-partes { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.jur-parte-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--card-border); border-radius: 8px; }
.jur-parte-nome { flex: 1; font-size: 13px; }
.jur-parte-papel { flex: 0 1 200px; padding: 5px 9px; border: 1px solid var(--card-border); border-radius: 6px; font-size: 12px; background: var(--card-bg); color: var(--text-primary); }
.jur-x { border: none; background: none; color: var(--text-secondary); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.jur-x:hover { color: #991b1b; }

.jur-pick-row { display: flex; gap: 8px; align-items: center; }
.jur-pick-display { flex: 1; padding: 8px 12px; border: 1px solid var(--card-border); border-radius: 7px; background: var(--card-bg); font-size: 13px; }

.jur-att { }
.jur-att-list { display: flex; flex-direction: column; gap: 5px; margin: 8px 0; }
.jur-att-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.jur-att-item a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); }
.jur-att-size { font-size: 11px; color: var(--text-secondary); }
.jur-att-empty { font-size: 12px; color: var(--text-secondary); font-style: italic; }

.jur-checklist { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.jur-check-doc { border: 1px solid var(--card-border); border-radius: 8px; padding: 10px 12px; }
.jur-check-doc-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.jur-check-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--card-border); flex-shrink: 0; }
.jur-check-dot.ok { background: #16a34a; }

.jur-timeline { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.jur-andamento-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--card-border); }
.jur-andamento-data { font-size: 11px; color: var(--text-secondary); width: 84px; flex-shrink: 0; }
.jur-andamento-texto { flex: 1; font-size: 13px; }

/* People picker */
.jur-picker { max-width: 460px; width: 90vw; max-height: 80vh; display: flex; flex-direction: column; }
.jur-picker-search { padding: 12px 18px 6px; }
.jur-picker-list { flex: 1; overflow: auto; padding: 6px 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.jur-picker-item { text-align: left; padding: 9px 12px; border: none; background: none; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--text-primary); }
.jur-picker-item:hover { background: var(--card-border); }
