/* ==========================================================================
   UniCapta — Layout shell (sidebar, topbar, páginas, login)
   Depende de design-system.css (tokens). Não redefinir tokens aqui.
   ========================================================================== */

/* ---------- Shell ---------- */
.app-shell {
    min-height: 100vh;
    display: flex;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 32rem),
        var(--background);
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    background:
        radial-gradient(circle at 92% 10%, rgba(37, 99, 235, 0.28), transparent 28%),
        linear-gradient(180deg, #071326 0%, #08214b 48%, #061733 100%);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    transition: width var(--transition), transform var(--transition);
}
.sidebar__brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-5);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: var(--topbar-height);
}
.sidebar__logo {
    width: 42px; height: 42px;
    border-radius: 15px;
    background: var(--primary-gradient);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
    display: grid; place-items: center;
    color: #fff; font-weight: 900; font-size: 20px;
    flex-shrink: 0;
}
.sidebar__brand-text { display: flex; flex-direction: column; overflow: hidden; }
.sidebar__brand-text strong { color: #fff; font-size: var(--fs-lg); letter-spacing: -0.3px; }
.sidebar__brand-text span { font-size: 11px; color: var(--sidebar-text); white-space: nowrap; }

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3) var(--space-3);
}
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

.sidebar__section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(197,212,238,0.5);
    padding: var(--space-4) var(--space-3) var(--space-2);
    white-space: nowrap;
}
.sidebar__link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-size: var(--fs-base);
    font-weight: 500;
    margin-bottom: 2px;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
    position: relative;
}
.sidebar__link:hover { background: var(--sidebar-hover-bg); color: #fff; }
.sidebar__link.active { background: var(--sidebar-active-bg); color: var(--sidebar-text-active); box-shadow: inset 3px 0 0 var(--primary-accent); }
.sidebar__link.active::before { content: none; }
.sidebar__link svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar__link-text { overflow: hidden; text-overflow: ellipsis; }

.sidebar__footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: var(--fs-xs);
    color: rgba(197,212,238,0.6);
    display: flex; align-items: center; justify-content: space-between;
    white-space: nowrap;
}

/* Sidebar recolhida */
.app-shell.collapsed .sidebar { width: var(--sidebar-collapsed); }
.app-shell.collapsed .sidebar__brand-text,
.app-shell.collapsed .sidebar__link-text,
.app-shell.collapsed .sidebar__section,
.app-shell.collapsed .sidebar__footer span { display: none; }
.app-shell.collapsed .sidebar__link { justify-content: center; }
.app-shell.collapsed .sidebar__footer { justify-content: center; }
.app-shell.collapsed .main { margin-left: var(--sidebar-collapsed); }

/* ---------- Main ---------- */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left var(--transition);
}

/* ---------- Topbar ---------- */
.topbar {
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 0 var(--space-6);
    position: sticky;
    top: 0;
    z-index: 900;
}
.topbar__toggle {
    background: none; border: none; color: var(--text-secondary);
    display: grid; place-items: center; padding: 8px; border-radius: var(--radius);
}
.topbar__toggle:hover { background: var(--surface-2); color: var(--text-primary); }
.topbar__toggle svg { width: 22px; height: 22px; }

.topbar__search {
    flex: 1;
    max-width: 460px;
    position: relative;
}
.topbar__search input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    font-size: var(--fs-sm);
    outline: none;
}
.topbar__search input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(18,86,196,0.1); }
.topbar__search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-muted); }

.topbar__actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }

.topbar__icon-btn {
    position: relative;
    background: none; border: none;
    color: var(--text-secondary);
    padding: 9px; border-radius: 50%;
    display: grid; place-items: center;
}
.topbar__icon-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.topbar__icon-btn svg { width: 20px; height: 20px; }
.topbar__badge {
    position: absolute; top: 4px; right: 4px;
    min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700;
    border-radius: var(--radius-pill);
    display: grid; place-items: center;
    border: 2px solid var(--surface);
}

/* Dropdown de conta */
.dropdown { position: relative; }
.dropdown__trigger {
    display: flex; align-items: center; gap: var(--space-2);
    background: none; border: none; padding: 4px 8px 4px 4px;
    border-radius: var(--radius-pill);
}
.dropdown__trigger:hover { background: var(--surface-2); }
.dropdown__user { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.dropdown__user strong { font-size: var(--fs-sm); color: var(--text-primary); }
.dropdown__user span { font-size: var(--fs-xs); color: var(--text-secondary); }
.dropdown__menu {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: var(--space-2);
    display: none;
    z-index: 950;
}
.dropdown.open .dropdown__menu { display: block; }
.dropdown__item {
    display: flex; align-items: center; gap: var(--space-3);
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: var(--fs-sm);
    width: 100%; background: none; border: none; text-align: left;
}
.dropdown__item:hover { background: var(--surface-2); }
.dropdown__item svg { width: 17px; height: 17px; color: var(--text-secondary); }
.dropdown__item--danger { color: var(--danger); }
.dropdown__item--danger svg { color: var(--danger); }
.dropdown__divider { height: 1px; background: var(--border); margin: var(--space-2) 0; }

/* ---------- Conteúdo da página ---------- */
.content { padding: var(--space-6); flex: 1; }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}
.page-header__title h1 { font-size: var(--fs-2xl); letter-spacing: -0.5px; }
.page-header__title p { color: var(--text-secondary); margin: 6px 0 0; font-size: var(--fs-sm); }
.page-header__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--space-2); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb span { color: var(--text-muted); }

/* Barra de filtros */
.filter-bar {
    display: flex; align-items: center; gap: var(--space-3);
    flex-wrap: wrap; margin-bottom: var(--space-5);
}
.filter-bar .form-control,
.filter-bar .form-select { width: auto; min-width: 180px; }
.filter-bar .search-grow { flex: 1; min-width: 220px; }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
    position: relative;
    background: linear-gradient(140deg, var(--primary-dark) 0%, var(--primary) 55%, #1a6fe0 100%);
    color: #fff;
    padding: var(--space-10);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.auth-side::before,
.auth-side::after {
    content: ""; position: absolute; border-radius: 50%;
    background: rgba(31,184,232,0.18); filter: blur(8px);
}
.auth-side::before { width: 340px; height: 340px; top: -80px; right: -80px; }
.auth-side::after { width: 260px; height: 260px; bottom: -60px; left: -40px; background: rgba(124,77,255,0.16); }
.auth-side__brand { display: flex; align-items: center; gap: var(--space-3); position: relative; z-index: 1; }
.auth-side__brand .sidebar__logo { width: 46px; height: 46px; }
.auth-side__brand strong { font-size: var(--fs-xl); }
.auth-side__content { position: relative; z-index: 1; max-width: 460px; }
.auth-side__content h2 { color: #fff; font-size: 34px; line-height: 1.2; letter-spacing: -0.6px; margin-bottom: var(--space-4); }
.auth-side__content p { color: rgba(255,255,255,0.82); font-size: var(--fs-md); }
.auth-side__features { position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--space-3); }
.auth-side__feature { display: flex; align-items: center; gap: var(--space-3); color: rgba(255,255,255,0.9); font-size: var(--fs-sm); }
.auth-side__feature .ico { width: 34px; height: 34px; border-radius: var(--radius); background: rgba(255,255,255,0.14); display: grid; place-items: center; }
.auth-side__feature svg { width: 18px; height: 18px; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: var(--space-8); background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: var(--fs-2xl); margin-bottom: var(--space-2); }
.auth-card > p.subtitle { color: var(--text-secondary); margin: 0 0 var(--space-6); }
.auth-card__footer { text-align: center; margin-top: var(--space-6); font-size: var(--fs-sm); color: var(--text-muted); }

@media (max-width: 900px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}

/* ---------- Overlay mobile ---------- */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(11,45,99,0.4);
    z-index: 999; display: none;
}

/* ---------- Responsividade ---------- */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .app-shell.sidebar-open .sidebar { transform: translateX(0); }
    .app-shell.sidebar-open .sidebar-overlay { display: block; }
    .main { margin-left: 0 !important; }
    .app-shell.collapsed .sidebar { width: var(--sidebar-width); }
    .app-shell.collapsed .sidebar__brand-text,
    .app-shell.collapsed .sidebar__link-text,
    .app-shell.collapsed .sidebar__section,
    .app-shell.collapsed .sidebar__footer span { display: block; }
}
@media (max-width: 640px) {
    .topbar__search { display: none; }
    .content { padding: var(--space-4); }
    .dropdown__user { display: none; }
    .hide-sm { display: none !important; }
}

/* ==========================================================================
   Legacy conversion: Login + Painel Executivo
   ========================================================================== */

.login-page {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
    background: #eef2f8;
}
.login-hero-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 40px 56px;
    color: white;
}
.login-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 30%, rgba(34, 211, 238, 0.22), transparent 24rem),
        radial-gradient(circle at 78% 80%, rgba(37, 99, 235, 0.34), transparent 24rem),
        linear-gradient(135deg, #050f24 0%, #0c2d6b 58%, #1a4fd6 100%);
}
.login-hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.36) 0 1px, transparent 1px 14px);
    opacity: 0.16;
}
.login-brand,
.login-hero-copy,
.login-footer {
    position: relative;
    z-index: 1;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 280px;
}
.login-brand-mark,
.login-logo-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1746a2 0%, #2563eb 100%);
    color: white;
    font-weight: 900;
}
.login-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 11px;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
}
.login-brand strong {
    color: #fff;
}
.login-hero-copy {
    max-width: 680px;
}
.login-hero-copy > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #dbeafe;
    font-size: 14px;
    padding: 7px 14px;
    backdrop-filter: blur(10px);
}
.login-hero-copy > span svg {
    width: 16px;
    height: 16px;
}
.login-hero-copy h1 {
    margin: 24px 0 0;
    font-size: clamp(36px, 5vw, 52px);
    letter-spacing: -0.05em;
    line-height: 1.08;
}
.login-hero-copy em {
    background: linear-gradient(90deg, #67e8f9, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-style: normal;
}
.login-hero-copy p {
    max-width: 610px;
    margin: 20px 0 0;
    color: rgba(219, 234, 254, 0.9);
    font-size: 17px;
    line-height: 1.75;
}
.login-footer {
    margin: 0;
    color: rgba(191, 219, 254, 0.72);
    font-size: 14px;
}
.login-float-card {
    position: absolute;
    z-index: 1;
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 42px rgba(15, 23, 42, 0.2);
    color: rgba(103, 232, 249, 0.9);
    backdrop-filter: blur(12px);
    animation: login-float 4s ease-in-out infinite;
}
.login-float-card svg {
    width: 28px;
    height: 28px;
}
.login-float-1 { right: 8%; top: 28%; }
.login-float-2 { right: 18%; top: 48%; animation-delay: 0.8s; }
.login-float-3 { right: 6%; top: 62%; animation-delay: 1.6s; }
.login-form-panel {
    position: relative;
    display: grid;
    min-height: 100vh;
    place-items: center;
    overflow: hidden;
    padding: 40px;
}
.login-form-panel::before,
.login-form-panel::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    filter: blur(48px);
}
.login-form-panel::before { right: -80px; top: -40px; background: rgba(219, 234, 254, 0.7); }
.login-form-panel::after { left: -70px; bottom: -60px; background: rgba(226, 232, 240, 0.9); }
.login-card {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 30px;
    background: white;
    box-shadow: 0 24px 64px -12px rgba(15, 23, 42, 0.18);
    padding: 38px;
}
.login-logo {
    display: grid;
    width: 56px;
    height: 56px;
    margin: 0 auto 24px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 16px 26px rgba(37, 99, 235, 0.26);
}
.login-heading { text-align: center; }
.login-heading h2,
.login-heading p { margin: 0; }
.login-heading h2 {
    color: #0f172a;
    font-size: 25px;
    letter-spacing: -0.04em;
}
.login-heading p {
    margin-top: 8px;
    color: #64748b;
    font-size: 14px;
}
.login-card form {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}
.login-card form > label {
    display: grid;
    gap: 7px;
    color: #1e293b;
    font-size: 14px;
    font-weight: 800;
}
.login-input {
    position: relative;
    display: flex;
    align-items: center;
}
.login-input > svg {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: #94a3b8;
}
.login-input input {
    width: 100%;
    height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.82);
    color: #0f172a;
    outline: none;
    padding: 0 44px 0 40px;
    transition: 0.18s ease;
}
.login-input input:focus {
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}
.login-input button {
    position: absolute;
    right: 10px;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
}
.login-input button svg {
    width: 16px;
    height: 16px;
}
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.login-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 14px;
}
.login-options button {
    border: 0;
    background: transparent;
    color: #2563eb;
    font-size: 14px;
    font-weight: 800;
}
.login-flash-wrap .alert {
    margin: 18px 0 -6px;
}
.login-submit {
    display: inline-flex;
    width: 100%;
    height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    box-shadow: 0 18px 30px rgba(37, 99, 235, 0.25);
    color: white;
    font-size: 15px;
    font-weight: 900;
}
.login-submit svg {
    width: 16px;
    height: 16px;
}
@keyframes login-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.dashboard-page {
    display: grid;
    gap: 20px;
}
.dashboard-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}
.dashboard-title-row h1 {
    margin: 0;
    color: #0f172a;
    font-size: 24px;
    letter-spacing: -0.03em;
}
.dashboard-title-row p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
}
.dashboard-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(500px, 0.88fr);
    gap: 16px;
}
.dashboard-capture-hero {
    position: relative;
    min-height: 275px;
    overflow: hidden;
    border-radius: 24px;
    background: radial-gradient(circle at 70% 20%, rgba(56, 189, 248, 0.35), transparent 32%),
        linear-gradient(135deg, #071b3f 0%, #0b3d9b 52%, #0968f6 100%);
    box-shadow: 0 22px 48px rgba(11, 31, 77, 0.28);
    color: white;
    padding: 28px;
}
.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: repeating-radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.4) 0 1px, transparent 1px 14px);
    opacity: 0.2;
}
.dashboard-capture-content {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}
.dashboard-capture-content > div:first-child { max-width: 580px; }
.dashboard-capture-content p { margin: 0; }
.dashboard-capture-content p:first-child {
    color: #dbeafe;
    font-size: 14px;
    font-weight: 800;
}
.dashboard-capture-content h2 {
    margin: 12px 0 14px;
    font-size: clamp(36px, 5vw, 52px);
    letter-spacing: -0.05em;
    line-height: 1;
}
.dashboard-capture-content h2 span { font-size: clamp(24px, 3vw, 34px); }
.dashboard-capture-content p:nth-of-type(2) {
    max-width: 440px;
    color: #eff6ff;
    font-size: 14px;
    line-height: 1.65;
}
.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}
.dashboard-hero-actions a,
.dashboard-empty-action,
.assistant-card-content a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    font-weight: 900;
    text-decoration: none;
}
.dashboard-hero-actions a {
    height: 44px;
    padding: 0 20px;
}
.dashboard-hero-actions a:first-child {
    background: white;
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.16);
    color: #0b1f4d;
}
.dashboard-hero-actions a:last-child {
    border: 1px solid rgba(255, 255, 255, 0.26);
    background: rgba(15, 23, 42, 0.2);
    color: white;
}
.dashboard-hero-actions svg,
.dashboard-empty-action svg,
.assistant-card-content a svg {
    width: 17px;
    height: 17px;
}
.hero-illustration {
    position: relative;
    width: 260px;
    height: 224px;
    flex-shrink: 0;
}
.hero-oval-shadow {
    position: absolute;
    bottom: 16px;
    left: 32px;
    width: 80px;
    height: 64px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.25);
    filter: blur(18px);
}
.hero-oval {
    position: absolute;
    bottom: 8px;
    left: 24px;
    width: 176px;
    height: 64px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
}
.hero-bar {
    position: absolute;
    bottom: 44px;
    width: 36px;
    border-radius: 14px 14px 0 0;
}
.hero-bar-1 { left: 80px; height: 112px; background: linear-gradient(to top, rgba(103, 232, 249, 0.82), rgba(219, 234, 254, 0.96)); }
.hero-bar-2 { left: 112px; height: 160px; background: linear-gradient(to top, rgba(59, 130, 246, 0.86), rgba(207, 250, 254, 0.96)); }
.hero-bar-3 { left: 144px; height: 208px; background: linear-gradient(to top, rgba(79, 70, 229, 0.88), rgba(219, 234, 254, 0.96)); }
.hero-line {
    position: absolute;
    height: 16px;
    border-radius: 999px;
    background: rgba(165, 243, 252, 0.82);
    transform: rotate(-36deg);
}
.hero-line-1 { left: 40px; top: 80px; width: 112px; }
.hero-line-2 { left: 112px; top: 40px; width: 80px; }
.hero-illustration svg {
    position: absolute;
    right: 12px;
    top: 8px;
    width: 70px;
    height: 70px;
    color: #cffafe;
    filter: drop-shadow(0 14px 18px rgba(15, 23, 42, 0.25));
}
.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.dashboard-kpi-card,
.dashboard-card,
.assistant-card {
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.dashboard-kpi-card {
    position: relative;
    min-height: 118px;
    overflow: hidden;
    padding: 16px;
}
.dashboard-kpi-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.dashboard-kpi-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 14px;
}
.dashboard-kpi-icon svg { width: 19px; height: 19px; }
.dashboard-kpi-icon-blue { background: #eff6ff; color: #1d4ed8; }
.dashboard-kpi-icon-green { background: #ecfdf5; color: #047857; }
.dashboard-kpi-icon-purple { background: #f5f3ff; color: #6d28d9; }
.dashboard-kpi-icon-amber { background: #fffbeb; color: #b45309; }
.dashboard-kpi-icon-violet { background: #f5f3ff; color: #7c3aed; }
.dashboard-kpi-icon-red { background: #fef2f2; color: #b91c1c; }
.dashboard-kpi-main p {
    margin: 0;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}
.dashboard-kpi-main strong {
    display: block;
    margin-top: 8px;
    color: #0f172a;
    font-size: 24px;
    letter-spacing: -0.04em;
}
.dashboard-kpi-main span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
}
.dashboard-kpi-badge {
    position: absolute;
    bottom: 14px;
    left: 16px;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 900;
    padding: 3px 8px;
}
.mini-sparkline {
    position: absolute;
    right: 12px;
    bottom: 8px;
    width: 96px;
    height: 32px;
    opacity: 0.75;
}
.dashboard-mid-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr 0.95fr;
    gap: 16px;
}
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 16px;
}
.dashboard-card { padding: 20px; }
.dashboard-card-header,
.dashboard-card-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.dashboard-card h2 {
    margin: 0;
    color: #0f172a;
    font-size: 14px;
}
.dashboard-card-header strong {
    display: block;
    margin-top: 16px;
    color: #0f172a;
    font-size: 24px;
    letter-spacing: -0.04em;
}
.dashboard-card-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 12px;
}
.dashboard-card button,
.dashboard-card-title a {
    border: 0;
    background: transparent;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}
.dashboard-card-header > button {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    box-shadow: var(--shadow-sm);
    color: #475569;
    padding: 7px 12px;
}
.capture-chart { margin-top: 16px; }
.capture-chart-board {
    position: relative;
    height: 176px;
    border-radius: 16px;
    background: linear-gradient(to bottom, #fff, #f8fafc);
    overflow: hidden;
}
.capture-chart-board::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #f1f5f9 1px, transparent 1px);
    background-size: 100% 44px;
}
.chart-label {
    position: absolute;
    left: 0;
    color: #94a3b8;
    font-size: 10px;
}
.chart-label-1 { top: 4px; }
.chart-label-2 { top: 25%; }
.chart-label-3 { top: 50%; }
.chart-label-4 { top: 75%; }
.chart-line {
    position: absolute;
    right: 12px;
    bottom: 32px;
    left: 36px;
    height: 2px;
    border-radius: 999px;
    background: #2563eb;
}
.chart-points,
.chart-months {
    position: absolute;
    right: 0;
    left: 32px;
    display: flex;
    justify-content: space-between;
}
.chart-points { bottom: 28px; }
.chart-points span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 0 0 4px #dbeafe;
}
.chart-months {
    bottom: 0;
    color: #64748b;
    font-size: 10px;
}
.chart-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    color: #64748b;
    font-size: 11px;
}
.chart-legend span {
    width: 32px;
    height: 2px;
    border-radius: 999px;
    background: #2563eb;
}
.dashboard-empty {
    display: flex;
    min-height: 190px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px dashed #e2e8f0;
    border-radius: 22px;
    background: rgba(248, 250, 252, 0.7);
    padding: 32px 24px;
    text-align: center;
}
.dashboard-empty > div {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: white;
    box-shadow: var(--shadow-sm);
    color: #1d4ed8;
}
.dashboard-empty > div svg {
    width: 22px;
    height: 22px;
}
.dashboard-empty strong {
    margin-top: 16px;
    color: #0f172a;
    font-size: 14px;
}
.dashboard-empty p {
    max-width: 320px;
    margin: 6px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.6;
}
.dashboard-empty-action {
    height: 36px;
    margin-top: 16px;
    background: linear-gradient(135deg, #1746a2 0%, #2563eb 100%);
    color: white;
    padding: 0 14px;
}
.dashboard-table-wrap { overflow-x: auto; }
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.dashboard-table th {
    padding: 10px 8px;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 11px;
    text-align: left;
}
.dashboard-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}
.dashboard-table td:first-child {
    color: #0f172a;
    font-weight: 800;
}
.dashboard-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 8px;
}
.dashboard-badge-success { background: #ecfdf5; color: #047857; }
.dashboard-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dashboard-progress > div {
    width: 64px;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #f1f5f9;
}
.dashboard-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1746a2 0%, #2563eb 100%);
}
.dashboard-progress small {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}
.opportunity-list {
    display: grid;
    gap: 8px;
}
.opportunity-list a {
    display: flex;
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    background: white;
    padding: 12px;
    text-align: left;
    text-decoration: none;
    transition: 0.18s ease;
}
.opportunity-list a:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
}
.opportunity-list strong,
.opportunity-list span,
.opportunity-list em,
.opportunity-list small {
    display: block;
}
.opportunity-list strong {
    color: #0f172a;
    font-size: 13px;
}
.opportunity-list span {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}
.opportunity-list em {
    margin-top: 6px;
    color: #047857;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}
.opportunity-list small {
    margin-top: 6px;
    color: #64748b;
    font-size: 11px;
    text-align: right;
}
.assistant-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
}
.assistant-card-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #eff6ff, white 52%, #ecfeff);
}
.assistant-card-bg::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 320px;
    height: 160px;
    background-image: repeating-radial-gradient(ellipse at center, rgba(37, 99, 235, 0.25) 0 1px, transparent 1px 12px);
    opacity: 0.4;
}
.assistant-card-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 210px;
    align-items: center;
    gap: 24px;
}
.assistant-card-content h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #0f172a;
    font-size: 22px;
    letter-spacing: -0.03em;
}
.assistant-card-content h2 span {
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 900;
    padding: 3px 8px;
}
.assistant-card-content p {
    max-width: 420px;
    margin: 16px 0 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}
.assistant-card-content a {
    height: 44px;
    margin-top: 20px;
    background: linear-gradient(90deg, #1d4ed8 0%, #06b6d4 100%);
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.2);
    color: white;
    padding: 0 18px;
}
.assistant-art {
    position: relative;
    width: 176px;
    height: 144px;
}
.assistant-shadow {
    position: absolute;
    right: 24px;
    bottom: 4px;
    left: 24px;
    height: 32px;
    border-radius: 50%;
    background: rgba(147, 197, 253, 0.6);
    filter: blur(12px);
}
.assistant-head {
    position: absolute;
    top: 20px;
    left: 50%;
    display: grid;
    width: 96px;
    height: 96px;
    place-items: center;
    transform: translateX(-50%);
    border: 1px solid #dbeafe;
    border-radius: 50%;
    background: white;
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.18);
}
.assistant-head > div {
    display: flex;
    width: 80px;
    height: 64px;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border-radius: 24px;
    background: linear-gradient(to bottom, #172554, #1e3a8a);
}
.assistant-head span {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #67e8f9;
    box-shadow: 0 0 12px rgba(103, 232, 249, 0.9);
}
.assistant-ear,
.assistant-base {
    position: absolute;
    background: #bfdbfe;
}
.assistant-ear {
    top: 56px;
    width: 16px;
    height: 40px;
    border-radius: 999px;
}
.assistant-ear-left { left: 24px; }
.assistant-ear-right { right: 24px; }
.assistant-base {
    top: 112px;
    left: 50%;
    width: 40px;
    height: 24px;
    transform: translateX(-50%);
    border-radius: 0 0 18px 18px;
    background: #dbeafe;
}
.assistant-orbit {
    position: absolute;
    border: 1px solid #dbeafe;
    border-radius: 50%;
}
.assistant-orbit-left { top: 8px; left: 8px; width: 96px; height: 96px; }
.assistant-orbit-right { top: 0; right: 4px; width: 112px; height: 112px; }

@media (max-width: 1280px) {
    .dashboard-top-grid,
    .dashboard-mid-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 980px) {
    .login-page {
        grid-template-columns: 1fr;
    }
    .login-hero-panel {
        min-height: auto;
        padding: 28px;
        gap: 72px;
    }
    .login-form-panel {
        min-height: auto;
        padding: 28px;
    }
}
@media (max-width: 760px) {
    .dashboard-capture-content,
    .assistant-card-content {
        grid-template-columns: 1fr;
        display: grid;
    }
    .hero-illustration,
    .assistant-art {
        display: none;
    }
    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-title-row,
    .dashboard-card-header,
    .dashboard-card-title {
        flex-direction: column;
    }
}
@media (max-width: 520px) {
    .login-card {
        padding: 28px;
    }
    .login-options {
        align-items: flex-start;
        flex-direction: column;
    }
    .login-float-card {
        display: none;
    }
}

/* ==========================================================================
   Legacy conversion: Painel Admin
   ========================================================================== */

.module-real-page {
    display: grid;
    gap: 20px;
}
.module-real-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    overflow: hidden;
    border-radius: 28px;
    background:
        radial-gradient(circle at 88% 20%, rgba(96, 165, 250, 0.36), transparent 24rem),
        linear-gradient(135deg, #0b1f4d 0%, #1746a2 52%, #2563eb 100%);
    box-shadow: 0 18px 42px rgba(11, 31, 77, 0.18);
    color: white;
    padding: 28px;
}
.module-real-header span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.module-real-header h1 {
    margin: 8px 0 8px;
    color: #fff;
    font-size: clamp(32px, 5vw, 48px);
    letter-spacing: -0.05em;
    line-height: 1;
}
.module-real-header p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 15px;
    line-height: 1.6;
}
.admin-header-action,
.legacy-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    padding: 0 16px;
}
.admin-header-action {
    flex-shrink: 0;
    border: 0;
    background: white;
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.18);
    color: #0b1f4d;
}
.admin-header-action svg,
.legacy-button svg {
    width: 16px;
    height: 16px;
}
.legacy-button.primary {
    border: 0;
    background: linear-gradient(135deg, #1746a2 0%, #2563eb 100%);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
    color: white;
}
.legacy-button.secondary {
    border: 1px solid #e2e8f0;
    background: white;
    color: #334155;
}
.module-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.module-summary-grid article,
.module-list-card {
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.module-summary-grid article {
    padding: 20px;
}
.module-summary-grid span {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}
.module-summary-grid strong {
    display: block;
    margin-top: 10px;
    color: #0f172a;
    font-size: 30px;
    letter-spacing: -0.05em;
}
.module-summary-grid p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 12px;
}
.admin-health-line {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
}
.admin-health-line svg {
    width: 18px;
    height: 18px;
    color: #16a34a;
}
.admin-tabs {
    display: inline-flex;
    width: fit-content;
    flex-wrap: wrap;
    gap: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    padding: 6px;
}
.admin-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    color: #475569;
    font-size: 14px;
    font-weight: 800;
    padding: 9px 13px;
    text-decoration: none;
}
.admin-tabs a.is-active {
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: var(--shadow-sm);
}
.admin-tabs svg {
    width: 16px;
    height: 16px;
}
.admin-tabs span {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
}
.admin-tabs a.is-active span {
    background: #dbeafe;
    color: #1d4ed8;
}
.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 18px;
    align-items: start;
}
.admin-card,
.admin-form-card {
    padding: 18px;
}
.admin-card-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.admin-card-title h2,
.admin-card-title p,
.admin-form-card h2 {
    margin: 0;
}
.admin-card-title h2,
.admin-form-card h2 {
    color: #0f172a;
    font-size: 18px;
}
.admin-card-title p {
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}
.tpl-table-wrap {
    overflow-x: auto;
}
.tpl-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 13px;
}
.tpl-table thead th {
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    padding: 11px 12px;
    text-align: left;
    text-transform: uppercase;
}
.tpl-table tbody td {
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    padding: 13px 12px;
    vertical-align: top;
}
.tpl-table tbody tr:last-child td {
    border-bottom: 0;
}
.tpl-table strong {
    color: #0f172a;
}
.tpl-table .right {
    text-align: right;
}
.tpl-sub {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
}
.tpl-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 9px;
}
.tpl-badge.emerald { background: #ecfdf5; color: #047857; }
.tpl-badge.blue { background: #eff6ff; color: #1d4ed8; }
.tpl-badge.indigo { background: #eef2ff; color: #4338ca; }
.tpl-badge.amber { background: #fffbeb; color: #b45309; }
.tpl-badge.rose { background: #fef2f2; color: #be123c; }
.tpl-badge.slate { background: #f1f5f9; color: #64748b; }
.admin-actions {
    white-space: nowrap;
}
.admin-actions,
.admin-actions form {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.admin-actions a,
.admin-actions button {
    border: 0;
    background: transparent;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}
.admin-actions button.danger {
    color: #dc2626;
}
.module-empty-state {
    display: grid;
    min-height: 150px;
    place-items: center;
    border: 1px dashed #e2e8f0;
    border-radius: 18px;
    background: #f8fafc;
    color: #64748b;
    padding: 28px;
    text-align: center;
}
.admin-form-card {
    position: sticky;
    top: calc(var(--topbar-height) + 18px);
}
.admin-form {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}
.admin-form label {
    display: grid;
    gap: 6px;
}
.admin-form label > span {
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}
.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
    color: #0f172a;
    font: inherit;
    outline: none;
    padding: 10px 12px;
}
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.admin-reset-form {
    border-top: 1px solid #f1f5f9;
    margin-top: 18px;
    padding-top: 18px;
}
.admin-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.admin-feature-option {
    display: flex !important;
    grid-template-columns: none;
    align-items: center;
    gap: 8px !important;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    padding: 9px 10px;
}
.admin-feature-option input {
    width: auto;
}

@media (max-width: 1280px) {
    .module-summary-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }
    .admin-form-card {
        position: static;
    }
}
@media (max-width: 760px) {
    .module-real-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .module-summary-grid,
    .admin-form-grid,
    .admin-feature-grid {
        grid-template-columns: 1fr;
    }
    .admin-tabs {
        width: 100%;
    }
    .admin-tabs a {
        flex: 1;
        justify-content: center;
    }
}

/* ==========================================================================
   Toolbar, busca e modais compartilhados (Auditoria / Acessos)
   ========================================================================== */
.tpl-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.legacy-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    flex: 1;
    min-width: 220px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
    color: #64748b;
    padding: 0 12px;
}
.legacy-search svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.legacy-search input {
    width: 100%;
    border: 0;
    background: transparent;
    color: #0f172a;
    font: inherit;
    outline: none;
}
.tpl-toolbar select {
    min-height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
    color: #0f172a;
    font: inherit;
    padding: 0 12px;
}
.tpl-badge.violet { background: #f5f3ff; color: #6d28d9; }

.cmodal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    padding: 20px;
}
.cmodal-overlay[hidden] { display: none; }
body.modal-open { overflow: hidden; }
.cmodal {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: auto;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.35);
}
.cmodal.cmodal-sm { max-width: 480px; }
.cmodal-head,
.cmodal > header {
    border-bottom: 1px solid #f1f5f9;
    padding: 18px 20px;
}
.cmodal-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.cmodal-title h2 { margin: 0; color: #0f172a; font-size: 18px; }
.cmodal-title p { margin: 4px 0 0; color: #64748b; font-size: 13px; }
.cmodal-close {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
}
.cmodal-close svg { width: 18px; height: 18px; }
.cmodal-body {
    display: grid;
    gap: 14px;
    padding: 20px;
}
.cmodal-foot,
.cmodal > footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #f1f5f9;
    padding: 16px 20px;
}
.cmodal-foot p { margin: 0; margin-right: auto; color: #94a3b8; font-size: 12px; }
.cmodal-foot-actions { display: inline-flex; gap: 10px; }

/* ==========================================================================
   Auditoria
   ========================================================================== */
.audit-summary .audit-critical { border-color: #fecaca; background: #fff5f5; }
.audit-summary span { display: inline-flex; align-items: center; gap: 6px; }
.audit-summary span svg { width: 14px; height: 14px; }
.audit-table tbody tr { cursor: pointer; }
.audit-table tbody tr:hover td { background: #f8fafc; }
.audit-user { display: flex; align-items: center; gap: 10px; }
.audit-avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #1746a2 0%, #2563eb 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}
.audit-desc { max-width: 360px; }
.audit-count { margin: 14px 0 0; color: #94a3b8; font-size: 12px; }
.audit-detail { display: grid; gap: 12px; margin: 0; }
.audit-detail > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; }
.audit-detail dt { color: #64748b; font-size: 12px; font-weight: 900; }
.audit-detail dd { margin: 0; color: #0f172a; font-size: 13px; word-break: break-word; }
.audit-detail dd.audit-ua { color: #64748b; font-size: 12px; }
.audit-changes { display: grid; gap: 12px; margin-top: 16px; }
.audit-changes h4 { margin: 0 0 6px; color: #475569; font-size: 12px; font-weight: 900; }
.audit-changes pre {
    max-height: 220px;
    overflow: auto;
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ==========================================================================
   Minha Conta
   ========================================================================== */
.config-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.config-side,
.config-main { display: grid; gap: 18px; }
.config-card {
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    padding: 20px;
}
.config-card-head { margin-bottom: 16px; }
.config-card-title { display: flex; align-items: center; gap: 8px; }
.config-card-title h2 { margin: 0; color: #0f172a; font-size: 17px; }
.config-card-title svg { width: 18px; height: 18px; color: #2563eb; }
.config-card-head p { margin: 6px 0 0; color: #64748b; font-size: 13px; }
.account-avatar-box { display: grid; place-items: center; margin: 8px 0 16px; }
.account-avatar-lg {
    display: inline-grid;
    place-items: center;
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg, #1746a2 0%, #2563eb 100%);
    color: #fff;
    font-size: 40px;
    font-weight: 900;
}
.account-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.brasao-actions { display: grid; margin-bottom: 8px; }
.brasao-actions .legacy-button { width: 100%; }
.config-hint { margin: 0; color: #94a3b8; font-size: 12px; text-align: center; }
.account-identity {
    display: grid;
    gap: 3px;
    margin-top: 16px;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
    text-align: center;
}
.account-identity strong { color: #0f172a; font-size: 16px; }
.account-identity span { color: #64748b; font-size: 13px; }
.config-facts { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.config-facts li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.config-facts span { color: #64748b; font-size: 13px; }
.config-facts strong { color: #0f172a; font-size: 13px; text-align: right; }
.cform-body { display: grid; gap: 14px; }
.cform-field { display: grid; gap: 6px; }
.cform-field > span { color: #475569; font-size: 12px; font-weight: 900; }
.cform-field input,
.cform-field select {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
    color: #0f172a;
    font: inherit;
    outline: none;
    padding: 10px 12px;
}
.cform-field input:focus,
.cform-field select:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.cform-grid { display: grid; gap: 12px; }
.cform-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-activity-list { display: grid; gap: 4px; }
.account-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 0;
}
.account-activity-item:last-child { border-bottom: 0; }
.account-activity-item strong { display: block; color: #0f172a; font-size: 13px; }
.account-activity-item p { margin: 3px 0 0; color: #64748b; font-size: 12px; }
.account-activity-item em { display: block; margin-top: 3px; color: #94a3b8; font-size: 12px; font-style: normal; }
.notif-dot {
    margin-top: 6px;
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #2563eb;
}

/* ==========================================================================
   Acessos
   ========================================================================== */
.acessos-header-actions { display: inline-flex; flex-wrap: wrap; gap: 10px; }
.acessos-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.acessos-kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    padding: 18px 20px;
}
.acessos-kpi-icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 14px;
}
.acessos-kpi-icon svg { width: 20px; height: 20px; }
.acessos-kpi-icon.tone-blue { background: #eff6ff; color: #1d4ed8; }
.acessos-kpi-icon.tone-green { background: #ecfdf5; color: #047857; }
.acessos-kpi-icon.tone-slate { background: #f1f5f9; color: #64748b; }
.acessos-kpi-icon.tone-amber { background: #fffbeb; color: #b45309; }
.acessos-kpi-card span { color: #64748b; font-size: 12px; font-weight: 900; }
.acessos-kpi-card strong { display: block; margin-top: 2px; color: #0f172a; font-size: 26px; letter-spacing: -0.03em; }
.acessos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}
.acessos-card { padding: 20px; }
.acessos-card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.acessos-card-toolbar h2 { margin: 0; color: #0f172a; font-size: 17px; }
.acessos-card-toolbar p { margin: 4px 0 0; color: #64748b; font-size: 13px; }
.acessos-search { max-width: 300px; flex: 0 1 300px; }
.acessos-user-list { display: grid; gap: 10px; }
.acessos-user-row {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    background: #fff;
    padding: 12px 14px;
}
.acessos-avatar {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #1746a2 0%, #2563eb 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
}
.acessos-user-info { flex: 1; min-width: 0; }
.acessos-user-info h3 { margin: 0; color: #0f172a; font-size: 14px; }
.acessos-user-info p { margin: 2px 0 0; color: #64748b; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.acessos-user-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.acessos-role-badge {
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 10px;
}
.acessos-role-empty { color: #94a3b8; font-size: 12px; font-style: italic; }
.acessos-perm-count { color: #64748b; font-size: 12px; }
.acessos-global-badge {
    border-radius: 999px;
    background: #fef3c7;
    color: #b45309;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 10px;
}
.acessos-status-badge {
    flex-shrink: 0;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    padding: 5px 11px;
}
.acessos-status-badge.emerald { background: #ecfdf5; color: #047857; }
.acessos-status-badge.amber { background: #fffbeb; color: #b45309; }
.acessos-status-badge.slate { background: #f1f5f9; color: #64748b; }
.acessos-card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.acessos-card-title h2 { margin: 0; color: #0f172a; font-size: 17px; }
.acessos-card-title svg { width: 18px; height: 18px; color: #2563eb; }
.acessos-profile-list { display: grid; gap: 10px; }
.acessos-profile-list article {
    border: 1px solid #eef2f7;
    border-radius: 14px;
    background: #f8fafc;
    padding: 12px 14px;
}
.acessos-profile-list strong { color: #0f172a; font-size: 13px; }
.acessos-profile-list p { margin: 4px 0 0; color: #64748b; font-size: 12px; }
.acessos-empty {
    display: grid;
    justify-items: center;
    gap: 10px;
    color: #64748b;
    padding: 30px 20px;
    text-align: center;
}
.acessos-empty svg { width: 32px; height: 32px; color: #cbd5e1; }
.acessos-restrictions { display: grid; gap: 18px; }
.acessos-restrictions-intro h2 { margin: 0; color: #0f172a; font-size: 17px; }
.acessos-restrictions-intro p { margin: 6px 0 0; color: #64748b; font-size: 13px; max-width: 720px; }
.acessos-restrictions-grid {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.acessos-card-subtitle { color: #64748b; font-size: 12px; font-weight: 900; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.acessos-doc-scroll { display: grid; gap: 8px; max-height: 560px; overflow: auto; }
.acessos-doc-item {
    display: flex;
    gap: 12px;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    text-decoration: none;
    text-align: left;
}
.acessos-doc-item.active { border-color: #2563eb; background: #eff6ff; }
.acessos-doc-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
}
.acessos-doc-icon svg { width: 16px; height: 16px; }
.acessos-doc-info { min-width: 0; }
.acessos-doc-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.acessos-doc-name { color: #0f172a; font-size: 13px; font-weight: 800; }
.acessos-doc-info small { display: block; margin-top: 3px; color: #94a3b8; font-size: 12px; }
.acessos-origin-badge { border-radius: 999px; font-size: 10px; font-weight: 900; padding: 2px 8px; background: #f1f5f9; color: #64748b; }
.acessos-origin-badge.origin-system { background: #eef2ff; color: #4338ca; }
.acessos-origin-badge.origin-client { background: #ecfdf5; color: #047857; }
.acessos-origin-badge.origin-project { background: #eff6ff; color: #1d4ed8; }
.acessos-origin-badge.origin-imported { background: #fffbeb; color: #b45309; }
.acessos-blocked-badge { border-radius: 999px; background: #fef2f2; color: #be123c; font-size: 10px; font-weight: 900; padding: 2px 8px; }
.acessos-doc-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.acessos-doc-detail-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    background: #fef2f2;
    color: #be123c;
}
.acessos-doc-detail-head h3 { margin: 0; color: #0f172a; font-size: 16px; }
.acessos-doc-detail-head p { margin: 2px 0 0; color: #64748b; font-size: 13px; }
.acessos-doc-desc { margin: 0 0 16px; color: #475569; font-size: 13px; }
.acessos-block-label { display: block; color: #0f172a; font-size: 13px; font-weight: 900; }
.acessos-block-hint { margin: 4px 0 12px; color: #94a3b8; font-size: 12px; }
.acessos-checkbox-list { display: grid; gap: 8px; max-height: 380px; overflow: auto; }
.acessos-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    cursor: pointer;
}
.acessos-checkbox-list label.checked { border-color: #fca5a5; background: #fff5f5; }
.acessos-checkbox-list input { width: 16px; height: 16px; }
.acessos-checkbox-list span { display: grid; }
.acessos-checkbox-list strong { color: #0f172a; font-size: 13px; }
.acessos-checkbox-list small { color: #64748b; font-size: 12px; }
.acessos-doc-detail-footer { display: flex; justify-content: flex-end; margin-top: 16px; }
.acessos-modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.acessos-modal-hint { margin: 0; color: #64748b; font-size: 12px; }

@media (max-width: 1200px) {
    .acessos-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .config-layout,
    .acessos-layout,
    .acessos-restrictions-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .acessos-kpi-grid,
    .cform-grid.cols-2,
    .acessos-modal-grid { grid-template-columns: 1fr; }
    .audit-detail > div { grid-template-columns: 1fr; gap: 4px; }
}
