/* ═══════════════════════════════════════════════════════════════════
   PLATTO UI — Design System único da plataforma
   Tema: Dark Premium · Índigo/Violeta
   Substitui: style.css, dashboard.css, design-system.css,
              admin-enhancements.css, global-enhancements.css,
              layout-improvements.css, ux-states.css, sidebar.css
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tokens ────────────────────────────────────────────────────────── */
:root {
    /* Superfícies */
    --bg:         #08090F;
    --surface:    #0F1119;
    --surface-2:  #151826;
    --surface-3:  #1B1F30;
    --border:     rgba(148,163,184,.09);
    --border-2:   rgba(148,163,184,.18);

    /* Marca */
    --primary:    #6366F1;
    --primary-2:  #8B5CF6;
    --primary-soft: rgba(99,102,241,.13);
    --primary-glow: rgba(99,102,241,.35);
    --grad: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);

    /* Texto */
    --text:       #E9EAF2;
    --text-2:     #A7ACC4;
    --muted:      #6B7194;

    /* Estados */
    --success:    #34D399;
    --warning:    #FBBF24;
    --danger:     #F87171;
    --info:       #60A5FA;
    --success-soft: rgba(52,211,153,.12);
    --warning-soft: rgba(251,191,36,.12);
    --danger-soft:  rgba(248,113,113,.12);
    --info-soft:    rgba(96,165,250,.12);

    /* Geometria */
    --radius-sm:  10px;
    --radius:     14px;
    --radius-lg:  20px;
    --radius-xl:  26px;

    /* Sombra */
    --shadow-1: 0 2px 10px rgba(0,0,0,.35);
    --shadow-2: 0 10px 34px rgba(0,0,0,.45);
    --shadow-glow: 0 8px 26px var(--primary-glow);

    /* Tipografia */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Sora', var(--font);

    /* Compat: variáveis usadas por JS/páginas legadas */
    --primary-color: #6366F1;
    --gray: #6B7194;
    --dark: #E9EAF2;
    --text-muted: #6B7194;
    --violet: #8B5CF6;
    --orange: #6366F1;   /* páginas antigas que usavam laranja herdam índigo */
    --orange2: #8B5CF6;
    --light: #151826;
    --primary-dark: #4F52D9;
    --success-color: #34D399;
    --danger-color: #F87171;
    --error-color: #F87171;
    --info-color: #60A5FA;
    --card: #0F1119;
    --sub: #A7ACC4;
    --dim: #6B7194;
    --rad: 14px;
    --dark-bg: #08090F;

    /* Compat: família --ds-* (antigo design-system.css) */
    --ds-primary: #6366F1;
    --ds-primary-strong: #4F52D9;
    --ds-primary-soft: rgba(99,102,241,.13);
    --ds-primary-ring: rgba(99,102,241,.45);
    --ds-primary-grad: linear-gradient(135deg, #6366F1, #8B5CF6);
    --ds-success: #34D399;
    --ds-success-soft: rgba(52,211,153,.14);
    --ds-danger: #F87171;
    --ds-danger-soft: rgba(248,113,113,.14);
    --ds-warning: #FBBF24;
    --ds-warning-soft: rgba(251,191,36,.14);
    --ds-info: #60A5FA;
    --ds-info-soft: rgba(96,165,250,.14);
    --ds-bg: #08090F;
    --ds-surface: #0F1119;
    --ds-surface-2: #151826;
    --ds-surface-3: #1B1F30;
    --ds-elevated: #1B1F30;
    --ds-border: rgba(148,163,184,.09);
    --ds-border-strong: rgba(148,163,184,.18);
    --ds-text: #E9EAF2;
    --ds-text-muted: #A7ACC4;
    --ds-text-dim: #6B7194;
    --ds-text-on-primary: #fff;
    --ds-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ds-radius-sm: 10px;
    --ds-radius: 12px;
    --ds-radius-lg: 16px;
    --ds-radius-xl: 22px;
    --ds-shadow-sm: 0 1px 3px rgba(0,0,0,.25);
    --ds-shadow: 0 4px 14px rgba(0,0,0,.35);
    --ds-shadow-lg: 0 12px 40px rgba(0,0,0,.5);
    --side-panel-width: 264px;

    /* O NAVEGADOR desenha checkbox, radio, select, seletor de data, campo de
       arquivo e barra de rolagem por conta própria — e sem esta declaração ele
       desenha tudo no modo CLARO, independentemente do CSS da página. Era por
       isso que um checkbox aparecia como quadrado branco no meio de um
       formulário escuro: nenhuma regra nossa alcança o interior desses
       controles. Uma linha resolve para a plataforma inteira. */
    color-scheme: dark;
}

/* ── Reset & base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Marca de seleção dos controles nativos no índigo do produto, em vez do
   verde/azul do sistema operacional de quem está usando. */
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

/* Caixa de seleção própria, para onde o controle nativo não basta: usada nos
   formulários de produto, combo e pagamentos. Fica aqui, e não em cada
   template, porque três cópias da mesma caixa é como elas divergem. */
.chk-platto {
    appearance: none; -webkit-appearance: none;
    /* Tamanho travado nos dois sentidos. Com appearance:none a caixa deixa de ser
       elemento substituído e o min-width:auto do flex vira 0 — aí qualquer linha
       apertada a achatava até virar um risco vertical ao lado do texto. */
    width: 20px; height: 20px; min-width: 20px; flex: 0 0 20px;
    border: 1.5px solid var(--border-2);
    border-radius: 6px;
    background: var(--surface-2);
    cursor: pointer; position: relative;
    transition: background .15s, border-color .15s;
}
.chk-platto:checked { background: var(--primary); border-color: var(--primary); }
.chk-platto:checked::after {
    content: ''; position: absolute; left: 6px; top: 2px;
    width: 5px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}
/* Brilhos ambiente sutis no fundo */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(900px 480px at 85% -10%, rgba(99,102,241,.10), transparent 60%),
        radial-gradient(700px 420px at -10% 100%, rgba(139,92,246,.07), transparent 60%);
}
h1,h2,h3,h4 { font-family: var(--font-display); color: var(--text); margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; transition: color .18s; }
a:hover { color: var(--primary-2); }
img { max-width: 100%; }
::selection { background: rgba(99,102,241,.35); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #262b42; }

/* ── Botões ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font); font-size: .875rem; font-weight: 600;
    color: var(--text);
    background: var(--surface-3);
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .22s, background .18s, border-color .18s, color .18s, filter .18s;
    user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn i { font-size: .9em; }

.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.28); }
.btn-primary:hover { box-shadow: var(--shadow-glow); filter: brightness(1.08); }

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

.btn-outline { background: transparent; color: var(--text-2); border-color: var(--border-2); }
.btn-outline:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

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

.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(248,113,113,.25); }
.btn-danger:hover { background: var(--danger); color: #0B0C12; box-shadow: 0 6px 18px rgba(248,113,113,.3); }

.btn-success { background: var(--success-soft); color: var(--success); border-color: rgba(52,211,153,.25); }
.btn-success:hover { background: var(--success); color: #06251A; box-shadow: 0 6px 18px rgba(52,211,153,.3); }

.btn-sm { padding: 7px 14px; font-size: .8rem; border-radius: 9px; }
.btn-lg { padding: 14px 28px; font-size: .95rem; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn.loading { opacity: .7; pointer-events: none; }

/* ── Formulários ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label, .field-label {
    display: flex; align-items: center; gap: 6px;
    font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 8px;
}
.form-group label i, .field-label i { color: var(--primary); font-size: .8rem; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=tel], input[type=date], input[type=time], input[type=url],
input[type=search], select, textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font); font-size: .9rem;
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.18);
    background: var(--surface-3);
}
input[readonly], input:disabled { opacity: .55; cursor: not-allowed; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7194' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
textarea { resize: vertical; min-height: 90px; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
/* Remove as setinhas nativas (spinner) dos campos numéricos — feias e fora do design.
   O valor continua digitável normalmente. Padrão para todo o site. */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }

.field-hint { font-size: .78rem; color: var(--muted); margin-top: 6px; display: block; }
.field-error { font-size: .78rem; color: var(--danger); margin-top: 6px; display: block; }
.field-ok { font-size: .78rem; color: var(--success); margin-top: 6px; display: block; }

/* Campo com ícone à esquerda */
.input-wrap { position: relative; }
.input-wrap > i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: .85rem; pointer-events: none; transition: color .18s;
}
.input-wrap input, .input-wrap select { padding-left: 40px; }
.input-wrap:focus-within > i { color: var(--primary); }
.input-wrap .toggle-pass {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--muted); cursor: pointer;
    padding: 8px 10px; border-radius: 8px; transition: color .18s;
}
.input-wrap .toggle-pass:hover { color: var(--text); }

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color .22s, transform .22s, box-shadow .22s;
}
.card.hoverable:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: -24px -24px 20px; padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}
.card-title { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 700; margin: 0; }
.card-title i { color: var(--primary); }
.card-body { }

/* ── Badges & status ───────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 999px;
    font-size: .72rem; font-weight: 700; letter-spacing: .02em;
    border: 1px solid transparent;
}
.badge-success { background: var(--success-soft); color: var(--success); border-color: rgba(52,211,153,.25); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger);  border-color: rgba(248,113,113,.25); }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(251,191,36,.25); }
.badge-info    { background: var(--info-soft);    color: var(--info);    border-color: rgba(96,165,250,.25); }
.badge-primary { background: var(--primary-soft); color: #A5B4FC;        border-color: rgba(99,102,241,.3); }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.status-dot.active  { background: var(--success); box-shadow: 0 0 8px rgba(52,211,153,.7); animation: plattoPulse 2s infinite; }
.status-dot.inactive{ background: var(--danger); }

/* ── Alertas ───────────────────────────────────────────────────────── */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 13px 16px; border-radius: var(--radius-sm);
    font-size: .87rem; margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert i { margin-top: 2px; }
.alert-success, .alert.success { background: var(--success-soft); color: var(--success); border-color: rgba(52,211,153,.25); }
.alert-error, .alert-danger, .alert.error { background: var(--danger-soft); color: var(--danger); border-color: rgba(248,113,113,.25); }
.alert-warning, .alert.warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(251,191,36,.25); }
.alert-info, .alert.info { background: var(--info-soft); color: var(--info); border-color: rgba(96,165,250,.25); }

/* ── Tabs ──────────────────────────────────────────────────────────── */
.tabs {
    position: relative;
    display: inline-flex; gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 5px;
    margin-bottom: 24px;
}
.tab-indicator {
    position: absolute; top: 5px; bottom: 5px; left: 0;
    background: var(--grad);
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
    z-index: 0;
    transition: transform .35s cubic-bezier(.34,1.3,.64,1), width .35s cubic-bezier(.34,1.3,.64,1);
}
.tab-btn {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px;
    background: none; border: none; border-radius: 10px;
    color: var(--muted); font-family: var(--font); font-size: .85rem; font-weight: 600;
    cursor: pointer; transition: color .22s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: plattoFadeUp .35s ease both; }

/* ── Tabela ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.data-table, .pagamentos-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.data-table th, .pagamentos-table th {
    text-align: left; padding: 12px 16px;
    font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.data-table td, .pagamentos-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.data-table tr:last-child td, .pagamentos-table tr:last-child td { border-bottom: none; }
.data-table tbody tr, .pagamentos-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover, .pagamentos-table tbody tr:hover { background: rgba(99,102,241,.045); }

/* ── Modais ────────────────────────────────────────────────────────── */
.modal, .mc-overlay, .emp-overlay {
    display: none; position: fixed; inset: 0; z-index: 3000;
    background: rgba(4,5,10,.72);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    align-items: center; justify-content: center; padding: 20px;
}
.modal.show, .modal.active, .modal.open,
.mc-overlay.show, .emp-overlay.open { display: flex; animation: plattoFadeIn .2s ease; }
.modal-content, .mc-box, .emp-box {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 540px;
    max-height: 92vh; overflow-y: auto;
    box-shadow: var(--shadow-2);
    animation: plattoScaleIn .3s cubic-bezier(.34,1.4,.64,1) both;
}
.modal-header, .mc-head, .emp-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 18px 24px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--surface); z-index: 2;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-header h3, .mc-head h2, .emp-head h3 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 10px; }
.modal-header h3 i, .mc-head h2 i, .emp-head h3 i { color: var(--primary); }
.close-modal, .mc-close, .emp-close {
    width: 34px; height: 34px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-3); border: none; border-radius: 9px;
    color: var(--muted); font-size: 1rem; cursor: pointer;
    transition: background .18s, color .18s, transform .18s;
}
.close-modal:hover, .mc-close:hover, .emp-close:hover { background: var(--danger-soft); color: var(--danger); transform: rotate(90deg); }
.modal-body, .mc-body, .emp-form { padding: 24px; }
.modal-footer, .mc-actions, .emp-actions { display: flex; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--border); }

/* Compat com modais de páginas antigas: botões salvar/cancelar */
.mc-btn-save {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px; background: var(--grad); border: none; border-radius: var(--radius-sm);
    color: #fff; font-family: var(--font); font-size: .9rem; font-weight: 700; cursor: pointer;
    transition: filter .18s, transform .18s, box-shadow .22s;
}
.mc-btn-save:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.mc-btn-cancel {
    padding: 12px 20px; background: var(--surface-3); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-2);
    font-family: var(--font); font-size: .88rem; font-weight: 600; cursor: pointer;
    transition: background .18s, color .18s;
}
.mc-btn-cancel:hover { background: var(--surface-2); color: var(--text); }
.mc-group { margin-bottom: 16px; }
.mc-label {
    display: flex; align-items: center; gap: 6px;
    font-size: .7rem; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: 7px;
}
.mc-label i { color: var(--primary); }
.mc-input { width: 100%; }
.mc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.emp-group { margin-bottom: 16px; }
.emp-label { display: block; font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 7px; }
.emp-input { width: 100%; }

/* ── Toast ─────────────────────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    display: flex; align-items: center; gap: 12px;
    background: var(--surface-2); border: 1px solid var(--border-2);
    border-radius: var(--radius); padding: 14px 18px;
    font-size: .85rem; font-weight: 600; color: var(--text);
    box-shadow: var(--shadow-2);
    transform: translateY(90px); opacity: 0;
    transition: .35s cubic-bezier(.34,1.4,.64,1);
    pointer-events: none; max-width: min(420px, calc(100vw - 40px));
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success .ti, .toast .ti.fa-check-circle { color: var(--success); }
.toast.error .ti, .toast .ti.fa-exclamation-circle { color: var(--danger); }

/* ── Loading / spinner / skeleton ──────────────────────────────────── */
.loading { text-align: center; padding: 36px 20px; color: var(--muted); }
.spinner {
    width: 34px; height: 34px; margin: 0 auto;
    border: 3px solid var(--surface-3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: plattoSpin .8s linear infinite;
}
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: plattoShimmer 1.4s infinite;
    border-radius: var(--radius-sm);
}

/* ── Empty state ───────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state .es-icon {
    width: 64px; height: 64px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-soft); border-radius: 18px;
    color: var(--primary); font-size: 1.5rem;
}
.empty-state h3 { color: var(--text-2); font-size: 1rem; }
.empty-state p { font-size: .85rem; max-width: 380px; margin: 0 auto; }

/* ── Page header (painéis) ─────────────────────────────────────────── */
.page-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 26px 32px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(99,102,241,.05), transparent);
}
.ph-left { display: flex; align-items: center; gap: 16px; }
.ph-icon {
    width: 52px; height: 52px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-soft);
    border: 1px solid rgba(99,102,241,.22);
    border-radius: var(--radius);
    color: var(--primary); font-size: 1.25rem;
}
.ph-title { font-size: 1.35rem; margin: 0; }
.ph-subtitle { font-size: .84rem; color: var(--muted); margin: 2px 0 0; }
.ph-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page-body { padding: 28px 32px; max-width: 1200px; }
@media (max-width: 640px) {
    .page-header { padding: 20px; }
    .page-body { padding: 20px; }
}

/* ── Stats ─────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    transition: transform .22s, border-color .22s, box-shadow .22s;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: var(--shadow-2); }
.stat-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--accent-color, var(--primary)); opacity: .8;
}
.stat-icon {
    width: 42px; height: 42px; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px; color: #fff; font-size: 1rem;
    background: var(--grad);
}
.stat-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.stat-value { font-size: 1.7rem; font-weight: 800; font-family: var(--font-display); margin-top: 4px; }

/* ── Cards expansíveis (admin: empresas/códigos/assinaturas) ───────── */
.empresa-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.empresa-card:hover { border-color: var(--border-2); }
.empresa-card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; cursor: pointer;
}
.empresa-card-nome { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .95rem; }
.empresa-card-expiracao { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.empresa-card-expiracao i { color: var(--primary); }
.empresa-card-expand { color: var(--muted); transition: transform .3s; }
.empresa-card.expanded .empresa-card-expand { transform: rotate(180deg); }
.empresa-card-body {
    max-height: 0; overflow: hidden;
    transition: max-height .4s cubic-bezier(.4,0,.2,1);
}
.empresa-card.expanded .empresa-card-body { max-height: 2400px; }
.empresa-card-content { padding: 4px 20px 20px; border-top: 1px solid var(--border); }
.empresa-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; padding: 16px 0; }
.empresa-info-item { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; }
.empresa-info-item i { color: var(--primary); margin-top: 3px; }
.empresa-info-item .label { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.empresa-info-item .value { color: var(--text-2); }
.empresa-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Navbar pública ────────────────────────────────────────────────── */
.platto-nav {
    position: sticky; top: 0; z-index: 900;
    background: rgba(8,9,15,.8);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.platto-nav-inner {
    max-width: 1160px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 14px 24px;
}
.platto-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--text); }
.platto-brand:hover { color: var(--text); }
.platto-brand-icon {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    background: var(--grad); border-radius: 10px; color: #fff; font-size: .9rem;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.platto-nav-links { display: flex; align-items: center; gap: 4px; }
.platto-nav-links a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 9px;
    color: var(--text-2); font-size: .85rem; font-weight: 500;
    transition: background .18s, color .18s;
}
.platto-nav-links a:hover { background: var(--surface-3); color: var(--text); }
.platto-nav-links a.nav-cta {
    background: var(--grad); color: #fff; font-weight: 600;
    box-shadow: 0 4px 14px rgba(99,102,241,.28);
    margin-left: 6px;
}
.platto-nav-links a.nav-cta:hover { filter: brightness(1.08); box-shadow: var(--shadow-glow); }

/* ── Dropdowns (submenus) ── */
.nav-dropdown { position: relative; }
.nav-drop-trigger {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 9px; background: none; border: none; cursor: pointer;
    color: var(--text-2); font-size: .85rem; font-weight: 500; font-family: inherit;
    transition: background .18s, color .18s;
}
.nav-dropdown:hover .nav-drop-trigger, .nav-drop-trigger:focus-visible { background: var(--surface-3); color: var(--text); }
.nav-drop-trigger i.fa-chevron-down { font-size: .62rem; transition: transform .2s; }
.nav-dropdown:hover .nav-drop-trigger i.fa-chevron-down { transform: rotate(180deg); }
.nav-drop-menu {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 232px;
    background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 14px;
    padding: 8px; box-shadow: var(--shadow-2);
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .18s, transform .18s, visibility .18s; z-index: 950;
}
.nav-dropdown:hover .nav-drop-menu, .nav-dropdown:focus-within .nav-drop-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-drop-menu::before { content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
.nav-drop-menu a {
    display: flex; align-items: flex-start; gap: 11px; padding: 10px 12px; border-radius: 10px;
    color: var(--text-2); font-size: .85rem; font-weight: 500;
}
.nav-drop-menu a:hover { background: var(--surface-3); color: var(--text); }
.nav-drop-menu a i { color: var(--primary); margin-top: 2px; width: 16px; text-align: center; }
.nav-drop-menu a b { display: block; color: var(--text); font-weight: 600; font-size: .86rem; }
.nav-drop-menu a small { color: var(--muted); font-size: .74rem; }

@media (max-width: 768px) { .platto-nav { display: none; } }

/* ── Bottom nav mobile ─────────────────────────────────────────────── */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    display: none; justify-content: space-around; align-items: center;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    background: rgba(15,17,25,.92);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-2);
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    flex: 1; max-width: 96px; padding: 7px 10px;
    color: var(--muted); border-radius: 12px; position: relative;
    transition: color .2s, transform .2s;
}
.bottom-nav-item:active { transform: scale(.92); }
.bottom-nav-item i { font-size: 1.25rem; }
.bottom-nav-item span { font-size: .66rem; font-weight: 600; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active::before {
    content: ''; position: absolute; top: -8px; width: 26px; height: 3px;
    background: var(--grad); border-radius: 0 0 3px 3px;
}
/* Página atual no menu de cima. A barra inferior já tinha esse estado
   desenhado; o menu do topo não tinha nenhum. */
.platto-nav-links a.active,
.nav-drop-trigger.active {
    background: rgba(99,102,241,.12);
    color: var(--text);
}
.platto-nav-links a.active { box-shadow: inset 0 -2px 0 var(--primary); }
.platto-nav-links a.nav-cta.active { box-shadow: none; }

@media (max-width: 768px) {
    .bottom-nav { display: flex; }
    body.has-bottom-nav { padding-bottom: 84px; }

    /* Não havia regra nenhuma para o menu do topo em tela pequena: os seis itens
       ficavam ao lado da marca num aparelho de 375px, espremidos, E a barra
       inferior aparecia junto — a mesma navegação duas vezes.
       No celular a barra de baixo assume, e o topo guarda só a marca e o botão
       de cadastro, que é a ação que a landing existe para provocar. Sobre,
       Termos e Privacidade continuam alcançáveis pelo rodapé. */
    .platto-nav-links > a:not(.nav-cta),
    .platto-nav-links > .nav-dropdown { display: none; }
    .platto-nav-inner { gap: 12px; }
    .platto-brand { font-size: 1rem; }
}

/* ── Footer ────────────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 36px 24px 28px;
    text-align: center;
}
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 12px; font-family: var(--font-display); font-weight: 700; }
.footer-brand .platto-brand-icon { width: 28px; height: 28px; font-size: .75rem; border-radius: 8px; }
.footer-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.footer-links a { color: var(--muted); font-size: .82rem; }
.footer-links a:hover { color: var(--primary); }
.footer-sep { color: var(--surface-3); }
.footer-copy { font-size: .74rem; color: var(--muted); margin: 0; }
/* Redes sociais: só aparecem quando o admin preenche a URL em
   Configurações → Redes. Antes esses campos existiam no painel e não eram lidos
   por lugar nenhum — quem preenchia não via efeito. */
.footer-social { display: flex; justify-content: center; gap: 14px; margin-bottom: 12px; }
.footer-social a {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--muted); font-size: .95rem;
    transition: color .2s, border-color .2s, transform .2s;
}
.footer-social a:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-2px); }

/* ── Auth (login / cadastro / reset) ───────────────────────────────── */
.auth-page {
    min-height: calc(100vh - 62px);
    display: flex; align-items: center; justify-content: center;
    padding: 44px 20px 70px; position: relative;
}
.auth-card, .register-card {
    width: 100%; max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-xl);
    padding: 38px 34px;
    box-shadow: var(--shadow-2);
    position: relative; z-index: 1;
}
.register-card { max-width: 560px; }
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-icon {
    width: 60px; height: 60px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    background: var(--grad); border-radius: 18px; color: #fff; font-size: 1.4rem;
    box-shadow: 0 8px 26px rgba(99,102,241,.4);
}
.auth-head h2 { font-size: 1.45rem; margin-bottom: 4px; }
.auth-head p { color: var(--muted); font-size: .87rem; margin: 0; }
.auth-alt { text-align: center; margin-top: 22px; font-size: .85rem; color: var(--muted); }
.auth-link-btn { background: none; border: none; color: var(--primary); font-family: var(--font); font-size: .82rem; font-weight: 600; cursor: pointer; padding: 0; }
.auth-link-btn:hover { color: var(--primary-2); text-decoration: underline; }

/* Seções numeradas do cadastro */
.form-section { margin-bottom: 26px; }
.form-section-title {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-display); font-weight: 700; font-size: .95rem;
    padding-bottom: 12px; margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.form-section-num {
    width: 26px; height: 26px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--grad); border-radius: 8px;
    color: #fff; font-size: .78rem; font-weight: 800;
}

/* Cards de escolha (tipo de negócio) */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card {
    cursor: pointer; text-align: center;
    padding: 18px 14px;
    background: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .2s, background .2s, transform .2s;
}
.choice-card:hover { transform: translateY(-2px); border-color: var(--border-2); }
.choice-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.choice-card .cc-emoji { font-size: 1.7rem; margin-bottom: 8px; }
.choice-card .cc-title { font-weight: 700; font-size: .9rem; }
.choice-card .cc-sub { color: var(--muted); font-size: .74rem; margin-top: 3px; }

/* ── Sidebar do painel ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 264px; flex-shrink: 0;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 800;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    overflow-y: auto;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.main-content { margin-left: 264px; min-height: 100vh; }
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-2); }
    .sidebar.open, .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
.menu-toggle {
    display: none; position: fixed; top: 14px; left: 14px; z-index: 1001;
    width: 42px; height: 42px; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 12px;
    color: var(--text); font-size: 1rem; cursor: pointer;
}
@media (max-width: 900px) { .menu-toggle { display: flex; } }

.sidebar-header { padding: 20px 18px 14px; border-bottom: 1px solid var(--border); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sidebar-brand-icon {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    background: var(--grad); border-radius: 10px; color: #fff; font-size: .85rem;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.sidebar-brand-text { font-family: var(--font-display); font-weight: 800; font-size: 1rem; }
.sidebar-store-card {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border);
    cursor: pointer; transition: border-color .2s, background .2s;
}
.sidebar-store-card:hover { border-color: rgba(99,102,241,.4); background: var(--primary-soft); }
.store-avatar {
    width: 34px; height: 34px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-soft); border-radius: 9px; color: var(--primary); font-size: .85rem;
}
.store-details { flex: 1; min-width: 0; }
.store-name { display: block; font-size: .84rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-label { display: block; font-size: .68rem; color: var(--muted); }
.store-edit-icon { color: var(--muted); font-size: .7rem; }

.sidebar-menu { flex: 1; padding: 12px 10px 24px; }
.menu-section-label {
    font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); padding: 16px 10px 6px;
}
.menu-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; margin: 2px 0;
    border-radius: var(--radius-sm);
    color: var(--text-2); font-size: .86rem; font-weight: 500;
    transition: background .18s, color .18s;
    border: none; width: 100%; text-align: left; background: none; cursor: pointer; font-family: var(--font);
}
.menu-item:hover { background: var(--surface-3); color: var(--text); }
.menu-item.active {
    background: var(--primary-soft); color: var(--primary); font-weight: 600;
    box-shadow: inset 2.5px 0 0 var(--primary);
}
.menu-item.danger:hover { background: var(--danger-soft); color: var(--danger); }
.menu-icon { width: 20px; text-align: center; font-size: .9rem; flex-shrink: 0; }
.menu-divider { border: none; border-top: 1px solid var(--border); margin: 14px 8px; }

.menu-group-header {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text-2); font-size: .86rem; font-weight: 500; cursor: pointer;
    transition: background .18s, color .18s;
}
.menu-group-header:hover { background: var(--surface-3); color: var(--text); }
.menu-arrow { margin-left: auto; font-size: .65rem; transition: transform .25s; }
.menu-group.open .menu-arrow { transform: rotate(90deg); }
.menu-group-body { max-height: 0; overflow: hidden; transition: max-height .35s cubic-bezier(.4,0,.2,1); }
.menu-group.open .menu-group-body { max-height: 420px; }
.submenu-item { padding-left: 30px; font-size: .82rem; }

.sidebar-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin: 12px 14px 0; padding: 12px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.stat-mini { text-align: center; padding: 6px; border-radius: 8px; }
.stat-mini .stat-value { font-size: 1.05rem; font-weight: 800; color: var(--primary); display: block; }
.stat-mini .stat-label { font-size: .6rem; }
.status-indicator {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .72rem; color: var(--muted);
    padding: 4px 10px; margin-top: 10px;
    background: var(--surface-2); border-radius: 999px;
}

/* ── Filter pills (home / listas) ──────────────────────────────────── */
.filter-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text-2); font-family: var(--font); font-size: .8rem; font-weight: 600;
    cursor: pointer; transition: all .2s;
}
.filter-pill:hover { border-color: var(--border-2); color: var(--text); }
.filter-pill.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.3); }

/* ── Utilidades ────────────────────────────────────────────────────── */
.u-muted { color: var(--muted); }
.u-center { text-align: center; }
.u-mt-0 { margin-top: 0; } .u-mb-0 { margin-bottom: 0; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ── Animações ─────────────────────────────────────────────────────── */
@keyframes plattoFadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes plattoFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes plattoScaleIn { from { opacity: 0; transform: translateY(22px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes plattoSpin { to { transform: rotate(360deg); } }
@keyframes plattoShimmer { to { background-position: -200% 0; } }
@keyframes plattoPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes slideInRight { from { transform: translateX(400px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideOutRight { from { transform: none; opacity: 1; } to { transform: translateX(400px); opacity: 0; } }

.anim-rise { opacity: 0; }             /* elementos que o platto-anim.js anima na entrada */
.anim-rise.anim-done { opacity: 1; }   /* estado final após a animação (o GSAP limpa o estilo inline) */
.no-gsap .anim-rise { opacity: 1; }    /* fallback sem GSAP */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .anim-rise { opacity: 1; }
}

/* ── Selo nas páginas de loja ──────────────────────────────────────────
   Substitui o rodapé da plataforma no cardápio e no rastreio. O cliente da
   lanchonete não tem o que fazer em "Preços" ou "Estabelecimentos"; a marca
   continua presente, mas como crédito no fim da página, não como menu
   competindo com o pedido. */
.selo-platto { padding: 26px 20px 34px; text-align: center; }
.selo-platto a {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--muted); font-size: .76rem; font-weight: 600;
    text-decoration: none; opacity: .75; transition: opacity .2s, color .2s;
}
.selo-platto a:hover { opacity: 1; color: var(--primary); }
.selo-platto i { color: var(--primary); }
.selo-platto .selo-legal { display: block; margin-top: 8px; font-size: .72rem; color: var(--muted); opacity: .75; }
.selo-platto .selo-legal a { font-size: .72rem; font-weight: 500; }
/* Sem a barra fixa de baixo, o espaço reservado para ela não faz sentido. */
body.pagina-loja { padding-bottom: 0; }
