/* =============================================================================
   AÇAITERIA CRM — COMBINA AÇAÍ
   CSS Profissional, Responsivo, Mobile-First
   Projeto Integrador UNIVESP — Grupo 22
   ============================================================================= */

/* ---------- RESET & VARIÁVEIS ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --acai:       #6C2EB9;
    --acai-dark:  #4A1D80;
    --acai-light: #9B59B6;
    --rosa:       #E91E63;
    --rosa-light: #F48FB1;
    --verde:      #00C853;
    --verde-light:#B9F6CA;
    --azul:       #2196F3;
    --azul-light: #BBDEFB;
    --amarelo:    #FFC107;
    --amarelo-bg: #FFF8E1;
    --vermelho:   #F44336;
    --cinza-50:   #FAFAFA;
    --cinza-100:  #F5F5F5;
    --cinza-200:  #EEEEEE;
    --cinza-300:  #E0E0E0;
    --cinza-400:  #BDBDBD;
    --cinza-600:  #757575;
    --cinza-800:  #424242;
    --cinza-900:  #212121;
    --branco:     #FFFFFF;
    --sombra-sm:  0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.06);
    --sombra-md:  0 4px 6px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.06);
    --sombra-lg:  0 10px 25px rgba(0,0,0,.12);
    --raio:       12px;
    --raio-sm:    8px;
    --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
    --fast:       .2s ease;
    --smooth:     .35s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

/* ---------- DARK MODE ---------- */
[data-theme="dark"] {
    --cinza-50:   #1e1e1e;
    --cinza-100:  #252525;
    --cinza-200:  #333333;
    --cinza-300:  #444444;
    --cinza-400:  #888888;
    --cinza-600:  #b0b0b0;
    --cinza-800:  #e0e0e0;
    --cinza-900:  #f0f0f0;
    --branco:     #1e1e1e;
    --sombra-sm:  0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
    --sombra-md:  0 4px 6px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.2);
    --sombra-lg:  0 10px 25px rgba(0,0,0,.4);
    --amarelo-bg: #332b00;
}
[data-theme="dark"] body { background: #121212; color: var(--cinza-800); }
[data-theme="dark"] .card { border-color: var(--cinza-300); }
[data-theme="dark"] .alert-info    { background: #1a2332; color: #90caf9; }
[data-theme="dark"] .alert-sucesso { background: #1b2e1b; color: #a5d6a7; }
[data-theme="dark"] .alert-erro    { background: #321b1b; color: #ef9a9a; }
[data-theme="dark"] .alert-aviso   { background: #332b00; color: #ffe082; }
[data-theme="dark"] .toast-sucesso { background: #1b2e1b; border-color: var(--verde); color: #a5d6a7; }
[data-theme="dark"] .toast-erro    { background: #321b1b; border-color: var(--vermelho); color: #ef9a9a; }
[data-theme="dark"] .toast-info    { background: #1a2332; border-color: var(--azul); color: #90caf9; }
[data-theme="dark"] .toast-aviso   { background: #332b00; border-color: var(--amarelo); color: #ffe082; }
[data-theme="dark"] .table thead   { background: var(--cinza-200); }
[data-theme="dark"] .table td      { border-color: var(--cinza-300); }
[data-theme="dark"] .form-control, [data-theme="dark"] select { background: var(--cinza-100); color: var(--cinza-800); border-color: var(--cinza-300); }
[data-theme="dark"] .search-results { background: #252525; border-color: var(--cinza-300); }
[data-theme="dark"] .search-results-group a { color: var(--cinza-800); }
[data-theme="dark"] .search-results-group a .sr-detail { color: var(--cinza-400); }
[data-theme="dark"] .search-results-group h4 { color: var(--cinza-400); }
[data-theme="dark"] .search-results-group a:hover { background: var(--cinza-200); }
[data-theme="dark"] textarea { background: var(--cinza-100); color: var(--cinza-800); border-color: var(--cinza-300); }
[data-theme="dark"] .modal-box { background: #252525; }
[data-theme="dark"] .footer { background: linear-gradient(135deg, #1a0a2e, #2d1052); }
[data-theme="dark"] .footer a { color: #ce93d8; }

/* Utility classes for themed inline colors (dark mode safe) */
.text-error     { color: #d32f2f; }
.text-danger    { color: #c62828; }
.text-success   { color: #2E7D32; }
.text-muted     { color: #888; }
.text-muted-light { color: #999; }
.text-link-muted  { color: #666; }
.text-acai      { color: #7B1FA2; }
.text-alert-title { color: #D32F2F; }
.bg-warning-row   { background: #FFF3E0; }
.bg-critical-row  { background: #ffebee; }
.bg-total-row     { background: #f0f0f0; font-weight: bold; }
.bg-white-card    { background: white; }

[data-theme="dark"] .text-error,
[data-theme="dark"] .text-danger    { color: #ef9a9a; }
[data-theme="dark"] .text-success   { color: #a5d6a7; }
[data-theme="dark"] .text-muted     { color: #aaa; }
[data-theme="dark"] .text-muted-light { color: #bbb; }
[data-theme="dark"] .text-link-muted  { color: #bbb; }
[data-theme="dark"] .text-acai      { color: #ce93d8; }
[data-theme="dark"] .text-alert-title { color: #ef9a9a; }
[data-theme="dark"] .bg-warning-row   { background: #332b00; }
[data-theme="dark"] .bg-critical-row  { background: #321b1b; }
[data-theme="dark"] .bg-total-row     { background: var(--cinza-200); }
[data-theme="dark"] .bg-white-card    { background: var(--cinza-100); }

/* Status colors (vendas) */
.text-status-recebido   { color: #E65100; }
.text-status-preparando { color: #F57C00; }
.text-status-pronto     { color: #2E7D32; }
.text-status-entregue   { color: #7B1FA2; }
.text-status-cancelado  { color: #c62828; }
[data-theme="dark"] .text-status-recebido   { color: #ffab40; }
[data-theme="dark"] .text-status-preparando { color: #ffcc80; }
[data-theme="dark"] .text-status-pronto     { color: #a5d6a7; }
[data-theme="dark"] .text-status-entregue   { color: #ce93d8; }
[data-theme="dark"] .text-status-cancelado  { color: #ef9a9a; }

/* Modal overlay */
.bg-modal-items { background: #f8f8f8; }
[data-theme="dark"] .bg-modal-items { background: var(--cinza-200); }

/* Complemento (venda) */
.comp-label { display:flex;align-items:center;gap:.4rem;padding:.4rem .6rem;border-radius:8px;cursor:pointer;font-size:.85rem;border:2px solid #e0e0e0;background:#fff;transition:all .15s; }
.comp-label.selected { border-color:#7B1FA2;background:#f3e5f5; }
.comp-price { margin-left:auto;color:#7B1FA2;font-weight:600;font-size:.8rem; }
.comp-info { font-size:.8rem;color:#7B1FA2;margin-top:.15rem; }
.vol-badge { font-size:.75rem;background:#e8e0f0;border-radius:4px;padding:0 .3rem; }
.cupom-info { margin-top:0.5rem;padding:0.5rem;background:#f3e5f5;border-radius:8px;font-size:0.9rem; }
[data-theme="dark"] .comp-label { border-color:#555;background:var(--cinza-100); }
[data-theme="dark"] .comp-label.selected { border-color:#ce93d8;background:#2d1f3d; }
[data-theme="dark"] .comp-price { color:#ce93d8; }
[data-theme="dark"] .comp-info { color:#ce93d8; }
[data-theme="dark"] .vol-badge { background:#3d2f4d; }
[data-theme="dark"] .cupom-info { background:#2d1f3d; }

/* Dark toggle button */
.dark-toggle {
    background: none;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 20px;
    color: var(--branco);
    cursor: pointer;
    font-size: 1.1rem;
    padding: .3rem .6rem;
    transition: border-color var(--fast), background var(--fast);
    line-height: 1;
}
.dark-toggle:hover { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.1); }
[data-theme="dark"] .dark-toggle { color: #f5f5f5; }

body {
    font-family: var(--font);
    color: var(--cinza-800);
    background: var(--cinza-100);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--acai); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---------- LAYOUT ---------- */
.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ---------- NAVBAR ---------- */
.navbar {
    background: linear-gradient(135deg, var(--acai) 0%, var(--acai-dark) 100%);
    color: var(--branco);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--sombra-md);
    min-height: 64px;
}

.navbar-brand {
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
    padding: .75rem 0;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 0;
    align-items: stretch;
    height: 100%;
}

.navbar-menu > li {
    position: relative;
    display: flex;
    align-items: stretch;
}

.navbar-menu > li > a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
    padding: 1.2rem 1rem;
    display: flex;
    align-items: center;
    gap: .35rem;
    transition: var(--fast);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    cursor: pointer;
}

.navbar-menu > li > a:hover,
.navbar-menu > li > a.active,
.navbar-menu > li.active > a {
    color: var(--branco);
    background: rgba(255,255,255,.1);
    border-bottom-color: var(--rosa-light);
    text-decoration: none;
}

/* Dropdown arrow */
.arrow {
    font-size: .7rem;
    transition: transform var(--fast);
}
.has-dropdown:hover > a > .arrow,
.has-dropdown.show > a > .arrow {
    transform: rotate(180deg);
}

/* Dropdown menu */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: linear-gradient(135deg, var(--acai-dark) 0%, #3A1466 100%);
    min-width: 230px;
    border-radius: 0 0 var(--raio-sm) var(--raio-sm);
    box-shadow: var(--sombra-lg);
    z-index: 1001;
    list-style: none;
    padding: .35rem 0;
    animation: slideDown .2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.has-dropdown:hover > .dropdown {
    display: block;
}

.dropdown li a {
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    color: rgba(255,255,255,.85);
    font-size: .9rem;
    font-weight: 500;
    transition: var(--fast);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.dropdown li a:hover,
.dropdown li a.active {
    background: rgba(255,255,255,.1);
    color: var(--branco);
    border-left-color: var(--rosa-light);
    text-decoration: none;
}

/* Logout */
.nav-logout { color: var(--rosa-light) !important; }
.nav-logout:hover { color: var(--branco) !important; background: rgba(244,143,177,.15) !important; }

/* User info na navbar */
.nav-user-info {
    display: flex;
    align-items: center;
    color: var(--rosa-light);
    font-size: .85rem;
    padding: .5rem .75rem;
    white-space: nowrap;
    opacity: .9;
}

/* Badges de papel */
.badge { display: inline-block; padding: .15rem .5rem; border-radius: .75rem; font-size: .75rem; font-weight: 600; }
.badge-admin { background: var(--roxo-medio); color: var(--branco); }
.badge-operador { background: var(--rosa-light); color: var(--roxo-escuro); }

/* Separator */
.nav-separator {
    border-left: 1px solid rgba(255,255,255,.2);
    margin: .75rem .25rem;
}

/* Hamburger toggle */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--branco);
    font-size: 1.6rem;
    cursor: pointer;
    padding: .5rem;
    line-height: 1;
}

@media (max-width: 860px) {
    .navbar { flex-wrap: wrap; padding: 0 1rem; }
    .navbar-toggle { display: block; }

    .navbar-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        border-top: 1px solid rgba(255,255,255,.15);
    }
    .navbar-menu.open { display: flex; }

    .navbar-menu > li {
        flex-direction: column;
    }

    .navbar-menu > li > a {
        padding: 1rem;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    .navbar-menu > li > a:hover,
    .navbar-menu > li > a.active,
    .navbar-menu > li.active > a {
        border-left-color: var(--rosa-light);
        border-bottom-color: transparent;
    }

    /* Dropdown mobile */
    .has-dropdown:hover > .dropdown { display: none; }
    .has-dropdown.show > .dropdown { display: block; }

    .dropdown {
        position: static;
        background: rgba(0,0,0,.15);
        box-shadow: none;
        border-radius: 0;
        min-width: 0;
        animation: none;
    }

    .dropdown li a {
        padding: .75rem 1rem .75rem 2.5rem;
    }

    .nav-separator {
        border-left: none;
        border-top: 1px solid rgba(255,255,255,.15);
        margin: 0;
        height: 0;
    }
}

/* ---------- HERO ---------- */
.hero {
    background: linear-gradient(135deg, var(--acai) 0%, var(--rosa) 100%);
    color: var(--branco);
    padding: 3rem 2rem;
    border-radius: var(--raio);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 60%);
    pointer-events: none;
}
.hero h1 { font-size: 2.2rem; margin-bottom: .5rem; position: relative; }
.hero p  { font-size: 1.1rem; opacity: .9; position: relative; }

.subtitle { color: var(--cinza-600); font-size: .95rem; margin-top: .25rem; }

/* ---------- CARDS ---------- */
.card {
    background: var(--branco);
    border-radius: var(--raio);
    padding: 1.5rem;
    box-shadow: var(--sombra-sm);
    margin-bottom: 1.5rem;
    transition: box-shadow var(--smooth), transform var(--smooth);
    border: 1px solid var(--cinza-200);
}
.card:hover {
    box-shadow: var(--sombra-md);
    transform: translateY(-2px);
}
.card h2, .card h3 { color: var(--acai); margin-bottom: .75rem; }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stats-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid var(--acai-light);
}
.stats-card:nth-child(2) { border-left-color: var(--rosa); }
.stats-card:nth-child(3) { border-left-color: var(--verde); }
.stats-card:nth-child(4) { border-left-color: var(--azul); }

.card-icon { font-size: 2.5rem; min-width: 55px; text-align: center; }
.card-content h3 { font-size: .85rem; color: var(--cinza-600); margin: 0 0 .25rem; text-transform: uppercase; letter-spacing: .5px; }
.stat-number { font-size: 1.7rem; font-weight: 700; color: var(--acai); margin: 0; }
.card-content small { color: var(--cinza-400); display: block; margin-top: .2rem; }

/* ---------- FORMULÁRIOS ---------- */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    margin-bottom: .4rem;
    font-weight: 600;
    font-size: .9rem;
    color: var(--cinza-800);
}

.form-control,
.form-control-inline {
    width: 100%;
    padding: .7rem .9rem;
    border: 2px solid var(--cinza-300);
    border-radius: var(--raio-sm);
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color var(--fast), box-shadow var(--fast);
    background: var(--branco);
}
.form-control-inline { width: auto; max-width: 100px; }

.form-control:focus, .form-control-inline:focus {
    outline: none;
    border-color: var(--acai);
    box-shadow: 0 0 0 3px rgba(108,46,185,.15);
}
.form-control::placeholder { color: var(--cinza-400); }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.form-group small { display: block; color: var(--cinza-600); margin-top: .2rem; font-size: .85rem; }

/* Checkboxes */
.checkbox-group { margin: 1rem 0; }
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    cursor: pointer;
    margin-bottom: .5rem;
}
.checkbox-label input { margin-top: .25rem; cursor: pointer; accent-color: var(--acai); }

/* ---------- BOTÕES ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .7rem 1.4rem;
    border: none;
    border-radius: var(--raio-sm);
    font-size: .95rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--fast), transform var(--fast), box-shadow var(--fast);
    text-align: center;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--sombra-sm); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--acai); color: var(--branco); }
.btn-primary:hover { background: var(--acai-dark); }

.btn-success   { background: var(--verde); color: var(--branco); }
.btn-success:hover { background: #00A844; }

.btn-info      { background: var(--azul); color: var(--branco); }
.btn-info:hover { background: #1976D2; }

.btn-warning   { background: var(--amarelo); color: var(--cinza-900); }
.btn-warning:hover { background: #FFB300; }

.btn-secondary { background: var(--cinza-600); color: var(--branco); }
.btn-secondary:hover { background: var(--cinza-800); }

.btn-danger    { background: var(--vermelho); color: var(--branco); }
.btn-danger:hover { background: #D32F2F; }

.btn-large { padding: 1rem 2rem; font-size: 1.1rem; width: 100%; margin-bottom: .5rem; }
.btn-block { display: flex; width: 100%; margin-bottom: .5rem; }

/* ---------- ALERTAS ---------- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--raio-sm);
    margin-bottom: 1rem;
    border-left: 4px solid;
    font-size: .95rem;
}
.alert-info    { background: #E3F2FD; border-color: var(--azul); color: #0D47A1; }
.alert-sucesso { background: #E8F5E9; border-color: var(--verde); color: #1B5E20; }
.alert-erro    { background: #FFEBEE; border-color: var(--vermelho); color: #B71C1C; }
.alert-aviso   { background: var(--amarelo-bg); border-color: var(--amarelo); color: #E65100; }

/* ---------- TABELAS ---------- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table thead { background: var(--cinza-100); }
.table th {
    padding: .75rem;
    text-align: left;
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--acai);
    border-bottom: 2px solid var(--cinza-300);
}
.table td { padding: .75rem; border-bottom: 1px solid var(--cinza-200); }
.table tbody tr:hover { background: var(--cinza-50); }

/* ---------- LGPD ---------- */
.lgpd-section {
    background: var(--amarelo-bg);
    padding: 1.5rem;
    border-left: 4px solid var(--amarelo);
    border-radius: var(--raio);
    margin-bottom: 2rem;
}

.lgpd-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem; margin: 1rem 0;
}
.lgpd-item { display: flex; justify-content: space-between; padding: .5rem 0; }
.info-text { color: var(--cinza-600); margin-top: 1rem; line-height: 1.7; }
.consent-info { background: var(--cinza-100); padding: 1rem; border-radius: var(--raio-sm); margin-top: 1rem; font-size: .9rem; }
.consent-info ul { margin-left: 1.5rem; margin-top: .5rem; }
.consent-info li { margin-bottom: .5rem; }

/* ---------- VENDA (LAYOUT SPLIT) ---------- */
.venda-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
.venda-form { display: flex; flex-direction: column; gap: 1.25rem; }
.venda-resumo { position: sticky; top: 80px; align-self: start; }
.resumo-card { position: sticky; top: 80px; }

.itens-lista {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--cinza-200);
}
.item-venda {
    background: var(--cinza-50);
    padding: .75rem;
    border-radius: var(--raio-sm);
    margin-bottom: .5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--cinza-200);
}
.item-nome { font-weight: 600; color: var(--acai); }
.item-valor { font-size: .9rem; color: var(--cinza-600); }

.btn-remover {
    background: var(--vermelho);
    color: var(--branco);
    border: none;
    padding: .3rem .7rem;
    border-radius: var(--raio-sm);
    cursor: pointer;
    font-size: .8rem;
    transition: background var(--fast);
}
.btn-remover:hover { background: #D32F2F; }

.resumo-totais {
    background: var(--cinza-50);
    padding: 1rem;
    border-radius: var(--raio-sm);
    margin: 1rem 0;
    border: 1px solid var(--cinza-200);
}
.total-line { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; }
.total-final {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--acai);
    border-top: 2px solid var(--cinza-300);
    padding-top: .75rem;
    margin-top: .5rem;
}
.resumo-buttons { display: flex; flex-direction: column; gap: .5rem; }
.placeholder { text-align: center; color: var(--cinza-400); padding: 1.5rem; }

@media (max-width: 860px) {
    .venda-container { grid-template-columns: 1fr; }
    .venda-resumo, .resumo-card { position: static; }
}

/* ---------- AÇÕES RÁPIDAS ---------- */
.quick-actions {
    background: var(--branco);
    padding: 2rem;
    border-radius: var(--raio);
    margin-bottom: 2rem;
    box-shadow: var(--sombra-sm);
    border: 1px solid var(--cinza-200);
}
.quick-actions h2 { color: var(--acai); margin-bottom: 1.25rem; }

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}
.action-buttons .btn { padding: 1rem; font-size: .95rem; }

/* ---------- POLÍTICA DE PRIVACIDADE ---------- */
.policy-container { max-width: 900px; margin: 0 auto; }
.policy-container h1 { font-size: 2rem; color: var(--acai); margin-bottom: .5rem; }
.last-updated { color: var(--cinza-600); font-size: .9rem; margin-bottom: 2rem; }
.policy-section { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--cinza-200); }
.policy-section h2 { color: var(--acai); font-size: 1.3rem; margin-bottom: 1rem; }
.policy-section ul { margin-left: 1.5rem; margin-top: .5rem; }
.policy-section li { margin-bottom: .5rem; line-height: 1.6; }
.contact-info { background: var(--cinza-100); padding: 1rem; border-radius: var(--raio-sm); margin: 1rem 0; }
.contact-info p { margin: .5rem 0; }
.highlight { background: var(--amarelo-bg); padding: 1rem; border-left: 4px solid var(--amarelo); border-radius: var(--raio-sm); margin: 1rem 0; }
.policy-footer { background: var(--acai); color: var(--branco); padding: 1.5rem; border-radius: var(--raio); margin: 2rem 0; text-align: center; }
.policy-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.policy-actions .btn { min-width: 150px; }

/* ---------- PROJETO INFO ---------- */
.project-info .card { border-left: 4px solid var(--acai-light); }
.project-info ul { margin-left: 1.5rem; margin-top: .5rem; }
.project-info li { margin-bottom: .4rem; }

/* ---------- FOOTER ---------- */
.footer {
    background: linear-gradient(135deg, var(--acai-dark), var(--acai));
    color: var(--branco);
    text-align: center;
    padding: 1.5rem 2rem;
    margin-top: auto;
    font-size: .9rem;
}
.footer p { margin: .3rem 0; opacity: .9; }

/* ---------- UTILITÁRIOS ---------- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.p-1  { padding: .5rem; }
.p-2  { padding: 1rem; }
.small-text { font-size: .9rem; color: var(--cinza-600); }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }
hr { border: none; border-top: 1px solid var(--cinza-200); margin: 1rem 0; }

/* ---------- CONFIRMATION MODAL ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
    background: var(--branco);
    border-radius: var(--raio);
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--sombra-lg);
    text-align: center;
    transform: scale(.9);
    transition: transform .25s ease;
}
.modal-overlay.open .modal-box { transform: scale(1); }
.modal-box .modal-icon { font-size: 3rem; margin-bottom: .75rem; }
.modal-box h3 { color: var(--cinza-900); margin-bottom: .5rem; }
.modal-box p { color: var(--cinza-600); margin-bottom: 1.5rem; font-size: .95rem; }
.modal-actions { display: flex; gap: .75rem; justify-content: center; }
.modal-actions .btn { min-width: 110px; }

/* ---------- PASSWORD STRENGTH ---------- */
.password-strength { margin-top: .4rem; }
.strength-bar {
    height: 6px;
    background: var(--cinza-200);
    border-radius: 3px;
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width .3s ease, background .3s ease;
}
.strength-label { font-size: .8rem; margin-top: .2rem; display: inline-block; }

/* ---------- RESPONSIVO GERAL ---------- */
@media (max-width: 600px) {
    .content { padding: 1rem .75rem; }
    .hero { padding: 2rem 1rem; }
    .hero h1 { font-size: 1.6rem; }
    .stat-number { font-size: 1.4rem; }
    .form-row { grid-template-columns: 1fr; }
    .action-buttons { grid-template-columns: 1fr; }
    .card { padding: 1rem; }
    .table th, .table td { padding: .5rem .4rem; font-size: .85rem; }
}

/* ---------- IMPRESSÃO ---------- */
@media print {
    .navbar, .footer, .action-buttons, .btn, .navbar-toggle, #toast-container { display: none !important; }
    .content { padding: 0; }
    .card { box-shadow: none; border: 1px solid var(--cinza-300); break-inside: avoid; }
}

/* ---------- GLOBAL SEARCH ---------- */
.navbar-search {
    position: relative;
    margin: 0 1rem;
    flex: 0 1 280px;
}
.navbar-search input {
    width: 100%;
    padding: .5rem .9rem .5rem 2.2rem;
    border: 2px solid rgba(255,255,255,.25);
    border-radius: 20px;
    background: rgba(255,255,255,.15);
    color: var(--branco);
    font-size: .9rem;
    font-family: var(--font);
    transition: border-color var(--fast), background var(--fast);
}
.navbar-search input::placeholder { color: rgba(255,255,255,.6); }
.navbar-search input:focus {
    outline: none;
    border-color: rgba(255,255,255,.6);
    background: rgba(255,255,255,.25);
}
.navbar-search::before {
    content: '🔍';
    position: absolute;
    left: .7rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .85rem;
    pointer-events: none;
}
.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 340px;
    width: max-content;
    max-width: 420px;
    background: var(--branco);
    border-radius: var(--raio-sm);
    box-shadow: var(--sombra-lg);
    max-height: 380px;
    overflow-y: auto;
    display: none;
    z-index: 2000;
    border: 1px solid var(--cinza-200);
}
.search-results.open { display: block; }
.search-results-group { padding: .5rem 0; }
.search-results-group h4 {
    padding: .3rem 1rem;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--cinza-600);
    margin: 0;
}
.search-results-group a {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    padding: .55rem 1rem;
    color: var(--cinza-800);
    text-decoration: none;
    transition: background var(--fast);
    white-space: nowrap;
    overflow: hidden;
}
.search-results-group a:hover { background: var(--cinza-100); text-decoration: none; }
.search-results-group a .sr-name { font-weight: 600; flex-shrink: 0; }
.search-results-group a .sr-detail { font-size: .82rem; color: var(--cinza-600); overflow: hidden; text-overflow: ellipsis; }
.search-no-results { padding: 1rem; text-align: center; color: var(--cinza-400); font-size: .9rem; }
@media (max-width: 860px) {
    .navbar-search { flex: 1 1 100%; order: 10; margin: .5rem 0; }
    .search-results { min-width: unset; width: 100%; max-width: none; }
}

/* ---------- TOAST NOTIFICATIONS ---------- */
#toast-container {
    position: fixed;
    top: 80px;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - 3rem);
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1.1rem;
    border-radius: var(--raio-sm);
    font-size: .93rem;
    line-height: 1.4;
    box-shadow: var(--sombra-lg);
    opacity: 0;
    transform: translateX(100%);
    transition: none;
    border-left: 4px solid;
}
.toast-show { animation: toastIn .35s ease forwards; }
.toast-hide { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity:0; transform:translateX(100%); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(100%); } }

.toast-sucesso { background: #E8F5E9; border-color: var(--verde); color: #1B5E20; }
.toast-erro    { background: #FFEBEE; border-color: var(--vermelho); color: #B71C1C; }
.toast-info    { background: #E3F2FD; border-color: var(--azul); color: #0D47A1; }
.toast-aviso   { background: var(--amarelo-bg); border-color: var(--amarelo); color: #E65100; }

.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-msg  { flex: 1; }
.toast-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: .5;
    transition: opacity var(--fast);
    color: inherit;
    line-height: 1;
    padding: 0 .2rem;
}
.toast-close:hover { opacity: 1; }

@media (max-width: 600px) {
    #toast-container { right: .5rem; top: 70px; max-width: calc(100% - 1rem); width: auto; }
    .toast { font-size: .85rem; padding: .7rem .9rem; }
}

/* ==========================================================================
   SUPORTE — Layout chat / tickets
   ========================================================================== */
.suporte-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.2rem;
    min-height: 520px;
    margin-top: 1.2rem;
}
@media (max-width: 860px) {
    .suporte-layout { grid-template-columns: 1fr; }
    .suporte-sidebar { max-height: 260px; overflow-y: auto; }
}
.suporte-sidebar {
    background: var(--branco);
    border-radius: var(--raio);
    box-shadow: var(--sombra-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.suporte-sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .9rem 1rem; border-bottom: 1px solid var(--cinza-200);
}
.suporte-sidebar-header h3 { font-size: 1rem; margin: 0; }
.suporte-filtros { padding: .6rem 1rem; }
.suporte-filtros select { width: 100%; padding: .4rem .6rem; border-radius: var(--raio-sm); border: 1px solid var(--cinza-300); font-size: .85rem; }
.suporte-ticket-list { flex: 1; overflow-y: auto; }
.suporte-ticket-item {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--cinza-100);
    cursor: pointer;
    transition: background var(--fast);
    border-left: 3px solid transparent;
}
.suporte-ticket-item:hover { background: var(--cinza-50); }
.suporte-ticket-item.ativo { background: var(--cinza-100); border-left-color: var(--acai); }
.suporte-ticket-item.prioridade-urgente { border-left-color: var(--vermelho); }
.suporte-ticket-item.prioridade-alta { border-left-color: var(--amarelo); }
.ticket-item-header { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--cinza-600); margin-bottom: .25rem; }
.ticket-id { font-weight: 600; }
.ticket-data { margin-left: auto; }
.ticket-assunto { font-weight: 600; font-size: .92rem; color: var(--cinza-900); margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-meta { display: flex; gap: .6rem; font-size: .78rem; color: var(--cinza-400); }
.ticket-status { font-size: .75rem; }
.status-aberto { color: var(--verde); }
.status-em_andamento { color: var(--amarelo); }
.status-resolvido { color: var(--azul); }
.status-fechado { color: var(--cinza-400); }
.suporte-no-tickets { padding: 2rem 1rem; text-align: center; color: var(--cinza-400); font-size: .9rem; }
.suporte-loading { padding: 2rem 1rem; text-align: center; color: var(--cinza-400); }

/* Chat area */
.suporte-chat {
    background: var(--branco);
    border-radius: var(--raio);
    box-shadow: var(--sombra-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 400px;
}
.suporte-empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 1; padding: 3rem; text-align: center; color: var(--cinza-400);
}
.suporte-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.suporte-empty-state h3 { margin-bottom: .4rem; color: var(--cinza-600); }
.suporte-chat-content { display: flex; flex-direction: column; flex: 1; }
.suporte-chat-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .8rem 1.2rem; border-bottom: 1px solid var(--cinza-200); background: var(--cinza-50);
}
.chat-header-info h3 { font-size: .95rem; margin: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.chat-header-info small { color: var(--cinza-600); font-size: .78rem; }
.suporte-mensagens {
    flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .8rem;
    max-height: 380px; min-height: 200px;
}
.chat-msg { display: flex; gap: .6rem; max-width: 85%; }
.chat-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-admin { align-self: flex-start; }
.chat-msg-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; background: var(--cinza-100); }
.chat-msg-body { background: var(--cinza-50); border-radius: var(--raio-sm); padding: .6rem .9rem; }
.chat-msg-admin .chat-msg-body { background: #f3e5f5; }
.chat-msg-header { display: flex; gap: .5rem; align-items: baseline; margin-bottom: .2rem; }
.chat-msg-header strong { font-size: .82rem; }
.chat-msg-time { font-size: .72rem; color: var(--cinza-400); }
.chat-msg-text { font-size: .9rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.suporte-chat-input {
    display: flex; gap: .6rem; padding: .8rem 1rem; border-top: 1px solid var(--cinza-200); align-items: flex-end;
}
.suporte-chat-input textarea {
    flex: 1; resize: none; border: 1px solid var(--cinza-300); border-radius: var(--raio-sm);
    padding: .6rem .8rem; font-family: var(--font); font-size: .9rem;
}
.suporte-chat-input textarea:focus { outline: none; border-color: var(--acai); }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; text-transform: capitalize; }
.badge-baixa { background: #e8f5e9; color: #2e7d32; }
.badge-normal { background: #fff8e1; color: #f57f17; }
.badge-alta { background: #fff3e0; color: #e65100; }
.badge-urgente { background: #ffebee; color: #c62828; }
.badge-fechado { background: var(--cinza-200); color: var(--cinza-600); }

/* Dark mode suporte overrides */
[data-theme="dark"] .suporte-sidebar { background: #1e1e1e; }
[data-theme="dark"] .suporte-chat { background: #1e1e1e; }
[data-theme="dark"] .suporte-chat-header { background: #252525; }
[data-theme="dark"] .chat-msg-body { background: #252525; }
[data-theme="dark"] .chat-msg-admin .chat-msg-body { background: #2a1a3a; }
[data-theme="dark"] .suporte-ticket-item:hover { background: #252525; }
[data-theme="dark"] .suporte-ticket-item.ativo { background: #2a2a2a; }

/* ==========================================================================
   FAB — Floating Action Button (ações rápidas)
   ========================================================================== */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1500;
}
.fab-btn {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, var(--acai), var(--rosa));
    color: white; border: none; font-size: 1.5rem; cursor: pointer;
    box-shadow: 0 4px 12px rgba(108,46,185,.4);
    transition: transform var(--fast), box-shadow var(--fast);
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 2;
}
.fab-btn:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(108,46,185,.5); }
.fab-btn.open { transform: rotate(45deg); }
.fab-menu {
    position: absolute; bottom: 70px; right: 0;
    display: flex; flex-direction: column; gap: .5rem; align-items: flex-end;
    opacity: 0; pointer-events: none; transform: translateY(10px);
    transition: opacity var(--fast), transform var(--fast);
}
.fab-container.open .fab-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
.fab-action {
    display: flex; align-items: center; gap: .5rem;
    background: var(--branco); color: var(--cinza-800);
    border: 1px solid var(--cinza-200); border-radius: 999px;
    padding: .5rem 1rem .5rem .7rem; font-size: .85rem; font-weight: 500;
    text-decoration: none; white-space: nowrap;
    box-shadow: var(--sombra-md); transition: transform var(--fast), box-shadow var(--fast);
    cursor: pointer;
}
.fab-action:hover { transform: translateX(-4px); box-shadow: var(--sombra-lg); text-decoration: none; }
.fab-action-icon { font-size: 1.1rem; }
[data-theme="dark"] .fab-action { background: #252525; border-color: #444; color: var(--cinza-800); }
@media print { .fab-container { display: none !important; } }

/* ==========================================================================
   NOTIFICATION BADGE (navbar)
   ========================================================================== */
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; border-radius: 999px;
    background: var(--vermelho); color: white;
    font-size: .65rem; font-weight: 700; padding: 0 5px;
    position: relative; top: -6px; left: -4px;
    animation: badgePulse 2s ease infinite;
}
.nav-badge:empty { display: none; }
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ==========================================================================
   SHORTCUTS MODAL (atalhos de teclado)
   ========================================================================== */
.shortcuts-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: .6rem;
}
.shortcut-item {
    display: flex; align-items: center; gap: .6rem; padding: .4rem .6rem;
    border-radius: var(--raio-sm); background: var(--cinza-50);
}
.shortcut-item kbd {
    display: inline-block; padding: .15rem .45rem; border-radius: 4px;
    background: var(--cinza-200); border: 1px solid var(--cinza-300);
    font-family: monospace; font-size: .78rem; font-weight: 600;
    min-width: 24px; text-align: center;
}
@media (max-width: 600px) {
    .shortcuts-grid { grid-template-columns: 1fr; }
}
[data-theme="dark"] .shortcut-item { background: #252525; }
[data-theme="dark"] .shortcut-item kbd { background: #333; border-color: #555; color: #e0e0e0; }

/* ==========================================================================
   FIDELITY CARD (cartão visual gamificado)
   ========================================================================== */
.fidelity-card {
    background: linear-gradient(135deg, var(--acai-dark) 0%, var(--acai) 50%, var(--rosa) 100%);
    border-radius: var(--raio); padding: 1.5rem; color: white;
    position: relative; overflow: hidden;
}
.fidelity-card::before {
    content: '🍇'; position: absolute; right: -10px; top: -10px; font-size: 6rem; opacity: .12; transform: rotate(15deg);
}
.fidelity-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.fidelity-header h4 { font-size: 1rem; margin: 0; }
.fidelity-points { font-size: 2rem; font-weight: 800; }
.fidelity-points small { font-size: .7rem; font-weight: 400; opacity: .8; }
.fidelity-stamps {
    display: grid; grid-template-columns: repeat(10, 1fr); gap: .4rem; margin: 1rem 0;
}
.stamp {
    aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: .9rem; border: 2px dashed rgba(255,255,255,.3);
    transition: transform var(--fast), background var(--fast);
}
.stamp.filled {
    background: rgba(255,255,255,.25); border-style: solid; border-color: rgba(255,255,255,.6);
    animation: stampPop .3s ease;
}
.stamp.reward { background: var(--amarelo); border-color: var(--amarelo); }
@keyframes stampPop { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
.fidelity-progress { height: 6px; background: rgba(255,255,255,.2); border-radius: 999px; overflow: hidden; }
.fidelity-progress-bar { height: 100%; background: var(--verde); border-radius: 999px; transition: width .6s ease; }
.fidelity-next-reward { font-size: .8rem; opacity: .8; margin-top: .5rem; }

/* ==========================================================================
   WELCOME BANNER (saudação personalizada)
   ========================================================================== */
.welcome-banner {
    display: flex; align-items: center; gap: 1.2rem;
    background: linear-gradient(135deg, var(--acai), var(--rosa));
    border-radius: var(--raio); padding: 1.2rem 1.5rem; color: white; margin-bottom: 1.2rem;
    position: relative; overflow: hidden;
}
.welcome-banner::after {
    content: ''; position: absolute; right: -30px; top: -30px;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.welcome-emoji { font-size: 2.5rem; }
.welcome-text h2 { font-size: 1.15rem; margin: 0 0 .2rem; font-weight: 600; }
.welcome-text p { font-size: .85rem; opacity: .85; margin: 0; }
.welcome-stats {
    margin-left: auto; display: flex; gap: 1.5rem; flex-shrink: 0;
}
.welcome-stat { text-align: center; }
.welcome-stat-value { font-size: 1.4rem; font-weight: 800; display: block; }
.welcome-stat-label { font-size: .7rem; opacity: .7; }
@media (max-width: 600px) {
    .welcome-banner { flex-direction: column; text-align: center; }
    .welcome-stats { margin-left: 0; }
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: var(--branco);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    box-shadow: 0 -2px 12px rgba(0,0,0,.1);
    border-top: 1px solid var(--cinza-200);
    padding: .25rem 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    flex: 1;
    padding: .4rem .2rem;
    color: var(--cinza-600);
    text-decoration: none;
    font-size: .65rem;
    font-weight: 500;
    transition: color var(--fast), transform var(--fast);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.bottom-nav-item.active {
    color: var(--acai);
}
.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 25%;
    right: 25%;
    height: 3px;
    background: var(--acai);
    border-radius: 0 0 2px 2px;
}
.bottom-nav-item:hover { color: var(--acai); text-decoration: none; }
.bottom-nav-item:active { transform: scale(.92); }
.bottom-nav-icon { font-size: 1.35rem; line-height: 1; }
.bottom-nav-label { line-height: 1; }
[data-theme="dark"] .bottom-nav { background: #1e1e1e; border-color: #333; }
[data-theme="dark"] .bottom-nav-item { color: #999; }
[data-theme="dark"] .bottom-nav-item.active { color: var(--acai-light); }
[data-theme="dark"] .bottom-nav-item.active::before { background: var(--acai-light); }
@media (min-width: 861px) { .bottom-nav { display: none; } }
@media print { .bottom-nav { display: none !important; } }

/* ==========================================================================
   PWA INSTALL BANNER
   ========================================================================== */
.pwa-install-banner {
    position: fixed;
    bottom: 75px;
    left: 1rem;
    right: 1rem;
    z-index: 9990;
    background: var(--branco);
    border-radius: var(--raio);
    box-shadow: 0 8px 30px rgba(0,0,0,.15);
    border: 1px solid var(--cinza-200);
    transform: translateY(120%);
    transition: transform .4s cubic-bezier(.4,0,.2,1);
    max-width: 500px;
    margin: 0 auto;
}
.pwa-install-banner.show { transform: translateY(0); }
.pwa-install-content {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .8rem 1rem;
}
.pwa-install-icon { font-size: 2rem; flex-shrink: 0; }
.pwa-install-text { flex: 1; font-size: .85rem; line-height: 1.3; }
.pwa-install-text strong { color: var(--acai); }
.pwa-install-close {
    background: none; border: none; font-size: 1.4rem;
    cursor: pointer; color: var(--cinza-400);
    padding: .2rem; line-height: 1;
}
[data-theme="dark"] .pwa-install-banner { background: #252525; border-color: #444; }
@media (min-width: 861px) { .pwa-install-banner { bottom: 2rem; left: auto; right: 2rem; } }

/* ==========================================================================
   SKIP TO CONTENT (Accessibility)
   ========================================================================== */
.skip-to-content {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    background: var(--acai);
    color: white;
    padding: .6rem 1.5rem;
    border-radius: 0 0 var(--raio-sm) var(--raio-sm);
    font-weight: 600;
    text-decoration: none;
    transition: top .2s ease;
}
.skip-to-content:focus {
    top: 0;
    outline: 3px solid var(--amarelo);
    outline-offset: 2px;
}

/* ==========================================================================
   OFFLINE INDICATOR
   ========================================================================== */
.offline-indicator {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 9999;
    background: #FF5722;
    color: white;
    padding: .45rem 1.2rem;
    border-radius: 0 0 var(--raio-sm) var(--raio-sm);
    font-size: .82rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    transition: transform .3s ease;
}
.offline-indicator.show { transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   PULL TO REFRESH INDICATOR
   ========================================================================== */
.pull-refresh-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 99999;
    background: var(--acai);
    color: white;
    padding: .5rem 1.5rem;
    border-radius: 0 0 var(--raio) var(--raio);
    font-size: .85rem;
    font-weight: 600;
    box-shadow: var(--sombra-md);
    transition: transform .2s ease;
}
.pull-refresh-indicator.show { transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   LAZY LOADING — Seções carregadas sob demanda (#9)
   ========================================================================== */
.lazy-section { opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .4s ease; }
.lazy-section.loaded { opacity: 1; transform: translateY(0); }
img[data-src] { opacity: 0; transition: opacity .3s ease; }
img[data-src][src] { opacity: 1; }

/* ==========================================================================
   TABLE HEADERS (sem position:sticky para evitar overlap com overflow-x:auto)
   ========================================================================== */

/* ==========================================================================
   AI CHATBOT SUGGESTION BUBBLE (suporte)
   ========================================================================== */
.ia-bubble {
    background: linear-gradient(135deg, #f3e5f5, #e8eaf6);
    border-left: 4px solid var(--acai);
    border-radius: var(--raio-sm);
    padding: .8rem 1rem;
    margin: .6rem 0;
    font-size: .87rem;
    line-height: 1.5;
    animation: fadeIn .3s ease;
}
.ia-bubble-header {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .4rem;
    font-weight: 600;
    color: var(--acai);
    font-size: .8rem;
}
.ia-bubble-confidence {
    display: inline-block;
    padding: .1rem .4rem;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 600;
    margin-left: auto;
}
.ia-conf-high { background: #e8f5e9; color: #2e7d32; }
.ia-conf-mid { background: #fff8e1; color: #f57f17; }
.ia-conf-low { background: #ffebee; color: #c62828; }
[data-theme="dark"] .ia-bubble { background: linear-gradient(135deg, #2a1a3a, #1a2332); }
[data-theme="dark"] .ia-conf-high { background: #1b5e20; color: #a5d6a7; }
[data-theme="dark"] .ia-conf-mid { background: #e65100; color: #ffe0b2; }
[data-theme="dark"] .ia-conf-low { background: #b71c1c; color: #ffcdd2; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* IA Conversation chat styles */
#iaConversation:empty::before {
    content: '🤖 Olá! Sou a IA do Combina Açaí.\A\ASou movida por TF-IDF + Cosine Similarity.\APergunte sobre vendas, clientes, estoque, LGPD...';
    white-space: pre-wrap;
    color: var(--cinza-500);
    font-size: .82rem;
    display: block;
    text-align: center;
    padding: 2rem 1rem;
}

/* ==========================================================================
   ENHANCED FOCUS STYLES (Accessibility)
   ========================================================================== */
:focus-visible {
    outline: 3px solid var(--acai-light);
    outline-offset: 2px;
}
.btn:focus-visible { box-shadow: 0 0 0 4px rgba(108,46,185,.3); }

/* Increase touch targets on mobile */
@media (max-width: 860px) {
    .btn { min-height: 44px; min-width: 44px; }
    .navbar-toggle { min-height: 44px; min-width: 44px; }
    .fab-btn { width: 52px; height: 52px; }
    .suporte-ticket-item { min-height: 60px; }
}

/* ==========================================================================
   SMOOTH PAGE TRANSITIONS
   ========================================================================== */
.content {
    animation: pageIn .3s ease;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   DASHBOARD MOBILE RESPONSIVE ENHANCEMENTS
   ========================================================================== */
@media (max-width: 600px) {
    .container { padding: .5rem; }
    .hero { padding: 1.5rem 1rem; }
    .hero h1 { font-size: 1.5rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
    .stat-card { padding: 1rem; }
    .stat-card .stat-value { font-size: 1.3rem; }
    .quick-actions { padding: 1rem; }
    .action-buttons { grid-template-columns: 1fr 1fr; gap: .5rem; }
    .action-btn { padding: .75rem .5rem; font-size: .85rem; }
    .chart-container { padding: 1rem; }
    .table { font-size: .8rem; }
    .table th, .table td { padding: .5rem .4rem; }
    .card { padding: 1rem; margin-bottom: 1rem; }
    h2 { font-size: 1.2rem; }
    .form-group { margin-bottom: .75rem; }
    .modal-box { width: 95vw; max-width: 95vw; margin: 1rem; padding: 1rem; }
}

@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .action-buttons { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.25rem; }
}
