/* ========== VARIAVEIS ========== */
:root {
    --hbl-green: #78BE20;
    --hbl-green-dark: #5a9e10;
    --hbl-green-light: #e8f5d6;
    --hbl-dark: #1a1a2e;
    --hbl-gray: #6c757d;
    --hbl-gray-light: #f0f2f5;
    --hbl-white: #FFFFFF;
    --hbl-danger: #dc3545;
    --hbl-warning: #ffc107;
    --hbl-info: #0dcaf0;
    --hbl-orange: #FF6B00;

    --btn-h: 44px;
    --btn-h-lg: 56px;
    --btn-h-sm: 36px;
    --nav-h: 80px;
    --header-h: 64px;
    --radius: 12px;
    --gap: 10px;
    --card-min: 200px;

    --border-light: #e0e0e0;
    --border-subtle: #f0f0f0;
    --border-form: #ccc;
    --bg-hover: #f8f9fa;
    --bg-remove: #fee;
    --hbl-orange-light: #fff3e6;
    --hbl-danger-light: #fde;
    --hbl-warning-bg: #fff3cd;
    --hbl-warning-text: #856404;
    --hbl-disabled-bg: #ccc;
    --hbl-disabled-text: #999;
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    background: var(--hbl-gray-light);
    color: var(--hbl-dark);
    padding-bottom: calc(var(--nav-h) + 8px);
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}

/* ========== HEADER ========== */
.app-header {
    background: linear-gradient(135deg, var(--hbl-green) 0%, var(--hbl-green-dark) 100%);
    color: white;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.app-header h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.daily-counter {
    font-size: 13px;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 20px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.header-user {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
}

/* ========== NAVEGACAO INFERIOR ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    background: var(--hbl-white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--hbl-gray);
    min-width: 72px;
    min-height: 72px;
    border-radius: 12px;
    transition: color 0.2s, background 0.2s;
    font-size: 12px;
    padding: 4px 8px;
}
.nav-item.active {
    color: var(--hbl-green-dark);
    font-weight: 700;
    background: var(--hbl-green-light);
}
.nav-icon { font-size: 28px; margin-bottom: 3px; }
.nav-label { font-size: 12px; font-weight: 500; }

/* ========== PDV ABAS SUPERIORES ========== */
.pdv-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 10px 0;
    background: var(--hbl-white);
    border-bottom: 2px solid var(--border-light);
}
.pdv-tab {
    flex: 1;
    padding: 14px 12px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: var(--hbl-gray);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    border-radius: 10px 10px 0 0;
    min-height: 56px;
    transition: all 0.2s;
}
.pdv-tab:active { background: var(--hbl-gray-light); }
.pdv-tab.active {
    color: var(--hbl-green-dark);
    border-bottom-color: var(--hbl-green);
    background: var(--hbl-green-light);
    font-weight: 700;
}

/* ========== PDV LAYOUT ========== */
.pdv-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--gap);
    padding: var(--gap);
    height: calc(100vh - var(--header-h) - var(--nav-h) - 78px);
    overflow: hidden;
}
#tab-content {
    overflow-y: auto;
}
@media (max-width: 900px) {
    .pdv-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* ========== PRESETS GRID ========== */
.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--hbl-gray);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border-subtle);
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
    gap: var(--gap);
    margin-bottom: 16px;
}
.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--hbl-white);
    cursor: pointer;
    padding: 12px;
    transition: transform 0.1s, box-shadow 0.15s;
    text-align: center;
    font-size: 16px;
}
.preset-btn:active { transform: scale(0.95); }
.preset-btn .preset-icon { font-size: 40px; margin-bottom: 8px; }
.preset-btn .preset-name { font-weight: 700; font-size: 18px; line-height: 1.2; }
.preset-btn .preset-desc { font-size: 13px; color: var(--hbl-gray); margin-top: 4px; }
.preset-btn .preset-price { font-size: 18px; font-weight: 700; color: var(--hbl-green-dark); margin-top: 6px; }
.preset-custom {
    border: 2px dashed var(--hbl-green);
    color: var(--hbl-green-dark);
    background: var(--hbl-green-light);
}

/* ========== MONTADOR DE SHAKE ========== */
.builder-section { margin-bottom: 16px; }
.builder-flavors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
    gap: var(--gap);
}
.flavor-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 3px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--hbl-white);
    cursor: pointer;
    padding: 12px;
    transition: transform 0.1s, border-color 0.2s;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}
.flavor-btn:active { transform: scale(0.95); }
.flavor-btn.selected { border-color: var(--hbl-green); background: var(--hbl-green-light); }
.flavor-btn .flavor-name { line-height: 1.2; font-size: 16px; }
.flavor-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--hbl-green);
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.addons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
    gap: var(--gap);
}
.addon-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--hbl-white);
    cursor: pointer;
    padding: 12px;
    transition: transform 0.1s, border-color 0.2s;
    font-size: 14px;
    text-align: center;
}
.addon-btn:active { transform: scale(0.95); }
.addon-btn.selected { border-color: var(--hbl-orange); background: var(--hbl-orange-light); }
.addon-btn .addon-name { font-weight: 600; font-size: 15px; }
.addon-btn .addon-price { font-size: 14px; color: var(--hbl-orange); font-weight: 600; margin-top: 4px; }

#builder-area { min-height: 100%; }

/* ========== BUILDER SUMMARY BAR ========== */
.builder-summary {
    background: var(--hbl-white);
    border: 2px solid var(--hbl-green);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}
.builder-summary-text { flex: 1; font-size: 14px; font-weight: 500; min-width: 200px; }
.builder-summary-price { font-size: 20px; font-weight: 700; color: var(--hbl-green-dark); white-space: nowrap; }
.builder-actions { display: flex; gap: 8px; }

/* ========== CARRINHO ========== */
.cart-container {
    background: var(--hbl-white);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.cart-title {
    font-size: 16px;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 8px;
}
.cart-items { flex: 1; overflow-y: auto; }
.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
    gap: 8px;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-label { font-size: 14px; font-weight: 600; line-height: 1.3; }
.cart-item-detail { font-size: 12px; color: var(--hbl-gray); }
.cart-item-price { font-size: 15px; font-weight: 700; color: var(--hbl-green-dark); white-space: nowrap; }
.cart-item-remove {
    min-width: 44px;
    min-height: 44px;
    border: none;
    background: var(--bg-remove);
    color: var(--hbl-danger);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-empty { padding: 40px 0; text-align: center; color: var(--hbl-gray); font-size: 14px; }

.cart-summary { border-top: 2px solid var(--border-light); padding-top: 10px; margin-top: auto; }
.cart-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.cart-total-row { font-size: 20px; font-weight: 700; padding: 8px 0; }
.cart-total-value { color: var(--hbl-green-dark); }

.cart-discount-input {
    width: 100px;
    padding: 6px 8px;
    border: 1px solid var(--border-form);
    border-radius: 6px;
    font-size: 14px;
    text-align: right;
}

/* ========== PAGAMENTO ========== */
.payment-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin: 8px 0;
}
.pay-btn {
    min-height: 48px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    background: var(--hbl-white);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    padding: 6px 4px;
    transition: all 0.15s;
}
.pay-btn.active { border-color: var(--hbl-green); background: var(--hbl-green-light); }
.pay-btn .pay-icon { font-size: 18px; display: block; }

/* ========== BOTOES (DESIGN SYSTEM) ========== */
/* Base — medium (44px) default */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; border-radius: var(--radius); cursor: pointer;
    font-weight: 600; font-size: 14px; line-height: 1;
    padding: 0 20px; min-height: var(--btn-h);
    text-decoration: none; transition: all 0.15s;
}
.btn:active { transform: scale(0.97); }

/* Color variants */
.btn-primary { background: var(--hbl-green); color: white; }
.btn-primary:disabled { background: var(--hbl-disabled-bg); color: var(--hbl-disabled-text); cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--border-light); color: var(--hbl-dark); }
.btn-danger { background: var(--hbl-danger); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--hbl-green); color: var(--hbl-green-dark); }

/* Size modifiers */
.btn-lg { min-height: var(--btn-h-lg); font-size: 18px; padding: 0 28px; }
.btn-sm { min-height: var(--btn-h-sm); font-size: 13px; padding: 0 12px; }

/* Width modifier */
.btn-block { width: 100%; }

/* Ghost — transparent, for header */
.btn-ghost {
    background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3);
    color: white; font-size: 12px; min-height: 32px; padding: 0 10px; border-radius: 6px;
}

.btn-nowrap { white-space: nowrap; }
.custom-size-input { display: flex; gap: 6px; align-items: center; }
.form-hint { font-size: 13px; color: var(--hbl-gray); margin: 2px 0 8px; }
.size-checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px; }
.size-checkbox-item { display: flex; align-items: center; gap: 4px; font-size: 14px; padding: 4px 6px; border-radius: 4px; cursor: pointer; }
.size-checkbox-item:hover { background: var(--hbl-green-light); }

/* Form action bar (Cancel + Save) */
.btn-group { display: flex; gap: 8px; margin-top: 16px; }
.btn-group .btn { flex: 1; }
.btn-group .btn-primary { flex: 2; }

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}
.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--hbl-gray);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* ========== FLAVOR SELECTOR MODAL ========== */
.flavor-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
    gap: var(--gap);
}
.flavor-select-btn {
    aspect-ratio: 1;
    border: 3px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--hbl-white);
    cursor: pointer;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.flavor-select-btn:active { transform: scale(0.95); }
.flavor-select-btn:disabled { opacity: 0.4; pointer-events: none; }
.flavor-selected {
    border-color: var(--hbl-green) !important;
    background: var(--hbl-green-light);
    box-shadow: 0 0 0 2px var(--hbl-green-light);
}
.flavor-actions {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}
.flavor-actions .btn-primary { flex: 1; }

.flavor-selections-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}
.flavor-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 2px solid var(--border-light);
    border-radius: 20px;
    background: white;
    font-size: 14px;
    font-weight: 600;
}

/* ========== BEBIDAS GRID ========== */
.drinks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
    gap: var(--gap);
}
.drink-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--hbl-white);
    cursor: pointer;
    padding: 14px 12px;
    transition: transform 0.1s;
    text-align: center;
}
.drink-btn:active { transform: scale(0.95); }
.drink-btn .drink-name { font-weight: 600; font-size: 16px; line-height: 1.2; }
.drink-btn .drink-price { font-size: 18px; font-weight: 700; color: var(--hbl-green-dark); margin-top: 6px; }

/* ========== PRODUTO FECHADO GRID ========== */
.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
    gap: var(--gap);
}
.package-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--hbl-white);
    cursor: pointer;
    padding: 14px 12px;
    transition: transform 0.1s;
    text-align: center;
}
.package-btn:active { transform: scale(0.95); }
.package-btn .pkg-name { font-weight: 600; font-size: 16px; line-height: 1.2; }
.package-btn .pkg-size { font-size: 13px; color: var(--hbl-gray); margin-top: 4px; }
.package-btn .pkg-price { font-size: 18px; font-weight: 700; color: var(--hbl-green-dark); margin-top: 6px; }

/* ========== ESTOQUE ========== */
.stock-table { width: 100%; border-collapse: collapse; background: var(--hbl-white); border-radius: var(--radius); overflow-x: auto; display: block; }
.stock-table th { background: var(--hbl-green); color: white; padding: 12px 10px; text-align: left; font-size: 13px; font-weight: 600; }
.stock-table td { padding: 10px; border-bottom: 1px solid var(--border-subtle); font-size: 14px; }
.stock-table tr:hover { background: var(--bg-hover); }
.product-thumb-cell { width: 64px; text-align: center; padding: 4px !important; }
.product-list-thumb { width: 56px; height: 56px; object-fit: contain; border-radius: 6px; }
.product-list-nophoto { font-size: 10px; color: var(--hbl-gray); display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; background: var(--hbl-gray-light); border-radius: 6px; text-align: center; }
.stock-ok { color: var(--hbl-green-dark); }
.stock-low { color: var(--hbl-warning); font-weight: 600; }
.stock-out { color: var(--hbl-danger); font-weight: 700; }
.stock-bar { height: 8px; border-radius: 4px; background: var(--border-light); overflow: hidden; width: 80px; display: inline-block; }
.stock-bar-fill { height: 100%; border-radius: 4px; }

/* ========== SUGESTÃO DE COMPRAS ========== */
.suggestion-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.suggestion-urgente { background: var(--hbl-danger-light); color: var(--hbl-danger); }
.suggestion-comprar { background: var(--hbl-orange-light); color: var(--hbl-orange); }
.suggestion-atencao { background: var(--hbl-warning-bg); color: var(--hbl-warning-text); }
.suggestion-ok { background: var(--hbl-green-light); color: var(--hbl-green-dark); }
.suggestion-sem_dados { background: var(--hbl-gray-light); color: var(--hbl-gray); }

/* ========== FINANCEIRO ========== */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
    gap: var(--gap);
    margin-bottom: 16px;
}
.summary-card {
    background: var(--hbl-white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.summary-card-label { font-size: 12px; color: var(--hbl-gray); font-weight: 600; text-transform: uppercase; }
.summary-card-value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.summary-card-value.positive { color: var(--hbl-green-dark); }
.summary-card-value.negative { color: var(--hbl-danger); }

.date-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    align-items: center;
}
.date-filters input[type="date"] {
    padding: 8px 10px;
    border: 1px solid var(--border-form);
    border-radius: 8px;
    font-size: 14px;
}
.quick-date-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-form);
    border-radius: 8px;
    background: var(--hbl-white);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}
.quick-date-btn.active { background: var(--hbl-green); color: white; border-color: var(--hbl-green); }

.chart-container { background: var(--hbl-white); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); margin-bottom: 16px; }

.sales-table { width: 100%; border-collapse: collapse; background: var(--hbl-white); border-radius: var(--radius); overflow: hidden; }
.sales-table th { background: var(--bg-hover); padding: 10px; text-align: left; font-size: 13px; font-weight: 600; border-bottom: 2px solid var(--border-light); }
.sales-table td { padding: 10px; border-bottom: 1px solid var(--border-subtle); font-size: 14px; }
.sales-table tr:hover { background: var(--bg-hover); cursor: pointer; }

/* ========== CLIENTES ========== */
.client-card {
    background: var(--hbl-white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.client-balance { font-size: 16px; font-weight: 700; }
.client-balance.has-debt { color: var(--hbl-danger); }

/* ========== FORMS ========== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--hbl-gray); }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-form);
    border-radius: 8px;
    font-size: 16px;
    background: white;
}
.form-control:focus { outline: 2px solid var(--hbl-green); border-color: var(--hbl-green); }

/* ========== TOAST ========== */
.toast-container { position: fixed; top: 12px; right: 12px; z-index: 3000; display: flex; flex-direction: column; gap: 6px; }
.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    max-width: 340px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.toast-success { background: var(--hbl-green); }
.toast-error { background: var(--hbl-danger); }
.toast-warning { background: var(--hbl-warning); color: var(--hbl-dark); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ========== PAGINA CONTAINER ========== */
.page-container { padding: var(--gap); max-width: 1200px; margin: 0 auto; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; }

/* ========== QTY CONTROLS ========== */
.qty-controls { display: flex; align-items: center; gap: 4px; }
.qty-btn {
    min-width: 44px;
    min-height: 44px;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    background: var(--hbl-white);
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qty-value { font-size: 16px; font-weight: 700; min-width: 24px; text-align: center; }

/* ========== MESSAGES ========== */
.messages { list-style: none; padding: 8px; }
.messages li { padding: 10px 16px; margin-bottom: 6px; border-radius: 8px; font-size: 14px; }
.messages .success { background: var(--hbl-green-light); color: var(--hbl-green-dark); }
.messages .error { background: var(--hbl-danger-light); color: var(--hbl-danger); }
.messages .warning { background: var(--hbl-warning-bg); color: var(--hbl-warning-text); }

/* ========== EMOJI PICKER ========== */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 6px;
}
.emoji-btn {
    height: 52px;
    font-size: 28px;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    background: var(--hbl-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.emoji-btn:active { transform: scale(0.9); }
.emoji-btn.emoji-selected {
    border-color: var(--hbl-green);
    background: var(--hbl-green-light);
    transform: scale(1.1);
}
.emoji-btn-none {
    height: 52px;
    font-size: 12px;
    border: 2px dashed var(--border-light);
    border-radius: 10px;
    background: var(--hbl-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hbl-gray);
    transition: all 0.15s;
}
.emoji-btn-none.emoji-selected {
    border-color: var(--hbl-green);
    background: var(--hbl-green-light);
    color: var(--hbl-green-dark);
}

/* ========== PRODUCT CARD IMAGES ========== */
.card-product-img {
    width: 80%;
    max-height: 100px;
    object-fit: contain;
    margin-bottom: 6px;
    pointer-events: none;
    flex-shrink: 0;
}

/* ========== IMAGE PICKER ========== */
.image-picker-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 2px dashed var(--border-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s;
}
.image-picker-preview:hover {
    border-color: var(--hbl-green);
}
.image-picker-toolbar {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 8px;
}
.image-picker-toolbar .btn {
    flex-shrink: 0;
    white-space: nowrap;
}
.image-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
}
.image-picker-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.image-picker-item:hover {
    border-color: var(--hbl-green);
}
.image-picker-item.selected {
    border-color: var(--hbl-green);
    box-shadow: 0 0 0 2px var(--hbl-green-light);
}
.image-picker-item img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}
.image-picker-label {
    font-size: 11px;
    color: var(--hbl-gray);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    max-width: 100%;
}

.image-picker-item.web-downloading {
    opacity: 0.5;
    pointer-events: none;
    border-color: var(--hbl-green);
}

/* ========== RECIPE INGREDIENT CARD ========== */
.ingredient-card {
    background: var(--hbl-gray-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
}
.ingredient-slot-hint {
    font-size: 13px;
    color: var(--hbl-green-dark);
    background: var(--hbl-green-light);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* ========== MOVE (REORDER) BUTTONS ========== */
.btn-move {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--hbl-white);
    cursor: pointer;
    font-size: 13px;
    color: var(--hbl-gray);
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}
.btn-move:hover { background: var(--hbl-green-light); color: var(--hbl-green-dark); border-color: var(--hbl-green); }
.btn-move:active { transform: scale(0.9); }
.btn-move-disabled { opacity: 0.25; cursor: default; pointer-events: none; }

/* ========== BUILDER REMOVE BUTTON ========== */
.builder-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.builder-remove-btn:hover, .builder-remove-btn:active { opacity: 1; background: var(--bg-remove); }

/* ========== HTMX LOADING & FEEDBACK ========== */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-flex; }
.htmx-request.htmx-indicator { display: inline-flex; }

/* Global spinner pill — topo central */
.global-spinner {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
    z-index: 4000; background: rgba(0,0,0,0.75); color: white;
    padding: 8px 20px; border-radius: 20px; font-size: 13px; font-weight: 500;
    align-items: center; gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: none;
}
.global-spinner::after { content: 'Carregando…'; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    width: 16px; height: 16px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* HTMX: desabilita elemento que disparou request (anti duplo-clique) */
.htmx-request { pointer-events: none; opacity: 0.6; cursor: wait; }
.htmx-request .btn { pointer-events: none; }

/* Form submit: estado "aguardando" */
.btn[disabled] { pointer-events: none; opacity: 0.6; cursor: wait; }

/* ========== ALPINE.JS CLOAK ========== */
[x-cloak] { display: none !important; }

/* ========== LOGIN ========== */
.login-body {
    background: var(--hbl-green);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-bottom: 0;
}
.login-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    text-align: center;
}
.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-title { font-size: 22px; font-weight: 700; color: var(--hbl-dark); margin-bottom: 24px; }
.login-error {
    background: #fde;
    color: var(--hbl-danger);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}
.login-success {
    background: var(--hbl-green-light);
    color: var(--hbl-green-dark);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}
.login-card .form-group { text-align: left; }

/* ── Login checkboxes ── */
.login-checkbox-group {
    margin-bottom: 10px;
    text-align: left;
    transition: opacity 0.2s;
}
.login-checkbox-group.login-checkbox-disabled {
    opacity: 0.45;
    pointer-events: none;
}
.login-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--hbl-dark);
    min-height: 44px;
    padding: 4px 0;
    user-select: none;
    -webkit-user-select: none;
}
.login-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--hbl-green);
    cursor: pointer;
    flex-shrink: 0;
}
.login-checkbox-hint {
    font-size: 12px;
    color: var(--hbl-gray);
    margin: -4px 0 0 32px;
    line-height: 1.4;
}

/* ── Trusted device cards ── */
.device-card {
    background: white;
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    border: 2px solid transparent;
}
.device-card-current {
    border-color: var(--hbl-green);
    background: var(--hbl-green-light);
}
.device-info { flex: 1; min-width: 0; }
.device-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--hbl-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.device-badge-current {
    font-size: 11px;
    font-weight: 600;
    background: var(--hbl-green);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
}
.device-meta {
    font-size: 12px;
    color: var(--hbl-gray);
    margin-top: 4px;
}

/* ========== PDV FILTER BAR ========== */
.pdv-filter-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--hbl-gray-light);
    padding: 8px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pdv-search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--border-form);
    border-radius: 8px;
    font-size: 15px;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 12px center no-repeat;
}
.pdv-search-input:focus { outline: 2px solid var(--hbl-green); border-color: var(--hbl-green); }
.category-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.category-chips::-webkit-scrollbar { display: none; }
.category-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border-light);
    background: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.category-chip:active { transform: scale(0.95); }
.category-chip.active {
    background: var(--hbl-green);
    color: white;
    border-color: var(--hbl-green);
}

/* ========== GLOBAL SEARCH OVERLAY ========== */
.header-search-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    min-width: 36px;
    min-height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.header-search-btn:hover { background: rgba(255,255,255,0.3); }
.search-overlay {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1500;
}
.search-panel {
    background: white;
    max-width: 520px;
    margin: 0 auto;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-height: calc(100vh - var(--header-h) - 40px);
    overflow-y: auto;
}
.search-panel-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: none;
    border-bottom: 2px solid var(--border-light);
    font-size: 16px;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 14px center no-repeat;
    border-radius: var(--radius) var(--radius) 0 0;
}
.search-panel-input:focus { outline: none; border-bottom-color: var(--hbl-green); }
.search-result-group {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hbl-gray);
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.1s;
    text-decoration: none;
    color: var(--hbl-dark);
}
.search-result-item:hover { background: var(--hbl-green-light); }
.search-result-icon { font-size: 20px; flex-shrink: 0; width: 28px; text-align: center; }
.search-result-info { flex: 1; min-width: 0; }
.search-result-name { font-weight: 600; font-size: 14px; }
.search-result-meta { font-size: 12px; color: var(--hbl-gray); }
.search-result-action { font-size: 12px; color: var(--hbl-green-dark); font-weight: 600; flex-shrink: 0; }
.search-loading { text-align: center; padding: 12px; color: var(--hbl-gray); font-size: 13px; }
.search-empty { padding: 24px 16px; text-align: center; color: var(--hbl-gray); font-size: 14px; }
.search-hint { padding: 16px; text-align: center; color: var(--hbl-gray); font-size: 13px; }

/* ========== FORM GRID HELPERS ========== */
.form-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.form-grid-2eq { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ========== RESPONSIVE: MOBILE ========== */
@media (max-width: 600px) {
    .payment-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .presets-grid,
    .drinks-grid,
    .package-grid,
    .builder-flavors-grid,
    .addons-grid,
    .flavor-selector-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .builder-summary {
        flex-direction: column;
        text-align: center;
    }
    .builder-summary-text { min-width: auto; }
    .page-title { font-size: 18px; }
    .chart-grid { grid-template-columns: 1fr; }
    .sales-table { overflow-x: auto; display: block; }
    .stock-table, .sales-table { font-size: 12px; }
    .stock-table th, .stock-table td,
    .sales-table th, .sales-table td { padding: 6px 4px; }
    .stock-table .hide-mobile,
    .sales-table .hide-mobile { display: none; }
    .modal-content { padding: 16px; }
    .date-filters { flex-direction: column; }
    .sugestoes-hide-mobile { display: none; }
    .form-grid-2, .form-grid-2eq, .form-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
    .payment-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-cards { grid-template-columns: 1fr; }
}

/* ========== SELETOR DE LOJA ========== */
.loja-selector-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.loja-selector-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    background: #fff;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-size: 16px;
    text-align: left;
}
.loja-selector-card:hover, .loja-selector-card:focus {
    border-color: var(--hbl-green);
    box-shadow: 0 2px 8px rgba(120,190,32,0.15);
}
.loja-selector-icon {
    font-size: 28px;
    flex-shrink: 0;
}
.loja-selector-name {
    font-weight: 600;
    color: var(--hbl-dark);
}

/* Header: switch store button */
.header-switch-loja {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.header-switch-loja:hover {
    opacity: 1;
}
