/* =====================================================================
   PETIÇÃO INICIAL — DESIGN SYSTEM GLOBAL  (base.css)
   Tema escuro · acento âmbar · tipografia serifada para títulos
   ---------------------------------------------------------------------
   Arquivo global usado em TODO o painel e nas páginas públicas.
   Seções: 1.tokens  2.reset  3.tipografia  4.componentes  5.utilitários
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* =====================================================================
   1. TOKENS
   ===================================================================== */
:root {
    --bg:            #0e0e11;
    --surface:       #16161b;
    --surface-2:     #1d1d24;
    --surface-3:     #26262f;
    --surface-4:     #313140;

    --line:          #2a2a33;
    --line-2:        #383844;
    --line-soft:     #21212a;

    --ink:           #f4f3f0;
    --ink-soft:      #b9b8b4;
    --ink-mute:      #7d7c79;
    --ink-faint:     #56554f;

    --brand:         #d6a85b;
    --brand-hi:      #e6c084;
    --brand-lo:      #b98a3e;
    --brand-ink:     #1a1407;
    --brand-soft:    rgba(214,168,91,.14);
    --brand-soft-2:  rgba(214,168,91,.08);
    --brand-line:    rgba(214,168,91,.35);

    --ok:    #5cb98a;  --ok-soft:   rgba(92,185,138,.14);  --ok-line:   rgba(92,185,138,.35);
    --warn:  #d9a441;  --warn-soft: rgba(217,164,65,.14);  --warn-line: rgba(217,164,65,.35);
    --err:   #d97070;  --err-soft:  rgba(217,112,112,.14); --err-line:  rgba(217,112,112,.38);
    --info:  #6ba3d6;  --info-soft: rgba(107,163,214,.14); --info-line: rgba(107,163,214,.35);

    --font-serif: 'Fraunces', Georgia, serif;
    --font-sans:  'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:  'JetBrains Mono', ui-monospace, Menlo, monospace;

    --r-xs: 5px; --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px; --r-pill: 999px;

    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
    --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 6px 20px rgba(0,0,0,.45);
    --shadow-lg: 0 18px 50px rgba(0,0,0,.6);
    --shadow-glow: 0 0 0 1px var(--brand-line), 0 8px 30px rgba(214,168,91,.12);

    --t-fast: 120ms cubic-bezier(.4,0,.2,1);
    --t-norm: 220ms cubic-bezier(.4,0,.2,1);
    --t-slow: 380ms cubic-bezier(.4,0,.2,1);

    --sidebar-w: 258px;
    --topbar-h:  66px;
    --container: 1180px;
    --container-narrow: 720px;

    --z-sidebar: 40; --z-topbar: 30; --z-dropdown: 60; --z-modal: 80; --z-toast: 100;
}

/* =====================================================================
   2. RESET
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    background-image:
        radial-gradient(900px 500px at 12% -5%, rgba(214,168,91,.05), transparent 60%),
        radial-gradient(700px 600px at 100% 0%, rgba(107,163,214,.04), transparent 55%);
    background-attachment: fixed;
}

img, svg, video { display: block; max-width: 100%; }
svg { fill: none; }
a { color: var(--brand); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-hi); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; }
::selection { background: var(--brand-soft); color: var(--brand-hi); }

* { scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--surface-4); border-radius: var(--r-pill); border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--line-2); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-xs); }

/* =====================================================================
   3. TIPOGRAFIA
   ===================================================================== */
h1, h2, h3, h4, h5 {
    font-family: var(--font-serif);
    font-weight: 600; line-height: 1.2;
    color: var(--ink); letter-spacing: -.01em;
}
h1 { font-size: 30px; } h2 { font-size: 24px; } h3 { font-size: 19px; }
h4 { font-size: 16px; } h5 { font-size: 14px; }
p { color: var(--ink-soft); }
small { font-size: 12.5px; }
code, kbd, samp, pre { font-family: var(--font-mono); font-size: .92em; }
code {
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--r-xs); padding: 1.5px 6px;
    color: var(--brand-hi); font-size: 12.5px;
}
kbd {
    background: var(--surface-3); border: 1px solid var(--line-2);
    border-bottom-width: 2px; border-radius: var(--r-xs);
    padding: 2px 7px; font-size: 11.5px; color: var(--ink);
}
hr { border: none; border-top: 1px solid var(--line); margin: var(--sp-5) 0; }

.text-serif { font-family: var(--font-serif); }
.text-mono  { font-family: var(--font-mono); }
.text-muted { color: var(--ink-mute); }
.text-soft  { color: var(--ink-soft); }
.text-brand { color: var(--brand); }
.text-ok    { color: var(--ok); }
.text-warn  { color: var(--warn); }
.text-err   { color: var(--err); }
.text-center{ text-align: center; }
.text-right { text-align: right; }
.text-left  { text-align: left; }
.text-xs { font-size: 11.5px; } .text-sm { font-size: 13px; }
.text-lg { font-size: 16px; }   .text-xl { font-size: 20px; }
.uppercase { text-transform: uppercase; letter-spacing: .06em; }
.fw-400 { font-weight: 400; } .fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.text-gradient {
    background: linear-gradient(100deg, var(--brand-hi), var(--brand));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* =====================================================================
   4. COMPONENTES — Botões
   ===================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: var(--sp-2);
    font-family: var(--font-sans);
    font-size: 14px; font-weight: 600;
    line-height: 1; white-space: nowrap;
    padding: 11px 18px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    transition: background var(--t-fast), border-color var(--t-fast),
                color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
    user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 17px; height: 17px; stroke: currentColor; }

.btn-primary {
    background: linear-gradient(180deg, var(--brand-hi), var(--brand));
    color: var(--brand-ink);
    box-shadow: 0 2px 10px rgba(214,168,91,.22);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--brand-hi), var(--brand-hi)); color: var(--brand-ink); }

.btn-secondary {
    background: var(--surface-3);
    color: var(--ink);
    border-color: var(--line-2);
}
.btn-secondary:hover { background: var(--surface-4); color: var(--ink); }

.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn-outline {
    background: transparent; color: var(--brand);
    border-color: var(--brand-line);
}
.btn-outline:hover { background: var(--brand-soft); color: var(--brand-hi); }

.btn-danger {
    background: var(--err); color: #fff;
}
.btn-danger:hover { background: #c85f5f; color: #fff; }

.btn-danger-soft {
    background: var(--err-soft); color: var(--err);
    border-color: var(--err-line);
}
.btn-danger-soft:hover { background: rgba(217,112,112,.22); color: var(--err); }

.btn-sm  { padding: 7px 12px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg  { padding: 14px 26px; font-size: 15px; }
.btn-lg svg { width: 19px; height: 19px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 9px; }
.btn-icon.btn-sm { padding: 6px; }

/* Grupo de botões segmentado */
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; border-right-width: 0; }
.btn-group .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.btn-group .btn:last-child  { border-radius: 0 var(--r-sm) var(--r-sm) 0; border-right-width: 1px; }

/* =====================================================================
   COMPONENTES — Badges / tags / pills
   ===================================================================== */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 600;
    padding: 3px 9px; border-radius: var(--r-pill);
    border: 1px solid transparent;
    line-height: 1.4; white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; stroke: currentColor; }
.badge-brand   { background: var(--brand-soft); color: var(--brand-hi); border-color: var(--brand-line); }
.badge-success { background: var(--ok-soft);    color: var(--ok);       border-color: var(--ok-line); }
.badge-warn    { background: var(--warn-soft);  color: var(--warn);     border-color: var(--warn-line); }
.badge-danger  { background: var(--err-soft);   color: var(--err);      border-color: var(--err-line); }
.badge-info    { background: var(--info-soft);  color: var(--info);     border-color: var(--info-line); }
.badge-muted   { background: var(--surface-3);  color: var(--ink-mute); border-color: var(--line-2); }

/* Badge com ponto pulsante (status ao vivo) */
.badge-dot::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}
.badge-dot.is-live::before { animation: pulse-dot 1.6s infinite; }
@keyframes pulse-dot {
    0%,100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
    50%     { opacity: .6; box-shadow: 0 0 0 4px transparent; }
}

/* =====================================================================
   COMPONENTES — Alerts / avisos
   ===================================================================== */
.alert {
    display: flex; gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 13.5px; color: var(--ink-soft);
    align-items: flex-start;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; stroke: currentColor; }
.alert strong { color: var(--ink); font-weight: 600; }
.alert a { font-weight: 600; }
.alert-success { background: var(--ok-soft);   border-color: var(--ok-line);   color: var(--ok); }
.alert-warn    { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.alert-error,
.alert-danger  { background: var(--err-soft);  border-color: var(--err-line);  color: var(--err); }
.alert-info    { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.alert-brand   { background: var(--brand-soft);border-color: var(--brand-line);color: var(--brand-hi); }
.alert--lg { padding: var(--sp-4) var(--sp-5); font-size: 14px; }

/* =====================================================================
   COMPONENTES — Avatar
   ===================================================================== */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-lo));
    color: var(--brand-ink);
    font-weight: 700; font-size: 14px;
    font-family: var(--font-sans);
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 80px; height: 80px; font-size: 28px; }
.avatar-ring { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand-line); }

/* Pilha de avatares */
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -10px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
/* =====================================================================
   COMPONENTES — Formulários
   ===================================================================== */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: var(--sp-4); }
.field:last-child { margin-bottom: 0; }

.field label,
.label {
    font-size: 13px; font-weight: 600; color: var(--ink);
    display: flex; align-items: center; gap: 6px;
}
.field label .required,
.required { color: var(--err); font-weight: 700; }
.field label small { font-weight: 400; color: var(--ink-mute); }

/* Inputs base */
.input, .select, .textarea {
    width: 100%;
    font-family: var(--font-sans); font-size: 14px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    padding: 10px 13px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
    appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--surface-4); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.input:disabled, .select:disabled, .textarea:disabled {
    opacity: .55; cursor: not-allowed; background: var(--surface);
}
.input.is-error, .select.is-error, .textarea.is-error {
    border-color: var(--err);
    box-shadow: 0 0 0 3px var(--err-soft);
}
.input.is-ok { border-color: var(--ok); }

.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }

/* Select com seta customizada */
.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237d7c79' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
    cursor: pointer;
}

/* Input com ícone */
.input-icon { position: relative; }
.input-icon svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 17px; height: 17px; stroke: var(--ink-mute); pointer-events: none;
}
.input-icon .input { padding-left: 38px; }
.input-icon--right svg { left: auto; right: 12px; }
.input-icon--right .input { padding-left: 13px; padding-right: 38px; }

/* Dica e erro abaixo do campo */
.field-hint {
    font-size: 12px; color: var(--ink-mute); line-height: 1.5;
}
.field-error {
    font-size: 12px; color: var(--err); font-weight: 500;
    display: flex; align-items: center; gap: 5px;
}
.field-error svg { width: 13px; height: 13px; stroke: currentColor; }

/* Linha de campos lado a lado */
.field-row { display: flex; gap: var(--sp-3); }
.field-row > .field { flex: 1; }
@media (max-width: 560px) { .field-row { flex-direction: column; gap: 0; } }

/* Input group — addon colado */
.input-group { display: flex; }
.input-group .input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .input-addon {
    display: flex; align-items: center; padding: 0 13px;
    background: var(--surface-3); border: 1px solid var(--line-2);
    border-left: none; border-radius: 0 var(--r-sm) var(--r-sm) 0;
    color: var(--ink-mute); font-size: 13px; white-space: nowrap;
}
.input-group .input-addon--left {
    border-left: 1px solid var(--line-2); border-right: none;
    border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.input-group .input-addon--left + .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* Checkbox e Radio customizados */
.check, .radio {
    display: flex; align-items: flex-start; gap: 9px;
    cursor: pointer; font-size: 13.5px; color: var(--ink-soft);
    user-select: none;
}
.check input, .radio input {
    appearance: none; flex-shrink: 0;
    width: 18px; height: 18px; margin-top: 1px;
    background: var(--surface-2);
    border: 1.5px solid var(--line-2);
    transition: background var(--t-fast), border-color var(--t-fast);
    cursor: pointer;
}
.check input { border-radius: var(--r-xs); }
.radio input { border-radius: 50%; }
.check input:hover, .radio input:hover { border-color: var(--brand); }
.check input:checked, .radio input:checked {
    background: var(--brand); border-color: var(--brand);
}
.check input:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1407' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 13px; background-repeat: no-repeat; background-position: center;
}
.radio input:checked {
    box-shadow: inset 0 0 0 4px var(--surface-2);
}
.check input:focus-visible, .radio input:focus-visible {
    outline: 2px solid var(--brand); outline-offset: 2px;
}

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; position: absolute; opacity: 0; }
.switch__track {
    width: 40px; height: 22px; flex-shrink: 0;
    background: var(--surface-4); border-radius: var(--r-pill);
    border: 1px solid var(--line-2);
    transition: background var(--t-norm), border-color var(--t-norm);
    position: relative;
}
.switch__track::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--ink-soft);
    transition: transform var(--t-norm), background var(--t-norm);
}
.switch input:checked + .switch__track {
    background: var(--brand); border-color: var(--brand);
}
.switch input:checked + .switch__track::after {
    transform: translateX(18px); background: var(--brand-ink);
}
.switch input:focus-visible + .switch__track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch__label { font-size: 13.5px; color: var(--ink-soft); }

/* Medidor de força de senha */
.pwd-meter { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.pwd-meter__bars { display: flex; gap: 4px; }
.pwd-meter__bar {
    flex: 1; height: 4px; border-radius: var(--r-pill);
    background: var(--surface-4);
    transition: background var(--t-norm);
}
.pwd-meter__bar.is-on-1 { background: var(--err); }
.pwd-meter__bar.is-on-2 { background: var(--warn); }
.pwd-meter__bar.is-on-3 { background: #b3c361; }
.pwd-meter__bar.is-on-4 { background: var(--ok); }
.pwd-meter__label { font-size: 11.5px; color: var(--ink-mute); }

/* Campo de código (OTP / MFA) */
.code-input {
    display: flex; gap: var(--sp-2); justify-content: center;
}
.code-input input,
.mfa-input {
    width: 48px; height: 56px;
    text-align: center;
    font-family: var(--font-mono); font-size: 22px; font-weight: 500;
    color: var(--ink);
    background: var(--surface-2);
    border: 1.5px solid var(--line-2);
    border-radius: var(--r-sm);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.mfa-input { width: 100%; letter-spacing: .5em; padding-left: .5em; }
.code-input input:focus,
.mfa-input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Upload de arquivos — dropzone */
.dropzone {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px;
    padding: 38px var(--sp-5);
    border: 1.5px dashed var(--line-2);
    border-radius: var(--r-md);
    background:
        radial-gradient(120% 140% at 50% 0%, var(--brand-soft-2), transparent 60%),
        var(--surface-2);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--t-fast), background var(--t-fast),
                box-shadow var(--t-fast), transform var(--t-fast);
}
.dropzone:hover {
    border-color: var(--brand-line);
    background:
        radial-gradient(120% 140% at 50% 0%, var(--brand-soft), transparent 60%),
        var(--surface-2);
}
.dropzone.is-dragover {
    border-color: var(--brand);
    border-style: solid;
    background:
        radial-gradient(120% 140% at 50% 0%, var(--brand-soft), transparent 55%),
        var(--surface-2);
    box-shadow: var(--shadow-glow);
    transform: scale(1.005);
}
.dropzone__icon {
    width: 58px; height: 58px; border-radius: 50%;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    display: flex; align-items: center; justify-content: center;
    transition: transform var(--t-fast);
}
.dropzone:hover .dropzone__icon { transform: translateY(-2px); }
.dropzone.is-dragover .dropzone__icon { transform: scale(1.08); }
.dropzone__icon svg { width: 26px; height: 26px; stroke: var(--brand); }
.dropzone__title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.dropzone__title b { color: var(--brand); }
.dropzone__hint { font-size: 12px; color: var(--ink-mute); }
.dropzone__formats {
    display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
    margin-top: 4px;
}
.dropzone__formats span {
    font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase;
    padding: 3px 8px; border-radius: var(--r-pill);
    background: var(--surface-3); color: var(--ink-soft);
}
.dropzone input[type=file] { display: none; }

/* Dropzone — variante compacta (uma linha) */
.dropzone--sm {
    flex-direction: row;
    gap: var(--sp-3);
    padding: 12px var(--sp-3);
    text-align: left;
    background: var(--surface-2);
}
.dropzone--sm .dropzone__icon {
    width: 38px; height: 38px; flex-shrink: 0;
}
.dropzone--sm .dropzone__icon svg { width: 18px; height: 18px; }
.dropzone--sm .dropzone__body {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 1px;
}
.dropzone--sm .dropzone__title { font-size: 13px; }
.dropzone--sm .dropzone__hint { font-size: 11.5px; }
.dropzone--sm .dropzone__btn {
    flex-shrink: 0;
    font-size: 12px; font-weight: 600;
    padding: 7px 14px; border-radius: var(--r-sm);
    background: var(--brand-soft); color: var(--brand);
    border: 1px solid var(--brand-line);
    transition: background var(--t-fast);
}
.dropzone--sm:hover .dropzone__btn { background: var(--brand-soft); }

/* Lista de arquivos enviados */
.file-list { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); }
.file-list:empty { margin-top: 0; }
.file-item {
    display: flex; align-items: center; gap: var(--sp-3);
    padding: 10px var(--sp-3);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    transition: border-color var(--t-fast), opacity .18s ease;
}
.file-item:hover { border-color: var(--line-2); }
.file-item__icon {
    width: 38px; height: 38px; flex-shrink: 0;
    background: var(--brand-soft); border-radius: var(--r-xs);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.file-item__icon svg { width: 18px; height: 18px; stroke: var(--brand); }
.file-item__icon img {
    width: 100%; height: 100%; object-fit: cover;
}
/* Cores do ícone por tipo de arquivo */
.file-item__icon.is-pdf   { background: rgba(224,90,80,.14); }
.file-item__icon.is-pdf   svg { stroke: #e05a50; }
.file-item__icon.is-doc   { background: rgba(86,140,224,.14); }
.file-item__icon.is-doc   svg { stroke: #568ce0; }
.file-item__icon.is-img   { background: rgba(91,184,122,.14); }
.file-item__icon.is-img   svg { stroke: #5bb87a; }
.file-item__body { flex: 1; min-width: 0; }
.file-item__name {
    font-size: 13px; font-weight: 500; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-item__meta { font-size: 11.5px; color: var(--ink-mute); margin-top: 1px; }
.file-item__bar {
    height: 3px; border-radius: var(--r-pill);
    background: var(--surface-4); overflow: hidden;
    margin-top: 6px;
}
.file-item__bar > i {
    display: block; height: 100%;
    background: var(--brand); border-radius: inherit;
    transition: width .3s ease;
}
.file-item__remove {
    width: 28px; height: 28px; flex-shrink: 0; border-radius: var(--r-xs);
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-mute); transition: background var(--t-fast), color var(--t-fast);
}
.file-item__remove:hover { background: var(--err-soft); color: var(--err); }
.file-item__remove svg { width: 15px; height: 15px; stroke: currentColor; }

/* Barra de progresso */
.progress {
    height: 7px; background: var(--surface-4);
    border-radius: var(--r-pill); overflow: hidden;
}
.progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-hi));
    border-radius: var(--r-pill);
    transition: width var(--t-slow);
}
.progress--lg { height: 11px; }
/* =====================================================================
   COMPONENTES — Cards
   ===================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
}
.card--pad     { padding: var(--sp-4); }
.card--pad-lg  { padding: var(--sp-5); }
.card--hover   { transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); }
.card--hover:hover {
    border-color: var(--line-2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.card--glow { border-color: var(--brand-line); box-shadow: var(--shadow-glow); }

.card__header {
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.card__header h3, .card__header h4 { margin: 0; }
.card__body   { padding: var(--sp-5); }
.card__footer {
    padding: var(--sp-3) var(--sp-5);
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    display: flex; align-items: center; gap: var(--sp-2);
}

/* Cabeçalho de seção dentro de card */
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-3); margin-bottom: var(--sp-4);
}
.section-head h3, .section-head h4 { margin: 0; }

/* Cabeçalho de página */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap;
}
.page-head h2 { margin: 0 0 3px; }
.page-head p { font-size: 13.5px; color: var(--ink-mute); }

/* =====================================================================
   COMPONENTES — Métricas / stat cards
   ===================================================================== */
.metric { display: flex; gap: var(--sp-3); align-items: flex-start; }
.metric__icon {
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: var(--r-sm);
    background: var(--surface-3);
    display: flex; align-items: center; justify-content: center;
}
.metric__icon svg { width: 21px; height: 21px; stroke: var(--ink-soft); }
.metric--accent .metric__icon { background: var(--brand-soft); }
.metric--accent .metric__icon svg { stroke: var(--brand); }
.metric__label { font-size: 12px; color: var(--ink-mute); font-weight: 500; }
.metric__value {
    font-family: var(--font-serif); font-size: 28px; font-weight: 600;
    color: var(--ink); line-height: 1.1; margin: 2px 0;
}
.metric__sub { font-size: 12px; color: var(--ink-mute); }
.metric__trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; }
.metric__trend.is-up   { color: var(--ok); }
.metric__trend.is-down { color: var(--err); }

.metric-grid {
    display: grid; gap: var(--sp-4);
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* =====================================================================
   COMPONENTES — Tabelas
   ===================================================================== */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
}
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
    text-align: left; font-weight: 600; font-size: 11.5px;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--ink-mute);
    padding: 12px var(--sp-4);
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table tbody td {
    padding: 13px var(--sp-4);
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink-soft);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody td strong, .table tbody td b { color: var(--ink); font-weight: 600; }
.table--compact thead th { padding: 8px var(--sp-3); }
.table--compact tbody td { padding: 8px var(--sp-3); }
.table .col-actions { text-align: right; white-space: nowrap; }
.table-wrap .table { min-width: 540px; }

/* Linha selecionável */
.table--selectable tbody tr { cursor: pointer; }
.table tbody tr.is-selected { background: var(--brand-soft-2); }

/* =====================================================================
   COMPONENTES — Paginação
   ===================================================================== */
.pagination {
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 8px;
    font-size: 13px; font-weight: 600;
    border-radius: var(--r-xs);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.pagination a:hover {
    background: var(--surface-3); color: var(--ink); border-color: var(--line-2);
}
.pagination .is-active {
    background: var(--brand); border-color: var(--brand);
    color: var(--brand-ink); cursor: default;
}
.pagination .is-disabled {
    opacity: .4; cursor: not-allowed; pointer-events: none;
}
.pagination .pagination__gap { border: none; background: none; color: var(--ink-faint); }
.pagination svg { width: 15px; height: 15px; stroke: currentColor; }

/* Resumo de paginação */
.pagination-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-4);
}
.pagination-bar__info { font-size: 12.5px; color: var(--ink-mute); }

/* =====================================================================
   COMPONENTES — Tabs
   ===================================================================== */
.tabs {
    display: flex; gap: 2px;
    border-bottom: 1px solid var(--line);
    margin-bottom: var(--sp-5);
}
.tabs a, .tabs button {
    padding: 10px var(--sp-4);
    font-size: 13.5px; font-weight: 600;
    color: var(--ink-mute);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--t-fast), border-color var(--t-fast);
    white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs a.is-active, .tabs button.is-active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

/* Tabs estilo "pílula" */
.tabs-pill {
    display: inline-flex; gap: 3px; padding: 3px;
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--r-sm);
}
.tabs-pill a, .tabs-pill button {
    padding: 7px 14px; font-size: 13px; font-weight: 600;
    border-radius: var(--r-xs); color: var(--ink-mute);
    transition: background var(--t-fast), color var(--t-fast);
}
.tabs-pill a:hover, .tabs-pill button:hover { color: var(--ink); }
.tabs-pill a.is-active, .tabs-pill button.is-active {
    background: var(--surface-4); color: var(--ink);
}

/* =====================================================================
   COMPONENTES — Modal
   ===================================================================== */
.modal-overlay {
    position: fixed; inset: 0; z-index: var(--z-modal);
    background: rgba(8,8,10,.72);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: var(--sp-4);
    opacity: 0; visibility: hidden;
    transition: opacity var(--t-norm), visibility var(--t-norm);
}
.modal-overlay.is-open { opacity: 1; visibility: visible; }
.modal {
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 460px;
    max-height: 90vh; overflow-y: auto;
    transform: translateY(12px) scale(.98);
    transition: transform var(--t-norm);
}
.modal-overlay.is-open .modal { transform: translateY(0) scale(1); }
.modal--sm { max-width: 360px; }
.modal--lg { max-width: 680px; }
.modal__header {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--line);
}
.modal__header h3 { margin: 0; }
.modal__close {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-soft);
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    transition: background var(--t-fast), color var(--t-fast),
                border-color var(--t-fast), transform var(--t-fast);
}
.modal__close:hover {
    background: var(--err-soft);
    color: var(--err);
    border-color: var(--err-line);
}
.modal__close:active { transform: scale(.92); }
.modal__close svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2.4; }
.modal__body { padding: var(--sp-5); }
.modal__body p { font-size: 13.5px; }
.modal__footer {
    display: flex; gap: var(--sp-2); justify-content: flex-end;
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--line);
    background: var(--surface-2);
}

/* =====================================================================
   COMPONENTES — Dropdown / menu
   ===================================================================== */
.dropdown { position: relative; display: inline-block; }
.dropdown__menu {
    position: absolute; right: 0; top: calc(100% + 6px);
    z-index: var(--z-dropdown);
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
}
.dropdown.is-open .dropdown__menu,
.dropdown__menu.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown__menu a, .dropdown__item {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; border-radius: var(--r-xs);
    font-size: 13px; color: var(--ink-soft);
    transition: background var(--t-fast), color var(--t-fast);
    width: 100%; text-align: left;
}
.dropdown__menu a:hover, .dropdown__item:hover {
    background: var(--surface-3); color: var(--ink);
}
.dropdown__menu a svg, .dropdown__item svg { width: 15px; height: 15px; stroke: currentColor; }
.dropdown__sep { height: 1px; background: var(--line); margin: 5px 0; }
.dropdown__label {
    padding: 6px 10px 4px; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint);
}

/* =====================================================================
   COMPONENTES — Tooltip
   ===================================================================== */
.tooltip { position: relative; display: inline-flex; }
.tooltip__bubble {
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--surface-4);
    color: var(--ink);
    font-size: 11.5px; font-weight: 500;
    padding: 5px 9px; border-radius: var(--r-xs);
    white-space: nowrap;
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
    z-index: var(--z-dropdown);
}
.tooltip:hover .tooltip__bubble {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
/* =====================================================================
   COMPONENTES — Toast / notificações
   ===================================================================== */
.toast-stack {
    position: fixed; top: 18px; right: 18px; z-index: var(--z-toast);
    display: flex; flex-direction: column; gap: var(--sp-2);
    max-width: 360px;
}
.toast {
    display: flex; align-items: flex-start; gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-left-width: 3px;
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-lg);
    font-size: 13px; color: var(--ink-soft);
    animation: toast-in var(--t-norm) cubic-bezier(.2,.8,.2,1);
}
.toast.is-leaving { animation: toast-out var(--t-norm) forwards; }
@keyframes toast-in  { from { opacity:0; transform: translateX(40px); } }
@keyframes toast-out { to   { opacity:0; transform: translateX(40px); } }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; stroke: currentColor; }
.toast strong { color: var(--ink); display: block; font-size: 13.5px; }
.toast--success { border-left-color: var(--ok);   color: var(--ok); }
.toast--error   { border-left-color: var(--err);  color: var(--err); }
.toast--warn    { border-left-color: var(--warn); color: var(--warn); }
.toast--info    { border-left-color: var(--info); color: var(--info); }
.toast__body { flex: 1; }
.toast__body p { color: var(--ink-soft); margin: 0; }

/* =====================================================================
   COMPONENTES — Estado vazio
   ===================================================================== */
.empty {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: var(--sp-7) var(--sp-5);
    gap: var(--sp-2);
}
.empty__icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: var(--sp-2);
}
.empty__icon svg { width: 28px; height: 28px; stroke: var(--ink-faint); }
.empty h3, .empty h4 { margin: 0; }
.empty p { font-size: 13px; color: var(--ink-mute); max-width: 380px; }

/* =====================================================================
   COMPONENTES — Skeleton (carregando)
   ===================================================================== */
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.4s infinite;
    border-radius: var(--r-xs);
}
@keyframes skeleton { to { background-position: -200% 0; } }
.skeleton--text { height: 12px; margin: 6px 0; }
.skeleton--title { height: 22px; width: 50%; }
.skeleton--circle { border-radius: 50%; }

/* Spinner */
.spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--surface-4);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
.spinner--lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   COMPONENTES — Stepper (passos)
   ===================================================================== */
.stepper { display: flex; align-items: center; gap: 0; }
.stepper__step { display: flex; align-items: center; gap: 9px; }
.stepper__num {
    width: 28px; height: 28px; flex-shrink: 0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 700;
    background: var(--surface-3); color: var(--ink-mute);
    border: 1px solid var(--line-2);
    transition: background var(--t-norm), color var(--t-norm), border-color var(--t-norm);
}
.stepper__label { font-size: 13px; font-weight: 600; color: var(--ink-mute); white-space: nowrap; }
.stepper__line {
    flex: 1; height: 1px; min-width: 24px;
    background: var(--line-2); margin: 0 12px;
}
.stepper__step.is-active .stepper__num {
    background: var(--brand); color: var(--brand-ink); border-color: var(--brand);
}
.stepper__step.is-active .stepper__label { color: var(--ink); }
.stepper__step.is-done .stepper__num {
    background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line);
}
.stepper__step.is-done .stepper__label { color: var(--ink-soft); }

/* =====================================================================
   COMPONENTES — Lista de definição
   ===================================================================== */
.deflist { display: grid; grid-template-columns: max-content 1fr; gap: 10px var(--sp-5); }
.deflist dt { font-size: 12.5px; color: var(--ink-mute); font-weight: 500; }
.deflist dd { font-size: 13.5px; color: var(--ink); }
@media (max-width: 480px) {
    .deflist { grid-template-columns: 1fr; gap: 2px var(--sp-3); }
    .deflist dd { margin-bottom: 8px; }
}

/* =====================================================================
   COMPONENTES — Accordion
   ===================================================================== */
.accordion { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.accordion__item { border-bottom: 1px solid var(--line); }
.accordion__item:last-child { border-bottom: none; }
.accordion__head {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-3); width: 100%;
    padding: var(--sp-3) var(--sp-4);
    font-size: 13.5px; font-weight: 600; color: var(--ink);
    background: var(--surface);
    transition: background var(--t-fast);
}
.accordion__head:hover { background: var(--surface-2); }
.accordion__head svg {
    width: 17px; height: 17px; stroke: var(--ink-mute);
    transition: transform var(--t-norm);
}
.accordion__item.is-open .accordion__head svg { transform: rotate(180deg); }
.accordion__body {
    display: none;
    padding: 0 var(--sp-4) var(--sp-4);
    font-size: 13px; color: var(--ink-soft);
}
.accordion__item.is-open .accordion__body { display: block; }

/* =====================================================================
   COMPONENTES — Breadcrumb
   ===================================================================== */
.breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--ink-mute);
}
.breadcrumb a { color: var(--ink-mute); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb__sep { color: var(--ink-faint); }
.breadcrumb__current { color: var(--ink); font-weight: 600; }

/* =====================================================================
   COMPONENTES — Notice banner
   ===================================================================== */
.notice-banner {
    display: flex; align-items: center; gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--brand-soft-2);
    border: 1px solid var(--brand-line);
    border-radius: var(--r-md);
    font-size: 13px; color: var(--ink-soft);
}
.notice-banner svg { width: 18px; height: 18px; flex-shrink: 0; stroke: var(--brand); }
.notice-banner a { font-weight: 600; }

/* =====================================================================
   COMPONENTES — Divisor com rótulo
   ===================================================================== */
.divider-text {
    display: flex; align-items: center; gap: var(--sp-3);
    color: var(--ink-faint); font-size: 11.5px;
    text-transform: uppercase; letter-spacing: .06em;
    margin: var(--sp-4) 0;
}
.divider-text::before, .divider-text::after {
    content: ''; flex: 1; height: 1px; background: var(--line);
}

/* =====================================================================
   COMPONENTES — Chip removível
   ===================================================================== */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 6px 4px 11px;
    background: var(--surface-3);
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    font-size: 12.5px; color: var(--ink-soft);
}
.chip button {
    width: 17px; height: 17px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-mute); transition: background var(--t-fast), color var(--t-fast);
}
.chip button:hover { background: var(--err-soft); color: var(--err); }
.chip button svg { width: 11px; height: 11px; stroke: currentColor; }

/* =====================================================================
   5. UTILITÁRIOS
   ===================================================================== */
.flex      { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col  { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.flex-1 { flex: 1; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }

.grid    { display: grid; }
.grid-2  { grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
.grid-3  { grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.grid-4  { grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
@media (max-width: 900px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.hidden { display: none !important; }
.w-full { width: 100%; }
.relative { position: relative; }

.mt-0 { margin-top: 0; }      .mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mb-0 { margin-bottom: 0; }   .mb-1 { margin-bottom: var(--sp-1); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }

/* Animação de entrada com atraso escalonado */
.fade-in { animation: fade-in var(--t-slow) both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }
.stagger > * { animation: fade-in var(--t-slow) both; }
.stagger > *:nth-child(1) { animation-delay: .03s; }
.stagger > *:nth-child(2) { animation-delay: .08s; }
.stagger > *:nth-child(3) { animation-delay: .13s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .23s; }
.stagger > *:nth-child(6) { animation-delay: .28s; }

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

/* =====================================================================
   ABAS DE CONFIGURAÇÃO (cn-tabs) — usado em conta.php
   ===================================================================== */
.cn-tabs {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    margin-bottom: var(--sp-5);
    overflow-x: auto;
    scrollbar-width: thin;
}
.cn-tabs::-webkit-scrollbar { height: 4px; }
.cn-tabs::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }

.cn-tabs__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    color: var(--ink-mute);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .03em;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
    white-space: nowrap;
    font-family: inherit;
    flex-shrink: 0;
}
.cn-tabs__btn svg { flex-shrink: 0; opacity: .85; }
.cn-tabs__btn:hover {
    background: rgba(255,255,255,.03);
    color: var(--ink);
}
.cn-tabs__btn.is-active {
    background: var(--brand-soft);
    color: var(--brand);
    box-shadow: inset 0 0 0 1px var(--brand-line);
}
.cn-tabs__btn.is-active svg { opacity: 1; }

/* Aba e botão de "perigo" — vermelho */
.cn-tabs__btn--danger.is-active {
    background: var(--err-soft);
    color: var(--err);
    box-shadow: inset 0 0 0 1px var(--err-line);
}
.cn-tabs__btn--danger:hover { color: var(--err); }

/* Painéis das abas */
.cn-tab-panel { display: none; }
.cn-tab-panel.is-active {
    display: block;
    animation: cnFadeInUp .28s cubic-bezier(.16,1,.3,1);
}
@keyframes cnFadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Card de seção destrutiva — borda e cabeçalho em vermelho */
.card--danger {
    border-color: var(--err-line);
}
.card--danger .section-head {
    border-bottom-color: var(--err-line);
}

/* =====================================================================
   CARD DE SEÇÃO (conta-secao) — cabeçalho com ícone, título e subtítulo
   ===================================================================== */
.conta-secao {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.conta-secao__head {
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}
.conta-secao__icone {
    width: 38px; height: 38px;
    border-radius: var(--r-sm);
    background: var(--brand-soft);
    color: var(--brand);
    display: grid; place-content: center;
    flex: 0 0 38px;
}
.conta-secao__icone svg {
    width: 19px; height: 19px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.conta-secao__icone--danger { background: var(--err-soft); color: var(--err); }
.conta-secao__info { min-width: 0; }
.conta-secao__info h3 {
    margin: 0 0 2px;
    font-size: 15px; font-weight: 600;
}
.conta-secao__info p {
    margin: 0;
    font-size: 13px; color: var(--ink-mute);
}
.conta-secao__body { padding: var(--sp-5); }
.conta-secao__status { margin-left: auto; flex: 0 0 auto; }

/* Card de seção destrutiva */
.conta-secao.zone-danger { border-color: var(--err-line); }
.conta-secao.zone-danger .conta-secao__head { border-bottom-color: var(--err-line); }

/* Chip de status (ativo / inativo) */
.status-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    font-size: 12px; font-weight: 600;
    border-radius: 100px;
}
.status-chip::before {
    content: ''; width: 6px; height: 6px;
    border-radius: 50%; background: currentColor;
}
.status-chip--ativo   { background: var(--ok-soft, rgba(110,190,130,.14)); color: var(--ok, #6ebe82); }
.status-chip--inativo { background: var(--surface-3); color: var(--ink-mute); }

/* Grade de formulário em 2 colunas */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3) var(--sp-4);
}
.form-grid__full { grid-column: 1 / -1; }
@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
}

/* Setup do 2FA: QR à esquerda, instruções à direita */
.mfa-setup {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--sp-5);
    align-items: start;
}
@media (max-width: 640px) { .mfa-setup { grid-template-columns: 1fr; } }
.mfa-qr {
    width: 240px; height: 240px;
    background: #fff;
    padding: 12px;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    line-height: 0;
}
.mfa-qr svg, .mfa-qr canvas, .mfa-qr img {
    display: block; width: 216px; height: 216px;
}
/* A regra global "svg { fill: none }" apagaria os módulos do QR.
   Aqui restauramos: cada <rect> usa o fill do seu atributo próprio
   ou herdado do <g>, em vez de "none". */
.mfa-qr svg,
.mfa-qr svg g,
.mfa-qr svg rect {
    fill: inherit;
}
.mfa-qr svg > rect:first-child { fill: #ffffff; }
.mfa-qr svg > g { fill: #000000; }
.mfa-instrucoes ol {
    margin: 0 0 var(--sp-4);
    padding-left: 20px;
    font-size: 14px; color: var(--ink-soft);
    line-height: 1.7;
}
.mfa-instrucoes ol li { margin-bottom: 6px; }
.mfa-segredo {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
}
.mfa-confirma-row {
    display: flex; gap: var(--sp-2); flex-wrap: wrap;
}
.mfa-input {
    max-width: 200px;
    font-family: var(--font-mono);
    letter-spacing: .35em; text-align: center; font-size: 16px;
}
.backup-codes { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.backup-codes code {
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--r-sm); padding: 8px 12px;
    font-family: var(--font-mono); font-size: 14px;
    text-align: center; letter-spacing: .05em;
}
.secret-key {
    display: inline-block;
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--r-sm); padding: 8px 12px;
    font-family: var(--font-mono); font-size: 14px; letter-spacing: .04em;
}

/* Mobile: abas mais compactas, esconde o texto exceto na ativa */
@media (max-width: 640px) {
    .cn-tabs { padding: 4px; gap: 2px; }
    .cn-tabs__btn { padding: 9px 11px; font-size: 11.5px; }
    .cn-tabs__btn span { display: none; }
    .cn-tabs__btn svg { width: 18px; height: 18px; }
    .cn-tabs__btn.is-active span { display: inline; }
}

/* Campo com erro de validação (destaque após toast de erro) */
.input--erro,
.input--erro:focus {
    border-color: var(--err) !important;
    box-shadow: 0 0 0 3px var(--err-soft) !important;
}

/* Mensagem de erro do QR (quando o desenho falha) */
.qr-erro {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--err-soft);
    border: 1px solid var(--err-line);
    border-radius: var(--r-sm);
    color: var(--err);
    font-size: 12px;
    text-align: center;
}

/* =====================================================================
   SELEÇÃO DE CLIENTE (autocomplete)
   ===================================================================== */
.cliente-select { position: relative; }
.cliente-select__lista {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    z-index: 30;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
}
.cliente-select__item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    padding: 9px 11px;
    cursor: pointer;
    transition: background .12s ease;
}
.cliente-select__item:hover,
.cliente-select__item.is-ativo {
    background: var(--brand-soft);
}
.cliente-select__nome {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}
.cliente-select__meta {
    display: flex;
    gap: 14px;
    margin-top: 2px;
    font-size: 12px;
    color: var(--ink-mute);
}
.cliente-select__vazio {
    padding: 12px;
    font-size: 13px;
    color: var(--ink-mute);
    text-align: center;
}
