:root {
    --bg: #f3f6fa;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-text: #047857;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-text: #b91c1c;
    --orange: #f97316;
    --orange-bg: #fff7ed;
    --orange-text: #c2410c;
    --warning: #eab308;
    --warning-bg: #fefce8;
    --warning-text: #a16207;
    --gray-status: #64748b;
    --gray-status-bg: #f1f5f9;
    --gray-status-text: #334155;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Top Navbar */
.topbar {
    height: 62px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
}

.brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.role-tag {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Admin Layout */
.method-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.admin-shell {
    display: flex;
    min-height: calc(100vh - 62px);
}

.sidebar {
    width: 252px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 14px 10px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    transition: background 0.12s, color 0.12s;
}

.sidebar-link:hover {
    background: var(--surface-2);
    color: var(--text);
}

.sidebar-link.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 6px;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 20px;
}

.mobile-menu-btn {
    display: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    white-space: nowrap;
}

.btn:hover {
    filter: brightness(0.97);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-sm {
    min-height: 34px;
    padding: 5px 11px;
    font-size: 13px;
}

.btn-lg {
    min-height: 50px;
    padding: 12px 20px;
    font-size: 15px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-warning {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}

.btn-orange {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
}

.btn-dark {
    background: #1e293b;
    color: #fff;
    border-color: #1e293b;
}

.btn-outline-danger {
    background: #fff;
    color: var(--danger);
    border-color: #fecaca;
}

/* Cards & Grids */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    min-width: 0;
    max-width: 100%;
}

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.card-body {
    padding: 18px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.page-sub {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}

.stat-card.accent-green { border-left: 4px solid var(--success); }
.stat-card.accent-red { border-left: 4px solid var(--danger); }
.stat-card.accent-orange { border-left: 4px solid var(--orange); }
.stat-card.accent-blue { border-left: 4px solid var(--primary); }

/* Executive Dashboard Layout */
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    transition: box-shadow 0.12s, transform 0.12s;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kpi-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.kpi-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.kpi-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon.blue { background: #eff6ff; color: #2563eb; }
.kpi-icon.green { background: #ecfdf5; color: #059669; }
.kpi-icon.red { background: #fef2f2; color: #dc2626; }
.kpi-icon.orange { background: #fff7ed; color: #ea580c; }
.kpi-icon.slate { background: #f1f5f9; color: #334155; }

.dash-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
    margin-bottom: 20px;
}

.dash-split > *, .stats-grid > *, .form-grid > *, .pos-workspace > *, .pos-menu-layout > *, .floor-mini-stats > * {
    min-width: 0;
}

.dash-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.tab-pills {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 3px;
    gap: 3px;
}

.tab-pill {
    border: 0;
    background: transparent;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
}

.tab-pill.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.live-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--success-text);
    background: var(--success-bg);
    border: 1px solid #a7f3d0;
    padding: 4px 10px;
    border-radius: 999px;
}

.live-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.prog-row {
    margin-bottom: 12px;
}

.prog-row:last-child {
    margin-bottom: 0;
}

.prog-head {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 5px;
}

.prog-track {
    height: 8px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.prog-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.25s ease;
}

.top-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.top-item-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

@media (max-width: 1180px) {
    .dash-split {
        grid-template-columns: 1fr;
    }
}

/* Table Status Cards (Waiter & Admin) */
.floor-shell {
    max-width: 1420px;
    margin: 0 auto;
    padding: 18px;
}

.floor-toolbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}

.floor-mini-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.floor-stat-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.floor-stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.floor-stat-val {
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.table-card {
    position: relative;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    border-top-width: 5px;
    background: var(--surface);
    padding: 15px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    min-height: 172px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.table-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.table-card.status-empty {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 55%);
    border-color: #a7f3d0;
    border-top-color: var(--success);
}
.table-card.status-occupied {
    background: linear-gradient(180deg, #fef2f2 0%, #ffffff 55%);
    border-color: #fecaca;
    border-top-color: var(--danger);
}
.table-card.status-bill_requested {
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 55%);
    border-color: #fed7aa;
    border-top-color: var(--orange);
}
.table-card.status-awaiting_payment {
    background: linear-gradient(180deg, #fefce8 0%, #ffffff 55%);
    border-color: #fde047;
    border-top-color: var(--warning);
}
.table-card.status-paid {
    background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 55%);
    border-color: #cbd5e1;
    border-top-color: var(--gray-status);
}

.table-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.table-name {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-empty { background: #d1fae5; color: var(--success-text); }
.badge-occupied { background: #fee2e2; color: var(--danger-text); }
.badge-bill_requested { background: #ffedd5; color: var(--orange-text); }
.badge-awaiting_payment { background: #fef08a; color: var(--warning-text); }
.badge-paid { background: #e2e8f0; color: var(--gray-status-text); }

.badge-unpaid { background: #fee2e2; color: #b91c1c; }
.badge-partial { background: #fef08a; color: #854d0e; }
.badge-open { background: #dbeafe; color: #1d4ed8; }
.badge-closed { background: #dcfce7; color: #166534; }
.badge-force_closed { background: #ffedd5; color: #9a3412; }

.table-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.table-card-amount {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.table-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    padding-top: 8px;
    border-top: 1px dashed rgba(15, 23, 42, 0.14);
}

.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: 999px;
}

.legend-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

/* Waiter Order Screen Split View */
.pos-workspace {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 16px;
    padding: 16px;
    height: calc(100vh - 62px);
}

.pos-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.pos-menu-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.category-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cat-btn {
    width: 100%;
    text-align: left;
    padding: 13px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.products-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.product-tile {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    min-height: 118px;
    text-align: left;
    transition: border-color 0.1s, background 0.1s;
}

.product-tile:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.product-tile:active {
    transform: scale(0.98);
}

.product-thumb {
    width: 100%;
    height: 94px;
    object-fit: cover;
    border-radius: 7px;
    background: #e2e8f0;
}

.product-tile-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.product-tile-price {
    font-weight: 800;
    font-size: 15px;
    color: var(--primary);
}

/* Right Bill / Party Panel */
.pos-right {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: var(--shadow-sm);
}

.bill-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.bill-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.party-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: var(--surface-2);
    margin-bottom: 10px;
}

.party-box.party-open {
    background: #fff;
    border: 2px solid var(--primary);
}

.party-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 800;
    font-size: 14px;
}

.party-divider {
    border: 0;
    border-top: 2px dashed #cbd5e1;
    margin: 14px 0;
}

.order-line {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid #eef2f6;
}

.order-line:last-child {
    border-bottom: 0;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: #fff;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
}

.qty-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.qty-val {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
}

.party-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
}

.bill-summary {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 5px;
}

.summary-row.grand {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

.bill-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

/* Forms & Tables */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

.form-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.form-control {
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th, .data-table td {
    padding: 11px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table th {
    background: var(--surface-2);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

/* Modals & Toasts */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal-backdrop.show {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
}

.modal-box.modal-lg {
    max-width: 820px;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 17px;
}

.modal-body {
    padding: 18px 20px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.toast-container {
    position: fixed;
    top: 74px;
    right: 18px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}

.toast {
    padding: 12px 16px;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-md);
    background: #1e293b;
}

.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.warning { background: #d97706; }

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 50%, #ecfdf5 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-md);
}

.alert {
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}

.alert-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-warning { background: #fefce8; color: #854d0e; border: 1px solid #fde047; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Responsive */
@media (max-width: 1080px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .pos-workspace {
        grid-template-columns: 1fr;
        height: auto;
    }
    .pos-menu-layout {
        grid-template-columns: 1fr;
    }
    .category-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .cat-btn {
        width: auto;
        white-space: nowrap;
    }
}

@media (max-width: 820px) {
    .mobile-menu-btn {
        display: inline-flex;
    }
    .sidebar {
        position: fixed;
        top: 62px;
        left: -270px;
        bottom: 0;
        z-index: 60;
        transition: left 0.18s ease;
        box-shadow: var(--shadow-md);
    }
    .sidebar.open {
        left: 0;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .topbar {
        height: auto;
        min-height: 56px;
        padding: 8px 10px;
        gap: 6px;
        flex-wrap: wrap;
    }
    .topbar-left {
        gap: 8px;
        min-width: 0;
        flex: 1 1 auto;
    }
    .brand-logo {
        font-size: 14px;
        gap: 7px;
        min-width: 0;
    }
    .brand-logo span:not(.brand-badge) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 145px;
    }
    .brand-badge {
        width: 30px;
        height: 30px;
        flex-shrink: 0;
    }
    .topbar-right {
        gap: 6px;
        flex-wrap: wrap;
    }
    .topbar-right .btn {
        min-height: 32px;
        padding: 4px 8px;
        font-size: 12px;
    }
    .user-pill {
        display: none;
    }
    .main-content {
        padding: 12px;
        width: 100%;
    }
    .page-title {
        font-size: 18px;
    }
    .page-header .form-control,
    .floor-toolbar .form-control {
        width: 100% !important;
        max-width: 100% !important;
    }
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .kpi-card {
        padding: 12px;
        gap: 8px;
    }
    .kpi-label {
        font-size: 11px;
    }
    .kpi-value {
        font-size: 18px;
        word-break: break-word;
    }
    .kpi-sub {
        font-size: 11px;
    }
    .kpi-icon {
        width: 34px;
        height: 34px;
    }
    .floor-shell {
        padding: 10px;
        width: 100%;
        max-width: 100%;
    }
    .floor-toolbar {
        padding: 10px 12px;
    }
    .floor-toolbar > div {
        width: 100%;
    }
    .tab-pills {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
    }
    .tab-pill {
        flex: 1 1 auto;
        text-align: center;
        padding: 6px 8px;
    }
    .status-legend {
        gap: 6px;
    }
    .legend-item {
        font-size: 11px;
        padding: 3px 8px;
    }
    .floor-mini-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .floor-stat-pill {
        padding: 10px 11px;
        gap: 6px;
    }
    .floor-stat-val {
        font-size: 16px;
    }
    .tables-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .table-card {
        padding: 11px;
        min-height: 146px;
        gap: 8px;
        border-radius: 12px;
    }
    .table-card-top {
        flex-direction: column;
        gap: 4px;
    }
    .table-name {
        font-size: 16px;
    }
    .status-badge {
        font-size: 11px;
        padding: 2px 8px;
    }
    .table-card-amount {
        font-size: 18px;
    }
    .table-card-footer {
        font-size: 11px;
        flex-wrap: wrap;
        gap: 4px;
    }
    .pos-workspace {
        padding: 10px;
        gap: 12px;
        width: 100%;
        max-width: 100%;
    }
    .pos-left, .pos-right {
        width: 100%;
        max-width: 100%;
    }
    .products-panel {
        padding: 10px;
    }
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .product-tile {
        padding: 8px;
        min-height: 112px;
    }
    .product-thumb {
        height: 76px;
    }
    .order-line {
        grid-template-columns: 1fr auto;
        gap: 6px;
    }
    .order-line > div:last-child {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
    .bill-actions {
        grid-template-columns: 1fr;
    }
    .method-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .card-body .form-group {
        min-width: 0 !important;
    }
    .method-btn, .ct-method-btn, .tp-method-btn {
        white-space: normal;
        padding: 8px 6px;
        font-size: 13px;
    }
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: calc(100vw - 20px);
    }
    .card-header, .card-body {
        padding: 12px;
    }
}
