/* ============================================================
   Gestão EADPlay — Design System
   Paleta oficial EADPlay (laranja #e7511c + grafite), logo em
   assets/img/eadplay-logo-p.png. Sidebar clara, cards 16px,
   tipografia Manrope. Dark mode via [data-theme="dark"].
   ============================================================ */

:root {
    /* Marca */
    --brand-50:  #fff4ee;
    --brand-100: #ffe4d6;
    --brand-200: #ffc6ab;
    --brand-300: #ffa078;
    --brand-400: #f87a46;
    --brand-500: #e7511c;   /* laranja oficial EADPlay */
    --brand-600: #c9410f;
    --brand-700: #a3350d;
    --brand-800: #7f2b0e;
    --brand-900: #5e2210;

    /* Acento (dinheiro / destaque) */
    --accent-400: #fbbf24;
    --accent-500: #f59e0b;
    --accent-600: #d97706;

    /* Semânticas */
    --success-500: #16a34a; --success-600: #15803d; --success-bg: #ecfdf3; --success-fg: #166534;
    --warning-500: #f59e0b; --warning-600: #d97706; --warning-bg: #fffbeb; --warning-fg: #92400e;
    --orange-500:  #f97316; --orange-600:  #ea580c; --orange-bg:  #fff7ed; --orange-fg:  #9a3412;
    --danger-500:  #ef4444; --danger-600:  #dc2626; --danger-bg:  #fef2f2; --danger-fg:  #991b1b;
    --info-500:    #0ea5e9; --info-600:    #0284c7; --info-bg:    #f0f9ff; --info-fg:    #075985;
    --muted-bg:    #f1f5f9; --muted-fg:    #475569;

    /* Neutros / superfícies */
    --bg:            #f4f6f8;
    --surface:       #ffffff;
    --surface-2:     #f8fafc;
    --surface-3:     #eef2f6;
    --border:        #e5e9ef;
    --border-strong: #cbd5e1;
    --text:          #0f172a;
    --text-2:        #475569;
    --text-3:        #94a3b8;
    --sidebar-bg:    #ffffff;
    --sidebar-border:#e5e9ef;
    --topbar-bg:     rgba(244,246,248,.85);

    /* Tipografia */
    --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --fs-xs: 11.5px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 26px; --fs-3xl: 32px;

    /* Geometria */
    --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-full: 999px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
    --shadow-md: 0 6px 20px -8px rgba(15,23,42,.12), 0 2px 6px rgba(15,23,42,.04);
    --shadow-lg: 0 24px 48px -16px rgba(15,23,42,.22);
    --sidebar-w: 256px;
    --topbar-h: 64px;
    --ease: cubic-bezier(.2,.8,.2,1);
}

[data-theme="dark"] {
    --bg:            #0c1116;
    --surface:       #131a21;
    --surface-2:     #18212a;
    --surface-3:     #1f2a35;
    --border:        #1f2a35;
    --border-strong: #334155;
    --text:          #e6edf3;
    --text-2:        #a3b1c2;
    --text-3:        #64748b;
    --sidebar-bg:    #0f161c;
    --sidebar-border:#1a2430;
    --topbar-bg:     rgba(12,17,22,.8);
    --success-bg: rgba(22,163,74,.14); --success-fg: #86efac;
    --warning-bg: rgba(245,158,11,.14); --warning-fg: #fcd34d;
    --orange-bg:  rgba(249,115,22,.14); --orange-fg:  #fdba74;
    --danger-bg:  rgba(239,68,68,.14);  --danger-fg:  #fca5a5;
    --info-bg:    rgba(14,165,233,.14); --info-fg:    #7dd3fc;
    --muted-bg:   #1f2a35; --muted-fg: #a3b1c2;
    --brand-50: rgba(231,81,28,.14); --brand-100: rgba(231,81,28,.24);
    --shadow-md: 0 6px 20px -8px rgba(0,0,0,.5);
    --shadow-lg: 0 24px 48px -16px rgba(0,0,0,.6);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font-family: var(--font); font-size: var(--fs-md); line-height: 1.5;
    -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
p { margin: 0 0 .75em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, .mono { font-family: var(--mono); font-size: .92em; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-200); color: var(--brand-900); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ── Layout ────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 60;
    background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border);
    display: flex; flex-direction: column; transition: transform .3s var(--ease);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 14px; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
    background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden;
    color: var(--brand-600); font-weight: 900; font-size: 20px;
}
.brand-mark img { width: 72%; height: 72%; object-fit: contain; display: block; }
.brand-mark.on-dark { border-color: transparent; box-shadow: 0 6px 16px -6px rgba(0,0,0,.45); }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-text { line-height: 1.1; }
.brand-text strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.brand-text span { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-nav { padding: 6px 12px 16px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 16px 10px 6px; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0; border-radius: 10px;
    color: var(--text-2); font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; color: var(--text-3); transition: color .15s; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item:hover i { color: var(--brand-600); }
.nav-item.active { background: var(--brand-50); color: var(--brand-700); }
.nav-item.active i { color: var(--brand-600); }
.nav-item .nav-pill { margin-left: auto; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--danger-bg); color: var(--danger-fg); }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--sidebar-border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.user-chip:hover { background: var(--surface-3); }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-100); color: var(--brand-800); font-weight: 800; font-size: 12px; flex-shrink: 0; }
.user-chip .u-name { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.15; }
.user-chip .u-mail { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .25s; }
body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
    display: flex; align-items: center; gap: 14px; padding: 0 28px;
    background: var(--topbar-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title h1 { font-size: var(--fs-xl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .t-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--brand-600); font-size: 14px; flex-shrink: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: grid; place-items: center; transition: all .15s; }
.icon-btn:hover { color: var(--brand-600); border-color: var(--brand-300); }

.content { padding: 22px 28px 60px; max-width: 1440px; width: 100%; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-3); margin-bottom: 18px; flex-wrap: wrap; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--brand-600); }
.crumbs i { font-size: 10px; }
.crumbs .cur { color: var(--text-2); font-weight: 600; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: var(--fs-2xl); }
.page-head p { color: var(--text-2); margin: 4px 0 0; font-size: var(--fs-sm); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Cards ─────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card + .card, .card-stack > * + * { margin-top: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: var(--fs-lg); font-weight: 800; }
.card-head p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.card-head .spacer { flex: 1; }
.card-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; background: var(--brand-50); color: var(--brand-600); }
.card-icon.success { background: var(--success-bg); color: var(--success-600); }
.card-icon.warning { background: var(--warning-bg); color: var(--warning-600); }
.card-icon.danger  { background: var(--danger-bg);  color: var(--danger-600); }
.card-icon.info    { background: var(--info-bg);    color: var(--info-600); }
.card-icon.accent  { background: #fff7e6; color: var(--accent-600); }
.card-icon.muted   { background: var(--muted-bg);   color: var(--muted-fg); }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }

/* KPIs */
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--kpi-glow, var(--brand-50)); opacity: .7; }
.kpi > * { position: relative; }
.kpi .k-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 16px; background: var(--brand-50); color: var(--brand-600); flex-shrink: 0; }
.kpi.success { --kpi-glow: var(--success-bg); } .kpi.success .k-icon { background: var(--success-bg); color: var(--success-600); }
.kpi.warning { --kpi-glow: var(--warning-bg); } .kpi.warning .k-icon { background: var(--warning-bg); color: var(--warning-600); }
.kpi.danger  { --kpi-glow: var(--danger-bg); }  .kpi.danger  .k-icon { background: var(--danger-bg);  color: var(--danger-600); }
.kpi.info    { --kpi-glow: var(--info-bg); }    .kpi.info    .k-icon { background: var(--info-bg);    color: var(--info-600); }
.kpi.accent  { --kpi-glow: #fff3d6; }           .kpi.accent  .k-icon { background: #fff3d6; color: var(--accent-600); }
.kpi .k-label { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.kpi .k-value { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }

/* ── Botões ────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
    padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: var(--fs-sm);
    transition: all .15s var(--ease); text-decoration: none; line-height: 1.2;
}
.btn:disabled, .btn.loading { opacity: .6; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: 0 4px 10px -4px rgba(201,65,15,.5); }
.btn-primary:hover { background: var(--brand-700); color: #fff; transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--brand-400); color: var(--brand-700); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger-600); border-color: transparent; }
.btn-danger:hover { background: var(--danger-500); color: #fff; }
.btn-success { background: var(--success-500); color: #fff; }
.btn-success:hover { background: var(--success-600); color: #fff; }
.btn-warning { background: var(--warning-bg); color: var(--warning-fg); }
.btn-warning:hover { background: var(--warning-500); color: #fff; }
.btn-accent { background: linear-gradient(135deg, var(--accent-500), var(--accent-600)); color: #fff; box-shadow: 0 6px 14px -6px rgba(217,119,6,.6); }
.btn-accent:hover { color: #fff; transform: translateY(-1px); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: var(--fs-lg); border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 9px; }
.btn .fa-spinner { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Badges / status ───────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .01em; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.no-dot::before { display: none; }
.badge-success { background: var(--success-bg); color: var(--success-fg); }
.badge-warning { background: var(--warning-bg); color: var(--warning-fg); }
.badge-orange  { background: var(--orange-bg);  color: var(--orange-fg); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-fg); }
.badge-info    { background: var(--info-bg);    color: var(--info-fg); }
.badge-muted   { background: var(--muted-bg);   color: var(--muted-fg); }
.badge-brand   { background: var(--brand-50);   color: var(--brand-700); }
.badge-lg { padding: 6px 14px; font-size: 13px; }

/* ── Tabelas ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table th, .table td { padding: 12px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.table th { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); background: var(--surface-2); white-space: nowrap; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .t-main { font-weight: 700; color: var(--text); }
.table .t-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.table .t-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table a.row-link { color: var(--text); font-weight: 700; }
.table a.row-link:hover { color: var(--brand-600); }
.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.money.strike { text-decoration: line-through; color: var(--text-3); font-weight: 500; }

/* ── Formulários ───────────────────────────────────────────── */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-9 { grid-column: span 9; } .col-2 { grid-column: span 2; }
.field label, .form-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.field label .req { color: var(--danger-500); }
.input, .select, .textarea {
    width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface);
    color: var(--text); font-size: var(--fs-md); transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-100); }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.input.mono { font-family: var(--mono); font-size: 13px; }
.textarea { min-height: 90px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input-group { display: flex; }
.input-group .input { border-radius: 10px 0 0 10px; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 10px 10px 0; background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); font-weight: 700; }
.input-group .btn { border-radius: 0 10px 10px 0; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.field .err { font-size: 12px; color: var(--danger-600); margin-top: 5px; display: none; }
.field.has-error .input, .field.has-error .select { border-color: var(--danger-500); }
.field.has-error .err { display: block; }
.check { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand-600); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .2s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .track { background: var(--brand-600); }
.switch input:checked + .track::after { transform: translateX(18px); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.radio-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.radio-card { position: relative; border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: all .15s; font-size: var(--fs-sm); }
.radio-card input { position: absolute; opacity: 0; }
.radio-card strong { display: block; font-size: 13px; }
.radio-card span { color: var(--text-3); font-size: 12px; }
.radio-card:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); }

/* ── Alertas / toasts ──────────────────────────────────────── */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; font-size: var(--fs-sm); border: 1px solid transparent; margin-bottom: 16px; }
.alert i { margin-top: 2px; }
.alert-success { background: var(--success-bg); color: var(--success-fg); border-color: rgba(22,163,74,.2); }
.alert-warning { background: var(--warning-bg); color: var(--warning-fg); border-color: rgba(245,158,11,.25); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger-fg);  border-color: rgba(239,68,68,.2); }
.alert-info    { background: var(--info-bg);    color: var(--info-fg);    border-color: rgba(14,165,233,.2); }
.alert-muted   { background: var(--muted-bg);   color: var(--muted-fg); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--text); color: #fff; box-shadow: var(--shadow-lg); font-size: var(--fs-sm); animation: toastIn .3s var(--ease); }
[data-theme="dark"] .toast { background: #e6edf3; color: #0c1116; }
.toast.success i { color: #4ade80; } .toast.danger i { color: #f87171; } .toast.warning i { color: #fbbf24; } .toast.info i { color: #38bdf8; }
.toast .t-close { margin-left: auto; opacity: .6; background: none; border: 0; color: inherit; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(15,23,42,.5); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; animation: fadeIn .2s; }
.modal { background: var(--surface); border-radius: var(--r-xl); width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); animation: modalIn .25s var(--ease); }
.modal.modal-lg { max-width: 760px; }
.modal.modal-sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { font-size: var(--fs-lg); }
.modal-head p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.modal-close { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 0; background: var(--surface-3); color: var(--text-2); }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; padding: 6px; background: var(--surface-3); border-radius: 12px; overflow-x: auto; margin-bottom: 18px; }
.tabs a { padding: 8px 14px; border-radius: 9px; font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }

/* ── Filtros ───────────────────────────────────────────────── */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.filters .field { min-width: 160px; flex: 1; }
.filters .field.wide { flex: 2; min-width: 220px; }
.filters .field label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.filters .input, .filters .select { padding: 8px 11px; font-size: var(--fs-sm); }
.search { position: relative; }
.search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 13px; }
.search .input { padding-left: 34px; }

/* ── Diversos ──────────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty i { font-size: 34px; margin-bottom: 12px; color: var(--border-strong); }
.empty h4 { color: var(--text-2); font-size: var(--fs-lg); margin-bottom: 4px; }
.empty p { font-size: var(--fs-sm); }
.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 12px 20px; font-size: var(--fs-sm); color: var(--text-3); }
.pagination a, .pagination span.cur { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border); color: var(--text-2); font-weight: 700; }
.pagination span.cur { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.pagination a:hover { border-color: var(--brand-400); color: var(--brand-700); }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: var(--fs-sm); }
.dl dt { color: var(--text-3); font-weight: 700; }
.dl dd { margin: 0; color: var(--text); font-weight: 600; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; font-size: var(--fs-sm); }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-50); }
.timeline li::after { content: ''; position: absolute; left: 10px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .tl-time { color: var(--text-3); font-size: 12px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.muted { color: var(--text-3); } .text-2 { color: var(--text-2); } .small { font-size: var(--fs-sm); } .xs { font-size: var(--fs-xs); }
.fw-7 { font-weight: 700; } .fw-8 { font-weight: 800; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .wrap { flex-wrap: wrap; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-right { text-align: right; } .text-center { text-align: center; }
.code-block { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; overflow-x: auto; position: relative; }
.code-block .copy { position: absolute; top: 8px; right: 8px; }
.key-reveal { font-family: var(--mono); font-size: 15px; letter-spacing: .02em; word-break: break-all; padding: 14px 16px; border-radius: 12px; background: var(--brand-50); border: 1px dashed var(--brand-400); color: var(--brand-800); font-weight: 700; }
.status-hero { border-radius: var(--r-lg); padding: 22px 24px; display: flex; gap: 18px; align-items: center; border: 1px solid; }
.status-hero .sh-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.status-hero h3 { font-size: var(--fs-xl); }
.status-hero p { margin: 4px 0 0; font-size: var(--fs-sm); opacity: .9; }
.status-hero.success { background: var(--success-bg); border-color: rgba(22,163,74,.25); color: var(--success-fg); } .status-hero.success .sh-icon { background: rgba(22,163,74,.15); }
.status-hero.info    { background: var(--info-bg);    border-color: rgba(14,165,233,.25); color: var(--info-fg); }    .status-hero.info .sh-icon { background: rgba(14,165,233,.15); }
.status-hero.warning { background: var(--warning-bg); border-color: rgba(245,158,11,.3); color: var(--warning-fg); } .status-hero.warning .sh-icon { background: rgba(245,158,11,.18); }
.status-hero.orange  { background: var(--orange-bg);  border-color: rgba(249,115,22,.3); color: var(--orange-fg); }  .status-hero.orange .sh-icon { background: rgba(249,115,22,.18); }
.status-hero.danger  { background: var(--danger-bg);  border-color: rgba(239,68,68,.3); color: var(--danger-fg); }   .status-hero.danger .sh-icon { background: rgba(239,68,68,.15); }

/* Gráfico de barras (CSS puro) */
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 170px; padding-top: 10px; }
.bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar .b { background: linear-gradient(180deg, var(--brand-400), var(--brand-600)); border-radius: 8px 8px 3px 3px; min-height: 3px; transition: height .6s var(--ease); position: relative; }
.bar.cur .b { background: linear-gradient(180deg, var(--accent-400), var(--accent-600)); }
.bar .b:hover { filter: brightness(1.08); }
.bar .lbl { font-size: 10.5px; color: var(--text-3); text-align: center; margin-top: 6px; font-weight: 700; }
.bar .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.bar:hover .tip { opacity: 1; }
.bar .b.zero { background: var(--surface-3); }

.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 50; }
.dropdown.open .dropdown-menu { display: block; animation: fadeIn .15s; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; border: 0; background: none; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); color: var(--text); }
.dropdown-menu .danger { color: var(--danger-600); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

/* ── Login ─────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-side { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 20% 10%, #e7511c 0%, #a3350d 45%, #2a1410 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(255,255,255,.12)'/%3E%3C/svg%3E"); }
.auth-side > * { position: relative; }
.auth-side h2 { font-size: 34px; font-weight: 800; line-height: 1.15; max-width: 480px; margin-top: 60px; letter-spacing: -.02em; }
.auth-side p { color: rgba(255,255,255,.78); max-width: 440px; font-size: 15px; margin-top: 14px; }
.auth-feat { display: grid; gap: 14px; margin-top: 36px; }
.auth-feat div { display: flex; gap: 12px; align-items: center; font-size: 14px; color: rgba(255,255,255,.9); }
.auth-feat i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 26px; margin: 20px 0 6px; }
.auth-card .sub { color: var(--text-2); font-size: var(--fs-sm); margin-bottom: 26px; }
.auth-card .field { margin-bottom: 14px; }
.auth-foot { margin-top: 22px; font-size: 12px; color: var(--text-3); text-align: center; }

/* ── Página pública de pagamento ───────────────────────────── */
.pub { min-height: 100vh; background: linear-gradient(180deg, #8a2e0d 0, #5e2210 260px, var(--bg) 260px); padding: 32px 16px 60px; }
.pub-wrap { max-width: 640px; margin: 0 auto; }
.pub-brand { display: flex; align-items: center; gap: 12px; color: #fff; margin-bottom: 26px; }
.pub-brand .brand-mark { border-color: transparent; box-shadow: 0 6px 16px -6px rgba(0,0,0,.45); }
.pub-card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; }
.pub-head { padding: 26px 28px 18px; border-bottom: 1px solid var(--border); }
.pub-head .eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.pub-head h1 { font-size: 24px; margin-top: 6px; }
.pub-amount { font-size: 40px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pub-body { padding: 22px 28px; }
.pub-foot { padding: 18px 28px 26px; background: var(--surface-2); font-size: 12.5px; color: var(--text-3); }
.pay-methods { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pay-methods span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: var(--surface-3); font-size: 12px; font-weight: 700; color: var(--text-2); }

/* ── Responsivo ────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar { transform: none; }
    .main { margin-left: 0; }
    .menu-toggle { display: grid; place-items: center; }
    .content, .topbar { padding-left: 18px; padding-right: 18px; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}
@media (max-width: 680px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .col-8, .col-6, .col-4, .col-3, .col-9, .col-2 { grid-column: span 12; }
    .page-head h2 { font-size: 22px; }
    .kpi .k-value { font-size: 22px; }
    .dl { grid-template-columns: 1fr; gap: 2px 0; } .dl dt { margin-top: 10px; }
    .topbar-title h1 { font-size: 16px; }
    .bars { gap: 4px; height: 130px; }
    .bar .lbl { font-size: 9px; }
    .table th, .table td { padding: 10px 12px; }
    .modal-body, .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
    .pub-head, .pub-body, .pub-foot { padding-left: 18px; padding-right: 18px; }
    .pub-amount { font-size: 32px; }
    .filters { padding: 12px 14px; }
    .toasts { left: 16px; right: 16px; max-width: none; }
}
@media print {
    .sidebar, .topbar, .btn, .no-print { display: none !important; }
    .main { margin: 0; }
}

/* ── Switch dentro de .field (a regra .field label força display:block) ── */
.field label.switch, .field .switch { display: inline-flex; align-items: center; margin-bottom: 0; min-height: 40px; font-weight: 600; line-height: 1.3; }
.field > .switch:only-child { margin-top: 0; }
/* Lista de toggles em cartões (ex.: e-mails do checkout) */
.switch-list { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.switch-list .switch { display: flex; align-items: center; width: 100%; min-height: 54px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); transition: border-color .15s, background .15s; }
.switch-list .switch:hover { border-color: var(--border-strong); }
.switch-list .switch:has(input:checked) { border-color: var(--brand-300); background: var(--brand-50); }
.switch-list .switch .lbl { display: block; font-weight: 600; color: var(--text); }
.switch-list .switch .sub { display: block; font-size: 12px; font-weight: 500; color: var(--text-3); margin-top: 2px; }
.switch-list .switch .track { margin-right: 2px; }
