/* Design system do Painel (redesign aprovado em docs/design/*.dc.html).
   Tokens em :root (claro) e :root[data-theme="dark"] (escuro). O tema é escolhido em
   wwwroot/js/tema.js, que também seta data-bs-theme no <html> — assim os componentes do
   Bootstrap que ainda sobraram nas páginas acompanham o tema sem override um por um.
   Classes próprias usam o prefixo .ui-; os componentes em Components/UI só montam a marcação. */

:root {
    --brand-50: #eef2ff; --brand-100: #e0e7ff; --brand-200: #c7d2fe; --brand-300: #a5b4fc; --brand-500: #6366f1;
    --brand-600: #4f46e5; --brand-700: #4338ca; --brand-800: #3730a3;
    --bg: #f7f7fb; --surface: #ffffff; --surface-2: #f9fafb; --surface-3: #f4f4f8; --segment-bg: #ebebf2;
    --row-selected: #f8f8ff;
    --border: #e8e8ef; --border-soft: #f0f0f5; --border-strong: #d4d4de;
    --text: #0f1020; --text-2: #45475a; --text-muted: #5b5e73; --text-subtle: #6b6d82; --text-faint: #a3a5b8;
    --success-bg: #ecfdf5; --success: #047857; --success-dot: #10b981;
    --warning-bg: #fffbeb; --warning-border: #fde68a; --warning: #92400e; --warning-strong: #b45309; --warning-dot: #f59e0b;
    --danger-bg: #fef2f2; --danger-border: #fecaca; --danger: #b91c1c; --danger-solid: #dc2626; --danger-dot: #ef4444;
    --info-bg: #eff6ff; --info: #1d4ed8; --info-dot: #3b82f6;
    --violet-bg: #f5f3ff; --violet: #6d28d9; --violet-dot: #8b5cf6;
    --shopee: #ee4d2d; --shopee-bg: #fff1ee; --shopee-fg: #c2410c; --shopee-border: #fed7aa; --shopee-soft: #fffaf5; --shopee-strong: #9a3412;
    --wa: #1faa53; --wa-bg: #dcfce7; --wa-fg: #15803d;
    --ig-grad: linear-gradient(45deg, #f58529, #dd2a7b, #8134af, #515bd4); --ig-bg: #fce7f3; --ig-fg: #be185d;
    --tg: #229ed9; --tg-bg: #e0f2fe; --tg-fg: #0369a1;
    --sidebar-bg: linear-gradient(180deg, #14132b 0%, #1c1740 60%, #2a1650 100%);
    --dark-pop: #1e1b3a;
    --radius-sm: 8px; --radius: 12px; --radius-lg: 16px;
    --shadow-card: 0 1px 3px rgba(16, 16, 32, .06), 0 4px 16px rgba(16, 16, 32, .04);
    --shadow-pop: 0 24px 64px rgba(16, 16, 32, .35);
    --font: "Inter", system-ui, sans-serif; --font-mono: "JetBrains Mono", ui-monospace, monospace;

    /* Ponte pro Bootstrap: o que sobrou de .form-control/.table/.modal lê daqui. */
    --bs-body-font-family: var(--font);
    --bs-body-font-size: 14px;
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-secondary-color: var(--text-subtle);
    --bs-emphasis-color: var(--text);
    --bs-link-color: var(--brand-600);
    --bs-link-hover-color: var(--brand-700);
    --bs-link-color-rgb: 79, 70, 229;
    --bs-link-hover-color-rgb: 67, 56, 202;
    --bs-primary: var(--brand-600);
    --bs-primary-rgb: 79, 70, 229;
    --bs-border-radius: var(--radius-sm);
    color-scheme: light;
}

:root[data-theme="dark"] {
    --brand-50: rgba(99, 102, 241, .16); --brand-100: rgba(99, 102, 241, .26); --brand-200: rgba(129, 140, 248, .38);
    --brand-300: #818cf8; --brand-500: #818cf8; --brand-600: #6366f1; --brand-700: #a5b4fc; --brand-800: #c7d2fe;
    --bg: #0e0d1c; --surface: #17162a; --surface-2: #1b1a30; --surface-3: #222139; --segment-bg: #26253e;
    --row-selected: rgba(99, 102, 241, .10);
    --border: #2b2a44; --border-soft: #232238; --border-strong: #3b3a58;
    --text: #ecebf8; --text-2: #c9c8de; --text-muted: #a9a8c3; --text-subtle: #9391ad; --text-faint: #6c6a88;
    --success-bg: rgba(16, 185, 129, .15); --success: #34d399; --success-dot: #34d399;
    --warning-bg: rgba(245, 158, 11, .14); --warning-border: rgba(245, 158, 11, .38); --warning: #fbbf24; --warning-strong: #fbbf24; --warning-dot: #fbbf24;
    --danger-bg: rgba(239, 68, 68, .15); --danger-border: rgba(239, 68, 68, .4); --danger: #f87171; --danger-solid: #dc2626; --danger-dot: #f87171;
    --info-bg: rgba(59, 130, 246, .15); --info: #93c5fd; --info-dot: #60a5fa;
    --violet-bg: rgba(139, 92, 246, .16); --violet: #c4b5fd; --violet-dot: #a78bfa;
    --shopee: #ee4d2d; --shopee-bg: rgba(238, 77, 45, .16); --shopee-fg: #fdba74; --shopee-border: rgba(251, 146, 60, .4); --shopee-soft: rgba(251, 146, 60, .08); --shopee-strong: #fdba74;
    --wa-bg: rgba(34, 197, 94, .15); --wa-fg: #4ade80;
    --ig-bg: rgba(236, 72, 153, .15); --ig-fg: #f472b6;
    --tg-bg: rgba(14, 165, 233, .15); --tg-fg: #7dd3fc;
    --sidebar-bg: linear-gradient(180deg, #0c0b1a 0%, #13112b 60%, #1c1036 100%);
    --dark-pop: #2a2750;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-pop: 0 24px 64px rgba(0, 0, 0, .6);
    --bs-link-color-rgb: 165, 180, 252;
    --bs-link-hover-color-rgb: 199, 210, 254;
    --bs-link-color: #a5b4fc;
    --bs-link-hover-color: #c7d2fe;
    color-scheme: dark;
}

/* ---------- Base ---------- */
html, body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
h1:focus { outline: none; }
a { color: var(--brand-600); }
a:hover { color: var(--brand-700); }
:root[data-theme="dark"] a { color: #a5b4fc; }
:root[data-theme="dark"] a:hover { color: #c7d2fe; }
small, .small { font-size: 12px; }
.mono { font-family: var(--font-mono); font-weight: 500; }
.tabular { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--text-subtle) !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ---------- Botões (mesma API do Bootstrap, visual novo) ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { box-shadow: 0 0 0 3px var(--brand-100); outline: none; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 20px; }
.btn-primary { background: var(--brand-600); border: 1px solid var(--brand-600); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .3); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
:root[data-theme="dark"] .btn-primary:hover { background: #4f46e5; border-color: #4f46e5; }
.btn-primary:disabled, .btn-primary.disabled { background: #c7c9f5; border-color: #c7c9f5; color: #fff; opacity: 1; box-shadow: none; }
:root[data-theme="dark"] .btn-primary:disabled { background: #3b3a6b; border-color: #3b3a6b; color: #a9a8c3; }
.btn-secondary, .btn-outline-secondary, .btn-outline-primary, .btn-light, .btn-outline-info, .btn-outline-dark {
    background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); font-weight: 500;
}
.btn-secondary:hover, .btn-outline-secondary:hover, .btn-outline-primary:hover, .btn-light:hover, .btn-outline-info:hover, .btn-outline-dark:hover {
    background: var(--surface-3); border-color: var(--border-strong); color: var(--text);
}
.btn-outline-primary { color: var(--brand-700); }
.btn-danger { background: var(--danger-solid); border: 1px solid var(--danger-solid); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-outline-danger { background: var(--surface); border: 1px solid var(--danger-border); color: var(--danger); font-weight: 500; }
.btn-outline-danger:hover { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.btn-success { background: var(--wa); border: 1px solid var(--wa); color: #fff; }
.btn-outline-success { background: var(--surface); border: 1px solid var(--border-strong); color: var(--success); font-weight: 500; }
.btn-outline-success:hover { background: var(--success-bg); color: var(--success); }
.btn-outline-warning { background: var(--surface); border: 1px solid var(--warning-border); color: var(--warning); font-weight: 500; }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text-muted); font-weight: 500; }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-ghost-danger { background: transparent; border: 1px solid transparent; color: var(--danger); font-weight: 500; }
.btn-ghost-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-link { color: var(--brand-600); font-weight: 600; padding: 0; height: auto; text-decoration: none; }
.btn-link:hover { color: var(--brand-700); text-decoration: underline; }
.btn-icon { width: 36px; height: 36px; padding: 0; background: transparent; border: 1px solid transparent; color: var(--text-muted); border-radius: var(--radius-sm); }
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn-icon--bordered { border-color: var(--border); background: var(--surface); }
.btn-icon--danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-icon--brand { color: var(--brand-600); }
.btn-icon--brand:hover { background: var(--brand-50); color: var(--brand-700); }
.btn:disabled, .btn.disabled { cursor: not-allowed; opacity: .55; }
.btn .spinner-border-sm { width: 14px; height: 14px; border-width: 2px; }

/* ---------- Formulários ---------- */
.form-label, .ui-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.form-control, .form-select {
    min-height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background-color: var(--surface); color: var(--text); font-size: 14px; font-family: inherit;
}
textarea.form-control { min-height: 88px; }
.form-control-sm, .form-select-sm { min-height: 32px; font-size: 13px; }
.form-control:focus, .form-select:focus { border-color: var(--brand-300); box-shadow: 0 0 0 3px var(--brand-100); background-color: var(--surface); color: var(--text); }
.form-control::placeholder { color: var(--text-faint); }
.form-control:disabled, .form-control[readonly] { background-color: var(--surface-3); }
.form-check-input { border-color: var(--border-strong); width: 18px; height: 18px; margin-top: 0; }
.form-check-input:checked { background-color: var(--brand-600); border-color: var(--brand-600); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--brand-100); border-color: var(--brand-300); }
.form-check { display: flex; align-items: center; gap: 8px; min-height: 24px; padding-left: 0; }
.form-check .form-check-input { float: none; margin-left: 0; flex-shrink: 0; }
.form-check-label { font-size: 14px; color: var(--text); }
.form-text { font-size: 12px; color: var(--text-subtle); }
.input-group-text { background: var(--surface-3); border-color: var(--border); color: var(--text-muted); font-size: 13px; font-weight: 600; }
.validation-message, .ui-field-error { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--danger); }
.valid.modified:not([type=checkbox]) { outline: none; }
.invalid { outline: none; border-color: var(--danger-border) !important; box-shadow: 0 0 0 3px var(--danger-bg); }
input[type="checkbox"] { accent-color: var(--brand-600); }

/* Input com adorno (ícone de busca à esquerda, chip/botão dentro à direita). */
.ui-input { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 40px; padding: 0 4px 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-subtle); }
.ui-input:focus-within { border-color: var(--brand-300); box-shadow: 0 0 0 3px var(--brand-100); }
.ui-input--lg { min-height: 44px; border-radius: 10px; padding-left: 14px; }
.ui-input > input, .ui-input > select { flex: 1 1 auto; min-width: 0; height: 36px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; padding: 0; }
.ui-input > input:focus { box-shadow: none; }
.ui-input__prefix { font-size: 13px; font-weight: 600; color: var(--text-subtle); }
.ui-input--search { width: 260px; max-width: 100%; }

/* Chip de período com calendário (PeriodoChip). */
.ui-periodo { position: relative; }
.ui-periodo__chip { display: flex; align-items: center; gap: 8px; height: 40px; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); cursor: pointer; white-space: nowrap; }
.ui-periodo__chip svg { color: var(--text-subtle); }
.ui-periodo__chip:hover { border-color: var(--border-strong); }
.ui-periodo__fundo { position: fixed; inset: 0; z-index: 40; }
.ui-periodo__painel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 41; width: 300px; max-width: calc(100vw - 32px); padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 12px; }
.ui-periodo__atalhos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ui-periodo__atalho { height: 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.ui-periodo__atalho:hover { border-color: var(--brand-300); }
.ui-periodo__atalho.is-active { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.ui-periodo__datas { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.ui-periodo__datas label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-subtle); }
.ui-periodo__datas input { height: 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); }

/* ---------- Página ---------- */
.ui-page { box-sizing: border-box; width: 100%; max-width: 1280px; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.ui-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ui-header__main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ui-header__icon { width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand-600); }
.ui-header__icon--wa { background: var(--wa); color: #fff; box-shadow: 0 6px 16px rgba(31, 170, 83, .28); }
.ui-header__icon--ig { background: var(--ig-grad); color: #fff; box-shadow: 0 6px 16px rgba(221, 42, 123, .28); }
.ui-header__icon--marca { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-soft); }
.ui-header__icon--marca img { width: 26px; height: 26px; object-fit: contain; }
.ui-header__icon--tg { background: var(--tg); color: #fff; box-shadow: 0 6px 16px rgba(34, 158, 217, .3); }
.ui-header__icon--tt { background: #0f1020; color: #fff; box-shadow: 0 6px 16px rgba(15, 16, 32, .25); }
.ui-header__title { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.ui-header__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ui-header__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ui-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ui-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ui-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ui-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ui-stack { display: flex; flex-direction: column; gap: 16px; }
.ui-spacer { flex: 1 1 auto; }

/* ---------- Card ---------- */
.ui-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); min-width: 0; }
.ui-card--clip { overflow: hidden; }
.ui-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.ui-card__head--plain { border-bottom: 0; padding-bottom: 0; }
.ui-card__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.ui-card__num { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.ui-card__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ui-card__body { padding: 20px; }
.ui-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--border-soft); font-size: 13px; color: var(--text-muted); }
.ui-card--dim .ui-card__body { opacity: .5; }

/* Bootstrap .card antigo (páginas/partes ainda não migradas) com o mesmo visual. */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); color: var(--text); }
.card-header { background: transparent; border-bottom: 1px solid var(--border-soft); font-weight: 600; padding: 16px 20px; }
.card-body { padding: 20px; }
.card-footer { background: transparent; border-top: 1px solid var(--border-soft); }

/* ---------- Chips ---------- */
.ui-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; width: fit-content; }
.ui-chip--pill { border-radius: 999px; padding: 0 10px; }
.ui-chip--sm { height: 20px; padding: 0 6px; }
.ui-chip--lg { height: 28px; padding: 0 10px; font-size: 13px; }
.ui-chip--success { background: var(--success-bg); color: var(--success); }
.ui-chip--warning { background: var(--warning-bg); color: var(--warning); box-shadow: inset 0 0 0 1px var(--warning-border); }
.ui-chip--danger { background: var(--danger-bg); color: var(--danger); }
.ui-chip--info { background: var(--info-bg); color: var(--info); }
.ui-chip--brand { background: var(--brand-50); color: var(--brand-800); }
.ui-chip--violet { background: var(--violet-bg); color: var(--violet); }
.ui-chip--wa { background: var(--wa-bg); color: var(--wa-fg); }
.ui-chip--tt { background: #0f1020; color: #ffffff; }
.ui-chip--ig { background: var(--ig-bg); color: var(--ig-fg); }
.ui-chip--tg { background: var(--tg-bg); color: var(--tg-fg); }
.ui-chip--outline { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
a.ui-chip, button.ui-chip { text-decoration: none; border: 0; cursor: pointer; font-family: inherit; }
a.ui-chip:hover, button.ui-chip:hover { filter: brightness(.97); }

/* Loja (plataforma) — cores por marca, iguais às da referência. */
.ui-shop { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; width: fit-content; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.ui-shop--mercadolivre { background: #fef9c3; color: #854d0e; }
.ui-shop--shopee { background: #ffedd5; color: #c2410c; }
.ui-shop--amazon { background: #fef3c7; color: #92400e; }
.ui-shop--magalu { background: #dbeafe; color: #1d4ed8; }
.ui-shop--tiktok { background: #f4f4f8; color: #0f1020; }
.ui-shop--kabum { background: #ffedd5; color: #0b4fa8; }
:root[data-theme="dark"] .ui-shop--mercadolivre { background: rgba(250, 204, 21, .16); color: #fde047; }
:root[data-theme="dark"] .ui-shop--shopee { background: rgba(249, 115, 22, .16); color: #fdba74; }
:root[data-theme="dark"] .ui-shop--amazon { background: rgba(245, 158, 11, .16); color: #fcd34d; }
:root[data-theme="dark"] .ui-shop--magalu { background: rgba(59, 130, 246, .16); color: #93c5fd; }
:root[data-theme="dark"] .ui-shop--tiktok { background: var(--surface-3); color: var(--text); }
:root[data-theme="dark"] .ui-shop--kabum { background: rgba(255, 101, 0, .16); color: #93c5fd; }

/* ---------- StatusChip ---------- */
.ui-status { display: inline-flex; align-items: center; gap: 6px; width: fit-content; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ui-status__dot { width: 6px; height: 6px; border-radius: 50%; background: #8a8ca0; flex-shrink: 0; }
.ui-status--success { background: var(--success-bg); color: var(--success); }
.ui-status--success .ui-status__dot { background: var(--success-dot); }
.ui-status--brand { background: var(--violet-bg); color: var(--violet); }
.ui-status--brand .ui-status__dot { background: var(--violet-dot); }
.ui-status--info { background: var(--info-bg); color: var(--info); }
.ui-status--info .ui-status__dot { background: var(--info-dot); }
.ui-status--warning { background: var(--warning-bg); color: var(--warning); }
.ui-status--warning .ui-status__dot { background: var(--warning-dot); }
.ui-status--danger { background: var(--danger-bg); color: var(--danger); }
.ui-status--danger .ui-status__dot { background: var(--danger-dot); }
.ui-status--live .ui-status__dot { animation: ui-pulse 1.6s ease-out infinite; }
@keyframes ui-pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 5px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- ToggleSwitch ---------- */
.ui-switch { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; width: 40px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: var(--border-strong); cursor: pointer; transition: background-color .15s ease; }
.ui-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 16, 32, .25); transition: transform .15s ease; }
.ui-switch[aria-checked="true"] { background: var(--brand-600); }
.ui-switch[aria-checked="true"]::after { transform: translateX(16px); }
.ui-switch--success[aria-checked="true"] { background: var(--success-dot); }
.ui-switch:disabled { opacity: .5; cursor: not-allowed; }
.ui-switch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-100); }
.ui-switch-label { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--text); }

/* ---------- SegmentedControl ---------- */
.ui-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: 10px; background: var(--segment-bg); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ui-seg--block { display: grid; width: 100%; }
.ui-seg__btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.ui-seg__btn:hover { color: var(--text); }
a.ui-seg__btn { text-decoration: none; }
.ui-seg__btn.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 16, 32, .12); }
:root[data-theme="dark"] .ui-seg__btn.is-active { background: #34335a; }
.ui-seg__btn:disabled { opacity: .45; cursor: not-allowed; }
.ui-seg--sm .ui-seg__btn { height: 28px; padding: 0 10px; font-size: 12px; }

/* ---------- Abas de status com contador ---------- */
.ui-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ui-tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.ui-tab:hover { background: var(--surface-3); color: var(--text); }
.ui-tab.is-active { background: var(--brand-50); color: var(--brand-800); font-weight: 600; }
.ui-tab__count { min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 999px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; background: var(--border-soft); color: var(--text-subtle); }
.ui-tab.is-active .ui-tab__count { background: var(--brand-200); color: var(--brand-800); }

/* ---------- StatFilterCard ---------- */
.ui-stat { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); font-family: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; color: var(--text); text-decoration: none; min-width: 0; }
.ui-stat:hover { border-color: var(--border-strong); color: var(--text); }
.ui-stat.is-active { border: 1.5px solid var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.ui-stat__label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.ui-stat__dot { width: 8px; height: 8px; border-radius: 50%; background: #8a8ca0; }
.ui-stat__value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.ui-stat__sub { font-size: 12px; color: var(--text-subtle); }

/* ---------- InfoHint ---------- */
.ui-hint { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; border: 0; padding: 0; background: var(--surface-3); color: var(--text-subtle); font-family: Georgia, serif; font-style: italic; font-size: 12px; font-weight: 700; line-height: 1; cursor: help; vertical-align: middle; position: relative; }
.ui-hint:hover, .ui-hint:focus { background: var(--brand-50); color: var(--brand-700); outline: none; }
.ui-hint[data-tip]:hover::after, .ui-hint[data-tip]:focus::after {
    content: attr(data-tip); position: absolute; z-index: 1100; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
    width: max-content; max-width: 300px; padding: 8px 10px; border-radius: 8px; background: var(--dark-pop); color: #fff;
    font-family: var(--font); font-style: normal; font-size: 12px; font-weight: 500; line-height: 1.45; text-align: left; white-space: normal;
    box-shadow: 0 10px 30px rgba(16, 16, 32, .25); pointer-events: none;
}
.ui-hint--end[data-tip]:hover::after, .ui-hint--end[data-tip]:focus::after { left: auto; right: -8px; transform: none; }
.ui-hint--start[data-tip]:hover::after, .ui-hint--start[data-tip]:focus::after { left: -8px; transform: none; }

/* ---------- ChannelBadge ---------- */
.ui-chan { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.ui-chan--ok { background: var(--success-bg); color: var(--success); }
.ui-chan--pending { background: var(--warning-bg); color: var(--warning-strong); box-shadow: inset 0 0 0 1px var(--warning-border); }
.ui-chan--off { background: var(--surface-3); color: var(--text-faint); }
.ui-chan--wa { background: var(--wa-bg); color: var(--wa-fg); }
.ui-chan--ig { background: var(--ig-bg); color: var(--ig-fg); }
.ui-chan--tt { background: #0f1020; color: #ffffff; }
.ui-chan--tg { background: var(--tg-bg); color: var(--tg-fg); }
.ui-chan--lg { width: 36px; height: 36px; border-radius: 10px; }
.ui-chans { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- FlowSteps ---------- */
.ui-flow { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.ui-flow--dim { opacity: .45; filter: grayscale(.4); }
.ui-flow__step { display: flex; align-items: center; gap: 10px; flex: 1 1 180px; min-width: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-soft); }
.ui-flow__num { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; background: var(--brand-600); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.ui-flow__icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; background: var(--brand-50); color: var(--brand-600); display: inline-flex; align-items: center; justify-content: center; }
.ui-flow__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ui-flow__kicker { font-size: 12px; font-weight: 600; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .05em; }
.ui-flow__label { font-size: 14px; font-weight: 600; color: var(--text); }
.ui-flow__arrow { display: flex; align-items: center; color: var(--brand-300); flex-shrink: 0; }

/* ---------- SelectionBar ---------- */
.ui-selbar { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 1040; display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 20px; border-radius: 14px; background: var(--dark-pop); color: #fff; box-shadow: 0 12px 32px rgba(16, 16, 32, .3); max-width: calc(100vw - 32px); }
@media (min-width: 992px) { .ui-selbar { left: calc(50% + 124px); } }
.ui-selbar__label { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui-selbar__clear { height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #c4c2e0; font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.ui-selbar__clear:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ui-selbar__cta { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: #6366f1; color: #fff; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ui-selbar__cta:hover { background: #5458e8; }
.ui-selbar__cta:disabled, .ui-selbar__btn:disabled { opacity: .55; cursor: progress; }
.ui-selbar__btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .1); color: #fff; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ui-selbar__btn:hover { background: rgba(255, 255, 255, .16); }

/* ---------- EmptyState ---------- */
.ui-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px 24px; text-align: center; }
.ui-empty__icon { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-3); color: var(--text-subtle); display: flex; align-items: center; justify-content: center; }
.ui-empty__icon--lg { width: 72px; height: 72px; }
.ui-empty__icon--wa { background: var(--wa-bg); color: var(--wa-fg); }
.ui-empty__icon--ig { background: var(--ig-grad); color: #fff; }
.ui-empty__icon--brand { background: var(--brand-50); color: var(--brand-600); }
.ui-empty__title { font-size: 16px; font-weight: 600; color: var(--text); }
.ui-empty__title--lg { font-size: 18px; }
.ui-empty__text { font-size: 13px; color: var(--text-subtle); }
.ui-empty__row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }

/* ---------- ConfirmDialog / modal ---------- */
.ui-backdrop { position: fixed; inset: 0; z-index: 1060; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 19, 43, .55); }
.ui-dialog { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 10px 40px rgba(16, 16, 32, .18); padding: 24px; display: flex; flex-direction: column; gap: 16px; color: var(--text); }
.ui-dialog__body { display: flex; gap: 14px; align-items: flex-start; }
.ui-dialog__icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--danger-bg); color: var(--danger); display: flex; align-items: center; justify-content: center; }
.ui-dialog__icon--brand { background: var(--brand-50); color: var(--brand-600); }
.ui-dialog__title { font-size: 16px; font-weight: 600; margin: 0; }
.ui-dialog__text { font-size: 13px; color: var(--text-muted); margin: 0; }
.ui-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; }

.ui-modal { width: 100%; max-width: 640px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-pop); overflow: hidden; color: var(--text); }
.ui-modal--lg { max-width: 820px; }
.ui-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 24px 24px 20px; }
.ui-modal__head-main { display: flex; gap: 14px; align-items: center; min-width: 0; }
.ui-modal__icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); display: flex; align-items: center; justify-content: center; }
.ui-modal__title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.ui-modal__body { padding: 0 24px 24px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }
.ui-modal__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border-soft); background: var(--surface-2); flex-wrap: wrap; }

/* Modais Bootstrap que ainda sobraram. */
.modal-content { background: var(--surface); color: var(--text); border: 0; border-radius: 20px; box-shadow: var(--shadow-pop); }
.modal-header, .modal-footer { border-color: var(--border-soft); padding: 16px 24px; }
.modal-body { padding: 20px 24px; }
.modal-title { font-size: 18px; font-weight: 700; }

/* ---------- Toast ---------- */
.ui-toast { position: fixed; right: 24px; bottom: 24px; z-index: 1080; display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: min(92vw, 480px); padding: 12px 12px 12px 16px; border-radius: 12px; background: var(--dark-pop); color: #fff; box-shadow: 0 10px 30px rgba(16, 16, 32, .25); animation: ui-toast-in .2s ease-out; }
@keyframes ui-toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.ui-toast__icon { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(52, 211, 153, .18); color: #34d399; }
.ui-toast--erro .ui-toast__icon { background: rgba(248, 113, 113, .18); color: #f87171; }
.ui-toast__text { flex-grow: 1; font-size: 14px; font-weight: 600; line-height: 1.4; }
.ui-toast__close { width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 8px; background: transparent; color: #c4c2e0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ui-toast__close:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- Tabela ---------- */
.ui-table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--text); }
.ui-table th { height: 40px; padding: 0 16px; background: var(--surface-2); border-bottom: 1px solid var(--border-soft); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-subtle); text-align: left; white-space: nowrap; }
.ui-table td { padding: 12px 16px; border-top: 1px solid var(--border-soft); vertical-align: middle; }
.ui-table tbody tr:first-child td { border-top: 0; }
.ui-table tr.is-selected td { background: var(--row-selected); }
.ui-table tr.is-clickable { cursor: pointer; }
.ui-table tr.is-clickable:hover td { background: var(--surface-2); }
.ui-table tr.ui-table__detail td { background: var(--surface-2); border-top: 0; }
.ui-table .col-check { width: 44px; padding-right: 0; }
.ui-table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.ui-table td.col-actions { padding-top: 6px; padding-bottom: 6px; }
.ui-table-wrap { position: relative; width: 100%; overflow-x: auto; }

/* Bootstrap .table antigo. */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--text); --bs-table-border-color: var(--border-soft); --bs-table-striped-bg: var(--surface-2); color: var(--text); font-size: 14px; }
.table > thead { color: var(--text-subtle); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table > thead th { background: var(--surface-2); font-weight: 600; border-bottom-width: 1px; white-space: nowrap; }
.table-light { --bs-table-bg: var(--surface-2); --bs-table-color: var(--text); }

/* Miniatura de produto. */
.ui-thumb { width: 44px; height: 44px; flex-shrink: 0; border-radius: 8px; background: var(--surface-3); color: var(--text-faint); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ui-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ui-thumb--sm { width: 36px; height: 36px; }
.ui-thumb--lg { width: 64px; height: 64px; border-radius: 10px; }

/* Produto (miniatura + título + loja) numa célula. */
.ui-product { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ui-product__text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ui-product__title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }

/* Preço. */
.ui-price { display: flex; flex-direction: column; gap: 2px; }
.ui-price__main { display: flex; align-items: center; gap: 6px; }
.ui-price__value { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui-price__orig { font-size: 12px; color: var(--text-subtle); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.ui-off { height: 20px; padding: 0 6px; border-radius: 6px; background: var(--success-bg); color: var(--success); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; white-space: nowrap; }

/* Paginação. */
.ui-pager { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.ui-pager__btns { display: flex; gap: 4px; }
.ui-pager__btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ui-pager__btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.ui-pager__btn:disabled { color: var(--text-faint); cursor: not-allowed; }
.ui-select-sm { height: 32px; min-height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 0 28px 0 8px; font-size: 13px; background-color: var(--surface); color: var(--text); }

/* Tiles (métrica / configuração numérica). */
.ui-tile { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); min-width: 0; }
.ui-tile__head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.ui-tile__icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; background: var(--brand-50); color: var(--brand-600); display: inline-flex; align-items: center; justify-content: center; }
.ui-tile__value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--text); }
.ui-tile__value--none { color: var(--text-faint); }
.ui-tile__num { display: flex; align-items: baseline; gap: 6px; }
.ui-tile__num input { width: 88px; height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ui-tile__num input:focus { outline: none; border-color: var(--brand-300); box-shadow: 0 0 0 3px var(--brand-100); }
.ui-tile__unit { font-size: 13px; font-weight: 600; color: var(--text-subtle); }

/* Cartão selecionável (canais no Criar lista / form de oferta). */
.ui-pick { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-family: inherit; text-align: left; cursor: pointer; transition: all .15s ease; width: 100%; color: var(--text); }
.ui-pick:hover:not(:disabled) { border-color: var(--border-strong); }
.ui-pick.is-selected { border: 1.5px solid var(--brand-500); background: var(--row-selected); box-shadow: 0 0 0 3px var(--brand-100); }
.ui-pick:disabled, .ui-pick.is-off { border: 1px dashed var(--border-strong); background: var(--surface-2); cursor: not-allowed; opacity: .8; }
.ui-pick__text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.ui-pick__label { font-size: 14px; font-weight: 600; color: var(--text); }
.ui-pick__sub { font-size: 12px; color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-pick__sub--warn { color: var(--warning-strong); font-weight: 600; }
.ui-pick__check { width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--border-strong); color: #fff; }
.ui-pick.is-selected .ui-pick__check { background: var(--brand-600); box-shadow: none; }
.ui-pick:disabled .ui-pick__check, .ui-pick.is-off .ui-pick__check { opacity: 0; }

/* Barra de progresso/cota. */
.ui-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ui-bar__fill { height: 100%; border-radius: 999px; background: var(--success-dot); }
.ui-bar__fill--warning { background: var(--warning-dot); }
.ui-bar__fill--danger { background: var(--danger-dot); }

/* Lista em linhas (dentro de card). */
.ui-list { display: flex; flex-direction: column; }
.ui-list__row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border-soft); min-width: 0; }
.ui-list__row:first-child { border-top: 0; }

/* Divulgação (<details>) usada pra "Destinos e templates" etc. */
.ui-disclosure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ui-disclosure > summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ui-disclosure > summary::-webkit-details-marker { display: none; }
.ui-disclosure > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--text-subtle); border-bottom: 2px solid var(--text-subtle); transform: rotate(45deg); transition: transform .15s ease; }
.ui-disclosure[open] > summary::after { transform: rotate(-135deg); }
.ui-disclosure__body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 12px; }

/* Checklist compacto (grupos/templates dentro do Criar lista). */
.ui-checklist { display: flex; flex-direction: column; border: 1px solid var(--border-soft); border-radius: 10px; max-height: 220px; overflow-y: auto; }
.ui-checklist__row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border-soft); font-size: 13px; cursor: pointer; }
.ui-checklist__row:first-child { border-top: 0; }
.ui-checklist__row:hover { background: var(--surface-2); }
.ui-checklist__head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border-soft); font-size: 12px; font-weight: 600; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .04em; }

/* Alertas Bootstrap que sobraram (erros de carregamento etc.). */
.alert { border-radius: var(--radius); font-size: 13px; border: 1px solid transparent; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: transparent; }

.badge { font-weight: 600; border-radius: 999px; padding: .35em .7em; font-size: 12px; }

/* Ícone girando (Fila "Ao vivo"). */
.ui-spin { animation: ui-spin 1.4s linear infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* Botão de tema da Topbar: lua no claro, sol no escuro. */
.tema-lua, .tema-sol { display: inline-flex; align-items: center; }
.tema-sol { display: none; }
:root[data-theme="dark"] .tema-sol { display: inline-flex; }
:root[data-theme="dark"] .tema-lua { display: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
    .ui-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .ui-page { padding: 24px 16px; }
    .ui-grid-2, .ui-grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575.98px) {
    .ui-header__title { font-size: 24px; }
    .ui-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .ui-input--search { width: 100%; }
    .ui-selbar { bottom: 16px; gap: 8px; padding-left: 14px; }
}

/* ---------- Login (LoginLayout) ---------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; background: var(--bg); }
.login-box { width: 100%; max-width: 380px; padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.login-box h1 { font-size: 22px; font-weight: 700; margin-bottom: 24px; text-align: center; }
.dois-fatores__qr { display: flex; justify-content: center; margin: 0 0 12px; }
.dois-fatores__qr svg { width: 200px; height: 200px; }
.dois-fatores__chave { text-align: center; margin: 0 0 20px; }
.dois-fatores__chave code { font-family: var(--font-mono); font-size: 13px; color: var(--text-2); background: var(--surface-3); padding: 4px 8px; border-radius: var(--radius-sm); }

/* Telas de acesso (Login.dc.html): formulário da direita do LoginLayout. */
.acesso-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 22px; }
.acesso-abas { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--surface-3); gap: 2px; }
.acesso-abas a { height: 40px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); display: flex; align-items: center; justify-content: center; text-decoration: none; }
.acesso-abas a.is-on { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(16, 16, 32, .12); }
.acesso-titulo { display: flex; flex-direction: column; gap: 6px; }
.acesso-titulo h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.acesso-titulo span { font-size: 15px; color: var(--text-2); }
.acesso-campos { display: flex; flex-direction: column; gap: 16px; }
.acesso-campo { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.acesso-campo > span:first-child { font-size: 13px; font-weight: 600; color: var(--text-2); }
.acesso-campo__topo { display: flex; justify-content: space-between; }
.acesso-campo__topo a { font-weight: 600; text-decoration: none; }
.acesso-campo input, .acesso-senha { height: 46px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; }
.acesso-campo input { padding: 0 14px; }
.acesso-campo input:focus { outline: 2px solid var(--brand-500); outline-offset: -1px; }
.acesso-campo input.invalid { border-color: var(--danger); }
.acesso-campo textarea { box-sizing: border-box; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; padding: 10px 14px; resize: vertical; }
.acesso-campo textarea:focus { outline: 2px solid var(--brand-500); outline-offset: -1px; }
/* Campo isca do formulário público (Contato Agência): fora da tela, não display:none. */
.acesso-isca { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.acesso-senha { display: flex; align-items: center; padding: 0 6px 0 14px; }
.acesso-senha:focus-within { outline: 2px solid var(--brand-500); outline-offset: -1px; }
.acesso-senha input { flex: 1 1 auto; min-width: 0; height: 100%; border: none; padding: 0; background: transparent; outline: none !important; }
.acesso-senha button { width: 34px; height: 34px; border: none; border-radius: 8px; background: transparent; color: var(--text-subtle); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.acesso-campo__erro { font-size: 13px; color: var(--danger); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acesso-cta { height: 50px; border: none; border-radius: 12px; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 10px 24px rgba(139, 92, 246, .35); }
.acesso-cta:hover { filter: brightness(1.05); }
.acesso-legal { font-size: 13px; color: var(--text-subtle); text-align: center; line-height: 1.5; }
.acesso-erro, .acesso-ok { padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.acesso-erro { background: var(--danger-bg); color: var(--danger); }
.acesso-ok { background: var(--success-bg); color: var(--success); }
.acesso-senha input.invalid { border: none; }
.acesso-senha:has(input.invalid) { border-color: var(--danger); }
