:root {
    --navy-950: #0c1527;
    --navy-900: #111d36;
    --navy-800: #182849;
    --navy-700: #233861;
    --blue-700: #083da5;
    --blue-600: #0b4ed6;
    --blue-500: #0c59f3;
    --blue-100: #c0d0ef;
    --blue-50: #e4eaf6;
    --bg: #cbd9f3;
    --surface: #eef2f9;
    --surface-2: #e6ebf4;
    --surface-3: #ccd7ed;
    --border: #9caed3;
    --border-strong: #2457bc;
    --text: #0f1624;
    --text-soft: #1b263c;
    --muted: #324e85;
    --success: #0b6b3a;
    --success-bg: #d5f5e3;
    --warning: #8a4b06;
    --warning-bg: #fdecc8;
    --danger: #a51c1c;
    --danger-bg: #fde0e0;
    --tint: #e0e6f2;
    --line: #c2cee5;
    --hover: #eceff6;
    --field: #f9f9fb;
    --topbar-bg: rgba(238, 242, 249, .94);
    --soft: #e7ebf4;
    --soft-line: #b5c3de;
    --gate-tint: #d3ddf0;
    --info-ink: #253f74;
    --info-line: #94acdb;
    --warn-line: #e8c884;
    --chip: #e6eaf2;
    --chip-ink: #223459;
    --chip-info: #dae2f1;
    --chip-info-ink: #213763;
    --danger-hover: #fbc7c7;
    --acc-blue: #d8e1f3;
    --acc-blue-line: #8da6d8;
    --acc-green: #c2f0d4;
    --acc-green-line: #7fcf9e;
    --acc-amber: #ffe3a6;
    --acc-amber-line: #e9c069;
    --acc-violet: #e0d2ff;
    --acc-violet-line: #b79ef0;
    --accent: var(--blue-600);
    /* Faixas sempre escuras do site público e do acesso (login/cadastro) */
    --brand-1: #0b4ed6;
    --brand-2: #111c32;
    --brand-3: #0b1323;
    --brand-ink: #d9e1f2;
    --brand-mute: #b0bfdd;
    --bar-soft-a: #8aa9e5;
    --bar-soft-b: #0b4ed6;
    --card-bg: linear-gradient(180deg, #fafbfc 0%, #f0f3f9 100%);
    --card-shadow: 0 20px 38px -18px rgba(15, 22, 36, .22), 0 5px 14px -6px rgba(15, 22, 36, .10), inset 0 1px 0 rgba(255, 255, 255, .92);
    color-scheme: light;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 14px 34px rgba(15, 22, 36, .16);
    --shadow-sm: 0 8px 20px rgba(15, 22, 36, .12);
    /* iOS: relevo suave em campos, botões e abas */
    --ios-field-bg: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%);
    --ios-field-line: #839cce;
    --ios-field-shadow: inset 0 1px 2px rgba(15, 22, 36, .08), inset 0 0 0 1px rgba(255, 255, 255, .55);
    --ios-field-focus: 0 0 0 4px rgba(22, 96, 243, .24), inset 0 1px 2px rgba(15, 22, 36, .05);
    --ios-btn-bg: linear-gradient(180deg, #ffffff 0%, #e7ebf3 100%);
    --ios-btn-line: #718fcb;
    --ios-btn-shadow: inset 0 1px 0 #ffffff, 0 1px 2px rgba(15, 22, 36, .08), 0 8px 16px -8px rgba(15, 22, 36, .26);
    --ios-btn-press: inset 0 2px 5px rgba(15, 22, 36, .14);
    --ios-primary-bg: linear-gradient(180deg, #578cf4 0%, #1660f3 55%, #0e51d7 100%);
    --ios-primary-shadow: inset 0 1px 0 rgba(255, 255, 255, .40), 0 1px 2px rgba(15, 22, 36, .14), 0 10px 20px -8px rgba(22, 96, 243, .45);
    --ios-seg-bg: #e5eaf2;
    --ios-seg-line: #b9c6df;
    --ios-seg-shadow: inset 0 1px 2px rgba(15, 22, 36, .07);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--text); }
h1:focus, h1:focus-visible { outline: none; }
p { margin: 0; }
code { font-family: "Cascadia Code", Consolas, monospace; background: var(--blue-50); border-radius: 6px; padding: 2px 6px; font-size: .85em; }

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 13px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--ios-btn-shadow);
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .06s ease;
    text-decoration: none !important;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); box-shadow: var(--ios-btn-press); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--ios-primary-bg); color: #fff; border-color: rgba(255, 255, 255, .18); box-shadow: var(--ios-primary-shadow); }
.btn-primary:hover { background: var(--ios-primary-bg); filter: brightness(1.07); }
.btn-primary:active { box-shadow: inset 0 2px 6px rgba(9, 33, 74, .35); }
.btn-outline { border-color: var(--ios-btn-line); background: var(--ios-btn-bg); color: var(--text-soft); }
.btn-outline:hover { border-color: var(--blue-500); color: var(--blue-700); }
.btn-ghost { color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: rgba(148, 163, 184, .14); color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }
.btn-light { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
.btn-outline-light { border-color: rgba(255, 255, 255, .4); color: #fff; box-shadow: none; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 34px; height: 34px; border-radius: 11px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.field-error { color: var(--danger); font-size: 12px; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ios-field-line);
    border-radius: 13px;
    background: var(--ios-field-bg);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
    box-shadow: var(--ios-field-shadow);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--blue-500);
    box-shadow: var(--ios-field-focus);
}
.input-sm, input.input-sm, select.input-sm { padding: 7px 11px; font-size: 13px; border-radius: 11px; }
textarea { resize: vertical; min-height: 70px; }
input[type="file"] { width: 100%; max-width: 100%; font: inherit; font-size: 13px; color: var(--muted); }
input[type="file"]::file-selector-button {
    margin-right: 12px; padding: 8px 14px; border-radius: 11px; cursor: pointer;
    border: 1px solid var(--ios-btn-line); background: var(--ios-btn-bg);
    color: var(--text-soft); font: inherit; font-weight: 600; font-size: 13px;
    box-shadow: var(--ios-btn-shadow);
}
input[type="file"]::file-selector-button:hover { border-color: var(--blue-500); color: var(--blue-700); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-soft); cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--blue-600); flex: none; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.form-section-title { font-size: 15px; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form .input { flex: 1; min-width: 130px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-info { background: var(--blue-50); color: var(--info-ink); }

/* ---------- App shell (igual ao programa) ---------- */
.ic { width: 18px; height: 18px; flex: none; display: block; }
:root {
    --side-bg: #153168;
    --side-line: rgba(255, 255, 255, .20);
    --side-text: #f4f6fb;
    --side-strong: #ffffff;
    --side-muted: #c9d5ed;
    --side-hover: rgba(255, 255, 255, .14);
    --side-active: rgba(111, 153, 236, .34);
    --side-accent: #a5bff3;
    --promo-a: #1a2e56;
    --promo-b: #101f3d;
    --avatar-a: #1748ab;
    --avatar-b: #256af4;
}
[data-theme="claro"] {
    --blue-600: #155bcc;
    --blue-500: #1767e8;
}
[data-theme="claro"] body,
[data-theme="claro"] .app-shell {
    background: radial-gradient(135% 110% at 15% -25%, #f0f2f7 0%, #d9e1f2 38%, #b9cbee 74%, #92b0ed 100%) fixed;
}
[data-theme="claro"] .sidebar:not(.sidebar-admin) {
    background: linear-gradient(180deg, #193b80 0%, #142f64 52%, #0d1d3d 100%);
}
[data-theme="claro"] .sidebar:not(.sidebar-admin) .brand img {
    box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
}
.app-shell {
    display: grid;
    grid-template-columns: 262px minmax(0, 1fr);
    min-height: 100vh;
    background: var(--bg);
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 14px 14px;
    background: var(--side-bg);
    color: var(--side-text);
    border-right: 1px solid var(--side-line);
    overflow-y: auto;
    z-index: 40;
}
.brand { display: flex; align-items: center; padding: 0 8px; text-decoration: none !important; width: fit-content; border-radius: 15px; }
.brand img {
    width: 68px; height: 68px; object-fit: contain; border-radius: 15px;
    box-shadow: 0 6px 16px rgba(6, 26, 54, .18);
}
.brand:focus-visible { outline: 2px solid var(--side-accent); outline-offset: 4px; }
.side-company {
    display: flex; align-items: center; gap: 9px; margin: 0 6px;
    padding: 9px 10px; border-radius: 10px; background: var(--side-hover);
    border: 1px solid var(--side-line);
    color: var(--side-text); line-height: 1.3; min-width: 0;
}
.side-company .side-logo {
    width: 30px; height: 30px; flex: none;
    object-fit: cover; object-position: left center; border-radius: 50%;
}
.side-company-text { display: flex; flex-direction: column; min-width: 0; }
.side-company-name { font-size: 13.5px; font-weight: 700; color: var(--side-strong); overflow-wrap: anywhere; }
.side-company-kind { font-size: 11.5px; font-weight: 600; color: var(--side-accent); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label {
    font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: var(--side-muted); padding: 0 12px 8px 19px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    border: 0;
    background: transparent;
    color: var(--side-text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    text-decoration: none !important;
    width: 100%;
}
.nav-item .ic { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--side-hover); color: var(--side-strong); }
.nav-item.active { background: var(--side-active); color: var(--side-accent); font-weight: 600; }
.nav-item.active .ic { opacity: 1; }
.nav-item.active::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--side-accent); margin-left: auto; flex: none; }
.sidebar-admin .nav-item.active::after { display: none; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; flex: none; }
.nav-item.active .nav-dot { opacity: 1; }
.sidebar-footer { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--side-line); padding-top: 12px; }
.sidebar-user {
    display: flex; align-items: center; gap: 11px; min-width: 0;
    margin: 0 2px 10px; padding: 9px 10px;
    border: 1px solid var(--side-line); border-radius: 10px; background: var(--side-hover);
}
.sidebar-user .user-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .22); }
.plan-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; color: var(--side-text); font-size: 13px; font-weight: 500;
}
.plan-row .ic { width: 18px; height: 18px; flex: none; opacity: .85; }
.plan-row .badge { margin-left: -4px; font-size: 10.5px; padding: 2px 8px; }
.nav-signout {
    justify-content: center; margin-top: 8px; font-size: 12px; font-weight: 600;
    color: var(--side-text); border: 1px solid var(--side-line);
}
.nav-signout .ic { width: 15px; height: 15px; color: var(--side-accent); }
.nav-signout:hover { color: var(--side-strong); background: var(--side-hover); }

/* Ocultar e reabrir o menu (computador) */
.sidebar-hide {
    position: absolute; top: 14px; right: 10px; z-index: 2;
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding: 0;
    border: 1px solid var(--side-line); border-radius: 9px;
    background: var(--side-hover); color: var(--side-text);
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sidebar-hide:hover { background: var(--side-active); border-color: var(--side-accent); color: var(--side-strong); }
.sidebar-hide .ic { width: 16px; height: 16px; }
.menu-restore {
    display: none; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0; flex: none;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--text-soft);
    cursor: pointer; box-shadow: var(--shadow-sm);
}
.menu-restore:hover { border-color: var(--blue-500); color: var(--blue-700); }
.menu-restore .ic { width: 17px; height: 17px; }
@media (min-width: 981px) {
    .app-shell { transition: grid-template-columns .22s ease; }
    .sidebar { transition: opacity .16s ease; }
    html[data-sidebar="oculto"] .app-shell { grid-template-columns: 0 minmax(0, 1fr); }
    html[data-sidebar="oculto"] .sidebar { opacity: 0; visibility: hidden; pointer-events: none; }
    html[data-sidebar="oculto"] .menu-restore { display: inline-flex; }
}
@media (max-width: 980px) {
    .sidebar-hide { display: none; }
}

/* painel da plataforma permanece sempre escuro */
.sidebar-admin {
    --side-bg: #0b1324;
    --side-line: rgba(255, 255, 255, .08);
    --side-text: #b6c6e2;
    --side-strong: #ffffff;
    --side-muted: #8fa6c9;
    --side-hover: rgba(255, 255, 255, .07);
    --side-active: rgba(59, 130, 246, .2);
    --side-accent: #93c5fd;
    background: radial-gradient(120% 70% at 0% 0%, #312e81 0%, #0b1324 62%);
}

.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 26px;
    background: var(--topbar-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumb-root { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.crumb-sep { font-size: 12px; color: var(--muted); }
.crumb-page { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.lang-picker { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--field); color: var(--text-soft); }
.lang-picker .ic { width: 15px; height: 15px; flex: 0 0 auto; color: var(--blue-600); }
[data-theme="escuro"] .lang-picker .ic { color: var(--blue-500); }
.lang-select { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; padding: 1px 0; max-width: 120px; }
.lang-select:focus { outline: none; }
@media (max-width: 640px) {
    .lang-picker { padding: 5px 6px; }
    .lang-picker .ic { display: none; }
    .lang-select { font-size: 12px; max-width: 78px; }
}
.install-app { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.install-app .ic { width: 16px; height: 16px; color: var(--blue-600); }
[data-theme="escuro"] .install-app .ic { color: var(--blue-500); }
@media (max-width: 1080px) { .install-app .install-label { display: none; } }
@media (max-width: 640px) { .install-app { padding: 7px 9px; } }
.install-help { display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; line-height: 1.5; color: var(--text-soft); }
.install-help-item { display: flex; flex-direction: column; gap: 3px; }
.install-help-item strong { color: var(--text); font-size: 13.5px; }
.install-help-note { margin: 2px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.topbar-context { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-company { font-weight: 600; color: var(--text-soft); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--avatar-a), var(--avatar-b)); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none;
}
.user-avatar-photo { object-fit: cover; background: var(--surface-2); }
.user-avatar-sm { width: 28px; height: 28px; font-size: 10.5px; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.profile-photo { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-photo-preview img,
.profile-photo-preview .user-avatar { width: 76px; height: 76px; font-size: 26px; border-radius: 50%; object-fit: cover; }
.profile-photo-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.social-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.social-field { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 12px; background: var(--field); border: 1px solid var(--border); min-width: 0; }
.social-field:focus-within { border-color: var(--accent); }
.social-field .input { border: 0; background: transparent; box-shadow: none; padding: 6px 0; min-width: 0; }
.social-field .input:focus { outline: none; }
.social-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.social-icon-instagram { background: linear-gradient(135deg, #f9ce34, #ee2a7b 55%, #6228d7); }
.social-icon-facebook { background: #1877f2; }
.social-icon-tiktok { background: #101010; }
.social-at { color: var(--text-muted, var(--text-soft)); font-weight: 700; opacity: .7; }
.social-toggle { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--text-soft); font-size: 13px; cursor: pointer; }
.social-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.social-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.social-chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); }
@media (max-width: 720px) { .social-grid { grid-template-columns: 1fr; } }
.user-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.user-text strong { font-size: 13.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-text span { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.sidebar-user .user-text strong { color: var(--side-strong); }
.sidebar-user .user-text span { color: var(--side-accent); }
.menu-button { display: none; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--text-soft); padding: 4px 6px; border-radius: 8px; }
.menu-button:hover { background: var(--bg); }
.content { padding: 24px 26px 48px; display: flex; flex-direction: column; gap: 18px; max-width: 1480px; width: 100%; margin: 0 auto; }

.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 26px; font-size: 13px; }
.banner a { font-weight: 700; }
.banner-info { background: var(--blue-50); color: var(--info-ink); border-bottom: 1px solid var(--info-line); }
.banner-warning { background: var(--warning-bg); color: var(--warning); border-bottom: 1px solid var(--warn-line); }
.banner-success { background: var(--success-bg); color: var(--success); margin: 12px 26px 0; border-radius: 10px; padding: 10px 14px; }

/* ---------- Page pieces ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-eyebrow { font-size: 12px; font-weight: 600; color: var(--blue-600); text-transform: capitalize; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.4px; margin-top: 2px; }
.page-subtitle { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: var(--card-shadow);
    min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; font-weight: 700; min-width: 0; }
.card-head a { font-size: 13px; font-weight: 600; }
.card-head span { font-size: 12.5px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    box-shadow: var(--card-shadow);
}
.stat-grid > .stat-card:not(.stat-highlight):nth-child(4n+1) { background: linear-gradient(160deg, var(--acc-blue), var(--surface) 72%); border-color: var(--acc-blue-line); }
.stat-grid > .stat-card:not(.stat-highlight):nth-child(4n+2) { background: linear-gradient(160deg, var(--acc-green), var(--surface) 72%); border-color: var(--acc-green-line); }
.stat-grid > .stat-card:not(.stat-highlight):nth-child(4n+3) { background: linear-gradient(160deg, var(--acc-amber), var(--surface) 72%); border-color: var(--acc-amber-line); }
.stat-grid > .stat-card:not(.stat-highlight):nth-child(4n+4) { background: linear-gradient(160deg, var(--acc-violet), var(--surface) 72%); border-color: var(--acc-violet-line); }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; color: var(--text); }
.stat-foot { font-size: 11.5px; color: var(--muted); }
.stat-highlight { background: linear-gradient(145deg, var(--navy-900), var(--navy-700)); border-color: transparent; color: #e2e8f0; }
.stat-highlight .stat-value, .stat-highlight .stat-label, .stat-highlight .stat-foot { color: #fff; }
.stat-highlight .stat-label, .stat-highlight .stat-foot { opacity: .75; }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.split-wide { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.empty-state { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 13.5px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--tint); }
.loading-line { color: var(--muted); padding: 16px 0; }

/* ---------- Início (igual ao programa) ---------- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.dash-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--blue-600); }
.dash-title { font-size: 30px; font-weight: 800; letter-spacing: -.6px; margin-top: 6px; }
.dash-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.dash-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-tools .input-sm { width: auto; }
.date-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
    font-size: 12px; color: var(--text-soft); white-space: nowrap;
}
.date-chip .ic { width: 15px; height: 15px; color: var(--blue-600); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card {
    display: flex; flex-direction: column; gap: 4px; min-width: 0;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 16px; padding: 16px 18px; box-shadow: var(--card-shadow);
}
.kpi-card:nth-child(2) { background: linear-gradient(165deg, var(--acc-blue), var(--surface) 78%); border-color: var(--acc-blue-line); }
.kpi-card:nth-child(3) { background: linear-gradient(165deg, var(--acc-amber), var(--surface) 78%); border-color: var(--acc-amber-line); }
.kpi-card:nth-child(4) { background: linear-gradient(165deg, var(--acc-violet), var(--surface) 78%); border-color: var(--acc-violet-line); }
.kpi-card.kpi-primary { background: linear-gradient(165deg, var(--acc-green), var(--surface) 78%); border-color: var(--acc-green-line); }
.kpi-head { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.kpi-icon {
    display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none;
    border-radius: 9px; background: var(--surface); border: 1px solid var(--border); color: var(--blue-600);
}
.kpi-icon .ic { width: 15px; height: 15px; }
.kpi-value { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.6px; margin-top: 6px; word-break: break-word; }
.kpi-note { color: var(--muted); font-size: 11.5px; }
.kpi-foot {
    display: flex; justify-content: space-between; gap: 14px;
    border-top: 1px solid var(--line); margin-top: auto; padding-top: 10px;
}
.kpi-card .kpi-head + .kpi-value { margin-top: 8px; }
.kpi-foot div { display: flex; flex-direction: column; min-width: 0; }
.kpi-foot span { font-size: 11px; color: var(--muted); }
.kpi-foot strong { font-size: 14px; font-weight: 700; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attention { display: flex; flex-wrap: wrap; gap: 10px; }
.attention-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 13px; border-radius: 999px;
    border: 1px solid var(--warn-line); background: var(--warning-bg); color: var(--warning);
    font-size: 12.5px; text-decoration: none !important;
}
.attention-chip .ic { width: 15px; height: 15px; }
.attention-chip:hover { border-color: var(--warning); }
.head-icon { display: flex; align-items: center; gap: 8px; }
.head-icon .ic { width: 16px; height: 16px; color: var(--blue-600); }
.quick-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.quick-item {
    display: flex; align-items: center; gap: 9px; min-width: 0;
    padding: 11px 12px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none !important;
    transition: border-color .15s ease, background .15s ease;
}
.quick-item .ic { width: 17px; height: 17px; color: var(--blue-600); flex: none; }
.quick-item:hover { border-color: var(--blue-500); background: var(--blue-50); }
.quick-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.charts-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.chart-card { border-radius: 16px; padding: 16px 18px; }
.chart-card h3 { font-size: 13.5px; font-weight: 700; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chart-head span { font-size: 12px; }
.more-card { padding: 0; }
.more-card > summary {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px; cursor: pointer; list-style: none;
    font-size: 15px; font-weight: 700; color: var(--text);
}
.more-card > summary::-webkit-details-marker { display: none; }
.more-card > summary::after { content: "▾"; color: var(--muted); font-size: 13px; transition: transform .15s ease; }
.more-card[open] > summary::after { transform: rotate(180deg); }
.more-hint { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.more-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 2px 20px 20px; }
.more-body .chart-card { background: var(--surface-2); border: 1px solid var(--border); padding: 14px 16px; }
.hbar-list { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 84px 40px; align-items: center; gap: 10px; font-size: 12px; }
.hbar-label { color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue-500), var(--blue-700)); }
.hbar-track .hbar-green { background: linear-gradient(90deg, #34d399, #0e9f6e); }
.hbar strong { text-align: right; color: var(--text); font-weight: 700; }
.donut-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut {
    width: 150px; height: 150px; border-radius: 50%; flex: none;
    display: grid; place-items: center; position: relative;
}
.donut::after { content: ""; position: absolute; inset: 26px; border-radius: 50%; background: var(--surface); }
.donut-hole { position: relative; z-index: 1; font-size: 22px; font-weight: 800; color: var(--text); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 150px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-soft); }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend span { flex: 1; min-width: 0; }
.legend strong { color: var(--text); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    font-weight: 600;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}
.data-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--hover); }
.data-table a { font-weight: 600; }
.data-table .right, .data-table th.right { text-align: right; }
.row-actions summary { list-style: none; cursor: pointer; display: inline-flex; }
.row-actions summary::-webkit-details-marker { display: none; }
.row-actions-panel { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; min-width: 280px; }
.delete-tenant { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.delete-tenant small { line-height: 1.45; }
.delete-tenant code { white-space: nowrap; }
.delete-tenant .code-input { flex: 1; min-width: 190px; text-transform: uppercase; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .input { max-width: 420px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 140px; }
.filters .field-grow { flex: 1; min-width: 220px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-neutral { background: var(--chip); color: var(--chip-ink); }
.badge-primary { background: var(--blue-100); color: var(--blue-700); }
.badge-info { background: var(--chip-info); color: var(--chip-info-ink); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Charts & lists ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding-top: 22px; }
.bar-chart-compact { height: 150px; gap: 6px; }
.bar-column { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; min-width: 0; position: relative; }
.bar { width: 100%; max-width: 46px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--blue-500), var(--blue-700)); min-height: 4px; }
.bar-soft { background: linear-gradient(180deg, var(--bar-soft-a), var(--bar-soft-b)); }
.bar-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar-value { font-size: 9.5px; color: var(--muted); opacity: 0; transition: opacity .15s; position: absolute; top: 0; }
.bar-column:hover .bar-value { opacity: 1; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rank-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rank-list li:last-child { border-bottom: 0; }
.rank-list strong { color: var(--blue-700); }
.request-list { list-style: none; padding: 0; margin: 0; }
.request-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.request-list li:last-child { border-bottom: 0; }
.request-list div { display: flex; flex-direction: column; }

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(8, 20, 38, .55);
    backdrop-filter: blur(2px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 42px 16px;
    overflow-y: auto;
}
.modal {
    width: min(880px, 100%);
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(2, 8, 23, .35);
    padding: 22px 24px;
    animation: modal-in .16s ease-out;
}
.modal-sm { width: min(520px, 100%); }
.modal-lg { width: min(1080px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.modal-head h2 { font-size: 19px; }
.modal-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.modal-close { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); color: var(--text); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Escolha de item do estoque ---------- */
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-card {
    display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
    padding: 16px; border: 1px solid var(--border-strong); border-radius: 12px;
    background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.choice-card strong { font-size: 15px; }
.choice-card span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.choice-card:hover, .choice-card:focus-visible {
    border-color: var(--blue-600); box-shadow: 0 10px 24px rgba(2, 8, 23, .14); transform: translateY(-1px);
}
@media (max-width: 640px) {
    .choice-grid { grid-template-columns: 1fr; }
}

/* ---------- Toast ---------- */
.toast {
    position: fixed; right: 22px; bottom: 22px; z-index: 120;
    display: flex; align-items: center; gap: 14px;
    background: var(--navy-900); color: #fff;
    padding: 12px 16px; border-radius: 11px;
    box-shadow: 0 16px 40px rgba(2, 8, 23, .35);
    font-size: 13.5px; max-width: min(440px, calc(100vw - 32px));
    animation: toast-in .18s ease-out;
}
.toast-success { border-left: 4px solid #4ade80; }
.toast-error { border-left: 4px solid #f87171; }
.toast-close { border: 0; background: transparent; color: #cbd5e1; font-size: 18px; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Gate ---------- */
.gate-screen {
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 12px; padding: 32px;
    background: radial-gradient(80% 80% at 50% 0%, var(--gate-tint) 0%, var(--bg) 65%);
}
.gate-screen h1 { font-size: 24px; }
.gate-screen p { color: var(--muted); max-width: 520px; }
.gate-logo { width: 74px; height: 74px; object-fit: contain; margin-bottom: 6px; }
.gate-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.gate-blocked { background: radial-gradient(80% 80% at 50% 0%, var(--warning-bg) 0%, var(--bg) 65%); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--blue-100); border-top-color: var(--blue-600); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Public ---------- */
.public-body { background: var(--surface); }
.public-header {
    position: sticky; top: 0; z-index: 60;
    background: color-mix(in srgb, var(--brand-3) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.public-header-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 22px; padding: 13px 24px; }
.public-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; text-decoration: none !important; }
.public-brand img { width: 34px; height: 34px; object-fit: contain; background: rgba(255, 255, 255, .1); border-radius: 9px; padding: 3px; }
.public-brand-full img { width: 54px; height: 54px; background: none; border-radius: 0; padding: 0; }
.public-nav { display: flex; gap: 20px; margin-left: 12px; flex: 1; }
.public-nav a { color: var(--brand-mute); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.public-nav a:hover { color: #fff; }
.public-actions { display: flex; gap: 8px; align-items: center; }
.public-actions .btn-ghost { color: #cbd5e1; }
.public-actions .btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.hero { background: radial-gradient(110% 120% at 80% -10%, var(--brand-1) 0%, var(--brand-2) 45%, var(--brand-3) 100%); color: #e2e8f0; overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 26px 26px; opacity: .35; pointer-events: none; }
.hero-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 74px 24px 86px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 60px; align-items: center; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 12px; }
.hero h1 { color: #fff; font-size: clamp(36px, 4.6vw, 58px); line-height: 1.06; letter-spacing: -1.4px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--brand-ink); }
.hero-lead { color: #b9c8e2; font-size: 17px; line-height: 1.6; margin-top: 20px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-checks { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 16px; color: #9fb3d4; font-size: 12.5px; }
.hero-checks li::before { content: "✓"; color: #4ade80; font-weight: 700; margin-right: 6px; }
.hero-shot { margin: 0; background: var(--brand-2); border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; overflow: hidden; box-shadow: 0 40px 90px rgba(0, 0, 0, .42); transform: rotate(.5deg); }
.hero-shot img { display: block; width: 100%; height: auto; }
.hero-shot figcaption { padding: 9px 14px; color: #93a5c4; font-size: 11px; border-top: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .04); }

.section { padding: 74px 24px; }
.section-soft { background: var(--soft); border-top: 1px solid var(--soft-line); border-bottom: 1px solid var(--soft-line); }
.section-inner { max-width: 1180px; margin: 0 auto; }
.section-narrow { max-width: 820px; }
.section h2 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.8px; margin-top: 4px; }
.section-lead { color: var(--muted); font-size: 15.5px; max-width: 720px; margin-top: 12px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 34px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; transition: transform .15s ease, box-shadow .15s ease; }
.feature-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--blue-50); color: var(--blue-700); font-weight: 800; font-size: 12px; letter-spacing: .5px; margin-bottom: 14px; }
.feature-card h3 { font-size: 16px; margin-bottom: 6px; }
.feature-card p { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 34px; align-items: stretch; }
.plan-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 26px 24px; display: flex; flex-direction: column; gap: 6px; }
.plan-card h3 { font-size: 18px; }
.plan-desc { color: var(--muted); font-size: 13px; }
.plan-price { display: flex; align-items: baseline; gap: 5px; margin-top: 14px; }
.plan-currency { color: var(--muted); font-size: 13px; }
.plan-price strong { font-size: 38px; letter-spacing: -1.5px; }
.plan-period { color: var(--muted); font-size: 13px; }
.plan-monthly { color: var(--muted); font-size: 12.5px; }
.plan-save { align-self: flex-start; background: var(--success-bg); color: var(--success); font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 9px; margin-top: 4px; }
.plan-list { list-style: none; padding: 0; margin: 16px 0 20px; display: flex; flex-direction: column; gap: 9px; color: var(--text-soft); font-size: 13px; flex: 1; }
.plan-list li::before { content: "✓"; color: var(--success); font-weight: 700; margin-right: 8px; }
.plan-featured { border: 2px solid var(--blue-600); box-shadow: 0 24px 60px color-mix(in srgb, var(--blue-600) 16%, transparent); background: linear-gradient(180deg, var(--surface-2), var(--surface) 40%); }
.plan-flag { position: absolute; top: -12px; left: 24px; background: var(--blue-600); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.plans-note { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 22px; }
.faq { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.faq details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 16px 18px; }
.faq details[open] { border-color: var(--info-line); box-shadow: 0 4px 14px rgba(37, 99, 235, .06); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--blue-600); font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq p { color: var(--muted); font-size: 13.5px; margin-top: 10px; max-width: 700px; }
.cta-band { background: radial-gradient(100% 150% at 20% 0%, var(--brand-1) 0%, var(--brand-2) 60%, var(--brand-3) 100%); color: #fff; padding: 56px 24px; }
.cta-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.cta-inner h2 { color: #fff; font-size: 30px; letter-spacing: -.7px; }
.cta-inner p { color: #b9c8e2; margin-top: 6px; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.public-footer { background: var(--brand-3); color: var(--brand-mute); padding: 40px 24px; }
.public-footer-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.public-footer p { font-size: 13px; max-width: 520px; }
.public-copy { font-size: 11.5px; color: #64748b; }
.public-footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; }
.public-footer-links a { color: var(--brand-mute); text-decoration: none; }
.public-footer-links a:hover { color: #fff; text-decoration: underline; }

/* ---------- Páginas legais ---------- */
.legal-page { padding: 64px 24px 84px; background: var(--bg); }
.legal-inner { max-width: 820px; margin: 0 auto; }
.legal-inner h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -1px; margin-top: 6px; }
.legal-inner h2 { font-size: 19px; margin: 32px 0 0; letter-spacing: -.3px; }
.legal-inner p, .legal-inner li { color: var(--muted); font-size: 15px; line-height: 1.72; }
.legal-inner p { margin-top: 12px; }
.legal-inner ul { display: grid; gap: 8px; margin-top: 12px; padding-left: 22px; }
.legal-inner a { color: var(--blue-600); font-weight: 600; }
.legal-updated { font-size: 12.5px !important; }
.legal-contact { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13.5px !important; }

/* ---------- Recuperar senha ---------- */
.recovery-card .btn-block { margin-top: 10px; }
.recovery-steps { display: grid; gap: 10px; margin: 0 0 14px; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.recovery-contact { margin-top: 14px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ---------- Auth ---------- */
/* Acesso (login/cadastro) em tela cheia: o cartão ocupa a janela e a página rola quando o formulário passa da altura da tela. */
.auth-section { min-height: calc(100vh - 82px); display: flex; padding: 34px 20px 46px; background: radial-gradient(70% 70% at 50% 0%, var(--gate-tint) 0%, var(--bg) 70%); }
.auth-card { margin: auto; width: min(600px, 100%); max-width: 100%; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 34px 38px; box-shadow: var(--shadow); }
/* Divisão em tela cheia: faixa azul enxuta de um lado, formulário do outro. */
.auth-split-section { padding: 0; background: var(--bg); }
.auth-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); width: 100%; }
.auth-aside { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 64px 8%; color: var(--brand-mute); background: radial-gradient(120% 130% at 18% 0%, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-3) 100%); }
.auth-aside-head { display: flex; flex-direction: column; gap: 26px; margin-bottom: 10px; }
.auth-aside-logo { width: 74px; height: 74px; }
.auth-aside h2 { color: #fff; font-size: clamp(24px, 2.3vw, 34px); line-height: 1.16; letter-spacing: -.7px; max-width: 480px; }
.auth-aside p { color: var(--brand-mute); font-size: 14.5px; line-height: 1.6; max-width: 430px; }
.auth-main { display: flex; padding: 40px 24px 48px; background: radial-gradient(70% 70% at 50% 0%, var(--gate-tint) 0%, var(--bg) 70%); }
.auth-main .auth-card { width: min(480px, 100%); padding: 32px 34px; }
.auth-split .auth-logo { display: none; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head h1 { font-size: 25px; letter-spacing: -.5px; }
.auth-head p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.auth-alt { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.auth-blocked-actions { display: grid; gap: 10px; margin-top: 16px; }
.auth-small { font-size: 12px; }
.auth-remember { display: flex; flex-direction: column; gap: 9px; margin: 2px 0 16px; }
.input.code-masked { font-family: "Cascadia Code", Consolas, monospace; letter-spacing: .12em; background: var(--blue-50); }
.link-inline { padding: 0; border: 0; background: none; color: var(--blue-600); font: inherit; text-decoration: underline; cursor: pointer; }
.link-inline:hover { color: var(--blue-700); }
.auth-center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.auth-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.auth-center .feature-icon { background: var(--danger-bg); color: var(--danger); font-size: 18px; }

/* Auth: card central único */
.auth-logo { display: block; width: 68px; height: 68px; border-radius: 16px; margin: 0 auto 12px; box-shadow: 0 14px 30px rgba(2, 8, 23, .22); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .stat-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .split-wide { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .charts-grid { grid-template-columns: 1fr; }
    .quick-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .more-body { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; width: 262px;
        transform: translateX(-102%); transition: transform .2s ease;
        box-shadow: 30px 0 60px rgba(2, 8, 23, .3);
    }
    .sidebar-open { transform: translateX(0); }
    .menu-button { display: inline-flex; }
    .topbar { padding: 11px 16px; }
    .content { padding: 18px 16px 40px; }
    .stat-grid, .stat-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split-grid { grid-template-columns: 1fr; }
    .crumb-root, .crumb-sep { display: none; }
    .hero-inner { grid-template-columns: 1fr; padding: 56px 20px 64px; gap: 40px; }
    .hero-shot { max-width: 620px; }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .plan-grid { grid-template-columns: 1fr; max-width: 520px; }
    .public-nav { display: none; }
    .auth-split { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-split .auth-logo { display: block; }
    .auth-main { padding: 34px 20px 42px; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    /* Campos que ocupavam 2 colunas não podem criar coluna fantasma no empilhado. */
    .form-grid > *, .form-grid-3 > * { grid-column: auto !important; }
}
@media (max-width: 640px) {
    .page-title { font-size: 22px; }
    .dash-title { font-size: 24px; }
    .dash-tools { width: 100%; }
    .dash-tools .date-chip { flex: 1 1 100%; justify-content: center; }
    .dash-tools .input-sm { flex: 1; min-width: 0; }
    .kpi-grid { gap: 10px; }
    .kpi-card { padding: 13px 14px; }
    .kpi-head { font-size: 12px; }
    .kpi-value { font-size: 21px; }
    .kpi-foot { gap: 10px; }
    .kpi-foot strong { font-size: 13px; }
    .quick-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .more-hint { display: none; }
    .more-card > summary { padding: 14px 16px; }
    .more-body { padding: 2px 16px 16px; }
    .stat-grid, .stat-grid-5 { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-value { font-size: 22px; }
    .feature-grid { grid-template-columns: 1fr; }
    .public-header-inner { flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px; }
    .public-brand-full img { width: 42px; height: 42px; }
    .public-actions { margin-left: auto; }
    .public-actions .btn-ghost:not(.theme-toggle) { display: none; }
    .section { padding: 52px 18px; }
    .banner { padding: 10px 16px; }
    .modal { padding: 18px; }
    .card { padding: 15px; }
    .auth-section { padding: 16px 12px 28px; }
    .auth-card { padding: 24px 6px; border: none; border-radius: 0; box-shadow: none; background: transparent; }
    .legal-page { padding: 40px 18px 56px; }
    .bar-chart { gap: 6px; }
}

/* ---------- seletores (cliente/produto) ---------- */
.picker { display: flex; flex-direction: column; gap: 8px; }
.picker-search { display: flex; gap: 8px; align-items: center; }
.picker-search .input { flex: 1; }
.picker-selected {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--tint);
}
.picker-selected div { display: flex; flex-direction: column; min-width: 0; }
.picker-selected strong { font-size: 14px; }
.picker-selected span { font-size: 12.5px; color: var(--muted); }
.picker-results {
    display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); max-height: 280px; overflow-y: auto; box-shadow: var(--shadow-sm);
}
.picker-result {
    display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px;
    border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer;
}
.picker-result:last-child { border-bottom: 0; }
.picker-result:hover { background: var(--blue-50); }
.picker-result strong { font-size: 13.5px; color: var(--text); }
.picker-result span { font-size: 12px; color: var(--muted); }
.picker-empty { font-size: 13px; color: var(--muted); padding: 10px 2px; }

/* ---------- paginação ---------- */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.pager span { font-size: 12.5px; color: var(--muted); }

/* ---------- itens de OS/orçamento ---------- */
.items-editor { display: flex; flex-direction: column; gap: 10px; }
.item-row {
    display: grid; grid-template-columns: 110px minmax(0, 1fr) 80px 110px 110px 36px;
    gap: 8px; align-items: center;
}
.item-row .input { width: 100%; }
.item-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.item-label { display: none; font-size: 10.5px; line-height: 1.35; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.item-field-total { align-items: flex-end; justify-content: center; }
.item-total { text-align: right; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.item-head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.items-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.totals-box { display: flex; flex-direction: column; gap: 6px; min-width: 240px; margin-left: auto; }
.totals-box div { display: flex; justify-content: space-between; gap: 24px; font-size: 13.5px; }
.totals-box .total { font-size: 16px; font-weight: 700; border-top: 1px solid var(--border); padding-top: 8px; }
.total-value {
    display: flex; align-items: center; min-height: 42px; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
    font-size: 18px; font-weight: 700; color: var(--text);
}

/* ---------- abas (segmented control) ---------- */
.tabs {
    display: flex; flex-wrap: wrap; gap: 3px; width: fit-content; max-width: 100%;
    padding: 4px; margin-bottom: 4px;
    border: 1px solid var(--ios-seg-line); border-radius: 999px;
    background: var(--ios-seg-bg); box-shadow: var(--ios-seg-shadow);
}
.tab {
    border: 0; background: transparent; padding: 8px 16px; font-size: 13.5px; font-weight: 600;
    color: var(--muted); cursor: pointer; border-radius: 999px;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.tab:hover { color: var(--text); }
.tab.active {
    color: var(--blue-700);
    background: var(--surface);
    box-shadow: inset 0 1px 0 #ffffff, 0 1px 2px rgba(13, 46, 92, .14), 0 4px 10px -4px rgba(13, 46, 92, .35);
}

/* ---------- detalhes ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 26px; }
.detail-grid .full { grid-column: 1 / -1; }
.detail-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.detail-item span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; }
.detail-item strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.money-list { display: flex; flex-direction: column; gap: 8px; }
.money-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid var(--line); list-style: none; }
.money-list li > * { min-width: 0; }
.money-list li:last-child { border-bottom: 0; }
.guarantee-number { overflow-wrap: anywhere; }
.photo-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); background: var(--surface-3); }
.photo-preview { width: 150px; height: 150px; border-radius: 14px; object-fit: cover; border: 1px solid var(--border); background: var(--surface-3); }
.logo-preview { display: flex; align-items: center; justify-content: center; max-width: 220px; min-height: 64px; border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: var(--surface); }
.logo-preview img { max-width: 100%; max-height: 72px; object-fit: contain; display: block; }
.plan-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.plan-summary.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.plan-card.featured { border-color: var(--blue-500); box-shadow: 0 12px 36px color-mix(in srgb, var(--blue-600) 12%, transparent); }
.plan-price { font-size: 30px; font-weight: 800; letter-spacing: -.8px; }
.plan-price small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-soft); }
.plan-features li::before { content: "✓"; color: var(--success); font-weight: 700; margin-right: 7px; }
.plan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
@media (max-width: 420px) {
    .plan-actions { grid-template-columns: 1fr; }
}
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.section-title h2 { font-size: 17px; margin: 0 0 4px; }
.section-title p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 400; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
/* Nova venda: pagamento à esquerda, itens à direita */
.sale-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 16px; align-items: start; }
.sale-grid > .sale-payment { order: 1; }
.sale-grid > .sale-items { order: 2; }
.small-table { font-size: 12.5px; }

@media (max-width: 1080px) {
    .plan-grid { grid-template-columns: 1fr; }
    .plan-summary { grid-template-columns: 1fr 1fr; }
    .two-col, .sale-grid { grid-template-columns: 1fr; }
    .sale-grid > .sale-payment, .sale-grid > .sale-items { order: initial; }
    .item-row { grid-template-columns: 90px minmax(0, 1fr) 70px 100px 90px 34px; }
}
@media (max-width: 720px) {
    .item-row {
        grid-template-columns: 1fr 1fr; gap: 10px 12px;
        padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--tint);
    }
    .item-head { display: none; }
    .item-field-desc { grid-column: 1 / -1; }
    .item-label { display: block; }
    .item-total { text-align: left; }
    .item-field-total { align-items: flex-start; }
    .item-remove { grid-column: 1 / -1; justify-self: end; }
    .detail-grid { grid-template-columns: 1fr; }
    .plan-summary { grid-template-columns: 1fr; }
}

/* ---------- Tema escuro ---------- */
[data-theme="escuro"] {
    --bg: #08142b;
    --surface: #0f2145;
    --surface-2: #152a54;
    --surface-3: #1d3565;
    --tint: #11254d;
    --line: #213c73;
    --hover: #172e5c;
    --field: #0b1a37;
    --topbar-bg: rgba(15, 33, 69, .92);
    --soft: #0b1a38;
    --soft-line: #24417a;
    --gate-tint: #183060;
    --border: #2a467f;
    --border-strong: #4064ab;
    --text: #f8f8f9;
    --text-soft: #e9ebef;
    --muted: #a0adc7;
    --blue-700: #5088f6;
    --blue-100: #223e77;
    --blue-50: #152951;
    --info-ink: #cbd6eb;
    --info-line: #244d9e;
    --warn-line: #4a3308;
    --chip: #162b55;
    --chip-ink: #dadee7;
    --chip-info: #122f68;
    --chip-info-ink: #c8d3ea;
    --success: #4ade80;
    --success-bg: #06341f;
    --warning: #fbbf24;
    --warning-bg: #3a2a06;
    --danger: #f87171;
    --danger-bg: #3f1414;
    --danger-hover: #7f1d1d;
    --acc-blue: #0d2554;
    --acc-blue-line: #224996;
    --acc-green: #0b3324;
    --acc-green-line: #1b5c40;
    --acc-amber: #3a2a06;
    --acc-amber-line: #5a4410;
    --acc-violet: #241a4a;
    --acc-violet-line: #3b2a6b;
    --card-bg: var(--surface);
    --card-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
    --shadow: 0 12px 30px rgba(0, 0, 0, .55);
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, .5);
    --ios-field-bg: linear-gradient(180deg, #122751 0%, #0c1b39 100%);
    --ios-field-line: #2b56ab;
    --ios-field-shadow: inset 0 1px 2px rgba(0, 0, 0, .45);
    --ios-field-focus: 0 0 0 4px rgba(80, 136, 246, .26), inset 0 1px 2px rgba(0, 0, 0, .35);
    --ios-btn-bg: linear-gradient(180deg, #1d3565 0%, #152a54 100%);
    --ios-btn-line: #315baf;
    --ios-btn-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 6px 14px -6px rgba(0, 0, 0, .65);
    --ios-btn-press: inset 0 2px 6px rgba(0, 0, 0, .5);
    --ios-primary-bg: linear-gradient(180deg, #578cf4 0%, #1660f3 55%, #0e51d7 100%);
    --ios-primary-shadow: inset 0 1px 0 rgba(255, 255, 255, .26), 0 8px 18px -8px rgba(22, 96, 243, .60);
    --ios-seg-bg: #0b1a38;
    --ios-seg-line: #284b8f;
    --ios-seg-shadow: inset 0 1px 2px rgba(0, 0, 0, .45);
    --side-bg: #091c41;
    --side-line: #1f3a6f;
    --side-text: #eeeff2;
    --side-strong: #ffffff;
    --side-muted: #b9c2d5;
    --side-hover: #132955;
    --side-active: #183d86;
    --side-accent: #84a6eb;
    color-scheme: dark;
}
[data-theme="escuro"] .faq summary::after,
[data-theme="escuro"] .faq details[open] summary::after { color: var(--blue-500); }
[data-theme="escuro"] .tab.active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 4px 10px -4px rgba(0, 0, 0, .7); }
[data-theme="escuro"] .modal { box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
[data-theme="escuro"] .plan-featured { box-shadow: 0 24px 60px color-mix(in srgb, var(--blue-600) 30%, transparent); }
[data-theme="escuro"] ::selection { background: rgba(80, 136, 246, .45); }
/* Lista nativa dos selects no tema escuro: fundo escuro e texto claro */
[data-theme="escuro"] select { color-scheme: dark; }
[data-theme="escuro"] select option,
[data-theme="escuro"] select optgroup {
    background-color: #0b1a37;
    color: #f8f8f9;
}
[data-theme="escuro"] select option:checked,
[data-theme="escuro"] select option:hover {
    background-color: #1660f3;
    color: #ffffff;
}

/* ---------- Botão de tema ---------- */
.theme-toggle span { display: none; }
[data-theme-pref="auto"] .theme-toggle .t-auto,
[data-theme-pref="claro"] .theme-toggle .t-claro,
[data-theme-pref="escuro"] .theme-toggle .t-escuro { display: inline; }

/* ---------- Padrão de desbloqueio e checklist da OS ---------- */
.device-types { display: flex; flex-wrap: wrap; gap: 8px; }
.device-type {
    border: 1px solid var(--border);
    background: var(--field);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.device-type:hover { background: var(--hover); }
.device-type.is-selected { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

.pattern-field { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.pattern-field > div:first-child { flex: 0 1 auto; min-width: 0; max-width: 560px; }
.pattern-picker { flex: 0 0 auto; }
.pattern-field .chip { display: inline-flex; margin-top: 8px; padding: 4px 10px; border-radius: 999px; background: var(--chip-info); color: var(--chip-info-ink); font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.pattern-lock { touch-action: manipulation; flex: 0 0 auto; }
.pattern-canvas { display: block; width: 100%; height: auto; }
.pattern-bg { fill: var(--surface-2); stroke: var(--border); stroke-width: 2; }
.pattern-line { stroke: var(--blue-600); stroke-width: 10; stroke-linecap: round; }
.pattern-hit { fill: transparent; cursor: pointer; }
.pattern-dot { fill: var(--border-strong); transition: fill .12s ease, r .12s ease; }
.pattern-node:hover .pattern-dot { fill: var(--blue-500); }
.pattern-node.is-active .pattern-dot { fill: var(--blue-600); }
.pattern-lock.is-readonly .pattern-hit { cursor: default; }
.pattern-lock.is-readonly .pattern-node:hover .pattern-dot { fill: var(--border-strong); }
.pattern-lock.is-readonly .pattern-node.is-active .pattern-dot,
.pattern-lock.is-readonly .pattern-node.is-active:hover .pattern-dot { fill: var(--blue-600); }
.pattern-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pattern-preview { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.checklist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; }
.checklist-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--tint); flex-wrap: wrap; }
.checklist-label { font-size: 13.5px; font-weight: 600; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--field); }
.seg { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 600; padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.seg + .seg { border-left: 1px solid var(--border); }
.seg:hover { background: var(--hover); }
.seg.active { background: var(--surface-3); color: var(--text); }
.seg-ok.active { background: var(--success-bg); color: var(--success); }
.seg-defect.active { background: var(--danger-bg); color: var(--danger); }
.checklist-view { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 20px; }
.checklist-view-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
@media (max-width: 720px) {
    .checklist-grid, .checklist-view { grid-template-columns: 1fr; }
    .pattern-field { flex-direction: column; }
}

/* ---------- Celular: menu, tabelas em cartões e toque ---------- */
.two-col > *, .sale-grid > * { min-width: 0; }
details:not([open]) > .row-actions-panel { display: none; }
.page-actions .row-actions { position: relative; }
.page-actions .row-actions-panel {
    position: absolute; right: 0; top: calc(100% + 6px);
    width: 280px; min-width: 0; z-index: 70;
    box-shadow: var(--shadow-sm);
}
.sidebar-backdrop { display: none; }

@media (max-width: 980px) {
    .sidebar { overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .sidebar-backdrop.is-open {
        display: block; position: fixed; inset: 0; z-index: 38;
        background: rgba(2, 8, 23, .52);
        -webkit-tap-highlight-color: transparent;
    }
    body.menu-open { overflow: hidden; }
}

@media (max-width: 980px) {
    /* Tabelas viram cartões: sem colunas apertadas nem textos sobrepostos. */
    .table-wrap { overflow: visible; margin: 0; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table { border-collapse: separate; font-size: 13.5px; }
    .data-table thead { display: none; }
    .data-table tbody { display: flex; flex-direction: column; gap: 8px; }
    .data-table tbody tr {
        border: 1px solid var(--border); border-radius: 12px;
        padding: 10px 14px; background: var(--tint);
    }
    .data-table tbody tr:hover { background: var(--tint); }
    .data-table td {
        position: relative; min-height: 26px;
        padding: 6px 0 6px 32%;
        border: 0; text-align: left !important; vertical-align: top;
        overflow-wrap: anywhere;
    }
    .data-table td::before {
        content: attr(data-label); position: absolute; left: 0; top: 8px;
        width: 28%; font-size: 10.5px; line-height: 1.35; font-weight: 700;
        letter-spacing: .4px; text-transform: uppercase; color: var(--muted);
    }
    .data-table td[data-label=""] { padding-left: 0; }
    .data-table td[data-label=""]::before { display: none; }
    .data-table td .action-row { justify-content: flex-end; flex-wrap: wrap; }
    .data-table td .hint, .data-table td .muted { display: block; }
    .data-table td .hint { margin-top: 2px; }
    .row-actions-panel { min-width: 0; width: 100%; }
    .page-actions { position: relative; }
    .page-actions .row-actions { position: static; }
    .page-actions .row-actions-panel { left: 0; right: 0; width: auto; }
}

@media (max-width: 640px) {
    .card { padding: 14px; border-radius: 14px; }
    .page-header { align-items: flex-start; gap: 10px; }
    .page-title { font-size: 21px; overflow-wrap: anywhere; }
    .page-subtitle { font-size: 13px; }
    .page-actions { gap: 6px; }
    .btn { white-space: normal; }

    .topbar { padding: 9px 12px; gap: 8px; }
    .crumb { flex: 1 1 auto; gap: 6px; }
    .crumb-page { font-size: 13px; }
    .menu-button { padding: 2px 4px; font-size: 22px; }
    .topbar-actions { flex: none; }
    .theme-toggle { padding: 7px 9px; }
    .theme-toggle > .t-auto, .theme-toggle > .t-claro, .theme-toggle > .t-escuro { display: none !important; }
    .theme-toggle > .t-short { display: inline !important; font-size: 12.5px; line-height: 1; }
    .topbar-company { flex: 1 1 auto; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .topbar-user { flex: none; gap: 6px; }
    .topbar-user .badge { display: none; }

    .input, input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="date"], input[type="datetime-local"],
    input[type="search"], input[type="tel"], select, textarea { font-size: 16px; }
    .input.code-masked { letter-spacing: .02em; }
    .input-sm, input.input-sm, select.input-sm { font-size: 15px; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .btn { flex: 1 1 140px; }

    .tabs { width: fit-content; overflow: visible; border-radius: 16px; }
    .tab { padding: 9px 14px; }

    .toolbar > .input { flex: 1 1 100%; max-width: none !important; width: 100%; }
    .filters .field, .filters .field-grow { flex: 1 1 100%; min-width: 0; }
    .filters .field .input { width: 100%; }
    .filters .btn { flex: 0 0 auto; }
    .picker-search { flex-wrap: wrap; }
    .picker-search .input { flex: 1 1 190px; min-width: 0; }

    .modal-backdrop { padding: 12px 10px; }
    .modal, .modal-sm, .modal-lg {
        width: 100%; max-height: calc(100dvh - 24px);
        overflow-y: auto; padding: 18px 16px;
    }
    .modal-head h2 { font-size: 18px; }

    .stat-card { padding: 13px 12px; }
    .stat-value { font-size: 20px; }
    .stat-label { font-size: 12px; }
    .pattern-preview { flex-wrap: wrap; }

    .public-header-inner { padding: 9px 12px; gap: 8px; }
    .public-brand-full img { width: 40px; height: 40px; }
    .public-actions { gap: 6px; }
    .public-actions .btn { padding: 9px 12px; font-size: 13px; }
    .public-actions .theme-toggle { padding: 8px; }
    .public-actions .theme-toggle > .t-auto,
    .public-actions .theme-toggle > .t-claro,
    .public-actions .theme-toggle > .t-escuro { display: none !important; }
    .public-actions .theme-toggle > .t-short { display: inline !important; font-size: 12.5px; line-height: 1; }
    .public-actions .btn-ghost:not(.theme-toggle) { display: inline-flex; }
}

.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.nav-group-label { color: var(--side-muted); font-size: 9px; font-weight: 700; letter-spacing: 1.3px; padding: 7px 12px; text-transform: uppercase; }
.nav-group .nav-item { padding: 8px 12px; font-size: 12.5px; }
.nav-group .nav-item > span { white-space: normal; }
.insights-dashboard { --chart-primary: #347ff0; --chart-secondary: #9e7c46; display: flex; flex-direction: column; gap: 22px; }
[data-theme="escuro"] .insights-dashboard { --chart-primary: #60a5fa; --chart-secondary: #f0b861; }
.insights-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.insights-header h1 { font-size: clamp(26px, 3vw, 32px); letter-spacing: -.8px; font-weight: 700; margin: 0 0 5px; }
.insights-header p { font-size: 13px; color: var(--muted); }
.insights-header-actions { display: flex; gap: 10px; align-items: center; }
.insights-header-actions .btn { font-size: 12px; padding: 10px 14px; }
.insights-shortcuts { position: relative; }
.insights-shortcuts summary { cursor: pointer; list-style: none; }
.insights-shortcuts summary::-webkit-details-marker { display: none; }
.insights-shortcuts nav { position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; width: 225px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px #0003; }
.insights-shortcuts nav a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 7px; color: var(--text); font-size: 13px; text-decoration: none; }
.insights-shortcuts nav a:hover { background: var(--surface-2); }
.insights-shortcuts .ic { width: 17px; height: 17px; color: var(--chart-primary); }
.insights-filter { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 0 0 16px; border-bottom: 1px solid var(--border); }
.insights-period { display: flex; align-items: center; gap: 10px; }
.insights-period label { font-size: 12px; color: var(--muted); }
.insights-period select { min-width: 190px; padding: 8px 12px; font-size: 12px; box-shadow: none; }
.insights-filter .field { max-width: 170px; }
.insights-filter .field label { font-size: 11px; }
.insights-filter .field input { padding: 7px 10px; font-size: 12px; }
.insights-range { font-size: 12px; color: var(--muted); }
.insights-refresh { margin-left: auto; padding: 9px 12px; font-size: 12px; box-shadow: none; }
.insights-refresh .ic { width: 15px; height: 15px; }
.insights-summary { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.insights-summary > :only-child { grid-column: 1 / -1; }
.insights-summary:empty { display: none; }
.insights-summary > .card { min-width: 0; padding: 22px; }
.insight-money { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; padding: 19px 0; border-bottom: 1px solid var(--line); text-decoration: none !important; color: var(--text); }
.insight-money > span { display: flex; flex-direction: column; gap: 5px; }
.insight-label { font-size: 14px; font-weight: 600; }
.insight-money small { font-size: 12px; color: var(--muted); }
.insight-money > strong { font-size: clamp(22px, 2vw, 28px); letter-spacing: -.6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.insight-revenue { padding-top: 8px; }
.insight-revenue > strong { color: var(--chart-primary); }
.insight-money:hover .insight-label, .insight-open-orders:hover, .insights-order-status a:hover { color: var(--chart-primary); }
.insights-dashboard a:focus-visible, .insights-dashboard summary:focus-visible { outline: 2px solid var(--chart-primary); outline-offset: 4px; border-radius: 4px; }
.insights-financial-detail > summary { padding-top: 15px; color: var(--muted); cursor: pointer; font-size: 12px; }
.insights-financial-detail .insight-money > strong { font-size: 22px; }
.insights-financial-detail p { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 12px; }
.insights-order-scope { font-size: 12px; color: var(--muted); }
.insight-open-orders { display: flex; align-items: center; gap: 12px; color: var(--text); padding: 12px 0 14px; text-decoration: none !important; }
.insight-open-orders strong { font-size: 36px; line-height: 1.2; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.insight-open-orders > span { font-size: 14px; }
.insight-open-orders > span:last-child { margin-left: auto; color: var(--muted); }
.insights-order-subset { font-size: 11px; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); }
.insights-order-status a { display: flex; gap: 9px; align-items: center; color: var(--text-soft); padding-top: 12px; font-size: 13px; text-decoration: none; }
.insights-order-status strong { margin-left: auto; color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; }
.insight-status-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.insight-status-dot.is-waiting { background: var(--warning); }
.insight-status-dot.is-ready { background: var(--success); }
.insights-definition { font-size: 12px; color: var(--muted); }
.insights-definition summary { cursor: pointer; width: fit-content; }
.insights-definition p { margin-top: 8px; line-height: 1.7; max-width: 1040px; }
.insights-disclosure { display: flex; align-items: center; gap: 14px; cursor: pointer; list-style: none; }
.insights-disclosure::-webkit-details-marker { display: none; }
.insights-disclosure > span:first-child { flex: 1; }
.insights-disclosure strong { font-size: 14px; font-weight: 600; }
.insights-disclosure small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.insights-disclosure::after { content: "+"; font-size: 22px; color: var(--muted); }
details[open] > .insights-disclosure::after { content: "−"; }
.insights-alerts[open] > .insights-disclosure, .insights-analysis[open] > .insights-disclosure { margin-bottom: 22px; }
.insights-analysis { border-top: 1px solid var(--border); padding: 20px 0 0; }
.insights-analysis-content { display: flex; flex-direction: column; gap: 18px; }
.insights-dashboard .card { box-shadow: none; background: var(--surface); border-radius: 15px; }
.insights-section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.insights-section-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -.3px; }
.insights-section-head p { font-size: 11px; color: var(--muted); margin-top: 6px; }
.insights-section-head > a { font-size: 12px; }
.insight-alert-total { font-size: 11px; color: var(--muted); background: var(--surface-2); padding: 5px 9px; border-radius: 6px; }
.insight-alert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
.insight-alert { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.insight-alert summary { display: flex; gap: 9px; align-items: center; padding: 12px; cursor: pointer; list-style: none; }
.insight-alert summary::-webkit-details-marker { display: none; }
.insight-alert summary > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.insight-alert summary strong { color: var(--text-soft); font-size: 11px; font-weight: 600; }
.insight-alert summary small { font-size: 9px; color: var(--muted); }
.insight-alert summary b { font-size: 18px; font-variant-numeric: tabular-nums; }
.insight-alert summary::after { content: "⌄"; color: var(--muted); }
.insight-alert[open] summary::after { transform: rotate(180deg); }
.insight-alert-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--blue-50); color: var(--chart-primary); flex: none; }
.insight-alert-icon .ic { width: 15px; height: 15px; }
.insight-alert.urgente .insight-alert-icon { background: var(--danger-bg); color: var(--danger); }
.insight-alert.urgente summary b, .insight-alert.urgente summary small { color: var(--danger); }
.insight-alert.atencao .insight-alert-icon { background: var(--warning-bg); color: var(--warning); }
.insight-alert.atencao summary small { color: var(--warning); }
.insight-alert-records { border-top: 1px solid var(--border); padding: 0 12px; }
.insight-alert-records a { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.insight-alert-records a span { font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.insight-alert-records a:last-child { border-bottom: 0; }
.insights-all-clear { display: flex; align-items: center; gap: 13px; padding: 8px 0; }
.insights-all-clear .ic { color: var(--success); width: 26px; height: 26px; }
.insights-all-clear strong { font-size: 12px; }
.insights-all-clear p { color: var(--muted); font-size: 11px; margin-top: 4px; }
.insights-updated { font-size: 12px; color: var(--muted); }
.insights-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.insight-chart-card { display: flex; flex-direction: column; min-height: 305px; }
.insights-chart-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.insights-chart-heading h3 { font-size: 14px; font-weight: 600; letter-spacing: -.15px; }
.insights-chart-heading p { font-size: 10px; color: var(--muted); margin-top: 5px; }
.insights-chart-heading > strong { font-size: 17px; font-weight: 650; color: var(--text); white-space: nowrap; letter-spacing: -.5px; }
.insights-chart-heading > strong small { color: var(--muted); font-size: 11px; }
.insights-chart-heading > .ic { color: var(--muted); }
.insight-svg { width: 100%; height: auto; overflow: visible; flex: none; }
.insight-axis { font-family: inherit; font-size: 11px; fill: var(--muted); }
.insight-gridline { stroke: var(--border); stroke-width: .7; stroke-dasharray: 3 4; }
.series-primary { background: var(--chart-primary); fill: var(--chart-primary); }
.series-secondary { background: var(--chart-secondary); fill: var(--chart-secondary); }
.insight-line { stroke: var(--chart-primary); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.insight-dot { fill: var(--chart-primary); stroke: var(--surface); stroke-width: 1.5; }
.insight-svg g:focus { outline: none; }
.insight-svg g:focus rect, .insight-svg g:hover rect { opacity: .75; }
.insight-legend { display: flex; gap: 15px; font-size: 10px; color: var(--muted); margin-bottom: 6px; }
.insight-legend span { display: inline-flex; align-items: center; gap: 5px; }
.insight-legend i { width: 7px; height: 7px; border-radius: 2px; }
.insight-data { margin-top: auto; font-size: 10px; color: var(--muted); }
.insight-data summary { padding-top: 8px; border-top: 1px solid var(--line); cursor: pointer; }
.insight-data .table-wrap { max-height: 280px; overflow: auto; margin-top: 10px; }
.insight-data .data-table { font-size: 11px; }
.insight-empty { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px; flex: 1; min-height: 200px; color: var(--muted); padding: 20px; }
.insight-empty .ic { width: 28px; height: 28px; opacity: .5; }
.insight-empty p { font-size: 12px; }
.insight-empty small { font-size: 10px; max-width: 250px; }
.insight-comparison { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.insight-comparison-row > div:first-child { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: 10px; margin-bottom: 5px; }
.insight-comparison-row strong { font-weight: 500; color: var(--text-soft); }
.insight-comparison-row small { color: var(--muted); font-size: 9px; }
.insight-comparison-track { height: 3px; border-radius: 4px; background: var(--surface-2); margin-top: 3px; }
.insight-comparison-track i { display: block; height: 100%; border-radius: 4px; }
.insight-chart-note { color: var(--muted); font-size: 9px; margin-top: auto; }
.insights-recent .data-table th { background: transparent; }
.insights-rankings summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.insights-rankings summary span { color: var(--muted); font-size: 10px; font-weight: 400; margin-left: 8px; }
.insights-ranking-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 22px; }
.insights-ranking-grid h3 { font-size: 12px; margin-bottom: 10px; }
.insight-ranking { padding-left: 20px; color: var(--muted); font-size: 11px; }
.insight-ranking li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.insight-ranking strong { float: right; color: var(--text); }
.insights-loading { font-size: 12px; color: var(--muted); }
.insight-skeleton { border: 1px solid var(--border); background: var(--surface); border-radius: 15px; padding: 22px; min-height: 184px; display: flex; flex-direction: column; gap: 18px; }
.insight-skeleton span, .insight-skeleton strong { display: block; height: 10px; width: 65%; border-radius: 4px; background: var(--surface-3); animation: insight-pulse 1.4s ease-in-out infinite alternate; }
.insight-skeleton strong { height: 30px; width: 45%; }
@keyframes insight-pulse { to { opacity: .3; } }
.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; }
@media (max-width: 1250px) { .insight-alert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .insights-summary { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .insights-charts { grid-template-columns: 1fr; } .insights-filter { gap: 12px; } .insights-header { align-items: flex-start; flex-wrap: wrap; } }
@media (max-width: 480px) {
    .insights-dashboard { gap: 18px; }
    .insights-header { gap: 16px; }
    .insights-header-actions { width: 100%; }
    .insights-shortcuts { margin-left: auto; }
    .insights-summary { gap: 18px; }
    .insights-summary > .card { padding: 18px; }
    .insights-summary .insights-section-head { margin-bottom: 14px; }
    .insights-section-head h2 { font-size: 15px; }
    .insight-money { padding: 16px 0; }
    .insight-revenue { padding-top: 4px; }
    .insight-money > strong { font-size: 25px; }
    .insights-period { flex: 1; }
    .insights-period select { min-width: 0; width: 100%; }
    .insights-refresh { padding: 10px; }
    .insights-refresh span { display: none; }
    .insights-range { flex-basis: 100%; order: 3; }
    .insights-disclosure { gap: 10px; }
    .insights-disclosure small { line-height: 1.45; }
    .insight-alert-total { flex: none; }
    .insight-alert-grid, .insights-ranking-grid { grid-template-columns: 1fr; }
    .insights-chart-heading > strong { font-size: 15px; }
    .insight-chart-card { min-height: 280px; }
    .insights-rankings summary span { display: block; margin: 4px 0 0; }
    .insights-recent .data-table td { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .insight-skeleton span, .insight-skeleton strong { animation: none; } }

/* ---------- Acompanhamento público da OS ---------- */
.tracking-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(120% 70% at 50% -10%, var(--tint) 0%, var(--bg) 62%);
}
.tracking-page { flex: 1; padding: 26px 16px 40px; }
.tracking-shell { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.tracking-head { padding: 4px 4px 2px; }
.tracking-company { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.tracking-head h1 { margin: 8px 0 4px; font-size: 23px; line-height: 1.22; color: var(--text); }
.tracking-sub { margin: 0; color: var(--muted); font-size: 13.5px; }
.tracking-status {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 15px 18px; border-radius: var(--radius);
    background: var(--card-bg); box-shadow: var(--card-shadow); border: 1px solid var(--border);
}
.tracking-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.tracking-status .badge { font-size: 13px; }
.tracking-updated { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.tracking-card {
    padding: 18px; border-radius: var(--radius);
    background: var(--card-bg); box-shadow: var(--card-shadow); border: 1px solid var(--border);
}
.tracking-card h2 { margin: 0 0 12px; font-size: 14.5px; color: var(--text); }
.tracking-rows { display: flex; flex-direction: column; gap: 10px; }
.tracking-row { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.tracking-row + .tracking-row { padding-top: 10px; border-top: 1px solid var(--line); }
.tracking-row span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tracking-row strong { color: var(--text); font-weight: 600; }
.tracking-timeline { list-style: none; margin: 0; padding: 0; }
.tracking-timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 18px; }
.tracking-timeline li:last-child { padding-bottom: 0; }
.tracking-timeline li:not(:last-child)::before {
    content: ""; position: absolute; left: 5px; top: 15px; bottom: 1px; width: 2px;
    background: var(--line); border-radius: 2px;
}
.tracking-dot {
    flex: none; width: 12px; height: 12px; margin-top: 3px; border-radius: 50%;
    background: var(--surface-3); border: 2px solid var(--border-strong);
}
.tracking-timeline li.is-current .tracking-dot {
    background: var(--blue-600); border-color: var(--blue-600);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .16);
}
.tracking-timeline strong { display: block; font-size: 14px; color: var(--text); }
.tracking-timeline span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.tracking-contact { display: flex; flex-direction: column; gap: 10px; }
.tracking-contact h2 { margin-bottom: 2px; }
.tracking-btn { width: 100%; justify-content: center; }
.tracking-phone { margin: 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.tracking-note { margin: 2px 6px 0; text-align: center; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.tracking-empty h1 { margin: 0 0 10px; font-size: 20px; }
.tracking-empty p { margin: 0 0 8px; color: var(--text-soft); font-size: 14px; line-height: 1.55; }
.tracking-footer {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 16px; font-size: 11.5px; color: var(--muted);
}
.tracking-footer img { width: 18px; height: 18px; object-fit: contain; opacity: .75; }
@media (max-width: 420px) {
    .tracking-page { padding: 18px 12px 30px; }
    .tracking-head h1 { font-size: 20px; }
    .tracking-updated { margin-left: 0; flex-basis: 100%; }
    .tracking-card { padding: 16px; }
}

/* ---------- Aparência (Configurações) ---------- */
.appearance-group { display: flex; flex-direction: column; gap: 10px; }
.appearance-group-title { font-size: 13px; font-weight: 700; color: var(--text-soft); }
.appearance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.appearance-card {
    position: relative; display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; border-radius: 14px; text-align: left; cursor: pointer;
    border: 1px solid var(--border); background: var(--field); color: var(--text-soft);
    font: inherit; font-size: 13.5px; font-weight: 600;
}
.appearance-card:hover { border-color: var(--border-strong); background: var(--hover); }
.appearance-swatch {
    width: 34px; height: 34px; border-radius: 10px; flex: none;
    border: 1px solid rgba(0, 0, 0, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.appearance-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appearance-check {
    position: absolute; top: 7px; right: 8px; display: none;
    width: 18px; height: 18px; border-radius: 50%; background: var(--blue-600);
    color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
.sw-auto { background: linear-gradient(135deg, #ffffff 0 46%, #0b1b33 54% 100%); }
.sw-claro { background: linear-gradient(180deg, #ffffff 0%, #d4dae2 100%); }
.sw-escuro { background: linear-gradient(180deg, #363b45 0%, #0d0f11 100%); }
[data-theme-pref="auto"] .appearance-mode[data-mode-toggle="auto"],
[data-theme-pref="claro"] .appearance-mode[data-mode-toggle="claro"],
[data-theme-pref="escuro"] .appearance-mode[data-mode-toggle="escuro"] {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-600) 22%, transparent);
}
[data-theme-pref="auto"] .appearance-mode[data-mode-toggle="auto"] .appearance-check,
[data-theme-pref="claro"] .appearance-mode[data-mode-toggle="claro"] .appearance-check,
[data-theme-pref="escuro"] .appearance-mode[data-mode-toggle="escuro"] .appearance-check { display: block; }
