/* ============================================================
   Prosomu — folha de estilos unificada (T23)
   Paleta clara + acentos vermelhos · Mobile-first
   ============================================================ */

/* 1. Reset / base */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

/* 2. Variáveis (:root) ---------------------------------------- */

:root {
    --topbar-h: 62px; /* altura da mobile-topbar — usada para sticky offsets */
    /* Superfícies */
    --c-bg:        #FBF6F1; /* cream */
    --c-bg-warm:   #F3E8DC; /* cream-deep */
    --c-bg-deep:   #F3E8DC; /* cream-deep (was a 3rd darker tone; Menna palette has no distinct 3rd surface, reuse cream-deep) */
    --c-surface:   #FFFFFF; /* paper */
    --c-paper:     #FFFFFF; /* paper */

    /* Texto */
    --c-text:      #1B1B47; /* navy */
    --c-text-dim:  #5C5A72; /* ink */
    --c-text-faint:#8B899C; /* lighter ink tint — not in the official token table; used only for the lowest-emphasis "faint" text role, derive as ink lightened ~25% */

    /* Linhas */
    --c-border:    #E6DDD0; /* line */
    --c-border-strong: #D8CBB5; /* line, darkened ~8% for a "strong" variant — no separate official token, derive from line */
    --c-line:      #E6DDD0; /* line */
    --c-line-soft: #EFE7DA; /* line, lightened ~8% — no separate official token, derive from line */

    /* Acento principal */
    --c-accent:    #E2654F; /* coral */
    --c-accent-hov:#C94F3B; /* coral-dark */
    --c-accent-soft:#FBE3DC; /* coral-soft */
    --c-accent-border:#F3C9BC; /* coral-soft, darkened ~6% for a visible border tone */

    /* Acento quente (mobile) — Menna has one coral accent, not two; both roles map to the same coral */
    --c-accent-warm:     #E2654F; /* coral */
    --c-accent-warm-soft:#FBE3DC; /* coral-soft */

    /* Semânticas */
    --c-ok:        #5E7A55; /* sage-dark */
    --c-ok-soft:   #E9F0E3; /* sage-soft */
    --c-warn:      #8C5F30; /* tan-dark */
    --c-warn-soft: #F3E6D5; /* tan-soft */
    --c-error:     #C94F3B; /* coral-dark — Menna has no separate error-red, reuse coral-dark for destructive/error states */
    --c-error-soft:#FBE3DC; /* coral-soft */
    --c-info:      #1B1B47; /* navy — Menna has no separate info-blue, reuse navy */
    --c-info-soft: #E9F0E3; /* sage-soft (closest neutral-positive tint available) */
    --c-gray-soft: #F3E8DC; /* cream-deep */

    /* Espaçamentos */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 24px;
    --sp-6: 32px;

    /* Raios — align to Menna's scale (8-12 small, 14-18 cards, 24-28 sections, 100 pills) */
    --r-sm: 10px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
    --r-full: 999px;

    /* Tipografia */
    --f-base: 1rem;
    --f-sm:   0.875rem;
    --f-lg:   1.125rem;
    --f-heading: 'Baloo 2', sans-serif;
    --f-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Sombras — Menna's two-tier scale */
    --shadow:   0 2px 8px rgba(27,27,71,.06), 0 1px 0 rgba(27,27,71,.04);
    --shadow-md:0 12px 32px rgba(27,27,71,.12);
}

/* 3. Tipografia ----------------------------------------------- */

body {
    font-family: var(--f-body);
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.5;
    font-size: 15px;
}

a { color: var(--c-accent); text-decoration: none; }
a:hover { color: var(--c-accent-hov); text-decoration: underline; }

h1, h2, h3, .heading {
    font-family: var(--f-heading);
    line-height: 1.25;
}

h1 {
    font-size: 26px;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}
h2 {
    font-size: 18px;
    margin: 24px 0 12px;
    letter-spacing: -0.01em;
}

.subtitle {
    color: var(--c-text-dim);
    margin: 0 0 24px;
    font-size: 14px;
}

/* 4. Layout ---------------------------------------------------- */

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

/* Mobile frame (T18 views) */
body.mobile-shell {
    background: var(--c-bg-warm);
    color: var(--c-text);
    font-size: 16px;
    line-height: 1.45;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}

body.mobile-shell .mobile-frame {
    max-width: none;
    width: 100%;
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 10%, #f9f3e6 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, var(--c-bg-deep) 0%, transparent 55%),
        var(--c-bg-warm);
    position: relative;
    padding-bottom: 94px;
}

/* 5. Componentes ---------------------------------------------- */

/* --- Botões --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}
.btn-primary {
    background: var(--c-accent);
    color: white;
}
.btn-primary:hover { background: var(--c-accent-hov); color: white; text-decoration: none; }
.btn-ghost {
    background: var(--c-surface);
    color: var(--c-text-dim);
    border-color: var(--c-border);
}
.btn-ghost:hover { background: var(--c-gray-soft); color: var(--c-text); text-decoration: none; }
.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--c-accent);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}
.btn-link:hover { color: var(--c-accent-hov); text-decoration: underline; }

/* Botão pequeno "Ignorar sempre" */
.btn-ignore {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--c-text-dim);
    background: transparent;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    cursor: pointer;
}
.btn-ignore:hover {
    color: var(--c-text);
    background: var(--c-gray-soft);
    border-color: var(--c-text-dim);
}

/* Botão CTA (landing) */
.btn-cta { padding: 12px 22px; font-size: 15px; }

/* Botão mobile cheio */
.btn-full {
    background: var(--c-text);
    color: var(--c-paper);
    border: none;
    padding: 13px 18px;
    border-radius: var(--r-lg);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    margin-top: 10px;
    cursor: pointer;
    letter-spacing: -0.01em;
}
.btn-full.accent { background: var(--c-accent-warm); }
.btn-full.ghost {
    background: transparent;
    color: var(--c-text);
    border: 1px solid var(--c-line);
}
.btn-full.ghost.danger { color: var(--c-error); }

/* --- Badges / pills --- */
.badge {
    display: inline-block;
    background: var(--c-accent);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--r-full);
    line-height: 1.4;
}
.badge.muted {
    background: var(--c-gray-soft);
    color: var(--c-text-dim);
}

/* --- Cards --- */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 20px;
    margin-bottom: 20px;
}

/* --- Flash messages --- */
.flash {
    padding: 10px 14px;
    border-radius: 6px;
    margin: 0 0 16px;
    font-size: 14px;
}
.flash-ok {
    background: var(--c-ok-soft);
    color: var(--c-ok);
    border: 1px solid #bbf7d0;
}
.flash-error {
    background: var(--c-accent-soft);
    color: var(--c-accent);
    border: 1px solid var(--c-accent-border);
}

/* --- Forms (admin/desktop) --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}
.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--c-text-dim);
    font-weight: 500;
}
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid input[type="search"],
.form-grid select,
.form-grid textarea {
    padding: 8px 10px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
    background: var(--c-surface);
    color: var(--c-text);
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 2px var(--c-accent-soft);
}
.form-grid textarea { resize: vertical; }

.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

/* --- Stats --- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 0 0 24px;
}
.stat {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 14px 16px;
}
.stat-label {
    font-size: 12px;
    color: var(--c-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 4px;
}
.stat.alert .stat-value { color: var(--c-accent); }

/* Stat grid mobile */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}
.stat-grid .stat {
    background: var(--c-paper);
    border-color: var(--c-line);
    border-radius: 12px;
    padding: 13px;
}
.stat-val {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}
.stat-val sub {
    font-size: 12px;
    font-weight: 400;
    color: var(--c-text-dim);
    margin-left: 2px;
    vertical-align: baseline;
}
.stat-grid .stat-label {
    font-size: 10px;
    letter-spacing: 0.1em;
    margin-top: 6px;
}
.stat.urgent .stat-val { color: var(--c-error); }
.stat.soon   .stat-val { color: var(--c-warn); }
.stat.ok     .stat-val { color: var(--c-ok); }

/* --- Tables --- */
table.items {
    width: 100%;
    border-collapse: collapse;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    overflow: hidden;
}
table.items th, table.items td {
    text-align: left;
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--c-border);
}
table.items th {
    background: var(--c-gray-soft);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--c-text-dim);
}
table.items tr:last-child td { border-bottom: none; }
table.items td.num { text-align: right; font-variant-numeric: tabular-nums; }

tr.matched td.state { color: var(--c-ok); }
tr.review { background: var(--c-warn-soft); }
tr.review td.state { color: var(--c-warn); }
tr.unmatched { background: var(--c-gray-soft); }
tr.unmatched td.state { color: var(--c-text-faint); }

.confidence { font-size: 12px; color: var(--c-text-dim); font-variant-numeric: tabular-nums; }

/* Generic table */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th, .table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--c-border);
}
.table th {
    background: var(--c-gray-soft);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--c-text-dim);
}
.table tr:last-child td { border-bottom: none; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Chips (filtros de categoria admin) --- */
.chip {
    background: var(--c-surface);
    border: 1px solid var(--c-accent-border);
    color: var(--c-accent);
    border-radius: var(--r-full);
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.chip:hover { background: var(--c-accent); color: white; }
.chip-score {
    background: var(--c-accent-soft);
    color: var(--c-accent);
    border-radius: var(--r-full);
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.chip:hover .chip-score { background: white; }

/* Chip de filtro mobile */
.filter-chip {
    background: var(--c-paper);
    border: 1px solid var(--c-line);
    border-radius: var(--r-full);
    padding: 6px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-dim);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    font-family: inherit;
}
.filter-chip.active {
    background: var(--c-text);
    color: var(--c-paper);
    border-color: var(--c-text);
}

/* Chip de categoria admin */
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-full);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    color: var(--c-text-dim);
    font-size: 13px;
    font-weight: 500;
}
.cat-chip:hover {
    background: var(--c-accent-soft);
    border-color: var(--c-accent-border);
    color: var(--c-accent);
    text-decoration: none;
}
.cat-chip.active {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: white;
}

.chip-count {
    background: var(--c-gray-soft);
    color: var(--c-text-dim);
    border-radius: var(--r-full);
    padding: 1px 7px;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.cat-chip.active .chip-count,
.filter-chip.active .chip-count { background: rgba(255,255,255,0.2); color: white; }

/* --- Tags inline --- */
.tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--r-sm);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 4px;
}
.tag-user { background: var(--c-warn-soft); color: var(--c-warn); }

/* --- Status pills (mobile) --- */
.status-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.track.urgent .status-pill { background: var(--c-error); color: white; }
.track.soon   .status-pill { background: var(--c-warn-soft); color: var(--c-warn); }
.track.ok     .status-pill { background: var(--c-ok-soft); color: var(--c-ok); }
.status-pill.unknown { background: var(--c-bg-deep); color: var(--c-text-dim); }

/* --- Price hints --- */
.price-hint {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: var(--r-sm);
    font-size: 10px;
    font-weight: 700;
}
.price-hint.below { background: var(--c-ok-soft); color: var(--c-ok); }
.price-hint.above { background: var(--c-error-soft); color: var(--c-error); }
.price-hint.avg   { background: var(--c-bg-deep); color: var(--c-text-dim); }

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--c-ok);
    color: white;
    padding: 12px 20px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 600;
    z-index: 100;
    opacity: 0;
    transition: all .3s cubic-bezier(.2,.9,.3,1);
    box-shadow: 0 6px 20px rgba(45,106,62,.35);
    white-space: nowrap;
    max-width: 90vw;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Modal (bottom sheet) --- */
.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(26,22,18,.55);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.modal-bg.show {
    display: flex;
    animation: m-fadeBg .25s ease;
}
@keyframes m-fadeBg { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--c-paper);
    width: 100%;
    max-width: 440px;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: 20px 18px 28px;
    max-height: 90vh;
    overflow-y: auto;
    animation: m-slideUp .3s cubic-bezier(.2,.9,.3,1);
}
.modal-tall { max-height: 80vh; overflow-y: auto; }
@keyframes m-slideUp {
    from { transform: translateY(100%); }
    to   { transform: none; }
}
.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--c-line);
    border-radius: 2px;
    margin: -8px auto 16px;
}
.modal h3 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 4px;
}
.modal h3 em { font-style: italic; color: var(--c-accent-warm); }
.modal-sub {
    font-size: 11px;
    color: var(--c-text-dim);
    margin-bottom: 16px;
}
.quickbuy-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.quickbuy-divider {
    font-size: 11px;
    color: var(--c-text-dim);
    text-align: center;
    margin: 4px 0 12px;
    position: relative;
}
.quickbuy-divider::before,
.quickbuy-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 28%;
    height: 1px;
    background: var(--c-border);
}
.quickbuy-divider::before { left: 0; }
.quickbuy-divider::after  { right: 0; }
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

/* Forms inside modal */
.modal input[type="text"],
.modal input[type="number"],
.modal input[type="search"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--c-line);
    border-radius: 10px;
    background: var(--c-paper);
    font-family: inherit;
    font-size: 15px;
    color: var(--c-text);
    margin-bottom: 10px;
}
.modal input:focus {
    outline: none;
    border-color: var(--c-accent-warm);
}

/* --- Empty states --- */
.empty {
    text-align: center;
    padding: 36px 20px;
    color: var(--c-text-dim);
    font-size: 12px;
}
.empty-icon { font-size: 38px; margin-bottom: 12px; }
.empty-line {
    color: var(--c-text-dim);
    font-size: 14px;
    padding: 8px 0;
    margin: 0;
}
.mobile-empty {
    padding: 24px 8px;
    color: var(--c-text-dim);
    font-size: 13px;
    text-align: center;
}
.mobile-empty a { color: var(--c-accent-warm); }

/* --- Utilitários --- */
.muted { color: var(--c-text-faint); font-weight: 400; }

/* 6. Padrões mobile ------------------------------------------- */

/* Topbar mobile */
.mobile-topbar {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--c-text);
    box-shadow: 0 2px 10px rgba(27,27,71,.15);
    position: sticky;
    top: 0;
    z-index: 10;
}
.mobile-topbar .topbar-actions { margin-left: auto; }
.mobile-brand {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--f-heading);
    font-weight: 700;
    font-size: 19px;
    text-decoration: none;
    color: #fff;
}
.mobile-brand-mark { width: 22px; height: 22px; border-radius: 50%; background: #fff; }
.mobile-brand-dot { color: var(--c-accent-warm); }
.mobile-topbar .topbar-icon-btn {
    color: #fff;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
}
.mobile-topbar .topbar-icon-btn:hover { background: rgba(255,255,255,.18); }
.topbar-avatar {
    background: var(--c-accent) !important;
    border: none !important;
    color: #fff;
    font-family: var(--f-heading);
    font-weight: 700;
    font-size: 13px;
}
.topbar-avatar:hover { background: var(--c-accent-hov) !important; }
.mobile-user-chip {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-text-dim);
    padding: 4px 10px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-full);
    background: var(--c-paper);
}
.mobile-user-chip a, .mobile-user-chip button {
    color: inherit;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0 0 0 6px;
    font-size: inherit;
    cursor: pointer;
    font-family: inherit;
}

/* Vista mobile */
.mobile-view {
    padding: 16px 18px 90px;
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Section label */
.section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--c-text-dim);
    margin: 22px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-line-soft);
}
.section-label:first-child { margin-top: 4px; }

/* Hero card */
.hero {
    background: var(--c-paper);
    border: 1px solid var(--c-line);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px;
    background: radial-gradient(circle, var(--c-accent-warm-soft) 0%, transparent 70%);
    pointer-events: none;
}
.hero-eyebrow {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--c-accent-warm);
    margin-bottom: 6px;
}
.hero-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 4px;
}
.hero-title em { font-style: italic; color: var(--c-accent-warm); font-weight: 700; }
.hero-sub { font-size: 12px; color: var(--c-text-dim); margin-top: 8px; }
.hero-action { margin-top: 14px; width: 100%; }
.hero.urgent { border-left: 3px solid var(--c-error); }
.hero.soon   { border-left: 3px solid var(--c-warn); }
.hero.ok     { border-left: 3px solid var(--c-ok); }

/* Track rows */
.track-list { display: flex; flex-direction: column; gap: 8px; }
.track {
    background: var(--c-paper);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    position: relative;
}
.track.urgent { border-left: 3px solid var(--c-error); padding-left: 13px; }
.track.soon   { border-left: 3px solid var(--c-warn); padding-left: 13px; }
.track.ok     { border-left: 3px solid var(--c-ok); padding-left: 13px; }

.track-icon {
    font-size: 22px;
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--c-bg-deep);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.track-body {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    font-family: inherit;
    color: inherit;
}
.track-name {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.track-brand {
    font-size: 11px;
    color: var(--c-text-faint);
    font-weight: 400;
    font-style: italic;
    margin-left: 4px;
}
.track-meta {
    font-size: 11px;
    color: var(--c-text-dim);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.track-meta .dot {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--c-text-faint);
    flex-shrink: 0;
}

/* Buy button */
.buy-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 2px solid var(--c-line);
    background: var(--c-paper);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 20px;
    color: var(--c-text-dim);
    flex-shrink: 0;
    font-family: inherit;
    font-weight: 300;
    line-height: 1;
    transition: transform .15s cubic-bezier(.2,.9,.3,1);
}
.buy-btn:active { transform: scale(0.88); }
.track.urgent .buy-btn { border-color: var(--c-error); color: var(--c-error); }
.track.soon   .buy-btn { border-color: var(--c-warn); color: var(--c-warn); }
.buy-btn.confirmed {
    background: var(--c-ok);
    border-color: var(--c-ok);
    color: white;
    transform: scale(1.05);
    animation: m-pop .35s ease;
}
@keyframes m-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1.05); }
}

/* Filter row */
.filter-row {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }

/* Add track CTA */
.add-track {
    background: transparent;
    border: 1.5px dashed var(--c-line);
    border-radius: var(--r-lg);
    padding: 16px;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--c-text-dim);
    margin-top: 12px;
    font-family: inherit;
}
.add-track:active {
    background: var(--c-paper);
    border-color: var(--c-accent-warm);
    color: var(--c-accent-warm);
}
.add-track .plus { font-size: 16px; }

/* Candidate rows (modal) */
.candidate {
    background: var(--c-paper);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.candidate-check {
    width: 24px; height: 24px;
    border-radius: 6px;
    border: 1.5px solid var(--c-line);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 14px;
    color: transparent;
    transition: all .2s;
}
.candidate.selected .candidate-check {
    background: var(--c-accent-warm);
    border-color: var(--c-accent-warm);
    color: white;
}
.candidate-info { flex: 1; min-width: 0; }
.candidate-name {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.candidate-meta { font-size: 10px; color: var(--c-text-dim); margin-top: 2px; }

/* History (product detail) */
.history { display: flex; flex-direction: column; gap: 0; margin-top: 8px; }
.history-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--c-line-soft);
    font-size: 13px;
}
.history-line:last-child { border-bottom: none; }
.history-line .hp { font-weight: 700; color: var(--c-text); }
.history-line .gap { color: var(--c-text-dim); font-size: 11px; }
.history-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--c-accent-warm);
    margin-right: 8px;
    vertical-align: middle;
}

/* Market cards */
.market-card {
    background: var(--c-paper);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-md);
}
.market-head {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 10px;
}
.market-head .track-icon { width: 36px; height: 36px; font-size: 18px; margin: 0; }
.market-title { font-size: 14px; font-weight: 600; line-height: 1.25; }
.market-price-you {
    text-align: right;
    font-size: 10px;
    color: var(--c-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.market-price-you strong {
    color: var(--c-text);
    font-size: 14px;
    display: block;
    margin-top: 2px;
}
.price-bar {
    height: 6px;
    background: var(--c-bg-deep);
    border-radius: 3px;
    position: relative;
    margin: 12px 0 6px;
}
.price-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--c-ok) 0%, var(--c-warn) 50%, var(--c-error) 100%);
    border-radius: 3px;
    opacity: 0.25;
}
.price-marker {
    position: absolute;
    top: -4px;
    width: 3px; height: 14px;
    background: var(--c-text);
    border-radius: 1px;
}
.price-marker.avg { background: var(--c-warn); }
.price-labels {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: var(--c-text-dim);
}
.market-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--c-line-soft);
    font-size: 11px;
    color: var(--c-text-dim);
}
.market-footer strong { color: var(--c-ok); }
.market-footer.warn strong { color: var(--c-error); }

/* Import sources */
.source-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}
.source-btn {
    background: var(--c-paper);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 16px 14px;
    text-align: left;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease;
    font-family: inherit;
    color: inherit;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.source-btn:active {
    transform: scale(0.97);
    border-color: var(--c-accent-warm);
}
.source-btn.featured {
    background: linear-gradient(135deg, #ffd400 0%, #fff3a0 100%);
    border-color: #e4be00;
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 14px;
}
.source-btn.featured .source-info { flex: 1; }
.source-icon { font-size: 26px; margin-bottom: 8px; }
.source-btn.featured .source-icon { margin-bottom: 0; font-size: 32px; }
.source-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.source-btn.featured .source-name { font-size: 16px; }
.source-desc {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: var(--c-text-dim);
    margin-top: 3px;
    line-height: 1.35;
}

/* Insights subtabs + cards */
.subtabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--c-line-soft);
}
.subtab {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-dim);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.subtab.active {
    color: var(--c-accent-warm);
    border-bottom-color: var(--c-accent-warm);
}

.insight-card {
    background: var(--c-paper);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-md);
}
.insight-card.accent { border-left: 3px solid var(--c-accent-warm); }
.insight-card.info   { border-left: 3px solid #2e7eb8; }
.insight-eyebrow {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--c-text-dim);
    margin-bottom: 6px;
}
.insight-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.insight-title em { font-style: normal; color: var(--c-accent-warm); font-weight: 700; }
.insight-title small { font-size: 12px; font-weight: 600; margin-left: 6px; }
.insight-title small.delta-up   { color: var(--c-error); }
.insight-title small.delta-down { color: var(--c-ok); }
.insight-sub {
    font-size: 12px;
    color: var(--c-text-dim);
    margin-top: 8px;
    line-height: 1.45;
}
.insight-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}
.insight-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 2px;
    border-bottom: 1px solid var(--c-line-soft);
    font-size: 13px;
}
.insight-list li:last-child { border-bottom: none; }
.insight-list li strong { color: var(--c-text); font-weight: 700; }

/* Tech note */
.technote {
    background: #e7f1f8;
    border: 1px dashed #2e7eb8;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--c-text);
    margin-top: 14px;
}
.technote strong { color: #2e7eb8; font-weight: 700; }
.technote code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    background: rgba(26,22,18,.06);
    padding: 1px 5px;
    border-radius: 3px;
}

/* Catalog cat groups (mobile) */
.catalog-cat { margin-bottom: 14px; }
.catalog-cat-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--c-text-dim);
    margin: 12px 0 6px;
}
.cat-group {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--c-text-dim);
    margin: 14px 0 6px;
}
.catalog-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--c-line-soft);
    cursor: pointer;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    color: inherit;
}
.catalog-item:active { background: var(--c-bg-deep); }
.catalog-item.is-tracked { opacity: 0.5; cursor: default; }
.catalog-item-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: var(--c-bg-deep);
    display: grid;
    place-items: center;
    font-size: 16px;
    flex-shrink: 0;
}
.catalog-item-body { flex: 1; min-width: 0; }
.catalog-item-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.catalog-item-meta { font-size: 10px; color: var(--c-text-dim); margin-top: 1px; }
.catalog-item-tracked {
    font-size: 10px;
    color: var(--c-ok);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-left: 8px;
}

/* Import link + admin link no mobile topbar */
.mobile-import-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 1px solid var(--c-line);
    color: var(--c-accent-warm);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    margin-right: 6px;
}
.mobile-import-link:active { background: var(--c-accent-warm-soft); }
.mobile-admin-link {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-text-faint);
    text-decoration: none;
    padding: 4px 8px;
    border: 1px dashed var(--c-line-soft);
    border-radius: var(--r-full);
    margin-right: 6px;
}

/* 7. Padrões admin -------------------------------------------- */

/* Topbar desktop */
.topbar {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.brand {
    font-family: var(--f-heading);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
    color: var(--c-text);
}
.brand:hover { color: var(--c-text); text-decoration: none; }
.brand-dot { color: var(--c-accent); }
.topbar nav { display: flex; gap: 18px; font-size: 14px; }
.topbar nav a { color: var(--c-text-dim); }
.topbar nav a.muted { color: var(--c-text-faint); }
.topbar nav a:hover { color: var(--c-accent); }
.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--c-text-faint);
}
.topbar-email { font-weight: 500; }
.topbar-logout { margin: 0; }

/* Auth card */
.auth-card {
    max-width: 380px;
    margin: 64px auto 0;
}
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .form-grid { grid-template-columns: 1fr; }
.auth-card .form-actions { margin-top: 12px; }
.auth-foot {
    margin-top: 16px;
    font-size: 13px;
    color: var(--c-text-dim);
    text-align: center;
}

/* Page head */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin: 0 0 16px;
}
.back-link {
    font-size: 13px;
    color: var(--c-text-dim);
    display: inline-block;
    margin-bottom: 4px;
}

/* Receipt list */
.list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--c-surface);
}
.list li { border-bottom: 1px solid var(--c-border); }
.list li:last-child { border-bottom: none; }
.list a.row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    color: var(--c-text);
}
.list a.row:hover { background: var(--c-accent-soft); text-decoration: none; }
.row-main { min-width: 0; }
.row-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.row-meta { font-size: 13px; color: var(--c-text-dim); }
.row-total { font-weight: 700; font-variant-numeric: tabular-nums; }

/* KV (key-value) */
.kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 16px;
    font-size: 14px;
}
.kv dt { color: var(--c-text-dim); }
.kv dd { margin: 0; font-weight: 600; }

/* Match picker */
.picker { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 4px; }
.picker-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    background: var(--c-surface);
}
.picker-input:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 2px var(--c-accent-soft);
}
.picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.picker-list.empty {
    padding: 8px 10px;
    font-size: 12px;
    color: var(--c-text-faint);
    text-align: left;
}
.picker-list li { border-bottom: 1px solid var(--c-border); }
.picker-list li:last-child { border-bottom: none; }
.picker-result {
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 8px 10px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.picker-result:hover { background: var(--c-accent-soft); }
.result-name { font-weight: 500; }
.result-cat {
    font-size: 11px;
    color: var(--c-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.picker-create {
    display: block;
    padding: 8px 10px;
    color: var(--c-accent);
    font-size: 13px;
    font-weight: 500;
    background: var(--c-accent-soft);
}
.picker-create:hover { background: var(--c-accent); color: white; text-decoration: none; }

/* htmx feedback */
.htmx-request .picker-input { opacity: 0.7; }
tr.htmx-swapping { opacity: 0.4; transition: opacity 200ms; }

/* Catalog (admin) */
.catalog-search {
    margin: 0 0 24px;
    position: relative;
}
.catalog-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    font: inherit;
    font-size: 15px;
    background: var(--c-surface);
}
.catalog-search-input:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-soft);
}
.catalog-search-results:not(:empty) {
    margin-top: 8px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.catalog-results {
    list-style: none;
    margin: 0;
    padding: 0;
}
.catalog-results.empty {
    padding: 16px;
    color: var(--c-text-dim);
    font-size: 14px;
}
.catalog-results li { border-bottom: 1px solid var(--c-border); }
.catalog-results li:last-child { border-bottom: none; }

.link-create { display: inline-block; margin-left: 8px; color: var(--c-accent); font-weight: 500; }

.cat-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 24px;
}
.cat-section { margin-bottom: 28px; }
.cat-title {
    font-size: 16px;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cat-count { font-size: 12px; color: var(--c-text-faint); font-weight: 500; }

.catalog-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}
.catalog-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    color: var(--c-text);
}
.catalog-card:hover {
    border-color: var(--c-accent-border);
    background: var(--c-accent-soft);
    text-decoration: none;
}
.card-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-name {
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-meta { font-size: 12px; color: var(--c-text-dim); }

/* Upload (admin) */
.upload-form { display: flex; flex-direction: column; gap: 16px; }
.upload-drop {
    display: block;
    padding: 32px 20px;
    text-align: center;
    border: 2px dashed var(--c-border-strong);
    border-radius: var(--r-md);
    background: var(--c-gray-soft);
    cursor: pointer;
    transition: border-color 120ms, background 120ms;
}
.upload-drop:hover { border-color: var(--c-accent); background: var(--c-accent-soft); }
.upload-drop input[type="file"] { display: block; margin: 0 auto 8px; font: inherit; }
.upload-hint { display: block; color: var(--c-text-dim); font-size: 13px; }
.upload-result h2 { margin-top: 0; font-size: 16px; }
.upload-result p { margin: 0 0 8px; font-size: 14px; }
.upload-ok      { border-left: 4px solid var(--c-ok); }
.upload-skipped { border-left: 4px solid var(--c-warn); }
.upload-error   { border-left: 4px solid var(--c-accent); }
.upload-output {
    background: var(--c-gray-soft);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--c-text-dim);
    margin: 8px 0 0;
}

/* Dashboard (admin) */
.profile-card {
    background: linear-gradient(135deg, var(--c-accent-soft) 0%, var(--c-surface) 100%);
    border-color: var(--c-accent-border);
}
.profile-text { font-size: 17px; line-height: 1.5; margin: 0 0 12px; color: var(--c-text); }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--r-full);
    background: var(--c-surface);
    border: 1px solid var(--c-accent-border);
    color: var(--c-accent);
    font-size: 13px;
    font-weight: 500;
}
.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dash-card { margin-bottom: 0; }
.dash-card-wide { grid-column: 1 / -1; }
.big-number {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 8px 0 4px;
    font-variant-numeric: tabular-nums;
}
.big-meta { font-size: 13px; color: var(--c-text-dim); margin-bottom: 4px; }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.delta-up { color: var(--c-accent); }
.delta-down { color: var(--c-ok); }

/* Category bars */
.cat-bars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cat-bar-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}
.cat-bar-label { font-weight: 500; }
.cat-bar-value { color: var(--c-text-dim); font-variant-numeric: tabular-nums; }
.cat-bar-track {
    height: 6px;
    background: var(--c-gray-soft);
    border-radius: var(--r-full);
    overflow: hidden;
}
.cat-bar-fill { height: 100%; background: var(--c-accent); border-radius: var(--r-full); }

/* Cycle chart */
.cycle-chart { width: 100%; height: auto; max-height: 110px; margin-top: 8px; }

/* Predictions list */
.pred-list { list-style: none; margin: 0; padding: 0; }
.pred-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--c-border);
}
.pred-row:last-child { border-bottom: none; }
.pred-icon { font-size: 26px; line-height: 1; flex-shrink: 0; width: 36px; text-align: center; }
.pred-body { flex: 1; min-width: 0; }
.pred-name { font-weight: 600; font-size: 14px; }
.pred-meta { font-size: 12px; color: var(--c-text-dim); }
.pred-when {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}
.pred-status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: var(--r-full);
}
.pred-status-urgent { background: var(--c-accent); color: white; }
.pred-status-soon   { background: var(--c-warn-soft); color: var(--c-warn); }
.pred-status-ok     { background: var(--c-ok-soft); color: var(--c-ok); }
.pred-days { font-size: 12px; color: var(--c-text-dim); font-variant-numeric: tabular-nums; }
.pred-row.pred-urgent {
    background: var(--c-accent-soft);
    margin: 0 -14px;
    padding-left: 14px;
    padding-right: 14px;
}

/* 8. Vistas específicas --------------------------------------- */

/* Landing */
.landing-hero {
    text-align: center;
    padding: 56px 0 32px;
    max-width: 720px;
    margin: 0 auto;
}
.landing-title {
    font-size: 38px;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin: 0 0 16px;
}
.landing-lead {
    font-size: 17px;
    color: var(--c-text-dim);
    margin: 0 auto 28px;
    max-width: 560px;
}
.landing-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.landing-privacy { font-size: 13px; color: var(--c-text-faint); margin: 0; }
.landing-section {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 0;
    border-top: 1px solid var(--c-border);
}
.landing-section-title { font-size: 20px; margin: 0 0 20px; letter-spacing: -0.015em; }
.landing-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 16px;
}
.landing-steps li {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 16px 18px;
}
.landing-step-num {
    flex: 0 0 32px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--c-accent-soft);
    color: var(--c-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}
.landing-steps h3, .landing-features h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.landing-steps p,  .landing-features p  { margin: 0; color: var(--c-text-dim); font-size: 14px; }
.landing-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.landing-features li {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 16px 18px;
}
.landing-final-cta {
    text-align: center;
    padding: 40px 20px;
    margin: 32px auto 0;
    max-width: 720px;
    background: var(--c-accent-soft);
    border: 1px solid var(--c-accent-border);
    border-radius: var(--r-md);
}
.landing-final-cta h2 { margin: 0 0 8px; font-size: 22px; }
.landing-final-cta p { margin: 0 0 20px; color: var(--c-text-dim); }
.landing-footer {
    max-width: 720px;
    margin: 32px auto 0;
    padding: 24px 0 8px;
    text-align: center;
    font-size: 12px;
    color: var(--c-text-faint);
    border-top: 1px solid var(--c-border);
}
.landing-footer-sep { margin: 0 6px; }

/* 6. Bottom nav + FAB ----------------------------------------- */

.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    max-width: none;
    background: rgba(251,246,241,.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--c-line);
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    padding: 8px 10px calc(26px + env(safe-area-inset-bottom));
    z-index: 20;
    align-items: center;
}
.nav-btn {
    background: none;
    border: none;
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    font-family: inherit;
    color: var(--c-text-dim);
    transition: color .15s;
    text-decoration: none;
}
.nav-btn.active { color: var(--c-accent-warm); }
.nav-icon { font-size: 18px; line-height: 1; }
.nav-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; }
.nav-fab {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--c-accent-warm);
    color: white;
    border: none;
    font-size: 26px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(226,101,79,.4);
    margin-top: -22px;
    line-height: 1;
    font-family: inherit;
    display: grid;
    place-items: center;
    transition: transform .2s;
    overflow: hidden;
    padding: 0;
}
.nav-fab:active { transform: scale(0.92); }
.nav-fab.fab-open { transform: scale(0.92); }
.nav-fab-mascot img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Bottom sheet "O que fazemos agora?" — substitui o antigo fab-menu genérico */
.menna-sheet-backdrop {
    position: fixed; inset: 0; z-index: 300; background: rgba(20,20,46,.45);
    opacity: 0; transition: opacity .2s ease;
}
.menna-sheet-backdrop.open { opacity: 1; }
.menna-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 301; max-width: 640px; margin: 0 auto;
    background: var(--c-bg); border-radius: 20px 20px 0 0; box-shadow: 0 -12px 32px rgba(27,27,71,.18);
    padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.9,.3,1);
}
.menna-sheet.open { transform: translateY(0); }
.menna-sheet__handle { width: 36px; height: 4px; border-radius: 2px; background: var(--c-line); margin: 0 auto 14px; }
.menna-sheet__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.menna-sheet__head img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.menna-sheet__head h3 { font-family: var(--f-heading); font-size: 1.0625rem; margin: 0; color: var(--c-text); }
.menna-sheet__card {
    display: flex; align-items: center; gap: 10px; background: var(--c-surface); border: 1px solid var(--c-line);
    border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
}
.menna-sheet__card-icon { font-size: 1.25rem; flex-shrink: 0; }
.menna-sheet__card-text { flex: 1; font-size: .8125rem; color: var(--c-text); line-height: 1.35; }
.menna-sheet .btn-pill-primary { flex-shrink: 0; white-space: nowrap; }
.menna-sheet__chat-link {
    display: block; text-align: center; color: var(--c-text-dim); font-size: .8125rem; font-weight: 600;
    text-decoration: none; padding: 8px;
}

/* Vista /today/manual.php */
.manual-page { display: flex; flex-direction: column; gap: 0; }

.manual-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0 16px;
}
.manual-header h2 { margin: 0; font-size: 20px; font-weight: 700; }
.btn-back {
    font-size: 13px;
    color: var(--c-text-dim);
    text-decoration: none;
    padding: 4px 0;
    flex-shrink: 0;
}
.btn-back:hover { color: var(--c-accent-warm); text-decoration: none; }

.manual-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.manual-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-text-dim); font-weight: 600; }
.manual-small-label { font-size: 11px; color: var(--c-text-dim); font-weight: 500; display: flex; flex-direction: column; gap: 4px; }

.manual-select,
.manual-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--c-line);
    border-radius: 10px;
    background: var(--c-paper);
    font-family: inherit;
    font-size: 15px;
    color: var(--c-text);
    appearance: none;
}
.manual-select:focus,
.manual-input:focus {
    outline: none;
    border-color: var(--c-accent-warm);
    box-shadow: 0 0 0 2px var(--c-accent-warm-soft);
}

.manual-store-row { display: flex; gap: 8px; align-items: center; }
.manual-new-store { margin-top: 6px; }

/* Linhas de produto */
.manual-row {
    background: var(--c-paper);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: 12px 14px;
    margin-bottom: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.manual-row-prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.picker-trigger {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    border-color: var(--c-line);
    color: var(--c-text-dim);
    font-size: 14px;
    border-radius: 10px;
    padding: 10px 12px;
}
.picker-trigger.has-product {
    color: var(--c-text);
    border-color: var(--c-accent-warm);
    background: var(--c-accent-warm-soft);
}
.picker-label { pointer-events: none; }
.row-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: var(--c-text-faint);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--r-sm);
}
.row-remove:hover { color: var(--c-error); background: var(--c-error-soft); }

/* Total bar */
.manual-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-top: 1px solid var(--c-line-soft);
    margin-top: 4px;
    margin-bottom: 16px;
}
.manual-total-label { font-size: 13px; color: var(--c-text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.manual-total-val { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.manual-actions { display: flex; flex-direction: column; gap: 8px; padding-bottom: 16px; }
.manual-add-btn { width: 100%; justify-content: center; margin-top: 4px; }

/* Vista /import/ */
.import-page { display: flex; flex-direction: column; gap: 0; }
.import-section { margin-bottom: 24px; }
.import-section-title { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.import-hint { font-size: 12px; color: var(--c-text-dim); margin: 0 0 12px; }
.import-loading { color: var(--c-text-dim); font-size: 13px; }
.import-empty { color: var(--c-text-dim); font-size: 13px; padding: 12px 0; }
.import-divider { border: none; border-top: 1px solid var(--c-line-soft); margin: 4px 0 20px; }

/* Drop zone */
.file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 20px;
    border: 2px dashed var(--c-line);
    border-radius: var(--r-lg);
    background: var(--c-paper);
    cursor: pointer;
    text-align: center;
    transition: border-color 120ms, background 120ms;
    margin-bottom: 12px;
}
.file-drop:hover { border-color: var(--c-accent-warm); background: var(--c-accent-warm-soft); }
.file-drop-icon { font-size: 28px; color: var(--c-accent-warm); }
.file-drop-label { font-size: 13px; color: var(--c-text-dim); }
.file-input-hidden { display: none; }
.file-preview { margin-bottom: 12px; font-size: 13px; color: var(--c-text-dim); }
.file-preview ul { margin: 0; padding-left: 16px; }

.import-submit {
    display: block;
    width: 100%;
    padding: 13px 18px;
    background: var(--c-accent-warm);
    color: white;
    border: none;
    border-radius: var(--r-lg);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.import-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Batch list */
.batch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.batch-item { }
.batch-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--c-paper);
    border: 1px solid var(--c-line);
    border-radius: 10px;
    font-size: 13px;
    color: var(--c-text);
    text-decoration: none;
}
.batch-link:hover { background: var(--c-accent-warm-soft); border-color: var(--c-accent-warm); text-decoration: none; }

/* Status table (fragmento HTMX) */
.import-status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.import-status-table th,
.import-status-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--c-line-soft);
}
.import-status-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-dim); }
.import-status-table tr:last-child td { border-bottom: none; }

/* Job rows */
.job-row { }
.job-done { }
.job-error td { background: var(--c-error-soft); }
.job-processing td { background: var(--c-warn-soft); }
.job-name { font-weight: 500; word-break: break-all; }
.job-result { color: var(--c-text-dim); font-size: 12px; }
.job-error-text { color: var(--c-error); font-size: 12px; }

/* Badge variantes de status */
.badge.badge-done       { background: var(--c-ok); }
.badge.badge-error      { background: var(--c-error); }
.badge.badge-processing { background: var(--c-warn); color: white; }
.badge.badge-queued     { background: var(--c-gray-soft); color: var(--c-text-dim); }

/* btn-accent — alias de btn-full.accent para compatibilidade com manual.php */
.btn.btn-accent {
    background: var(--c-accent-warm);
    color: white;
    border-color: transparent;
    justify-content: center;
    width: 100%;
    font-size: 15px;
    font-weight: 600;
    padding: 13px 18px;
    border-radius: var(--r-lg);
}
.btn.btn-accent:hover { background: #bf3800; color: white; text-decoration: none; }

/* 9. Media queries desktop ------------------------------------ */

@media (min-width: 481px) {
    /* Catalog picker mobile — sticky search */
    .catalog-search.sticky-mobile {
        position: sticky;
        top: 0;
        background: var(--c-paper);
        padding: 4px 0 10px;
        z-index: 2;
    }
}

@media (max-width: 480px) {
    .topbar { padding: 12px 16px; }
    .container { padding: 16px 14px 32px; }

    .list a.row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "title total"
            "meta badge";
    }
    .row-main  { grid-area: title; }
    .row-total { grid-area: total; }
    .row-meta  { grid-area: meta; }
    .badge     { grid-area: badge; justify-self: end; }

    table.items th, table.items td { padding: 8px; font-size: 13px; }
    table.items .col-vat,
    table.items .col-unit { display: none; }

    .page-head { flex-direction: column; align-items: stretch; }
    .form-grid { grid-template-columns: 1fr; }
    .catalog-grid { grid-template-columns: 1fr; }
    .dash-grid { grid-template-columns: 1fr; }
    .big-number { font-size: 30px; }

    .landing-hero { padding: 32px 0 24px; }
    .landing-title { font-size: 28px; }
    .landing-lead { font-size: 15px; }
    .landing-features { grid-template-columns: 1fr; }
    .landing-final-cta { padding: 28px 16px; }
}

/* ============================================================
   Vista /receipts/receipt.php  (redesign)
   ============================================================ */
.receipt-page { display: flex; flex-direction: column; gap: 0; }
.receipt-page--scroll {
    margin: -16px -18px 0; /* cancela padding do mobile-view para sticky header funcionar */
}

/* — Cabeçalho — */
.receipt-header2 {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: 14px 16px 0;
}
.receipt-page--scroll .receipt-header2 {
    position: sticky;
    top: var(--topbar-h);
    z-index: 8;
}
.receipt-header2-main {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 12px;
}
.receipt-header2-info { flex: 1; min-width: 0; }
.receipt-header2-store-row {
    display: flex; align-items: center; gap: 4px; margin-bottom: 3px;
}
.receipt-header2-store {
    font-size: 17px; font-weight: 700; letter-spacing: -.01em;
    color: var(--c-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.receipt-header2-meta {
    font-size: 12px; color: var(--c-text-dim);
    display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.receipt-header2-dot { opacity: .4; }
.rh2-badge {
    display: inline-flex; align-items: center;
    background: var(--c-warn); color: #fff;
    font-size: 10px; font-weight: 700; letter-spacing: .03em;
    padding: 2px 7px; border-radius: 10px;
}
.receipt-header2-total {
    font-size: 22px; font-weight: 800; letter-spacing: -.02em;
    color: var(--c-accent-warm); line-height: 1;
    flex-shrink: 0; text-align: right;
}

/* Thumbnail do talão */
.receipt-thumb-btn {
    position: relative; flex-shrink: 0;
    width: 54px; height: 72px;
    border: 1.5px solid var(--c-border);
    border-radius: 6px; overflow: hidden;
    background: var(--c-bg);
    cursor: pointer; padding: 0;
    transition: border-color .15s, box-shadow .15s;
}
.receipt-thumb-btn:hover { border-color: var(--c-accent-warm); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.receipt-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.receipt-thumb-hint {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.42); color: #fff;
    font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    opacity: 0; transition: opacity .15s;
}
.receipt-thumb-btn:hover .receipt-thumb-hint { opacity: 1; }

/* Barra de pendentes */
.receipt-pending-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 0 10px;
    font-size: 12px; font-weight: 500; color: var(--c-warn);
    border-top: 1px solid var(--c-line);
}
.confirm-all-btn {
    flex-shrink: 0; padding: 3px 10px;
    font-size: 11px; font-weight: 700;
    border: 1.5px solid var(--c-ok); border-radius: 20px;
    background: none; color: var(--c-ok); cursor: pointer;
    transition: background .15s, color .15s;
}
.confirm-all-btn:hover { background: var(--c-ok); color: #fff; }
.confirm-all-btn:disabled { opacity: .5; cursor: default; }

.ri2-manual { flex-direction: column; gap: 6px; }
.ri2-manual-name { padding-bottom: 2px; }
.ri2-manual .ri2-nums-row { width: 100%; }
.ri2-confirm-btn {
    flex-shrink: 0; margin-left: 4px;
    width: 28px; height: 28px;
    border-radius: 50%; border: 2px solid var(--c-ok);
    background: none; color: var(--c-ok);
    font-size: 13px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.ri2-confirm-btn:hover { background: var(--c-ok); color: #fff; }
.ri2-confirm-btn:disabled { opacity: .5; cursor: default; }

.receipt-store-select {
    font: inherit; font-size: 16px; font-weight: 700;
    color: var(--c-text); background: none;
    border: none; border-bottom: 2px solid var(--c-accent-warm);
    padding: 2px 4px 2px 0; cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 2px center;
    padding-right: 18px;
}
.receipt-new-store-link {
    font-size: 18px; font-weight: 300; color: var(--c-accent-warm);
    text-decoration: none; line-height: 1; padding: 0 2px;
}
.receipt-date-input {
    font: inherit; font-size: 13px; color: var(--c-text-dim);
    background: none; border: none; border-bottom: 1px dashed var(--c-border);
    padding: 1px 2px; cursor: pointer;
    appearance: none; -webkit-appearance: none;
}
.receipt-date-input:focus { outline: none; border-bottom-color: var(--c-accent-warm); color: var(--c-text); }
.store-new-form { padding: 12px 16px; border-bottom: 1px solid var(--c-line); }
.store-new-input {
    flex: 1; padding: 8px 12px; border: 1.5px solid var(--c-border); border-radius: 8px;
    font: inherit; font-size: 14px; background: var(--c-bg); color: var(--c-text);
}
.store-new-input:focus { outline: none; border-color: var(--c-accent-warm); }
.store-new-btn {
    padding: 8px 16px; background: var(--c-accent-warm); color: #fff;
    border: none; border-radius: 8px; font: inherit; font-size: 14px;
    font-weight: 600; cursor: pointer; white-space: nowrap;
}

/* — Modal de imagem — */
.receipt-img-modal {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,.7);
    align-items: center; justify-content: center;
    padding: 20px;
}
.receipt-img-modal.open { display: flex; }
.receipt-img-modal-inner {
    position: relative; max-width: 100%; max-height: 90vh;
    border-radius: 10px; overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.receipt-img-modal-inner img {
    display: block; max-width: 100%; max-height: 88vh;
    object-fit: contain;
}
.receipt-img-modal-close {
    position: absolute; top: 8px; right: 8px;
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(0,0,0,.5); color: #fff;
    border: none; cursor: pointer; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.receipt-img-modal-close:hover { background: rgba(0,0,0,.8); }

/* — Lista de items — */
.receipt-items2 { display: flex; flex-direction: column; }

.ri2 {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--c-line);
    background: var(--c-bg);
    transition: background .12s;
}
.ri2 + .ri2 {
    margin-top: 4px;
}
.ri2-pending {
    flex-direction: column; align-items: stretch;
    background: var(--c-surface);
    border-left: 3px solid var(--c-warn);
    padding: 12px 16px 14px 13px;
    border-radius: 4px;
    margin: 6px 8px;
    border-bottom: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ri2-pending + .ri2,
.ri2 + .ri2-pending {
    margin-top: 4px;
}
.ri2-ignored {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 14px; margin: 2px 8px;
    border-radius: 4px; opacity: .45;
    border-left: 3px solid var(--c-border);
}
.ri2-ignored-text {
    flex: 1; font-size: 12px; color: var(--c-text-dim);
    text-decoration: line-through; font-style: italic;
}
.ri2-unignore-btn {
    background: none; border: none; cursor: pointer;
    font-size: 14px; color: var(--c-text-dim); padding: 2px 4px;
    border-radius: 4px; transition: color .12s;
}
.ri2-unignore-btn:hover { color: var(--c-text); }
.ri2-ignore-btn {
    background: none; border: none; cursor: pointer;
    font-size: 11px; color: var(--c-text-dim); padding: 1px 5px;
    border-radius: 4px; transition: color .12s, background .12s;
    flex-shrink: 0; line-height: 1.6;
}
.ri2-ignore-btn:hover { color: var(--c-error, #c0392b); background: rgba(192,57,43,.08); }
.ri2-hint-row { display: flex; align-items: center; gap: 8px; }
.ri2-top {
    display: flex; align-items: center; gap: 11px;
    width: 100%;
}
.ri2-icon {
    font-size: 20px; width: 30px; text-align: center; flex-shrink: 0; line-height: 1;
}
.ri2-icon-pending {
    font-size: 15px; font-weight: 800; color: var(--c-warn);
    background: var(--c-warn-soft); border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
}
.ri2-info { flex: 1; min-width: 0; }
.ri2-name {
    font-size: 14px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--c-text);
}
.ri2-raw {
    font-size: 12px; font-weight: 600;
    color: var(--c-text-dim);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: ui-monospace, monospace; letter-spacing: .01em;
}
.ri2-cat { font-size: 11px; color: var(--c-text-dim); margin-top: 1px; }
.ri2-label-pending { font-size: 11px; color: var(--c-warn); font-weight: 500; margin-top: 1px; }

.ri2-price-col {
    display: flex; align-items: center; gap: 4px;
    flex-shrink: 0; justify-content: flex-end;
}
.ri2-qty { font-size: 11px; color: var(--c-text-dim); }
.ri2-price { font-size: 14px; font-weight: 700; color: var(--c-text); white-space: nowrap; }
.ri2-edit-btn {
    background: none; border: none; cursor: pointer;
    font-size: 13px; padding: 3px 5px; border-radius: 5px;
    color: var(--c-text-dim); line-height: 1;
    transition: background .12s;
    flex-shrink: 0;
}
.ri2-edit-btn:hover, .ri2-edit-btn:active { background: var(--c-gray-soft); }
.ri2-edit-header {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px 4px; flex-wrap: wrap;
}
.ri2-edit-icon { font-size: 20px; flex-shrink: 0; }
.ri2-edit-name { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; }
.ri2-edit-raw { font-size: 11px; color: var(--c-text-dim); flex-basis: 100%; padding-left: 28px; }
.ri2-rematch-btn {
    background: none; border: 1px solid var(--c-border); border-radius: 6px;
    font-size: 13px; padding: 2px 6px; cursor: pointer; color: var(--c-text-dim);
    flex-shrink: 0; transition: border-color .12s, color .12s;
}
.ri2-rematch-btn:hover { border-color: var(--c-accent-warm); color: var(--c-accent-warm); }

/* — Picker inline (items pendentes) — */

/* Linha 1: input descrição + botão catálogo */
.ri2-desc-row {
    display: flex; align-items: flex-end; gap: 8px; width: 100%;
}
.ri2-desc-wrap {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px;
}
.ri2-field-hint {
    font-size: 10px; color: var(--c-text-dim);
    font-family: ui-monospace, monospace; letter-spacing: .01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding-left: 2px; line-height: 1.2;
}
.ri2-desc-input {
    width: 100%; padding: 8px 10px;
    border: 1.5px solid var(--c-border); border-radius: 7px;
    font: inherit; font-size: 13px; font-weight: 500;
    background: var(--c-bg); color: var(--c-text);
    transition: border-color .15s, box-shadow .15s;
}
.ri2-desc-input:focus {
    outline: none; border-color: var(--c-accent-warm);
    box-shadow: 0 0 0 2px var(--c-accent-warm-soft);
}
.ri2-catalog-btn {
    display: inline-flex; align-items: center; gap: 4px;
    flex-shrink: 0; padding: 5px 11px;
    background: var(--c-bg); border: 1.5px dashed var(--c-accent-warm);
    border-radius: 20px; font: inherit; font-size: 12px; font-weight: 600;
    color: var(--c-accent-warm); cursor: pointer; white-space: nowrap;
    transition: background .12s, border-color .12s; margin-left: auto;
}
.ri2-catalog-btn:hover, .ri2-catalog-btn:active {
    background: var(--c-accent-warm-soft); border-color: var(--c-accent-warm);
}

/* Linha 2: chips de sugestão + botão catálogo */
.ri2-chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; align-items: center; }
.ri2-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px;
    background: var(--c-bg); border: 1.5px solid var(--c-border);
    border-radius: 20px; font: inherit; font-size: 13px; font-weight: 500;
    color: var(--c-text); cursor: pointer;
    transition: background .12s, border-color .12s;
}
.ri2-chip:hover, .ri2-chip:active {
    background: var(--c-accent-warm-soft); border-color: var(--c-accent-warm);
}
.ri2-chip-score { font-size: 10px; color: var(--c-text-dim); font-weight: 400; }

/* Linha 3: quantidade + preço */
.ri2-nums-row {
    display: flex; align-items: center; gap: 6px; width: 100%;
    padding-top: 6px; border-top: 1px solid var(--c-line); margin-top: 4px;
}
.ri2-num-label {
    display: flex; flex-direction: column; gap: 2px;
    font-size: 9px; font-weight: 600; color: var(--c-text-dim);
    text-transform: uppercase; letter-spacing: .04em;
    align-items: center; flex-shrink: 0;
}
.ri2-num-input {
    padding: 5px 6px; border: 1.5px solid var(--c-border); border-radius: 6px;
    font: inherit; font-size: 13px; font-weight: 700;
    background: var(--c-bg); color: var(--c-text);
    text-align: center; width: 52px;
    transition: border-color .15s, box-shadow .15s;
}
.ri2-num-input:focus {
    outline: none; border-color: var(--c-accent-warm);
    box-shadow: 0 0 0 2px var(--c-accent-warm-soft);
}
.ri2-price-wrap { display: flex; align-items: center; gap: 3px; }
.ri2-num-price { width: 68px; }
.ri2-eur { font-size: 12px; font-weight: 600; color: var(--c-text-dim); }
.ri2-num-computed {
    display: flex; flex-direction: column; gap: 2px;
    font-size: 9px; font-weight: 600; color: var(--c-text-dim);
    text-transform: uppercase; letter-spacing: .04em;
    align-items: center; flex-shrink: 0;
}
.ri2-num-computed-val {
    padding: 5px 8px; border: 1.5px solid transparent; border-radius: 6px;
    font: inherit; font-size: 13px; font-weight: 700;
    background: var(--c-line); color: var(--c-text-dim);
    text-align: center; min-width: 52px; white-space: nowrap;
}
.ri2-num-sep {
    font-size: 14px; font-weight: 300; color: var(--c-text-dim); flex-shrink: 0;
}

/* Modal de search por catálogo (bottom sheet) */
.ri2-search-modal {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.5);
    align-items: flex-end; justify-content: center;
}
.ri2-search-modal.open { display: flex; }
.ri2-search-panel {
    width: 100%; max-width: 520px;
    background: var(--c-surface);
    border-radius: 16px 16px 0 0;
    padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    max-height: 70vh;
    box-shadow: 0 -8px 40px rgba(0,0,0,.2);
}
.ri2-search-header {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14px; font-weight: 700;
}
.ri2-search-close {
    background: var(--c-gray-soft); border: none; cursor: pointer;
    width: 28px; height: 28px; border-radius: 50%;
    font-size: 12px; font-weight: 700; color: var(--c-text-dim);
    display: flex; align-items: center; justify-content: center;
}
.ri2-search-input {
    width: 100%; padding: 10px 13px;
    border: 1.5px solid var(--c-border); border-radius: 8px;
    font: inherit; font-size: 14px;
    background: var(--c-bg); color: var(--c-text);
    transition: border-color .15s, box-shadow .15s;
}
.ri2-search-input:focus {
    outline: none; border-color: var(--c-accent-warm);
    box-shadow: 0 0 0 2px var(--c-accent-warm-soft);
}
.ri2-search-results { overflow-y: auto; }

/* Search inline (sem modal) */
.ri2-search-inline { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.ri2-search-inline .ri2-search-input {
    width: 100%; padding: 8px 12px;
    border: 1.5px solid var(--c-border); border-radius: 8px;
    font: inherit; font-size: 13px;
    background: var(--c-bg); color: var(--c-text);
    transition: border-color .15s, box-shadow .15s;
}
.ri2-search-inline .ri2-search-input:focus {
    outline: none; border-color: var(--c-accent-warm);
    box-shadow: 0 0 0 2px var(--c-accent-warm-soft);
}
.ri2-search-inline .ri2-search-results { max-height: 220px; overflow-y: auto; }

/* — Icon picker — */
.icon-picker-wrap { display: flex; align-items: center; gap: 10px; }
.icon-preview {
    font-size: 28px; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--c-border); border-radius: 8px;
    background: var(--c-bg); cursor: pointer; flex-shrink: 0;
    transition: border-color .15s;
}
.icon-preview:hover { border-color: var(--c-accent-warm); }
.icon-preview img { width: 32px; height: 32px; object-fit: contain; }
.icon-picker-actions { display: flex; flex-direction: column; gap: 6px; }
.icon-picker-open-btn, .icon-upload-label {
    font-size: 12px; font-weight: 600; color: var(--c-accent-warm);
    background: none; border: none; cursor: pointer; padding: 0;
    text-align: left; text-decoration: underline; text-underline-offset: 2px;
}
.icon-upload-label input[type=file] { display: none; }

.icon-picker-modal {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.5); backdrop-filter: blur(3px);
    align-items: flex-start; justify-content: center;
    padding: 60px 16px 16px;
}
.icon-picker-modal.open { display: flex; }
.icon-picker-panel {
    width: 100%; max-width: 520px;
    background: var(--c-surface); border-radius: 16px;
    padding: 16px; display: flex; flex-direction: column; gap: 12px;
    max-height: 70vh; box-shadow: 0 12px 48px rgba(0,0,0,.2);
}
.icon-picker-header {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14px; font-weight: 700;
}
.icon-picker-close {
    background: var(--c-gray-soft); border: none; cursor: pointer;
    width: 28px; height: 28px; border-radius: 50%;
    font-size: 12px; color: var(--c-text-dim);
    display: flex; align-items: center; justify-content: center;
}
.icon-picker-search {
    width: 100%; padding: 8px 12px;
    border: 1.5px solid var(--c-border); border-radius: 8px;
    font: inherit; font-size: 13px; background: var(--c-bg); color: var(--c-text);
}
.icon-picker-search:focus { outline: none; border-color: var(--c-accent-warm); }
.icon-picker-inner {
    width: 100%; max-width: 520px;
    background: var(--c-surface); border-radius: 16px;
    padding: 16px; display: flex; flex-direction: column; gap: 10px;
    max-height: 72vh; box-shadow: 0 12px 48px rgba(0,0,0,.2);
}
.icon-picker-search-wrap {
    display: flex; align-items: center; gap: 8px;
}
.icon-picker-search-wrap .icon-picker-search { flex: 1; margin: 0; }
.icon-picker-sections-scroll {
    overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 12px;
}
.icon-picker-cat-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--c-text-dim); margin-bottom: 4px;
}
.icon-picker-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 6px;
}
.icon-picker-btn {
    font-size: 22px; padding: 6px; border-radius: 8px;
    border: 1.5px solid transparent; background: var(--c-bg);
    cursor: pointer; text-align: center; transition: border-color .1s, background .1s;
    aspect-ratio: 1;
}
.icon-picker-btn:hover { border-color: var(--c-accent-warm); background: var(--c-accent-warm-soft); }
.icon-picker-btn.selected { border-color: var(--c-accent-warm); background: var(--c-accent-warm-soft); }

/* — Acções no rodapé — */
.receipt-actions2 {
    display: flex; gap: 8px; padding: 16px;
    border-top: 1px solid var(--c-border); margin-top: auto;
}

/* — Animação de resolução — */
.resolved-anim { animation: ri2-resolve .45s ease; }
@keyframes ri2-resolve {
    0%  { background: var(--c-ok-soft); }
    100%{ background: var(--c-bg); }
}

/* Legacy aliases — usados noutras páginas */
.receipt-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid var(--c-line); background: var(--c-bg);
}
.receipt-item.unresolved { background: var(--c-surface); opacity: .7; }
.receipt-item-icon { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; }
.receipt-item-body { flex: 1; min-width: 0; }
.receipt-item-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receipt-item-cat  { font-size: 11px; color: var(--c-text-dim); margin-top: 2px; }
.receipt-item-price { font-size: 14px; font-weight: 600; flex-shrink: 0; text-align: right; display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.receipt-qty { font-size: 11px; color: var(--c-text-dim); }
.receipt-actions { display: flex; gap: 10px; padding: 16px; }
.receipt-back { margin: 16px; }

/* ============================================================
   Vista /purchases/
   ============================================================ */
.purchases-page { display: flex; flex-direction: column; }

.purchases-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface);
    position: sticky; top: 0; z-index: 10;
}
.purchases-count { font-size: 12px; color: var(--c-text-dim); }
.sort-tabs { display: flex; gap: 4px; }
.sort-tab {
    font-size: 12px; padding: 4px 10px; border-radius: 20px;
    color: var(--c-text-dim); text-decoration: none;
    border: 1px solid transparent;
    transition: all .15s;
}
.sort-tab.active {
    background: var(--c-accent-warm); color: #fff;
    border-color: var(--c-accent-warm);
}
.sort-tab:not(.active):hover { border-color: var(--c-border); }

.purchases-list { display: flex; flex-direction: column; }
.purchase-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-line);
    background: var(--c-bg);
    transition: background .15s;
}
.purchase-row.out-of-stock { background: rgba(226,101,79,.06); }
.purchase-icon { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; }
.purchase-body { flex: 1; min-width: 0; }
.purchase-name {
    font-size: 14px; font-weight: 500;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.badge-out {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--c-accent-warm); color: #fff;
    padding: 2px 7px; border-radius: 10px;
}
.purchase-meta {
    font-size: 11px; color: var(--c-text-dim); margin-top: 3px;
    display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.purchase-right { flex-shrink: 0; text-align: right; }
.purchase-price { font-size: 14px; font-weight: 600; }
.purchase-times { font-size: 11px; color: var(--c-text-dim); }

.purchases-empty { padding: 48px 24px; text-align: center; }
.purchases-note { font-size: 11px; color: var(--c-text-dim); padding: 8px 16px 24px; }

/* ============================================================
   Vista /receipts/
   ============================================================ */
.receipts-page { display: flex; flex-direction: column; }
.receipts-list { display: flex; flex-direction: column; }

.receipt-row {
    display: flex; align-items: center;
    border-bottom: 1px solid var(--c-line);
    background: var(--c-bg);
}
.receipt-row-link {
    flex: 1; display: flex; align-items: center; gap: 12px;
    padding: 13px 0 13px 16px;
    color: var(--c-text); text-decoration: none;
    min-width: 0;
}
.receipt-row-link:hover { background: var(--c-surface); }
.receipt-row-icon { font-size: 22px; flex-shrink: 0; width: 32px; text-align: center; }
.receipt-row-body { flex: 1; min-width: 0; }
.receipt-row-store { font-size: 14px; font-weight: 600; }
.receipt-row-meta  { font-size: 12px; color: var(--c-text-dim); margin-top: 2px;
                     display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.receipt-row-total { font-size: 15px; font-weight: 700; padding-right: 4px; flex-shrink: 0; }

.receipt-delete-btn {
    background: none; border: none; cursor: pointer;
    font-size: 18px; padding: 13px 14px; color: var(--c-text-dim);
    flex-shrink: 0;
    transition: color .15s;
}
.receipt-delete-btn:hover { color: var(--c-error); }

.import-spinner {
    text-align: center;
    padding: 24px;
    font-size: 15px;
    color: var(--c-text-dim);
    animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ============================================================
   Review inline na vista /today/receipt.php
   ============================================================ */
.review-banner {
    background: var(--c-warn-soft);
    border-left: 3px solid var(--c-warn);
    padding: 10px 16px;
    font-size: 13px;
    color: var(--c-warn);
    display: flex; gap: 8px; align-items: flex-start;
}

.review-item { flex-direction: column; align-items: flex-start !important; padding: 12px 16px !important; gap: 8px !important; }
.review-body { width: 100%; }
.review-raw  { font-size: 13px; font-weight: 600; color: var(--c-text-dim); margin-bottom: 8px; }

.review-price-edit {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
}
.review-price-label {
    font-size: 12px; color: var(--c-text-dim); white-space: nowrap;
}
.review-price-input {
    width: 90px; padding: 6px 10px;
    border: 1px solid var(--c-border); border-radius: 8px;
    font: inherit; font-size: 14px; font-weight: 600;
    background: var(--c-surface); color: var(--c-text);
    text-align: right;
}
.review-price-input:focus { outline: none; border-color: var(--c-accent-warm); box-shadow: 0 0 0 2px var(--c-accent-warm-soft); }

.btn-reopen {
    background: none; border: none; cursor: pointer;
    font-size: 13px; padding: 3px 6px; margin-left: 2px;
    color: var(--c-text-dim);
    border-radius: 6px;
    line-height: 1;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.btn-reopen:hover, .btn-reopen:active { background: var(--c-gray-soft); color: var(--c-text); }

.review-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.review-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: 20px; padding: 5px 12px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    color: var(--c-text);
    transition: background .15s, border-color .15s;
}
.review-chip:hover { background: var(--c-accent-warm-soft); border-color: var(--c-accent-warm); }
.chip-score { font-size: 10px; color: var(--c-text-dim); }

.review-search { position: relative; }
.review-search-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font: inherit; font-size: 14px;
    background: var(--c-surface);
    color: var(--c-text);
}
.review-search-input:focus { outline: none; border-color: var(--c-accent-warm); box-shadow: 0 0 0 2px var(--c-accent-warm-soft); }

.review-search-results { margin-top: 4px; }
.picker-results-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--c-border); border-radius: 8px; overflow: hidden; }
.picker-result-btn {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: var(--c-surface);
    border: none; border-bottom: 1px solid var(--c-line);
    cursor: pointer; text-align: left; font: inherit;
    transition: background .1s;
}
.picker-result-btn:last-of-type { border-bottom: none; }
.picker-result-btn:hover { background: var(--c-bg-warm); }
.picker-result-icon { font-size: 18px; flex-shrink: 0; }
.picker-result-name { font-size: 14px; font-weight: 500; flex: 1; }
.picker-result-cat  { font-size: 11px; color: var(--c-text-dim); }
.picker-results-empty { font-size: 13px; color: var(--c-text-dim); padding: 8px 0; }
.picker-create-link { display: block; padding: 10px 14px; font-size: 13px; color: var(--c-accent-warm); font-weight: 500; }
.picker-create-link:hover { background: var(--c-accent-warm-soft); }

.review-resolved { font-size: 11px; color: var(--c-ok); font-weight: 600; }
.resolved-anim { animation: resolve-flash .4s ease; }
@keyframes resolve-flash { 0%{background:var(--c-ok-soft)} 100%{background:transparent} }

.receipt-actions { display: flex; gap: 10px; padding: 16px; }

/* ═══════════════════════════════════════════════════════════════
   TOPBAR — ícones 🛒 e 👤
═══════════════════════════════════════════════════════════════ */
.topbar-actions {
    display: flex; align-items: center; gap: 4px;
}
.topbar-icon-btn {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: none; border: none;
    font-size: 20px; cursor: pointer;
    border-radius: 50%;
    transition: background .15s;
    text-decoration: none;
    color: inherit;
}
.topbar-icon-btn:hover { background: var(--c-surface); }
.topbar-badge {
    position: absolute; top: 2px; right: 2px;
    background: var(--c-accent-warm); color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 8px; padding: 0 3px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}
.topbar-user-menu { position: relative; }
.user-dropdown {
    position: absolute; top: calc(100% + 6px); right: 0;
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: 200px; z-index: 200; padding: 8px 0;
    max-height: 80vh; overflow-y: auto;
}
.user-dropdown-name  { padding: 8px 16px 2px; font-weight: 600; font-size: 14px; }
.user-dropdown-email { padding: 0 16px 8px; font-size: 12px; color: var(--c-text-dim); border-bottom: 1px solid var(--c-line); }
.user-dropdown-logout {
    display: block; width: 100%; padding: 10px 16px;
    background: none; border: none; text-align: left;
    font: inherit; font-size: 14px; cursor: pointer; color: var(--c-text);
    transition: background .1s;
}
.user-dropdown-logout:hover { background: var(--c-bg-warm); color: var(--c-accent-warm); }

/* ═══════════════════════════════════════════════════════════════
   CART BTN — botão 🛒 inline (Despensa, Today)
═══════════════════════════════════════════════════════════════ */
.cart-btn {
    background: none; border: 1px solid var(--c-border);
    border-radius: 8px; padding: 4px 8px;
    font-size: 16px; cursor: pointer; line-height: 1;
    transition: background .15s, border-color .15s;
    color: var(--c-text-dim);
}
.cart-btn:hover { background: var(--c-accent-warm-soft); border-color: var(--c-accent-warm); }
.cart-btn-added {
    background: var(--c-accent-warm-soft);
    border-color: var(--c-accent-warm);
    color: var(--c-accent-warm);
}
.track-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.hero-btns { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.hero-btns .cart-btn { font-size: 20px; padding: 8px 12px; border-radius: 10px; }

/* ═══════════════════════════════════════════════════════════════
   LISTA DE COMPRAS — /list/
═══════════════════════════════════════════════════════════════ */
.list-page { padding: 0 0 80px; }

.list-add-bar {
    display: flex; gap: 8px; padding: 14px 16px 8px;
    position: sticky; top: 0; background: var(--c-bg); z-index: 10;
    border-bottom: 1px solid var(--c-line);
}
.list-add-input {
    flex: 1; padding: 10px 14px;
    border: 1px solid var(--c-border); border-radius: 10px;
    font: inherit; font-size: 15px;
    background: var(--c-surface); color: var(--c-text);
}
.list-add-input:focus { outline: none; border-color: var(--c-accent-warm); box-shadow: 0 0 0 2px var(--c-accent-warm-soft); }
.list-add-btn {
    width: 42px; height: 42px;
    background: var(--c-accent-warm); color: #fff;
    border: none; border-radius: 10px; font-size: 22px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.list-search-results { padding: 0 16px 4px; }
.list-search-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--c-border); border-radius: 10px; overflow: hidden; background: var(--c-surface); }
.list-search-btn {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; background: none;
    border: none; border-bottom: 1px solid var(--c-line);
    cursor: pointer; text-align: left; font: inherit;
    transition: background .1s;
}
.list-search-btn:last-child { border-bottom: none; }
.list-search-btn:hover { background: var(--c-bg-warm); }
.list-search-icon { font-size: 18px; flex-shrink: 0; }
.list-search-name { font-size: 14px; font-weight: 500; flex: 1; }
.list-search-cat  { font-size: 11px; color: var(--c-text-dim); }
.list-search-empty { font-size: 13px; color: var(--c-text-dim); padding: 10px 0; }
.list-add-free-btn { background: none; border: none; color: var(--c-accent-warm); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }

#list-items { padding: 8px 16px; }
.list-empty { text-align: center; color: var(--c-text-dim); font-size: 15px; padding: 40px 0; line-height: 1.6; }

.list-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--c-line);
    transition: opacity .2s;
}
.list-item.checked { opacity: .45; }
.list-check-btn {
    width: 28px; height: 28px; flex-shrink: 0;
    border: 2px solid var(--c-border); border-radius: 50%;
    background: none; cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s;
    color: var(--c-text-dim);
}
.list-item.checked .list-check-btn {
    background: var(--c-ok); border-color: var(--c-ok); color: #fff;
}
.list-item-icon { font-size: 20px; flex-shrink: 0; }
.list-item-name { flex: 1; font-size: 15px; font-weight: 500; }
.list-item.checked .list-item-name { text-decoration: line-through; color: var(--c-text-dim); }
.list-del-btn {
    width: 28px; height: 28px; flex-shrink: 0;
    background: none; border: none; font-size: 18px;
    color: var(--c-text-dim); cursor: pointer; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: color .1s, background .1s;
}
.list-del-btn:hover { color: var(--c-error); background: var(--c-error-soft); }

.list-section-done {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 4px 6px;
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; color: var(--c-text-dim);
}
.list-clear-btn {
    background: none; border: none; font: inherit; font-size: 12px;
    color: var(--c-accent-warm); cursor: pointer; font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   FAB → Modal lista de compras
═══════════════════════════════════════════════════════════════ */
.fab-list-sheet {
    width: min(420px, 100vw);
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
    display: flex; flex-direction: column;
    padding: 0; overflow: hidden;
}
.fab-list-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 16px 10px;
    border-bottom: 1px solid var(--c-line);
}
.fab-list-title { font-size: 16px; font-weight: 700; }
.fab-list-close {
    background: none; border: none; font-size: 22px;
    color: var(--c-text-dim); cursor: pointer; padding: 0 4px;
}
.fab-list-search-wrap { padding: 10px 16px; border-bottom: 1px solid var(--c-line); }
.fab-list-input {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--c-border); border-radius: 10px;
    font: inherit; font-size: 15px;
    background: var(--c-surface); color: var(--c-text);
}
.fab-list-input:focus { outline: none; border-color: var(--c-accent-warm); box-shadow: 0 0 0 2px var(--c-accent-warm-soft); }
.fab-list-results { flex: 1; overflow-y: auto; padding: 8px 16px 16px; }

/* ═══════════════════════════════════════════════════════════════
   Novas adições 2026-04-27
═══════════════════════════════════════════════════════════════ */

/* purchase-body como botão clicável */
button.purchase-body {
    background: none; border: none; text-align: left;
    cursor: pointer; padding: 0; width: 100%; min-width: 0;
    font: inherit; color: inherit;
}
button.purchase-body:hover .purchase-name { color: var(--c-accent-warm); }

/* Lista: item seleccionado (pré-compra) */
.list-item.selected { background: var(--c-accent-warm-soft); }
.list-item.selected .list-check-btn { color: var(--c-accent-warm); }

/* Barra "Finalizar compra" */
.list-finalize-bar {
    position: sticky; bottom: 72px;
    display: flex; justify-content: center;
    padding: 12px 16px;
    background: linear-gradient(to top, var(--c-bg) 70%, transparent);
    pointer-events: none;
}
.list-finalize-bar > * { pointer-events: all; }
.btn-finalize {
    background: var(--c-accent-warm); color: #fff;
    border: none; border-radius: 24px;
    padding: 14px 28px; font-size: 15px; font-weight: 700;
    cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.18);
    transition: transform .1s, box-shadow .1s;
}
.btn-finalize:active { transform: scale(.97); box-shadow: 0 2px 8px rgba(0,0,0,.15); }

/* Filtros da página de talões */
/* — Receipts filter bars — */
.receipts-type-bar {
    display: flex; gap: 8px; padding: 12px 16px 0;
}
.rtype-pill {
    flex: 1; text-align: center;
    padding: 8px 0; border-radius: 10px; font-size: 13px; font-weight: 600;
    background: var(--c-surface); color: var(--c-text-dim);
    text-decoration: none; border: 1.5px solid var(--c-line);
    transition: background .15s, color .15s, border-color .15s;
}
.rtype-pill.active {
    background: var(--c-text); color: var(--c-bg);
    border-color: var(--c-text);
}
.receipts-period-bar {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 16px 12px; border-bottom: 1px solid var(--c-line);
}
.rperiod-btn {
    padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
    background: var(--c-surface); color: var(--c-text-dim);
    text-decoration: none; border: 1.5px solid var(--c-line);
    cursor: pointer; transition: background .12s, color .12s, border-color .12s;
    white-space: nowrap;
}
.rperiod-btn.active { background: var(--c-accent-warm); color: #fff; border-color: var(--c-accent-warm); }
.rperiod-btn:hover:not(.active) { border-color: var(--c-accent-warm); color: var(--c-accent-warm); }
.rperiod-cal { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.rperiod-cal-label { font-size: 11px; font-weight: 500; max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.receipts-month-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--c-text-dim); padding: 14px 16px 4px;
}
.receipts-results { margin-top: 0; }

/* — Date modal (dialog centrado, topo) — */
.datemod-backdrop {
    display: none; position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
}
.datemod-backdrop.open { display: block; }
.datemod {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.94);
    width: calc(100% - 32px); max-width: 400px; z-index: 501;
    background: var(--c-surface);
    border-radius: 18px;
    padding: 20px 20px 24px;
    box-shadow: 0 12px 48px rgba(0,0,0,.22);
    transition: transform .22s cubic-bezier(.32,1.1,.6,1), opacity .2s;
    opacity: 0; pointer-events: none;
    display: flex; flex-direction: column; gap: 16px;
}
.datemod.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.datemod-handle { display: none; }
.datemod-title {
    font-size: 15px; font-weight: 700; text-align: center; margin-top: -4px;
}
.datemod-presets {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.datemod-preset {
    padding: 10px; border-radius: 10px; font-size: 13px; font-weight: 500;
    background: var(--c-bg); border: 1.5px solid var(--c-line);
    cursor: pointer; transition: border-color .12s, background .12s;
}
.datemod-preset:hover { border-color: var(--c-accent-warm); background: var(--c-surface); }
.datemod-sep {
    text-align: center; font-size: 11px; color: var(--c-text-dim);
    position: relative;
}
.datemod-sep::before, .datemod-sep::after {
    content: ''; position: absolute; top: 50%; width: 28%; height: 1px;
    background: var(--c-line);
}
.datemod-sep::before { left: 0; }
.datemod-sep::after  { right: 0; }
.datemod-range {
    display: flex; align-items: center; gap: 10px;
}
.datemod-field { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.datemod-field-label { font-size: 11px; font-weight: 600; color: var(--c-text-dim); text-transform: uppercase; letter-spacing: .05em; }
.datemod-input {
    width: 100%; padding: 10px; border-radius: 10px;
    border: 1.5px solid var(--c-border); font: inherit; font-size: 14px;
    background: var(--c-bg); color: var(--c-text);
}
.datemod-input:focus { outline: none; border-color: var(--c-accent-warm); }
.datemod-arrow { font-size: 18px; color: var(--c-text-dim); flex-shrink: 0; margin-top: 16px; }
.datemod-preview {
    text-align: center; font-size: 13px; color: var(--c-accent-warm);
    font-weight: 600; min-height: 18px;
}
.datemod-apply {
    width: 100%; padding: 14px; border-radius: 12px;
    background: var(--c-accent-warm); color: #fff;
    border: none; font: inherit; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: opacity .15s;
}
.datemod-apply:hover { opacity: .88; }

/* User dropdown: links de navegação */
.user-dropdown-link {
    display: block; padding: 9px 16px;
    font-size: 14px; color: var(--c-text);
    text-decoration: none;
    transition: background .12s;
}
.user-dropdown-link:hover { background: var(--c-surface); }
.user-dropdown-section {
    padding: 8px 16px 4px;
    font-size: 10px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--c-text-dim);
    border-top: 1px solid var(--c-line);
    margin-top: 2px;
}

/* Histórico: loja e tendência de preços */
.history-store { font-size: 11px; color: var(--c-text-dim); flex: 1; padding: 0 4px; }
.history-avg { font-size: 12px; color: var(--c-text-dim); padding: 6px 0 2px; text-align: right; }
.hp.price-high { color: var(--c-accent-warm); font-weight: 700; }
.hp.price-low  { color: #22a85a; font-weight: 700; }

/* Banner: talão vindo do carrinho */
.from-cart-banner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: var(--c-ok); color: white;
    font-size: 13px; font-weight: 600; gap: 8px;
}
.from-cart-back { color: white; text-decoration: underline; font-weight: 400; white-space: nowrap; }

/* Secção "Já não tenho" no detalhe de produto */
.detail-out-section { padding: 12px 0 0; border-top: 1px solid var(--c-line); margin-top: 8px; }
.detail-out-label { font-size: 12px; color: var(--c-text-dim); margin-bottom: 6px; }
.detail-out-form { display: flex; gap: 8px; align-items: center; }
.detail-out-qty { width: 60px; padding: 6px 8px; border: 1.5px solid var(--c-border); border-radius: 6px; font: inherit; font-size: 14px; text-align: center; background: var(--c-bg); color: var(--c-text); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   DESPENSA — cart-ring e pdetail
═══════════════════════════════════════════════════════════════ */

/* Toggle switch carrinho */
.cart-ring {
    flex-shrink: 0;
    width: 44px; height: 26px;
    background: var(--c-border); border: none; border-radius: 13px;
    cursor: pointer; padding: 0; position: relative;
    transition: background .22s ease;
}
.cart-ring::after {
    content: '';
    position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
    transition: transform .22s ease;
}
.cart-ring.cart-ring-in {
    background: var(--c-ok);
}
.cart-ring.cart-ring-in::after {
    transform: translateX(18px);
}

.purchase-price-inline { font-weight: 600; color: var(--c-text); }
.purchase-price-avg { color: var(--c-text-dim); font-size: 10px; }
.purchase-price-var { font-size: 10px; font-weight: 700; }
.purchase-price-var.var-up   { color: var(--c-accent-warm); }
.purchase-price-var.var-down { color: var(--c-ok); }

/* Modal de detalhe de produto (pdetail) */
.pdetail-backdrop {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.pdetail-sheet {
    background: var(--c-bg); border-radius: 18px;
    width: 100%; max-width: 480px;
    max-height: 85vh; overflow-y: auto;
    padding: 20px 20px 28px;
    position: relative;
    box-shadow: 0 12px 48px rgba(0,0,0,.22);
}
.pdetail-close {
    position: absolute; top: 14px; right: 16px;
    background: var(--c-surface); border: none; border-radius: 50%;
    width: 28px; height: 28px; font-size: 13px; cursor: pointer;
    color: var(--c-text-dim); display: flex; align-items: center; justify-content: center;
}
.pdetail-head {
    display: flex; align-items: center; gap: 12px;
    padding-right: 32px; margin-bottom: 16px;
}
.pdetail-icon { font-size: 32px; flex-shrink: 0; }
.pdetail-name { font-size: 17px; font-weight: 700; }
.pdetail-cat  { font-size: 12px; color: var(--c-text-dim); margin-top: 2px; }

.pdetail-stats {
    display: flex; gap: 0; border: 1px solid var(--c-line);
    border-radius: 10px; overflow: hidden; margin-bottom: 20px;
}
.pdetail-stat {
    flex: 1; padding: 10px 8px; text-align: center;
    border-right: 1px solid var(--c-line);
}
.pdetail-stat:last-child { border-right: none; }
.pdetail-stat-val { font-size: 15px; font-weight: 700; }
.pdetail-stat-val small { font-size: 10px; font-weight: 400; }
.pdetail-stat-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--c-text-dim); margin-top: 2px; }
.var-up   .pdetail-stat-val { color: var(--c-accent-warm); }
.var-down .pdetail-stat-val { color: var(--c-ok); }

.pdetail-hist-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--c-text-dim); margin-bottom: 8px;
}
.pdetail-hist { display: flex; flex-direction: column; gap: 0; }
.pdetail-hist-row {
    display: grid; grid-template-columns: 90px 1fr auto auto;
    gap: 6px; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--c-line);
    font-size: 13px;
}
.pdetail-hist-date { color: var(--c-text-dim); font-size: 12px; }
.pdetail-hist-store { color: var(--c-text-dim); font-size: 12px; }
.pdetail-hist-price { font-weight: 700; text-align: right; }
.pdetail-hist-gap { font-size: 11px; color: var(--c-text-dim); text-align: right; }
.price-high { color: var(--c-accent-warm); }
.price-low  { color: var(--c-ok); }
.pdetail-empty { color: var(--c-text-dim); font-size: 13px; padding: 12px 0; }

/* ═══════════════════════════════════════════════════════════════
   CATÁLOGO — lista, produto edit, categorias
═══════════════════════════════════════════════════════════════ */

.catalog-page { display: flex; flex-direction: column; }

.catalog-topbar {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px 8px;
}
.catalog-search-form { flex: 1; display: flex; align-items: center; }
.catalog-search-wrap { flex: 1; position: relative; display: flex; align-items: center; }
.catalog-search-input {
    flex: 1; width: 100%; padding: 10px 34px 10px 14px;
    border: 1.5px solid var(--c-border); border-radius: 10px;
    font: inherit; font-size: 15px; background: var(--c-bg); color: var(--c-text);
}
.catalog-search-input:focus { outline: none; border-color: var(--c-accent-warm); }
.catalog-search-clear {
    position: absolute; right: 10px;
    font-size: 14px; color: var(--c-text-dim); text-decoration: none;
}
.catalog-new-btn {
    flex-shrink: 0; width: 36px; height: 36px;
    border-radius: 50%; background: var(--c-accent-warm); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 300; text-decoration: none; line-height: 1;
    transition: opacity .15s;
}
.catalog-new-btn:hover { opacity: .85; }

.catalog-cat-pills {
    display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 10px;
    scrollbar-width: none;
}
.catalog-cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
    flex-shrink: 0; padding: 4px 12px;
    border: 1.5px solid var(--c-border); border-radius: 20px;
    font-size: 12px; font-weight: 500; color: var(--c-text-dim);
    text-decoration: none; white-space: nowrap;
    transition: border-color .15s, color .15s, background .15s;
}
.cat-pill.active, .cat-pill:hover {
    border-color: var(--c-accent-warm); color: var(--c-accent-warm);
    background: var(--c-accent-warm-soft);
}

.catalog-group { margin-bottom: 4px; }
.catalog-group-title {
    padding: 10px 16px 4px;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--c-text-dim);
}
.catalog-list { display: flex; flex-direction: column; }
.catalog-row {
    display: flex; align-items: center; gap: 0;
    border-bottom: 1px solid var(--c-line);
    background: var(--c-bg); transition: background .12s;
}
.catalog-row-main {
    display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
    padding: 10px 12px 10px 16px;
    text-decoration: none; color: var(--c-text);
}
.catalog-row:hover { background: var(--c-surface); }
.catalog-row-icon { font-size: 24px; width: 32px; text-align: center; flex-shrink: 0; }
.catalog-row-info { flex: 1; min-width: 0; }
.catalog-row-name { font-size: 14px; font-weight: 500; }
.catalog-row-meta { font-size: 11px; color: var(--c-text-dim); margin-top: 1px; }
.ov-dot { font-size: 10px; color: var(--c-accent-warm); margin-left: 4px; }
.catalog-cart-btn {
    flex-shrink: 0; width: 38px; height: 38px; margin-right: 10px;
    border-radius: 50%; border: 2px solid var(--c-border);
    background: var(--c-bg); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; transition: border-color .15s, background .15s, transform .1s;
    opacity: .45;
}
.catalog-cart-btn:hover { opacity: 1; border-color: var(--c-accent-warm); transform: scale(1.08); }
.catalog-cart-btn.active { opacity: 1; background: var(--c-accent-warm); border-color: var(--c-accent-warm); }
.catalog-empty { padding: 48px 24px; text-align: center; color: var(--c-text-dim); }

.catalog-ac {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
    background: var(--c-surface); border: 1.5px solid var(--c-border);
    border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
    overflow: hidden; max-height: 320px; overflow-y: auto;
}
.catalog-ac-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; text-decoration: none; color: var(--c-text);
    border-bottom: 1px solid var(--c-border);
}
.catalog-ac-item:last-child { border-bottom: none; }
.catalog-ac-item:hover, .catalog-ac-item.focused { background: var(--c-gray-soft); }
.catalog-ac-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.catalog-ac-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.catalog-ac-name { font-size: 14px; font-weight: 600; }
.catalog-ac-meta { font-size: 12px; color: var(--c-text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catalog-ac-create { color: var(--c-accent-warm); font-size: 13px; font-weight: 600; justify-content: center; }

/* Product edit page */
.product-edit-page { padding-bottom: 40px; }
.product-edit-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px 8px;
}
.product-edit-preview {
    display: flex; flex-direction: column; align-items: center;
    padding: 20px 16px 16px; text-align: center;
}
.product-edit-preview-icon { font-size: 52px; line-height: 1; }
.product-edit-preview-icon img { width: 52px; height: 52px; object-fit: contain; }
.product-edit-preview-name { font-size: 20px; font-weight: 700; margin-top: 8px; }
.product-edit-global { font-size: 11px; color: var(--c-text-dim); margin-top: 4px; }

.product-edit-form { padding: 0 16px; }
.pe-field { margin-bottom: 20px; }
.pe-label {
    display: block; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--c-text-dim); margin-bottom: 6px;
}
.pe-input {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--c-border); border-radius: 8px;
    font: inherit; font-size: 15px; background: var(--c-bg); color: var(--c-text);
    box-sizing: border-box;
}
.pe-input:focus { outline: none; border-color: var(--c-accent-warm); }
.pe-textarea { height: 72px; resize: vertical; }
.pe-input-short { max-width: 120px; }
.pe-select {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--c-border); border-radius: 8px;
    font: inherit; font-size: 15px; background: var(--c-bg); color: var(--c-text);
}
.pe-hint { font-size: 11px; color: var(--c-text-dim); margin-top: 4px; }
.pe-hint-link { font-size: 11px; color: var(--c-accent-warm); margin-top: 4px; display: inline-block; }
.pe-actions { display: flex; gap: 10px; margin-top: 24px; }

.pe-hist-section { padding: 24px 16px 0; }
.pe-hist-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--c-text-dim); margin-bottom: 8px;
}
.pe-hist-row {
    display: grid; grid-template-columns: 90px 1fr auto;
    gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--c-line);
    font-size: 13px;
}
.pe-hist-date { color: var(--c-text-dim); font-size: 12px; }
.pe-hist-store { color: var(--c-text-dim); font-size: 12px; }
.pe-hist-price { font-weight: 700; text-align: right; }
.pe-hist-avg { font-size: 12px; color: var(--c-text-dim); padding: 8px 0; text-align: right; }
.alert-ok {
    margin: 12px 16px; padding: 10px 14px;
    background: var(--c-ok-soft, #e8f5e9); color: var(--c-ok);
    border-radius: 8px; font-size: 13px; font-weight: 600;
}

/* Categories page */
.categories-page { padding-bottom: 40px; }
.categories-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px 8px;
}
.page-title { font-size: 16px; font-weight: 700; }
.cat-section-label {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 6px;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--c-text-dim);
}
.cat-list { display: flex; flex-direction: column; }
.cat-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-bottom: 1px solid var(--c-line);
}
.cat-row-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.cat-row-name { flex: 1; font-size: 14px; }
.cat-row-global { font-size: 10px; color: var(--c-text-dim); }
.cat-icon-input {
    width: 40px; padding: 8px 4px; text-align: center;
    border: 1.5px solid var(--c-border); border-radius: 8px;
    font: inherit; font-size: 18px; background: var(--c-bg);
}
.cat-name-input { flex: 1; }
.cat-edit-form { display: flex; align-items: center; gap: 8px; flex: 1; }
.cat-new-form { padding: 10px 16px; background: var(--c-surface); border-bottom: 1px solid var(--c-line); }
.cat-new-row { display: flex; align-items: center; gap: 8px; }
.cat-empty { padding: 24px 16px; color: var(--c-text-dim); font-size: 13px; }

/* ===== Menna auth screen (login/register split) ===== */
.auth-shell { min-height: 100vh; display: flex; }
.auth-left {
    flex: 1; background: var(--c-text); color: #fff;
    padding: 40px; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.auth-left::before {
    content: ""; position: absolute; left: -80px; bottom: -80px; width: 320px; height: 320px;
    border-radius: 50%; background: radial-gradient(circle, var(--c-accent) 0%, transparent 70%); opacity: .35;
}
.auth-left__logo {
    font-family: var(--f-heading); font-weight: 700; font-size: 1.375rem; color: #fff;
    display: flex; align-items: center; gap: 8px; text-decoration: none;
    position: relative; z-index: 1;
}
.auth-left__logo-mark { width: 26px; height: 26px; border-radius: 50%; background: #fff; }
.auth-left__mid { position: relative; z-index: 1; max-width: 420px; }
.auth-left__headline { font-family: var(--f-heading); font-size: 2rem; font-weight: 700; line-height: 1.25; margin: 0 0 24px; }
.auth-bubble {
    display: inline-block; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
    color: #fff; padding: 10px 16px; border-radius: 16px 16px 16px 4px; font-size: .875rem; margin-bottom: 10px;
}
.auth-bubble--user { margin-left: 28px; border-radius: 16px 16px 4px 16px; background: rgba(255,255,255,.16); }
.auth-left__foot { position: relative; z-index: 1; font-size: .75rem; opacity: .6; }
.auth-right { flex: 1; background: var(--c-bg); display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-right-inner { width: 100%; max-width: 380px; }
.auth-tabs { display: flex; background: var(--c-bg-warm); border-radius: 999px; padding: 4px; margin-bottom: 28px; }
.auth-tab {
    flex: 1; text-align: center; padding: 10px 0; border-radius: 999px; text-decoration: none;
    font-size: .875rem; font-weight: 700; color: var(--c-text-dim);
}
.auth-tab--active { background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow); }
.auth-form-title { font-family: var(--f-heading); font-size: 1.375rem; font-weight: 700; margin: 0 0 6px; color: var(--c-text); }
.auth-form-subtitle { color: var(--c-text-dim); font-size: .875rem; margin: 0 0 24px; }
.auth-field { margin-bottom: 16px; }
.auth-field-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.auth-field label { display: block; font-size: .8125rem; font-weight: 600; color: var(--c-text); margin-bottom: 6px; }
.auth-field-head label { margin-bottom: 0; }
.auth-field a { font-size: .75rem; color: var(--c-accent); text-decoration: none; font-weight: 600; }
.auth-field input {
    width: 100%; box-sizing: border-box; padding: 11px 14px; border-radius: var(--r-sm);
    border: 1px solid var(--c-border); background: var(--c-surface); font-size: .9375rem; font-family: inherit;
}
.auth-field input:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.auth-submit {
    width: 100%; padding: 13px; border: none; border-radius: 999px; background: var(--c-accent); color: #fff;
    font-size: .9375rem; font-weight: 700; cursor: pointer; margin-top: 8px;
}
.auth-submit:hover { background: var(--c-accent-hov); }
.auth-foot2 { text-align: center; font-size: .8125rem; color: var(--c-text-dim); margin-top: 20px; }
.auth-foot2 a { color: var(--c-accent); font-weight: 700; text-decoration: none; }
.auth-privacy-note { text-align: center; font-size: .75rem; line-height: 1.5; color: var(--c-text-dim); margin-top: 16px; max-width: 340px; margin-left: auto; margin-right: auto; }
@media (max-width: 860px) {
    .auth-left { display: none; }
    .auth-right { min-height: 100vh; }
}

/* ===== Onboarding ===== */
.onboarding-shell {
    min-height: calc(100vh - 74px - 90px); display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 2.5rem 1rem;
}
.onboarding-avatar {
    width: 128px; height: 128px; border-radius: 50%; background: var(--c-accent-soft);
    display: flex; align-items: center; justify-content: center; font-size: 3.5rem;
    box-shadow: var(--shadow-md); margin-bottom: 1.5rem; overflow: hidden;
}
.onboarding-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.onboarding-title { font-family: var(--f-heading); font-size: 1.625rem; font-weight: 700; color: var(--c-text); margin: 0 0 .75rem; }
.onboarding-body { max-width: 300px; color: var(--c-text-dim); font-size: .9375rem; line-height: 1.5; margin: 0 0 2rem; }
.onboarding-cta {
    padding: .875rem 2.5rem; border: none; border-radius: 999px; background: var(--c-accent); color: #fff;
    font-size: .9375rem; font-weight: 700; text-decoration: none; display: inline-block;
}
.onboarding-cta:hover { background: var(--c-accent-hov); }
.onboarding-skip {
    display: block; margin-top: 1rem; font-size: .8125rem; color: var(--c-text-dim); text-decoration: none;
}
.onboarding-skip:hover { color: var(--c-accent); }

/* ===== Navegação principal: um só componente, mesmos ícones/posições sempre =====
   Colapsado (desktop default): só ícones, coluna estreita.
   Expandido (desktop toggle / mobile aberto): a MESMA coluna alarga e as
   legendas aparecem ao lado de cada ícone — os ícones não mudam de posição. */

.hamburger-btn {
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff;
    width: 38px; height: 38px; border-radius: 10px; font-size: 18px; cursor: pointer; flex-shrink: 0;
}
.nav-backdrop {
    position: fixed; inset: 0; background: rgba(20,20,46,.4); z-index: 90;
    opacity: 0; transition: opacity .2s ease;
}
.nav-backdrop.open { opacity: 1; }

/* Mobile: escondida fora do ecrã por defeito; abre já larga (com legendas) */
.app-nav {
    position: fixed; top: 0; bottom: 0; left: 0; width: 232px; max-width: 84vw;
    background: var(--c-text); z-index: 91; overflow-y: auto; overflow-x: hidden;
    padding: 16px 8px; display: flex; flex-direction: column; gap: 4px;
    transform: translateX(-100%); transition: transform .2s ease;
}
.app-nav.open { transform: translateX(0); }
.app-nav__toggle {
    display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer;
    padding: 8px; margin-bottom: 12px; font-family: var(--f-heading); font-weight: 700; font-size: 1.0625rem; color: #fff;
}
.app-nav__brand-text { white-space: nowrap; }
.app-nav__item {
    display: flex; align-items: center; gap: .75rem; padding: .625rem .75rem; border-radius: 10px;
    font-size: .875rem; font-weight: 500; color: rgba(255,255,255,.7); text-decoration: none; white-space: nowrap;
}
.app-nav__item:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-nav__item--active { background: var(--c-accent); color: #fff; font-weight: 700; }
.app-nav__icon { width: 22px; text-align: center; flex-shrink: 0; font-size: 1.0625rem; }
.app-nav__spacer { flex: 1; }
.app-nav__user { display: flex; align-items: center; gap: .75rem; padding: .625rem .75rem; }
.app-nav__avatar {
    width: 28px; height: 28px; border-radius: 50%; background: var(--c-accent); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: .6875rem; font-weight: 700;
    font-family: var(--f-heading); flex-shrink: 0;
}
.app-nav .app-nav__label { color: inherit; }

@media (min-width: 980px) {
    body.mobile-shell { display: flex; min-height: 100vh; }
    .app-nav {
        position: sticky; top: 0; height: 100vh; transform: none;
        width: 64px; flex-shrink: 0; transition: width .18s ease; z-index: 15;
    }
    .app-nav.open { width: 232px; }
    /* Colapsado: só ícones — legendas e nome do brand escondidos sem mudar a posição dos ícones */
    .app-nav:not(.open) .app-nav__label,
    .app-nav:not(.open) .app-nav__brand-text { display: none; }
    .app-nav:not(.open) .app-nav__item,
    .app-nav:not(.open) .app-nav__toggle,
    .app-nav:not(.open) .app-nav__user { justify-content: center; }

    body.mobile-shell .mobile-frame { max-width: none; flex: 1; min-width: 0; margin: 0; }
    /* a coluna de navegação substitui os links de atalho da bottom bar em desktop,
       mas a mascote (abre o bottom sheet) mantém-se, flutuante no canto inferior direito */
    .mobile-nav { background: none; border: none; box-shadow: none; pointer-events: none;
        display: flex; justify-content: flex-end; padding: 0 40px calc(32px + env(safe-area-inset-bottom)); }
    .mobile-nav .nav-btn { display: none; }
    .mobile-nav .nav-fab { pointer-events: auto; margin-top: 0; }
    .mobile-topbar .mobile-brand { display: none; } /* já visível na coluna de navegação */
    .hamburger-btn { display: none; } /* em desktop o toggle está na própria coluna */
    .mobile-view { max-width: 720px; margin: 0 auto; padding: 24px 32px 56px; }
    .menna-sheet { max-width: 420px; right: 40px; left: auto; bottom: 110px; border-radius: 20px; }
    .menna-sheet-backdrop { background: transparent; }
}

/* ===== Início / Dashboard (BI view; simple stacked cards on mobile, full grid on desktop) ===== */
.dash-page { padding: 4px 0 24px; }
.dash-topbar { margin-bottom: 1.25rem; }
.dash-title { font-family: var(--f-heading); font-size: 1.25rem; font-weight: 700; margin: 0 0 .25rem; color: var(--c-text); }
.dash-subtitle { color: var(--c-text-dim); font-size: .8125rem; margin: 0; }
.dash-period { display: none; }
.kpi-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.kpi-tile { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 14px; padding: 14px 16px; }
.kpi-tile--ok { background: var(--c-ok-soft); }
.kpi-tile--warn { background: var(--c-accent-soft); }
.kpi-tile__label { font-size: .6875rem; color: var(--c-text-dim); font-weight: 600; margin-bottom: .375rem; text-transform: uppercase; letter-spacing: .03em; }
.kpi-tile__row { display: flex; align-items: baseline; gap: .5rem; }
.kpi-tile__value { font-family: var(--f-heading); font-size: 1.375rem; font-weight: 800; color: var(--c-text); }
.kpi-tile__delta { font-size: .75rem; font-weight: 700; }
.kpi-tile__delta--up { color: var(--c-accent-hov); }
.kpi-tile__delta--down { color: var(--c-ok); }
.dash-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.section-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px; padding: 16px; }
.section-card__title { font-family: var(--f-heading); font-size: .9375rem; margin: 0 0 .75rem; color: var(--c-text); }
.cat-bar { height: 10px; border-radius: 999px; overflow: hidden; display: flex; margin-bottom: 12px; }
.cat-bar__seg { height: 100%; }
.cat-legend { display: flex; flex-direction: column; gap: 6px; }
.cat-legend__row { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--c-text); }
.cat-legend__swatch { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.cat-legend__pct { margin-left: auto; color: var(--c-text-dim); font-weight: 600; }
.d-table { width: 100%; border-collapse: collapse; }
.d-table th { text-align: left; font-size: .625rem; text-transform: uppercase; letter-spacing: .04em; color: var(--c-text-dim); font-weight: 700; padding: 0 0 8px; border-bottom: 1px solid var(--c-line); }
.d-table td { padding: 8px 4px 8px 0; border-bottom: 1px solid var(--c-line); font-size: .75rem; color: var(--c-text); }
.d-table tr:last-child td { border-bottom: none; }
.attn-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--c-line); border-left: 3px solid var(--c-accent); padding-left: 10px; }
.attn-row:last-child { border-bottom: none; }
.attn-row--soon { border-left-color: var(--c-warn); }
.attn-row__icon { width: 28px; height: 28px; border-radius: 8px; background: var(--c-bg-warm); display: flex; align-items: center; justify-content: center; font-size: .875rem; flex-shrink: 0; }
.attn-row__meta { font-size: .6875rem; color: var(--c-text-dim); }
.insight-strip { display: none; }
@media (min-width: 980px) {
    .dash-page { max-width: 1180px; margin: 0 auto; padding: 8px 0 40px; }
    .dash-topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
    .dash-title { font-family: var(--f-heading); font-size: 1.625rem; font-weight: 700; margin: 0 0 .25rem; color: var(--c-text); }
    .dash-subtitle { color: var(--c-text-dim); font-size: .875rem; margin: 0; }
    .dash-period { display: flex; gap: 4px; background: var(--c-bg-warm); border-radius: 999px; padding: 4px; }
    .dash-period a { padding: 6px 14px; border-radius: 999px; font-size: .75rem; font-weight: 700; color: var(--c-text-dim); text-decoration: none; }
    .dash-period a.active { background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow); }

    .kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
    .kpi-tile { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px; padding: 1.25rem 1.375rem; }
    .kpi-tile--ok { background: var(--c-ok-soft); }
    .kpi-tile--warn { background: var(--c-accent-soft); }
    .kpi-tile__label { font-size: .71875rem; color: var(--c-text-dim); font-weight: 600; margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .03em; }
    .kpi-tile__row { display: flex; align-items: baseline; gap: .5rem; }
    .kpi-tile__value { font-family: var(--f-heading); font-size: 1.75rem; font-weight: 800; color: var(--c-text); }
    .kpi-tile__delta { font-size: .75rem; font-weight: 700; }
    .kpi-tile__delta--up { color: var(--c-accent-hov); }
    .kpi-tile__delta--down { color: var(--c-ok); }

    .insight-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 24px; }
    .insight-chip { background: var(--c-surface); border: 1px solid var(--c-line); border-left: 3px solid var(--c-accent); border-radius: 14px; padding: 14px 16px; font-size: .8125rem; color: var(--c-text); display: flex; gap: 10px; align-items: flex-start; }
    .insight-chip__mark { width: 26px; height: 26px; border-radius: 50%; background: var(--c-accent-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .875rem; }

    .dash-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 24px; }
    .section-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 18px; padding: 1.5rem; }
    .section-card__title { font-family: var(--f-heading); font-size: 1.0625rem; margin: 0 0 1rem; color: var(--c-text); }

    .cat-bar { height: 12px; border-radius: 999px; overflow: hidden; display: flex; margin-bottom: 14px; }
    .cat-bar__seg { height: 100%; }
    .cat-legend { display: flex; flex-direction: column; gap: 8px; }
    .cat-legend__row { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--c-text); }
    .cat-legend__swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
    .cat-legend__pct { margin-left: auto; color: var(--c-text-dim); font-weight: 600; }

    .d-table { width: 100%; border-collapse: collapse; }
    .d-table th { text-align: left; font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; color: var(--c-text-dim); font-weight: 700; padding: 0 0 10px; border-bottom: 1px solid var(--c-line); }
    .d-table td { padding: 10px 0; border-bottom: 1px solid var(--c-line); font-size: .8125rem; color: var(--c-text); }
    .d-table tr:last-child td { border-bottom: none; }

    .attn-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--c-line); border-left: 3px solid var(--c-accent); padding-left: 10px; }
    .attn-row:last-child { border-bottom: none; }
    .attn-row--soon { border-left-color: var(--c-warn); }
    .attn-row__icon { width: 30px; height: 30px; border-radius: 8px; background: var(--c-bg-warm); display: flex; align-items: center; justify-content: center; font-size: .9375rem; flex-shrink: 0; }
    .attn-row__meta { font-size: .75rem; color: var(--c-text-dim); }
}

.btn-pill-primary, .btn-pill-ghost {
    padding: .4rem .875rem; border-radius: 999px; font-size: .75rem; font-weight: 700; cursor: pointer; border: 1px solid transparent;
}
.btn-pill-primary { background: var(--c-accent); color: #fff; }
.btn-pill-primary:hover { background: var(--c-accent-hov); }
.btn-pill-ghost { background: none; border-color: var(--c-border); color: var(--c-text-dim); }

/* ===== Conversa (chat) ===== */
.chat-shell { display: flex; flex-direction: column; height: calc(100vh - 74px - 90px); margin: -4px -18px 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 82%; padding: .625rem .875rem; font-size: .875rem; line-height: 1.4; border-radius: 16px; }
.chat-msg--menna { align-self: flex-start; background: var(--c-bg-warm); color: var(--c-text); border-radius: 16px 16px 16px 4px; }
.chat-msg--user { align-self: flex-end; background: var(--c-accent); color: #fff; border-radius: 16px 16px 4px 16px; }
.chat-quick { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 12px; }
.chat-input-bar { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--c-line); background: var(--c-surface); }
.chat-input-bar input { flex: 1; padding: .625rem .875rem; border-radius: 999px; border: 1px solid var(--c-border); font-size: .875rem; font-family: inherit; }
.chat-input-bar button { padding: .625rem 1.125rem; border-radius: 999px; background: var(--c-accent); color: #fff; border: none; font-weight: 700; cursor: pointer; }
@media (min-width: 980px) {
    .chat-shell { max-width: 560px; height: calc(100vh - 220px); border: 1px solid var(--c-line); border-radius: 18px; overflow: hidden; margin: 8px 0; }
}

/* ===== Perfil ===== */
.profile-page { text-align: center; padding-top: 8px; }
.profile-avatar {
    width: 72px; height: 72px; border-radius: 50%; background: var(--c-accent); color: #fff;
    font-family: var(--f-heading); font-weight: 700; font-size: 1.75rem;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.profile-name { font-family: var(--f-heading); font-size: 1.25rem; margin: 0 0 2px; }
.profile-email { color: var(--c-text-dim); font-size: .8125rem; margin: 0 0 4px; }
.profile-role { color: var(--c-text-dim); font-size: .8125rem; margin: 0 0 20px; }
.profile-page .section-card { text-align: left; }

/* ===== Detalhe do talão: imagem grande à esquerda em desktop ===== */
.receipt-desktop-image { display: none; }
.receipt-done-btn { order: -1; width: 100%; margin-bottom: 8px; }
@media (min-width: 980px) {
    .receipt-page-body { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
    .receipt-desktop-image {
        display: block; position: sticky; top: 24px;
        background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px;
        padding: 12px; box-shadow: var(--shadow);
    }
    .receipt-desktop-image img { width: 100%; height: auto; border-radius: 10px; display: block; }
    .receipt-thumb-btn { display: none; } /* miniatura só faz sentido em mobile; desktop já mostra a imagem grande */
    .receipt-actions2 { display: flex; }
    .receipt-done-btn { order: 0; width: auto; margin-bottom: 0; }
}
