/* ========== Garçom Digital — Design System ========== */
:root {
    --bg: #f2f4f7;
    --bg-elev: #ffffff;
    --bg-soft: #f8fafc;
    --border: #e3e8ef;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;

    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    --accent: #0ea5e9;

    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 2px 8px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10), 0 4px 12px rgba(15, 23, 42, 0.06);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary {
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-soft); border-color: var(--border-strong); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; }
.btn-ghost { color: var(--text-muted); padding: 8px 14px; }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ========== Cards ========== */
.card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* ========== Login ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 10%, rgba(30, 64, 175, 0.08), transparent 50%),
        radial-gradient(circle at 80% 90%, rgba(14, 165, 233, 0.06), transparent 50%),
        var(--bg);
}
.login-card {
    background: var(--bg-elev);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 30px 40px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
}
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.login-logo img {
    max-width: 240px;
    height: auto;
}
.login-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text);
    transition: all 0.15s;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-elev);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; }

.login-hint {
    margin-top: 20px;
    padding: 12px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--primary-dark);
    text-align: center;
    line-height: 1.6;
}

/* ========== Topbar ========== */
.topbar {
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
}
.topbar-brand img { height: 36px; }
.topbar-info { color: var(--text-muted); font-size: 13px; }
.topbar-info strong { color: var(--text); }

/* ========== Tabs ========== */
.tabs {
    display: flex;
    gap: 4px;
    padding: 0 28px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
}
.tab {
    padding: 14px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-badge {
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    animation: pulse-badge 1.4s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}
@keyframes pulse-badge {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
        transform: scale(1.08);
    }
}

/* ========== Main content ========== */
.main {
    padding: 28px;
    max-width: 1400px;
    margin: 0 auto;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}
.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}
.section-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 2px;
}

/* ========== Tables grid ========== */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.table-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.table-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--border);
    transition: background 0.2s;
}
.table-card.status-fechada::before { background: var(--text-soft); }
.table-card.status-liberada::before { background: var(--warning); }
.table-card.status-ocupada::before { background: var(--success); }
.table-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.table-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.table-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}
.table-number small { font-size: 12px; color: var(--text-muted); font-weight: 500; display: block; }
.status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.status-fechada .status-pill { background: #f1f5f9; color: var(--text-muted); }
.status-liberada .status-pill { background: var(--warning-bg); color: var(--warning); }
.status-ocupada .status-pill { background: var(--success-bg); color: var(--success); }

.access-code-display {
    background: var(--primary-bg);
    border: 1px dashed var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin: 12px 0;
    text-align: center;
}
.access-code-display .label {
    font-size: 11px;
    color: var(--primary-dark);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.access-code-display .code {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 2px;
    font-family: ui-monospace, 'SF Mono', monospace;
}

.table-alerts {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 10px 0;
}
.alert-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    animation: pulse 1.8s ease-in-out infinite;
}
.alert-chip.waiter { background: var(--warning-bg); color: var(--warning); border: 1px solid #fde68a; }
.alert-chip.bill { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.table-actions {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.table-actions .btn { flex: 1; min-width: 90px; }

/* ========== Orders panel ========== */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.order-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.order-card-head {
    padding: 16px 20px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.order-card-head h3 {
    font-size: 17px;
    font-weight: 700;
}
.order-total {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}
.order-items {
    padding: 8px 0;
}
.order-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
}
.order-item:last-child { border-bottom: none; }
.order-item:hover { background: var(--bg-soft); }
.order-item.delivered-row {
    background: var(--success-bg);
}
.order-item.delivered-row:hover { background: #d1fae5; }
.order-item-info { flex: 1; min-width: 0; }
.order-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.order-cancel-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--danger);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.order-cancel-btn:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    transform: scale(1.05);
}
.item-name { font-weight: 600; font-size: 14px; }
.item-meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.item-price { font-weight: 700; color: var(--text); font-size: 14px; }
.item-qty {
    background: var(--primary-bg);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }

/* ========== Modal ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    animation: fadeIn 0.2s;
}
.modal {
    background: var(--bg-elev);
    border-radius: var(--radius-lg);
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-close {
    color: var(--text-muted);
    font-size: 22px;
    padding: 4px 8px;
    border-radius: 6px;
}
.modal-close:hover { background: var(--bg-soft); color: var(--text); }
.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.modal-foot {
    padding: 16px 24px;
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.qr-display { text-align: center; }
.qr-display img {
    max-width: 260px;
    margin: 0 auto 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    background: white;
}
.qr-url {
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
    background: var(--bg-soft);
    padding: 8px;
    border-radius: 6px;
    font-family: ui-monospace, monospace;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ========== Client — access screen ========== */
.client-page {
    min-height: 100vh;
    background: var(--bg);
}
.client-access {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.access-card {
    background: var(--bg-elev);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px 32px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--border);
}
.access-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.access-card .table-info {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}
.code-input {
    font-size: 30px;
    text-align: center;
    letter-spacing: 4px;
    padding: 16px;
    font-weight: 800;
    font-family: ui-monospace, 'SF Mono', monospace;
}

/* ========== Client — menu ========== */
.client-header {
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}
.client-header-content {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.client-header h1 { font-size: 17px; font-weight: 800; }
.client-header small { color: var(--text-muted); font-size: 12px; display: block; font-weight: 500; }

.call-buttons {
    display: flex;
    gap: 10px;
    padding: 16px 20px 0;
    max-width: 720px;
    margin: 0 auto;
}
.call-buttons .btn { flex: 1; }

.menu-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 140px;
}
.category-section { margin-bottom: 28px; }
.category-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.category-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.menu-item {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    transition: all 0.15s;
}
.menu-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}
.menu-item-info { flex: 1; min-width: 0; }
.menu-item-name { font-weight: 700; font-size: 15px; color: var(--text); }
.menu-item-desc { font-size: 13px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.menu-item-price { font-weight: 800; color: var(--primary); margin-top: 6px; font-size: 15px; }
.qty-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
}

/* Controle de peso (itens por kg) */
.weight-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-bg);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.weight-value {
    font-size: 14px;
    font-weight: 700;
    min-width: 48px;
    text-align: center;
    color: var(--primary-dark);
}
.weight-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
    text-align: right;
    min-width: 80px;
    flex-shrink: 0;
    padding-right: 4px;
}
.menu-item-weight-info {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

/* Meio a meio (pizza) */
.menu-item-actions-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.btn-half-half {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-half-half:hover {
    background: #fde68a;
}
.half-half-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    flex-shrink: 0;
}
.hh-selected {
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
}
.hh-price-tag {
    font-weight: 700;
    color: var(--success);
}
.hh-first-flavor {
    padding: 12px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 14px;
}
.hh-instruction {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 10px;
    font-weight: 600;
}
.hh-flavors-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}
.hh-flavor-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elev);
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}
.hh-flavor-option:hover {
    background: var(--primary-bg);
    border-color: var(--primary);
}
.hh-flavor-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.hh-flavor-name {
    font-weight: 600;
    font-size: 14px;
}
.hh-flavor-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
}
.hh-flavor-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
    margin-left: 12px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--bg-elev);
    color: var(--text);
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}
.qty-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.qty-value { min-width: 24px; text-align: center; font-weight: 700; font-size: 14px; }

/* Cart bar fixa */
.cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-elev);
    border-top: 1px solid var(--border);
    padding: 14px 20px;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
    z-index: 50;
    transform: translateY(100%);
    transition: transform 0.3s;
}
.cart-bar.visible { transform: translateY(0); }
.cart-content {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.cart-info { font-weight: 600; font-size: 14px; }
.cart-total { color: var(--primary); font-size: 18px; font-weight: 800; }

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--text);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    font-size: 14px;
    z-index: 200;
    transition: transform 0.3s;
    max-width: 90vw;
}
.toast.visible { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ========== Panel + tab views ========== */
.tab-view { display: none; }
.tab-view.active { display: block; }

/* Responsive */
@media (max-width: 640px) {
    .topbar { padding: 12px 16px; }
    .tabs { padding: 0 12px; overflow-x: auto; }
    .tab { padding: 12px 14px; font-size: 13px; }
    .main { padding: 16px; }
    .section-title { font-size: 18px; }
    .tables-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
    .table-card { padding: 14px; }
    .table-number { font-size: 22px; }
}

/* ========== Sub-abas (Pendentes/Entregues/Todos) ========== */
.sub-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    width: fit-content;
}
.sub-tab {
    padding: 9px 20px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}
.sub-tab:hover { color: var(--text); background: var(--bg-soft); }
.sub-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.sub-tab-badge {
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.sub-tab.active .sub-tab-badge {
    background: white;
    color: var(--primary-dark);
}

/* ========== Filtro de mesas (pílulas) ========== */
.table-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.table-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}
.table-filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.table-pill {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}
.table-pill:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--bg-soft);
}
.table-pill.active {
    background: var(--text);
    color: white;
    border-color: var(--text);
}
.table-pill.has-pending,
.table-pill.has-alert {
    border-color: var(--danger);
    color: var(--danger);
    font-weight: 700;
    animation: shake-pill 1.6s ease-in-out infinite;
}
.table-pill.has-pending.active,
.table-pill.has-alert.active {
    background: var(--text);
    border-color: var(--text);
    color: white;
    /* Quando ativa (selecionada), para de tremer — mas mantém destaque sutil */
    animation: none;
}
.pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    display: inline-block;
    flex-shrink: 0;
    animation: pulse-dot 1.2s ease-in-out infinite;
}
.table-pill.active .pill-dot {
    background: white;
    animation: none;
}
@keyframes shake-pill {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
    85%, 95% { transform: translateX(0); }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ========== Destaque de mesa com pedido pendente ========== */
.order-card.highlight {
    border-color: var(--warning);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15), var(--shadow);
    position: relative;
}
.order-card.highlight::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--warning);
    border-radius: var(--radius) 0 0 var(--radius);
}
.order-card.highlight .order-card-head {
    background: var(--warning-bg);
}
.order-count-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 4px;
}
.order-empty-row {
    padding: 22px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

/* ========== Nav de categorias (cliente) ========== */
.category-nav {
    display: flex;
    gap: 6px;
    padding: 10px 20px 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 720px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 12px;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-nav-item {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    transition: all 0.15s;
    white-space: nowrap;
    cursor: pointer;
}
.category-nav-item:hover {
    color: var(--text);
    border-color: var(--border-strong);
}
.category-nav-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========== Modal do carrinho (cliente) ========== */
.cart-modal-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.cart-modal-item:last-child { border-bottom: none; }
.cart-modal-item-info { min-width: 0; }
.cart-modal-item-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-modal-item-price {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.cart-modal-item-total {
    font-weight: 800;
    color: var(--primary);
    font-size: 14px;
    min-width: 80px;
    text-align: right;
}
.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--border);
    font-size: 15px;
}
.cart-summary strong {
    color: var(--primary);
    font-size: 22px;
    font-weight: 800;
}
.cart-group-running-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-muted);
}
.cart-group-running-total strong:first-child {
    color: var(--text);
    font-weight: 700;
}
.cart-group-running-total > strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
}
@media (max-width: 480px) {
    .cart-modal-item {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
    }
    .cart-modal-item-total {
        grid-column: 2;
        grid-row: 2;
        text-align: right;
    }
    .cart-modal-item .qty-control {
        grid-column: 2;
        grid-row: 1;
    }
}

/* ========== Aba Chamadas ========== */
.calls-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.call-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: pulse-border 2.4s ease-in-out infinite;
}
@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35), var(--shadow-sm); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}
.call-card-head {
    padding: 14px 18px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.call-card-head h3 {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
}
.call-card-chips {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.call-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}
.call-chip.call-waiter-chip {
    background: var(--warning-bg);
    border-color: #fde68a;
}
.call-chip.call-bill-chip {
    background: var(--danger-bg);
    border-color: #fecaca;
}
.call-chip-icon { font-size: 22px; }
.call-chip-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.call-chip-text small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ========== Histórico do cliente ========== */
.history-loading, .history-empty {
    padding: 30px 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.history-item:last-child { border-bottom: none; }
.history-item-info { flex: 1; min-width: 0; }
.history-item-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.history-item-price {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    margin-left: 16px;
}
.history-item-total {
    font-weight: 800;
    color: var(--primary);
    font-size: 15px;
    min-width: 80px;
    text-align: right;
}
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.history-item.is-pending .status-dot { background: var(--warning); }
.history-item.is-delivered .status-dot { background: var(--success); }
.history-item.is-pending { opacity: 1; }
.history-item.is-delivered { opacity: 1; }

.history-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}
.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}
.legend-dot.dot-pending { background: var(--warning); }
.legend-dot.dot-delivered { background: var(--success); }

/* Rodapé do modal "Minha conta" */
.history-foot {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px;
}
.history-foot .cart-summary {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.history-foot .btn {
    align-self: stretch;
}

/* 3 botões nas ações do cliente ficam um pouco apertados no mobile */
@media (max-width: 520px) {
    .call-buttons .btn {
        font-size: 12px;
        padding: 10px 8px;
    }
}

/* ========================================================================
   ADMIN — Gestão do cardápio
   ======================================================================== */

/* ========== SuperAdmin — Painel Master ========== */
.sa-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.sa-stat-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: var(--shadow-sm);
}
.sa-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}
.sa-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.admin-table tr.is-suspended td {
    opacity: 0.55;
    background: repeating-linear-gradient(
        -45deg,
        transparent, transparent 10px,
        rgba(239, 68, 68, 0.04) 10px, rgba(239, 68, 68, 0.04) 20px
    );
}
.sa-tab-view { display: none; }
.sa-tab-view.active { display: block; }
.admin-tab-view { display: none; }
.admin-tab-view.active { display: block; }

/* Badge de status de mesa */
.table-status-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}
.table-status-badge.fechada { background: var(--bg-soft); color: var(--text-muted); }
.table-status-badge.liberada { background: #dbeafe; color: #1e40af; }
.table-status-badge.ocupada { background: var(--success-bg); color: var(--success); }

/* ========== Password Requirements Checklist ========== */
.pw-requirements {
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 18px;
}
.pw-req-title {
    font-size: 12px;
    font-weight: 800;
    color: #854d0e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px;
}
.pw-req-item {
    font-size: 13px;
    color: #92400e;
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.15s;
}
.pw-req-item code {
    background: #fef9c3;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
}
.pw-req-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    background: #fde68a;
    color: #92400e;
    transition: all 0.15s;
}
.pw-req-item.pass { color: #166534; }
.pw-req-item.pass .pw-req-icon { background: #bbf7d0; color: #166534; }
.pw-req-item.fail { color: #991b1b; }
.pw-req-item.fail .pw-req-icon { background: #fecaca; color: #991b1b; }

/* Relatórios */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.report-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.report-total {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 14px;
}
.report-table-wrapper {
    max-height: 320px;
    overflow-y: auto;
}
.report-mini-table {
    width: 100%;
    border-collapse: collapse;
}
.report-mini-table th {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-elev);
}
.report-mini-table td {
    padding: 7px 10px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.report-mini-table tbody tr:hover { background: var(--bg-soft); }
/* ========== Fim SuperAdmin ========== */

.admin-help {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--primary-bg);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    line-height: 1.5;
}

.form-row {
    display: flex;
    gap: 12px;
}
.form-row .form-group { margin-bottom: 16px; }
textarea.form-input { resize: vertical; font-family: inherit; }

/* Tabela de itens */
.admin-items-wrapper {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table thead {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
}
.admin-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg-soft); }
.admin-table tbody tr.category-header-row:hover { background: var(--bg-soft); }

/* Cabeçalho de categoria agrupando os itens */
.category-header-row td {
    background: var(--bg-soft);
    padding: 0 !important;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border) !important;
}
.category-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    width: 100%;
    box-sizing: border-box;
}
.category-header-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.category-header-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-elev);
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* Contagem dentro das pílulas de filtro (admin) */
.pill-count {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 7px;
    background: var(--bg-soft);
    color: var(--text-muted);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.table-pill.active .pill-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}
.admin-table tr.is-unavailable td {
    opacity: 0.55;
    background: repeating-linear-gradient(
        -45deg,
        transparent, transparent 10px,
        rgba(239, 68, 68, 0.04) 10px, rgba(239, 68, 68, 0.04) 20px
    );
}
.item-cell-name {
    font-weight: 700;
    color: var(--text);
}
.item-cell-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cat-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Toggle ON/OFF */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 64px;
    height: 28px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
    font-family: inherit;
}
.toggle-switch.on { background: var(--success); }
.toggle-switch.off { background: #cbd5e1; }
.toggle-thumb {
    position: absolute;
    top: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: left 0.2s;
}
.toggle-switch.on .toggle-thumb { left: 39px; }
.toggle-switch.off .toggle-thumb { left: 3px; }
.toggle-label {
    position: absolute;
    font-size: 10px;
    font-weight: 800;
    color: white;
    letter-spacing: 0.5px;
}
.toggle-switch.on .toggle-label { left: 10px; }
.toggle-switch.off .toggle-label { right: 9px; }

/* Lista de categorias no modal */
.cat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    user-select: none;
}
.cat-item:last-child { border-bottom: none; }
.cat-item.dragging { opacity: 0.4; }
.cat-item.drag-over { background: var(--primary-bg); border-radius: var(--radius-sm); }
.cat-drag {
    color: var(--text-soft);
    cursor: grab;
    font-size: 14px;
    padding: 0 4px;
    letter-spacing: -2px;
}
.cat-drag:active { cursor: grabbing; }
.cat-count {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    background: var(--bg-soft);
    padding: 3px 8px;
    border-radius: 10px;
}

/* Responsividade tabela admin */
@media (max-width: 720px) {
    .admin-table thead { display: none; }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
        display: block;
        width: 100%;
    }
    .admin-table tr {
        padding: 12px;
        border-bottom: 1px solid var(--border);
    }
    .admin-table td {
        padding: 6px 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }
    .admin-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 11px;
        text-transform: uppercase;
    }
    .item-cell-desc { max-width: none; white-space: normal; }
    .form-row { flex-direction: column; gap: 0; }
}

/* ========== Barra de seleção de grupo (cliente) ========== */
.group-bar {
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    position: sticky;
    /* top é definido via JS = altura do header */
    top: 0;
    z-index: 35;
    box-shadow: var(--shadow-sm);
}
.group-bar-content {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.group-bar-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ========== Barra de totais por grupo (pílulas) ========== */
.group-totals-bar {
    background: var(--bg);
    /* padding top maior pra deixar espaço pro hover da pílula subir sem ser cortado */
    padding: 12px 20px 6px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    z-index: 34;
    /* top é definido dinamicamente via JS — ver client.js DOMContentLoaded */
}
.group-totals-content {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0 6px;
}
.group-totals-content::-webkit-scrollbar { display: none; }
.group-total-pill {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 14px;
    border-radius: var(--radius);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 110px;
}
.group-total-pill:hover:not(:disabled) {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.group-total-pill:disabled {
    cursor: default;
    opacity: 0.55;
}
.group-total-pill-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.group-total-pill-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary);
}
.group-total-pill.empty .group-total-pill-value {
    color: var(--text-muted);
}

.group-dropdown {
    position: relative;
    flex: 1;
    min-width: 160px;
}
.group-dropdown-trigger {
    width: 100%;
    padding: 9px 14px;
    background: var(--primary-bg);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-sm);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    transition: all 0.15s;
}
.group-dropdown-trigger:hover {
    background: white;
    border-color: var(--primary);
}
.group-dropdown-trigger .chev {
    font-size: 11px;
    opacity: 0.7;
}
.group-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
}
.group-option {
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.12s;
}
.group-option:hover { background: var(--bg-soft); }
.group-option.active {
    background: var(--primary-bg);
    color: var(--primary-dark);
    font-weight: 700;
}
.group-option .check {
    color: var(--primary);
    font-weight: 800;
}
.group-option-action {
    color: var(--primary);
    font-weight: 700;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 12px;
}

/* ========== Modal de gerenciar grupos ========== */
.groups-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.groups-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 14px;
    font-size: 13px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.group-item {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.group-item:last-child { border-bottom: none; }
.group-item.is-default .group-name-input {
    background: var(--primary-bg);
    border-color: var(--primary-light);
    font-weight: 700 !important;
    color: var(--primary-dark);
}
.group-name-input {
    flex: 1;
    padding: 8px 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}
.group-action-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-elev);
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.group-action-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.group-action-btn.delete {
    color: var(--danger);
    font-weight: 800;
    font-size: 16px;
}
.group-action-btn.delete:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
}
.group-action-btn.default-edit {
    font-size: 14px;
}
.group-action-btn.default-edit:hover {
    background: var(--primary-bg);
    border-color: var(--primary-light);
}
.new-group-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.new-group-row .form-input {
    flex: 1;
    padding: 9px 12px;
}

/* Filtro de grupos no modal "Minha conta" */
.history-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.history-filter-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.history-filter-pill:hover {
    color: var(--text);
    border-color: var(--border-strong);
}
.history-filter-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Indicador "Enviando para X" no modal do carrinho */
.cart-target-group {
    background: var(--primary-bg);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--primary-dark);
    text-align: center;
}
.cart-target-group strong {
    color: var(--primary-dark);
    font-weight: 800;
}

/* ========== Histórico agrupado por grupo ========== */
.history-group {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border);
}
.history-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.history-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-soft);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.history-group-name {
    font-weight: 800;
    font-size: 14px;
    color: var(--text);
}
.history-group-total {
    font-weight: 800;
    color: var(--primary);
    font-size: 14px;
}
.history-group-items {
    padding: 0 4px;
}
