/* =======================================================================
   base.css: tokens do design system + componentes compartilhados
   Linguagem visual: superfícies claras e arredondadas, botões pretos em
   pílula, controles segmentados, cartões cinza/preto e destaque no laranja
   da logo 3Plan (#FF4E10). Verde fica reservado para estados de sucesso.
   Modo escuro: <html data-mode="dark"> troca os tokens (bloco logo abaixo);
   componentes usam só tokens, nunca cores fixas de fundo/texto.
   ======================================================================= */

:root {
    color-scheme: light;
    --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-display: "Outfit", "Inter", system-ui, sans-serif;

    --page: #E8E8EB;
    --surface: #FFFFFF;
    --surface-2: #F5F5F6;
    --surface-3: #EEEEF0;
    --surface-4: #E2E2E6;       /* hover de preenchimentos em surface-3 */
    --raised: #FFFFFF;          /* item selecionado sobre surface-3 (segmentado, sol/lua) */
    --line: #E7E7EA;
    --line-2: #D9D9DE;
    --line-3: #C6C6CD;          /* borda em hover */
    --ink: #0D0D0E;
    --ink-2: #3F3F46;
    --ink-3: #6B6B75;
    --ink-4: #9F9FA8;
    --ink-hover: #2A2A2F;

    /* Texto e detalhes sobre preenchimentos em --ink (botão principal, cartão escuro, toast) */
    --on-ink: #FFFFFF;
    --on-ink-2: rgba(255, 255, 255, .82);
    --on-ink-3: rgba(255, 255, 255, .62);
    --on-ink-soft: rgba(255, 255, 255, .14);
    --on-ink-success: #7FE0A0;
    --on-ink-danger: #FF8C8F;

    /* Laranja da logo e variações */
    --accent: #FF4E10;          /* preenchimentos (texto escuro por cima) */
    --accent-hover: #F04200;
    --accent-strong: #E84300;   /* ícones e traços sobre o fundo (≥ 3:1) */
    --accent-deep: #CC3A00;     /* texto sobre o fundo (≥ 4,5:1) */
    --accent-soft: #FFEDE6;
    --on-accent: #0D0D0E;       /* texto sobre laranja, verde e amarelo (igual nos dois modos) */

    --success: #2FB45A;
    --success-deep: #16733A;
    --success-soft: #E7F6EC;

    --danger: #E5484D;
    --danger-deep: #B42318;
    --danger-soft: #FEF0F0;
    --danger-soft-hover: #FCE1E1;
    --danger-line: #F6D2D3;
    --warning: #F5A524;
    --warning-deep: #8A4E00;
    --warning-soft: #FFF5E3;
    --info: #2E90FA;
    --info-deep: #175CD3;
    --info-soft: #EDF5FF;

    /* Tela da planta: clara nos dois modos, para as cores da planta ficarem fiéis ao PDF */
    --canvas: #F3F3F5;
    --canvas-dot: #CBCBD1;

    --chart-bar: #CFCFD5;
    --chart-bar-hover: #A9A9B2;
    --pending-row: #FFFAF2;
    --swatch-edge: rgba(13, 13, 14, .14);
    --code-bg: #FBFBFC;
    --code-bg-focus: #FFFFFF;
    --skeleton-hi: #F7F7F8;
    --backdrop: rgba(13, 13, 14, .34);
    --showcase-bg: #0D0D0E;     /* vitrine das telas de acesso: escura nos dois modos */

    --r-xs: 8px;
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-pill: 999px;

    --sh-xs: 0 1px 2px rgba(13, 13, 14, .06);
    --sh-sm: 0 1px 3px rgba(13, 13, 14, .09), 0 1px 2px rgba(13, 13, 14, .04);
    --sh-md: 0 10px 30px rgba(13, 13, 14, .08), 0 2px 8px rgba(13, 13, 14, .05);
    --sh-lg: 0 30px 80px rgba(13, 13, 14, .18), 0 8px 24px rgba(13, 13, 14, .08);
    --ring: 0 0 0 3px rgba(255, 78, 16, .35);

    --ease: cubic-bezier(.2, .8, .2, 1);
}

/* --------------------------------------------------------------- modo escuro */
:root[data-mode="dark"] {
    color-scheme: dark;

    --page: #070708;
    --surface: #141416;
    --surface-2: #1B1B1E;
    --surface-3: #242428;
    --surface-4: #2E2E33;
    --raised: #38383F;
    --line: #27272C;
    --line-2: #36363C;
    --line-3: #4A4A52;
    --ink: #F2F2F3;
    --ink-2: #D0D0D6;
    --ink-3: #A0A0AA;
    --ink-4: #7A7A85;
    --ink-hover: #D6D6DB;

    --on-ink: #0D0D0E;
    --on-ink-2: rgba(13, 13, 14, .78);
    --on-ink-3: rgba(13, 13, 14, .6);
    --on-ink-soft: rgba(13, 13, 14, .08);
    --on-ink-success: #16733A;
    --on-ink-danger: #B42318;

    --accent: #FF4E10;
    --accent-hover: #FF6A36;
    --accent-strong: #FF6A36;
    --accent-deep: #FF8457;
    --accent-soft: #35190F;

    --success: #34C26A;
    --success-deep: #5FD68D;
    --success-soft: #16291E;

    --danger: #E5484D;
    --danger-deep: #FF8A8E;
    --danger-soft: #331A1D;
    --danger-soft-hover: #422125;
    --danger-line: #5A2A2E;
    --warning: #F5A524;
    --warning-deep: #F7BC5C;
    --warning-soft: #33280F;
    --info: #2E90FA;
    --info-deep: #7DB6FF;
    --info-soft: #152538;

    --canvas: #E4E4E8;
    --canvas-dot: #C3C3CA;

    --chart-bar: #45454D;
    --chart-bar-hover: #64646E;
    --pending-row: #1E1A12;
    --swatch-edge: rgba(255, 255, 255, .18);
    --code-bg: #101012;
    --code-bg-focus: #0C0C0E;
    --skeleton-hi: #2C2C31;
    --backdrop: rgba(0, 0, 0, .6);
    --showcase-bg: #111113;

    --sh-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --sh-sm: 0 1px 3px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .3);
    --sh-md: 0 10px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
    --sh-lg: 0 30px 80px rgba(0, 0, 0, .6), 0 8px 24px rgba(0, 0, 0, .4);
    --ring: 0 0 0 3px rgba(255, 106, 54, .45);
}

/* Durante a troca de modo, sem transições (tudo muda junto); o botão sol/lua continua deslizando. */
.is-switching-mode *:not(.mode-toggle-knob), .is-switching-mode *::before, .is-switching-mode *::after { transition: none !important; }

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss03";
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
svg { flex-shrink: 0; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring); }
[hidden] { display: none !important; }
::selection { background: rgba(255, 78, 16, .24); }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------- tipografia */
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; }
.h1 { font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px); line-height: 1.08; font-weight: 400; letter-spacing: -0.03em; }
.h2 { font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.h3 { font-size: 15px; line-height: 1.35; font-weight: 600; }
.muted { color: var(--ink-3); }
.subtle { color: var(--ink-4); }
.small { font-size: 12.5px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.link { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--ink); }
.link-button { background: none; border: 0; padding: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------------------------------------------- botões */
.btn {
    --h: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--h);
    padding: 0 18px;
    border-radius: var(--r-pill);
    border: 1px solid transparent;
    background: transparent;
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
    position: relative;
    transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover:not(:disabled) { background: var(--ink-hover); }
.btn-secondary { background: var(--surface-3); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-4); }
.btn-outline { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-outline:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-3); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #D93A40; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger-deep); }
.btn-danger-soft:hover:not(:disabled) { background: var(--danger-soft-hover); }
.btn-light { background: rgba(255, 255, 255, .1); color: #fff; }
.btn-light:hover:not(:disabled) { background: rgba(255, 255, 255, .18); }
.btn-sm { --h: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { --h: 50px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid; border-color: #fff #fff #fff transparent;
    animation: spin .7s linear infinite;
}
.btn-primary.is-loading::after { border-color: var(--on-ink) var(--on-ink) var(--on-ink) transparent; }
.btn-secondary.is-loading::after, .btn-outline.is-loading::after, .btn-ghost.is-loading::after {
    border-color: var(--ink) var(--ink) var(--ink) transparent;
}
.btn-accent.is-loading::after { border-color: var(--on-accent) var(--on-accent) var(--on-accent) transparent; }

.icon-circle {
    width: 36px; height: 36px; border-radius: 50%;
    display: inline-grid; place-items: center;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line);
    transition: background-color .15s, transform .15s var(--ease);
    text-decoration: none;
}
.icon-circle svg { width: 17px; height: 17px; }
.icon-circle:hover { transform: rotate(45deg); }
.card-ink .icon-circle { background: var(--on-ink); border-color: var(--on-ink); color: var(--ink); }

/* ------------------------------------------------------------- formulários */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--ink-2); display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.field-label .optional { color: var(--ink-4); font-weight: 400; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--surface-2);
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--ink-4); }
.input:hover:not(:disabled) { border-color: var(--line-2); }
.input:focus { background: var(--surface); border-color: var(--ink); box-shadow: var(--ring); }
.input:disabled { opacity: .6; cursor: not-allowed; }
.input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(229, 72, 77, .25); }
.input-wrap > .input-icon { position: absolute; left: 14px; color: var(--ink-4); pointer-events: none; width: 18px; height: 18px; display: grid; place-items: center; }
.input-wrap > .input-icon svg { width: 18px; height: 18px; display: block; }
.input-wrap:focus-within > .input-icon { color: var(--ink); }
.input-wrap.has-icon .input { padding-left: 42px; }
.input-wrap.has-action .input { padding-right: 48px; }
.input-wrap > .input-action {
    position: absolute; right: 6px; width: 36px; height: 36px; border-radius: 10px;
    border: 0; background: transparent; color: var(--ink-3); display: grid; place-items: center;
}
.input-wrap > .input-action:hover { background: var(--surface-3); color: var(--ink); }
.input-wrap > .input-action svg { width: 18px; height: 18px; }
.field-hint { font-size: 12px; color: var(--ink-3); }
.field-error { font-size: 12px; color: var(--danger-deep); }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6B75' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
:root[data-mode="dark"] select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A0A0AA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }

.checkbox { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.checkbox input { appearance: none; width: 18px; height: 18px; margin: 1px 0 0; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; flex: none; transition: .15s; }
.checkbox input:checked { background: var(--ink); border-color: var(--ink); }
.checkbox input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--on-ink); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }

/* Controle segmentado */
.segmented { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-3); border-radius: 14px; }
.segmented > button, .segmented > a {
    height: 34px; padding: 0 14px; border: 0; background: transparent; border-radius: 10px;
    color: var(--ink-3); font-weight: 500; font-size: 13.5px; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: background-color .15s, color .15s, box-shadow .15s;
}
.segmented > button svg, .segmented > a svg { width: 16px; height: 16px; }
.segmented > button:hover, .segmented > a:hover { color: var(--ink); }
.segmented > button[aria-pressed="true"], .segmented > button[aria-selected="true"], .segmented > a[aria-pressed="true"] {
    background: var(--raised); color: var(--ink); box-shadow: var(--sh-sm);
}
.segmented.is-block { display: flex; }
.segmented.is-block > button { flex: 1; }
.segmented.is-sm > button, .segmented.is-sm > a { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }

/* Interruptor */
.switch { position: relative; display: inline-block; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch input:disabled { cursor: not-allowed; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: background-color .2s var(--ease); }
.switch span::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease);
}
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--on-ink); }
.switch input:focus-visible + span { box-shadow: var(--ring); }
.switch input:disabled + span { opacity: .5; }

/* ----------------------------------------------------------------- cartões */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card-muted { background: var(--surface-2); border-color: transparent; }
.card-ink { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.card-ink .muted { color: var(--on-ink-3); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.card-ink .card-sub { color: var(--on-ink-3); }

/* ------------------------------------------------------------ selos/alertas */
.badge {
    display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
    border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1;
    background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: var(--success-deep); }
.badge-warning { background: var(--warning-soft); color: var(--warning-deep); }
.badge-danger { background: var(--danger-soft); color: var(--danger-deep); }
.badge-info { background: var(--info-soft); color: var(--info-deep); }
.badge-ink { background: var(--ink); color: var(--on-ink); }
.badge-outline { background: transparent; border: 1px solid var(--line-2); }

.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.45; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert strong { font-weight: 600; }
.alert-success { background: var(--success-soft); color: var(--success-deep); }
.alert-danger { background: var(--danger-soft); color: var(--danger-deep); }
.alert-warning { background: var(--warning-soft); color: var(--warning-deep); }
.alert-info { background: var(--info-soft); color: var(--info-deep); }
.alert .alert-actions { margin-top: 6px; }

/* ------------------------------------------------------------------ avatar */
.avatar {
    width: 36px; height: 36px; border-radius: 50%; flex: none;
    display: inline-grid; place-items: center;
    background: var(--accent); color: var(--on-accent);
    font-weight: 600; font-size: 13px; letter-spacing: .02em;
}
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }

/* ------------------------------------------------------------------ tabela */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
    text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3);
    padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td:first-child, .table th:first-child { padding-left: 4px; }
.table .cell-actions { text-align: right; white-space: nowrap; }

/* ------------------------------------------------------------------ toasts */
.toasts {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    z-index: 1000; pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
    pointer-events: auto; display: flex; align-items: center; gap: 10px;
    min-height: 44px; max-width: 100%; padding: 8px 18px 8px 8px;
    background: var(--ink); color: var(--on-ink); border-radius: 999px; box-shadow: var(--sh-lg);
    font-size: 14px; animation: toast-in .25s var(--ease);
}
.toast.is-leaving { animation: toast-out .2s var(--ease) forwards; }
.toast-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--on-ink-soft); flex: none; }
.toast-icon svg { width: 16px; height: 16px; }
.toast-success .toast-icon { background: var(--success); color: var(--on-accent); }
.toast-error .toast-icon { background: var(--danger); color: #fff; }
.toast-warning .toast-icon { background: var(--warning); color: var(--on-accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ------------------------------------------------------------------- modal */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 900;
    background: var(--backdrop); backdrop-filter: blur(3px);
    display: grid; place-items: center; padding: 16px;
    animation: fade-in .15s ease;
}
.modal {
    width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto;
    background: var(--surface); border-radius: 24px; box-shadow: var(--sh-lg); padding: 24px;
    animation: modal-in .22s var(--ease);
}
.modal-head { display: flex; gap: 14px; align-items: flex-start; }
.modal-head-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); flex: none; }
.modal-head-icon svg { width: 22px; height: 22px; }
.modal-head-icon.is-danger { background: var(--danger-soft); color: var(--danger-deep); }
.modal-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.modal-desc { color: var(--ink-3); margin-top: 4px; }
.modal-body { margin-top: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-actions { margin-top: 24px; display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* Menu suspenso */
.menu {
    position: absolute; z-index: 800; min-width: 220px; padding: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-md);
    animation: modal-in .15s var(--ease);
}
.menu-item {
    width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px;
    border: 0; background: transparent; border-radius: 10px; text-align: left; text-decoration: none;
    color: var(--ink-2); font-size: 13.5px;
}
.menu-item svg { width: 17px; height: 17px; color: var(--ink-3); }
.menu-item:hover, .menu-item.is-active { background: var(--surface-2); color: var(--ink); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* --------------------------------------------------------- estados/diversos */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 16px; }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-2); margin-bottom: 6px; }
.empty-icon svg { width: 26px; height: 26px; }
.empty-title { font-size: 16px; font-weight: 600; }
.empty-text { color: var(--ink-3); max-width: 380px; }
.empty .btn { margin-top: 10px; }

.skeleton {
    background: linear-gradient(90deg, var(--surface-3) 25%, var(--skeleton-hi) 37%, var(--surface-3) 63%);
    background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 10px;
}
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--ink-4); font-size: 12px; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line-2); font-size: 11px; color: var(--ink-3); font-family: var(--font-ui); }

/* Tela cheia de carregamento / erro de configuração */
.boot { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
/* Conteúdo maior que a tela (tela de aceite do Termo): rola e continua centralizado quando cabe. */
.boot.is-scrollable { display: flex; height: 100vh; height: 100dvh; min-height: 0; overflow: auto; }
.boot.is-scrollable > .boot-card { margin: auto; }
.boot-card { width: min(520px, 100%); background: var(--surface); border-radius: var(--r-xl); padding: 36px; box-shadow: var(--sh-md); }
.boot-card pre { text-align: left; background: var(--surface-2); padding: 14px; border-radius: 12px; overflow: auto; font-size: 12.5px; }

/* Cadastro aguardando aprovação */
.pending-card { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pending-brand svg { display: block; border-radius: 50%; box-shadow: var(--sh-sm); }
.pending-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 3vw, 34px); line-height: 1.12; letter-spacing: -0.03em; margin-top: 2px; }
.pending-status:empty { display: none; }
.pending-status svg { vertical-align: -2px; }
.pending-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }

/* Crédito discreto */
.app-credit { font-size: 11.5px; color: var(--ink-4); letter-spacing: .01em; }
.pending-card .app-credit { margin-top: 12px; }

/* Termo de Uso (termos.html, janela do cadastro/login e tela de aceite) */
.terms-doc { color: var(--ink-2); font-size: 14px; line-height: 1.65; text-align: left; }
.terms-head { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
/* Logo em preto; no modo escuro fica clara para continuar legível. */
.terms-logo { display: block; width: auto; height: 30px; margin-bottom: 16px; }
:root[data-mode="dark"] .terms-logo { filter: invert(1); }
.terms-version { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.terms-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); }
.terms-subtitle { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); }
.terms-section { margin-top: 20px; }
.terms-section-title { font-size: 13px; font-weight: 700; letter-spacing: .03em; line-height: 1.4; color: var(--ink); margin-bottom: 6px; }
.terms-section p + p, .terms-section ul + p { margin-top: 10px; }
.terms-section ul { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.terms-sign { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.terms-sign-name { font-weight: 600; color: var(--ink); }
.terms-companies { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.terms-company { display: flex; flex-direction: column; gap: 1px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.terms-company strong { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.terms-doc.is-scroll { max-height: min(52vh, 520px); overflow: auto; padding: 2px 10px 2px 2px; scrollbar-width: thin; }
.terms-check { font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.terms-check .link { color: var(--ink); }
.checkbox input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }

/* Tela de aceite do Termo dentro da plataforma */
.terms-gate { width: min(760px, 100%); text-align: left; display: flex; flex-direction: column; gap: 16px; }
.terms-gate-head { display: flex; align-items: center; gap: 14px; }
.terms-gate-head svg { display: block; flex: none; }
.terms-gate-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 2.8vw, 30px); line-height: 1.15; letter-spacing: -0.02em; }
.terms-gate .terms-doc.is-scroll { border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; max-height: min(48vh, 460px); }
.terms-gate-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* Botão sol/lua do modo escuro (js/lib/color-mode.js) */
.mode-toggle {
    position: relative; flex: none; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center;
    width: 68px; height: 36px; padding: 3px; border-radius: 999px;
    background: var(--surface-3); border: 1px solid var(--line); color: var(--ink-4);
    transition: border-color .15s, color .15s;
}
.mode-toggle:hover { border-color: var(--line-2); color: var(--ink-3); }
.mode-toggle-knob {
    position: absolute; top: 3px; left: 3px; width: 30px; height: 28px; border-radius: 999px;
    background: var(--raised); box-shadow: var(--sh-sm); transition: transform .28s var(--ease);
}
.mode-toggle[aria-checked="true"] .mode-toggle-knob { transform: translateX(30px); }
.mode-toggle-icon { position: relative; display: grid; place-items: center; height: 28px; }
.mode-toggle-icon svg { display: block; }
.mode-toggle[aria-checked="false"] .is-sun { color: var(--accent-strong); }
.mode-toggle[aria-checked="true"] .is-moon { color: var(--ink); }
.boot-corner { position: fixed; top: 16px; right: 16px; z-index: 5; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
