@import url('tokens.css?v=p1'); /* bump o sufixo ao mudar tokens — @import não passa pelo cache-buster PHP */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/remixicon@4.3.0/fonts/remixicon.css');

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--p-font);
    background: var(--p-bg);
    color: var(--p-text);
    font-size: var(--fs-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
a { color: var(--p-link); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: none; box-shadow: var(--p-ring); border-radius: var(--radius-sm); }

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

/* ---------- shell: mobile-first (topbar + drawer), sidebar fixa no desktop ---------- */

.shell { min-height: 100vh; min-height: 100dvh; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 0 var(--sp-4);
    background: var(--p-surface);
    border-bottom: 1px solid var(--p-border);
}
.topbar h2 { font-size: var(--fs-md); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .store-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    max-width: 40vw;
    font-size: var(--fs-sm);
    color: var(--p-text-2);
    overflow: hidden;
}
.topbar .store-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(82vw, 300px);
    background: var(--p-nav-bg);
    border-right: 1px solid var(--p-border);
    display: flex;
    flex-direction: column;
    transform: translateX(-102%);
    transition: transform .25s ease;
    overflow-y: auto;
    /* rolagem sem scrollbar visível (pedido do usuário — a barra nativa do
       Windows aparecia colada na borda do nav) */
    scrollbar-width: none;
    padding: var(--sp-4) var(--sp-3);
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar.open { transform: translateX(0); }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, .4);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.sidebar-backdrop.active { pointer-events: auto; }
.sidebar-backdrop.visible { opacity: 1; }

.brand {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-2) var(--sp-4);
    font-weight: 600;
    font-size: var(--fs-md);
    min-height: 44px;
}
.brand-mark {
    width: 30px;
    height: 30px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--p-primary);
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 700;
    overflow: hidden;
}
/* Com logo de verdade a marca deixa de ser quadrada -- logotipo costuma
   ser retangular (ícone + nome), e `object-fit: cover` numa caixa 30x30
   cortava só a fatia esquerda (o ícone), ficando indistinguível do
   favicon (achado ao vivo, 2026-07-27). `contain` + largura livre mostra
   o logotipo inteiro, sem cortar. */
.brand-mark:has(img) { width: auto; max-width: 140px; background: none; padding: 0; }
.brand-mark img { width: auto; max-width: 100%; height: 100%; object-fit: contain; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-section-title {
    margin: var(--sp-4) var(--sp-2) var(--sp-1);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--p-text-3);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 8px 10px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--p-nav-item);
    font-size: var(--fs-sm);
    font-weight: 500;
    text-decoration: none;
}
.nav-link:hover { background: var(--p-nav-hover); text-decoration: none; }
.nav-link.active { background: var(--p-nav-active-bg); box-shadow: 0 1px 2px rgba(26, 26, 26, .08); font-weight: 600; }
.nav-link i { font-size: 1.15em; color: var(--p-text-2); }
.nav-link.active i { color: var(--p-text); }

.nav-footer { margin-top: auto; padding-top: var(--sp-4); }

/* botão de recolher — só faz sentido com a sidebar fixa (desktop);
   no mobile o nav é drawer e o botão fica escondido */
.sidebar-collapse-btn {
    display: none;
    align-items: center;
    gap: var(--sp-2);
    width: 100%;
    margin-top: var(--sp-2);
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--p-text-2);
    cursor: pointer;
}
.sidebar-collapse-btn:hover { background: var(--p-nav-hover); color: var(--p-text); }
.sidebar-collapse-btn i { font-size: 1.15em; transition: transform .2s ease; }

.content {
    padding: var(--sp-4);
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
}

/* Desktop: shell vira grid (nav | conteúdo) — a versão anterior usava
   margin-left + width:100% no .content, que soma 240px além da viewport e
   vazava scroll horizontal (achado ao vivo 2026-07-25, reporte do usuário). */
@media (min-width: 1024px) {
    .shell {
        display: grid;
        /* minmax(0, 1fr): 1fr puro tem mínimo = min-content e conteúdo
           largo (tabela/nowrap) empurrava a coluna além da viewport */
        grid-template-columns: var(--nav-w) minmax(0, 1fr);
        grid-template-rows: var(--topbar-h) 1fr;
        min-height: 100vh;
        min-height: 100dvh;
    }
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100dvh;
        grid-row: 1 / 3;
        grid-column: 1;
        width: auto;
        transform: none;
        transition: none;
    }
    .sidebar-backdrop { display: none; }
    .topbar { grid-column: 2; grid-row: 1; }
    .content {
        grid-column: 2;
        grid-row: 2;
        padding: var(--sp-6) 0;
        /* ocupa 90% da coluna útil (pedido do usuário 2026-07-25) — o teto
           antigo de 62rem deixava faixas laterais grandes em tela larga */
        width: 95%;
        max-width: none;
        margin: 0 auto;
    }
    #navToggle { display: none; }
    .sidebar-collapse-btn { display: flex; }

    /* estado recolhido — só ícones, ativado pelo botão no rodapé do nav
       (persistido em localStorage, ver Auth.js) */
    body.nav-collapsed .shell { grid-template-columns: 68px minmax(0, 1fr); }
    body.nav-collapsed .sidebar { padding-left: var(--sp-2); padding-right: var(--sp-2); }
    body.nav-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
    body.nav-collapsed .brand-name,
    body.nav-collapsed .nav-section-title,
    body.nav-collapsed .nav-link span,
    body.nav-collapsed .sidebar-collapse-btn span { display: none; }
    body.nav-collapsed .nav-link { justify-content: center; padding: 10px 0; }
    body.nav-collapsed .nav-link i { font-size: 1.3em; }
    body.nav-collapsed .sidebar-collapse-btn { justify-content: center; }
    body.nav-collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }
}

/* ---------- page header ---------- */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}
.page-header h1 { font-size: var(--fs-xl); }
.page-header p { color: var(--p-text-2); font-size: var(--fs-sm); margin-top: 2px; }
.page-header > div:first-child { flex: 1 1 220px; min-width: 0; }
.page-header .actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ---------- cards ---------- */

.card {
    background: var(--p-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    margin-bottom: var(--sp-4);
    overflow: hidden;
}
.card-body { padding: var(--sp-4); }
.card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-4) 0;
}
.card-header h3 { font-size: var(--fs-lg); flex: 1; min-width: 0; }
.card-header + .card-body { padding-top: var(--sp-3); }
.card-sub { color: var(--p-text-2); font-size: var(--fs-sm); }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat {
    background: var(--p-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: var(--sp-4);
}
.stat .label { font-size: var(--fs-sm); color: var(--p-text-2); }
.stat .value { font-size: var(--fs-stat); font-weight: 600; margin-top: 2px; letter-spacing: -0.02em; }
.stat .hint { font-size: var(--fs-xs); color: var(--p-text-3); margin-top: 2px; }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 var(--sp-4);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--p-surface);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--p-text);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background .12s ease, border-color .12s ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary { background: var(--p-primary); color: var(--p-primary-text); }
.btn--primary:hover:not(:disabled) { background: var(--p-primary-hover); }
.btn--secondary { border-color: var(--p-border-strong); }
.btn--secondary:hover:not(:disabled) { background: var(--p-surface-2); }
.btn--ghost { background: transparent; }
.btn--ghost:hover:not(:disabled) { background: var(--p-nav-hover); }
.btn--danger { background: var(--p-critical); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #a82208; }
.btn--danger-ghost { background: transparent; color: var(--p-critical); }
.btn--danger-ghost:hover:not(:disabled) { background: var(--p-critical-bg); }
.btn--sm { min-height: 30px; padding: 0 var(--sp-3); }
.btn--icon { width: 36px; padding: 0; }
.btn--sm.btn--icon { width: 30px; }
.btn--block { width: 100%; }
.btn .ri-loader-4-line { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */

.field { margin-bottom: var(--sp-4); min-width: 0; }
.field label { display: block; font-size: var(--fs-sm); font-weight: 500; margin-bottom: 4px; }
.field .hint { font-size: var(--fs-xs); color: var(--p-text-3); margin-top: 4px; }

.input, .select, .textarea {
    width: 100%;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--p-border-strong);
    border-radius: var(--radius-sm);
    background: var(--p-surface);
    font: inherit;
    font-size: var(--fs-base);
    color: var(--p-text);
}
.textarea { min-height: 88px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--p-text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--p-link); box-shadow: var(--p-ring); }

.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp-4); }
@media (min-width: 720px) {
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid .span-2 { grid-column: span 2; }
}

.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border: 1px solid var(--p-border-strong); border-left: 0; }

.radio-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.radio-option { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-base); cursor: pointer; }
.radio-option input[type="radio"] { margin-top: 3px; accent-color: var(--p-accent, currentColor); }
.radio-option .hint { display: block; font-size: var(--fs-xs); color: var(--p-text-3); }
.input-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--p-border-strong);
    border-right: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background: var(--p-surface-2);
    color: var(--p-text-2);
    font-size: var(--fs-sm);
    white-space: nowrap;
}
.input-prefix + .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* switch (toggle) */
.switch-row {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--p-border);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row .info { flex: 1; min-width: 0; }
.switch-row .info strong { display: block; font-weight: 500; font-size: var(--fs-base); }
.switch-row .info span { display: block; color: var(--p-text-2); font-size: var(--fs-sm); margin-top: 1px; }

.switch { position: relative; flex: none; width: 40px; height: 22px; margin-top: 2px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch .track {
    position: absolute;
    inset: 0;
    background: var(--p-border-strong);
    border-radius: var(--radius-full);
    transition: background .15s ease;
    pointer-events: none;
}
.switch .track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    transition: transform .15s ease;
}
.switch input:checked + .track { background: var(--p-success); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--p-ring); }

/* ---------- badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: 500;
    white-space: nowrap;
}
.badge--success { background: var(--p-success-bg); color: var(--p-success); }
.badge--critical { background: var(--p-critical-bg); color: var(--p-critical); }
.badge--warning { background: var(--p-warning-bg); color: var(--p-warning); }
.badge--info { background: var(--p-info-bg); color: var(--p-info); }
.badge--neutral { background: var(--p-surface-2); color: var(--p-text-2); box-shadow: inset 0 0 0 1px var(--p-border); }

/* ---------- toolbar / busca ---------- */

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    align-items: center;
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--p-border);
}
.search-field { position: relative; flex: 1 1 200px; min-width: 0; }
.search-field i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--p-text-3);
    pointer-events: none;
}
.search-field .input { padding-left: 32px; }

/* ---------- tabela responsiva: vira "cards" no mobile ---------- */

.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.data-table th {
    text-align: left;
    font-weight: 500;
    color: var(--p-text-2);
    background: var(--p-surface-2);
    padding: 8px var(--sp-4);
    border-bottom: 1px solid var(--p-border);
    white-space: nowrap;
}
.data-table td {
    padding: 10px var(--sp-4);
    border-bottom: 1px solid var(--p-border);
    vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--p-surface-3); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }

/* Mobile: cada linha vira um "item de lista" com hierarquia (padrão do
   admin Shopify) — 1ª célula é o TÍTULO (sem rótulo, fonte maior), as
   demais viram pares rótulo ↔ valor nas duas pontas da linha, ações no
   rodapé à direita. A versão anterior imprimia rótulo inline em tudo no
   mesmo corpo de texto — ficava uma lista chapada, sem leitura (reporte
   do usuário 2026-07-25). */
@media (max-width: 719px) {
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
    .data-table tr { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--p-border); }
    .data-table tr:last-child { border-bottom: 0; }

    /* pares rótulo ↔ valor: rótulo à esquerda apagado, valor à direita */
    .data-table td {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: var(--sp-3);
        padding: 3px 0;
        border: 0;
    }
    .data-table td[data-label]::before {
        content: attr(data-label);
        flex: none;
        color: var(--p-text-3);
        font-size: var(--fs-xs);
    }
    .data-table td.num { text-align: right; }

    /* 1ª célula = título do item: bloco cheio, fonte de corpo, sem rótulo
       (o conteúdo se identifica sozinho — nome/código/foto) */
    .data-table td:first-child {
        display: block;
        font-size: var(--fs-base);
        padding-bottom: var(--sp-2);
    }
    .data-table td:first-child::before { display: none; }

    /* célula de colspan (empty state / mensagens) volta a ser bloco puro */
    .data-table td[colspan] { display: block; }

    /* ações fecham o item, alinhadas à direita e separadas do conteúdo */
    .data-table .row-actions {
        justify-content: flex-end;
        margin-top: var(--sp-2);
    }

    /* linha de skeleton: blocos empilhados com larguras naturais */
    .data-table td .skeleton { flex: 1; }
}

/* paginação */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--fs-sm);
    color: var(--p-text-2);
}

/* ---------- estados vazios / skeleton ---------- */

.empty-state { text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--p-text-2); }
.empty-state i { font-size: 28px; color: var(--p-text-3); display: block; margin-bottom: var(--sp-2); }
.empty-state strong { display: block; color: var(--p-text); font-weight: 600; margin-bottom: 2px; }

.skeleton {
    display: inline-block;
    width: 100%;
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--p-surface-2) 25%, var(--p-border) 50%, var(--p-surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- tabs ---------- */

.tabs {
    display: flex;
    gap: var(--sp-1);
    padding: 0 var(--sp-4);
    border-bottom: 1px solid var(--p-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 10px var(--sp-3);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--p-text-2);
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.tab:hover { color: var(--p-text); }
.tab.active { color: var(--p-text); border-bottom-color: var(--p-primary); font-weight: 600; }

/* ---------- modal (bottom-sheet no mobile, dialog no desktop) ---------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s ease;
}
.modal-backdrop.visible { opacity: 1; }
.modal {
    background: var(--p-surface);
    width: 100%;
    max-height: 92dvh;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(24px);
    transition: transform .2s ease;
}
.modal-backdrop.visible .modal { transform: none; }
.modal-header {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-4);
    border-bottom: 1px solid var(--p-border);
}
.modal-header h3 { flex: 1; font-size: var(--fs-lg); min-width: 0; }
.modal-body { padding: var(--sp-4); overflow-y: auto; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid var(--p-border);
}
@media (min-width: 720px) {
    .modal-backdrop { align-items: center; padding: var(--sp-6); }
    .modal { width: 560px; max-height: 86vh; border-radius: var(--radius); }
    .modal--lg { width: 760px; }
}

/* ---------- toast ---------- */

.toast-region {
    position: fixed;
    z-index: 120;
    left: var(--sp-4);
    right: var(--sp-4);
    bottom: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    pointer-events: none;
}
@media (min-width: 720px) { .toast-region { left: auto; width: 360px; } }
.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
    background: var(--p-primary);
    color: #fff;
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
    font-size: var(--fs-sm);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}
.toast.visible { opacity: 1; transform: none; }
.toast i { flex: none; margin-top: 1px; }
.toast--error i { color: #ff9c8f; }
.toast--success i { color: #7fd7a9; }

/* ---------- utilitários ---------- */

.muted { color: var(--p-text-2); }
.mono { font-variant-numeric: tabular-nums; }
.text-right { text-align: right; }
.flex { display: flex; gap: var(--sp-2); align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.divider { border: 0; border-top: 1px solid var(--p-border); margin: var(--sp-4) 0; }

/* banner de aviso dentro de card */
.callout {
    display: flex;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    align-items: flex-start;
}
.callout i { flex: none; margin-top: 1px; }
.callout--info { background: var(--p-info-bg); color: var(--p-info); }
.callout--warning { background: var(--p-warning-bg); color: var(--p-warning); }
.callout--critical { background: var(--p-critical-bg); color: var(--p-critical); }
.callout--success { background: var(--p-success-bg); color: var(--p-success); }

/* provider card (pagamentos) */
.provider-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
@media (min-width: 720px) { .provider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- gráficos de venda (Início) ---------- */

.charts-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
@media (min-width: 900px) { .charts-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }

/* card de crescimento */
.growth-head { margin-bottom: var(--sp-3); }
.growth-total { font-size: var(--fs-stat); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: normal; }
.growth-sub { font-size: var(--fs-sm); color: var(--p-text-2); margin-top: 2px; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.growth-delta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-weight: 600;
    font-size: var(--fs-xs);
    padding: 2px 7px;
    border-radius: var(--radius-full);
}
.growth-delta--up { color: var(--p-success); background: var(--p-success-bg); }
.growth-delta--down { color: var(--p-critical); background: var(--p-critical-bg); }
.growth-delta--flat { color: var(--p-text-3); }

.growth-chart-wrap { position: relative; }
.growth-chart { width: 100%; height: 200px; display: block; overflow: visible; touch-action: none; cursor: crosshair; }
.growth-chart:focus-visible { outline: none; }

/* marks: linha 2px, área ~10% opacidade, grid hairline recessivo — specs
   fixas da skill de dataviz, não números soltos */
.chart-grid { stroke: var(--p-border); stroke-width: 1; }
.chart-grid-label { font-size: 9px; fill: var(--p-text-3); font-family: var(--p-font); }
.chart-axis-label { font-size: 10px; fill: var(--p-text-3); font-family: var(--p-font); }
.chart-area { fill: var(--p-link); fill-opacity: 0.08; stroke: none; }
.chart-line { fill: none; stroke: var(--p-link); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-end-dot { fill: var(--p-link); stroke: var(--p-surface); stroke-width: 2; }
.chart-crosshair { stroke: var(--p-border-strong); stroke-width: 1; }
.chart-hover-dot { fill: var(--p-link); stroke: var(--p-surface); stroke-width: 2; }

.growth-tooltip {
    position: absolute;
    top: 4px;
    min-width: 108px;
    padding: 6px 10px;
    background: var(--p-text);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    pointer-events: none;
    box-shadow: var(--shadow-pop);
    z-index: 5;
}
.growth-tooltip .tt-date { color: rgba(255, 255, 255, .65); margin-bottom: 2px; }
.growth-tooltip .tt-value { font-weight: 700; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.growth-tooltip .tt-count { color: rgba(255, 255, 255, .65); margin-top: 1px; }

/* card de venda por forma de pagamento */
.pm-list { display: flex; flex-direction: column; gap: var(--sp-4); }
.pm-row-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: 6px; }
.pm-chip { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pm-label { font-size: var(--fs-sm); color: var(--p-text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-value { font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.pm-bar-track { height: 8px; border-radius: var(--radius-full); background: var(--p-surface-2); overflow: hidden; }
.pm-bar-fill { height: 100%; border-radius: var(--radius-full); }
.pm-count { font-size: var(--fs-xs); color: var(--p-text-3); margin-top: 3px; }
.provider-card {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4);
    background: var(--p-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.provider-card img { width: 40px; height: 40px; object-fit: contain; border-radius: var(--radius-sm); flex: none; }
.provider-card .info { flex: 1; min-width: 0; }
.provider-card .info strong { display: block; }
.provider-card .info .card-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* login */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    background: var(--p-bg);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { justify-content: center; padding-bottom: var(--sp-2); }
.auth-card .card { margin-bottom: 0; }

/* imagem em tabela (banner/produto) */
.thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--p-surface-2);
    box-shadow: inset 0 0 0 1px var(--p-border);
    flex: none;
}
.thumb--wide { width: 84px; }

/* dropzone simples de upload */
.dropzone {
    border: 1px dashed var(--p-border-strong);
    border-radius: var(--radius-sm);
    padding: var(--sp-5);
    text-align: center;
    color: var(--p-text-2);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--p-link); background: var(--p-info-bg); }
.dropzone img { max-width: 100%; max-height: 140px; border-radius: var(--radius-sm); }

/* ---------- corte de imagem (banner/logo/favicon) ---------- */

.cropper-viewport {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    background: var(--p-surface-2);
    box-shadow: 0 0 0 1px var(--p-border);
    touch-action: none;
    user-select: none;
}
.cropper-img {
    position: absolute;
    left: 0;
    top: 0;
    max-width: none;
    /* left/top ficam fixos em 0 -- a posição real é feita por
       transform:translate() em JS, nunca mexendo em left/top (evita
       reflow a cada frame de arraste) */
    will-change: transform;
    pointer-events: none;
}
.cropper-zoom-row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
    color: var(--p-text-3);
}
.cropper-zoom-row input[type="range"] { flex: 1; }

/* lista de definição (detalhe do cliente etc.) */
.def-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px var(--sp-4); font-size: var(--fs-sm); }
.def-list dt { color: var(--p-text-2); white-space: nowrap; }
.def-list dd { min-width: 0; overflow-wrap: anywhere; }
