:root {
    color-scheme: light;
    --logo-dark-bg: #071426;
    --logo-accent: #e6a62e;
    --sidebar-bg: var(--logo-dark-bg);
    --sidebar-text: #e8e8f0;
    --sidebar-text-muted: rgba(232, 232, 240, 0.54);
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active-bg: linear-gradient(135deg, rgba(230, 166, 46, 0.30) 0%, rgba(230, 166, 46, 0.15) 100%);
    --sidebar-active-border: rgba(230, 166, 46, 0.40);

    --surface-0: #f9fafb;
    --surface-1: #ffffff;
    --surface-2: #f3f4f6;
    --surface-3: #e5e7eb;
    --surface-accent: rgba(230, 166, 46, 0.10);

    --topbar-bg: #ffffff;
    --topbar-border: #e5e7eb;
    --topbar-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);

    --border-subtle: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    --brand: var(--logo-accent);
    --brand-strong: #c98d1c;
    --brand-light: rgba(230, 166, 46, 0.16);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 2px 8px rgba(0, 0, 0, 0.05);
    --card-shadow-elevated: 0 4px 16px rgba(0, 0, 0, 0.10);

    --icon-color: #374151;
    --icon-color-muted: #6b7280;
    --sidebar-nav-text: rgba(255, 255, 255, 0.92);
    --sidebar-nav-text-muted: rgba(255, 255, 255, 0.84);
    --sidebar-nav-text-hover: #ffffff;
    --sidebar-nav-text-active: #ffffff;
    --sidebar-nav-chevron: rgba(255, 255, 255, 0.55);
    --sidebar-nav-chevron-expanded: rgba(255, 255, 255, 0.84);
    --sidebar-icon-color: rgba(255, 255, 255, 0.80);
    --sidebar-icon-color-hover: rgba(255, 255, 255, 0.96);
    --sidebar-icon-color-active: var(--brand);
}

.dark-mode {
    color-scheme: dark;
    --sidebar-bg: var(--logo-dark-bg);
    --sidebar-text: #e8e8f0;
    --sidebar-text-muted: rgba(232, 232, 240, 0.54);
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active-bg: linear-gradient(135deg, rgba(230, 166, 46, 0.30) 0%, rgba(230, 166, 46, 0.15) 100%);
    --sidebar-active-border: rgba(230, 166, 46, 0.40);

    --surface-0: var(--logo-dark-bg);
    --surface-1: #0b1b32;
    --surface-2: #102640;
    --surface-3: #17304d;
    --surface-accent: rgba(230, 166, 46, 0.14);

    --topbar-bg: rgba(7, 20, 38, 0.94);
    --topbar-border: rgba(255, 255, 255, 0.08);
    --topbar-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f2f8;
    --text-secondary: #a0a8c0;
    --text-muted: #6b7290;

    --brand: var(--logo-accent);
    --brand-strong: #f3bd52;
    --brand-light: rgba(230, 166, 46, 0.16);

    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.28), 0 4px 16px rgba(0, 0, 0, 0.20);
    --card-shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.32);

    --icon-color: #ffffff;
    --icon-color-muted: #a0a8c0;
    --sidebar-nav-text: rgba(255, 255, 255, 0.92);
    --sidebar-nav-text-muted: rgba(255, 255, 255, 0.84);
    --sidebar-nav-text-hover: #ffffff;
    --sidebar-nav-text-active: #ffffff;
    --sidebar-nav-chevron: rgba(255, 255, 255, 0.55);
    --sidebar-nav-chevron-expanded: rgba(255, 255, 255, 0.84);
    --sidebar-icon-color: rgba(255, 255, 255, 0.80);
    --sidebar-icon-color-hover: rgba(255, 255, 255, 0.96);
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--surface-0);
    color: var(--text-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

body {
    font-size: 0.95rem;
    line-height: 1.6;
}

a,
.btn-link {
    color: inherit;
}

h1:focus {
    outline: none;
}

.page-shell {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-card,
.surface-card {
    border-radius: 0.75rem;
    border: 1px solid var(--border-subtle);
    background: var(--surface-1);
    box-shadow: var(--card-shadow);
}

.hero-card {
    padding: 1.6rem;
}

.hero-card.compact {
    padding: 1.35rem 1.5rem;
}

.hero-grid,
.page-title-row,
.leaderboard-row,
.activity-row,
.legend-row,
.leaderboard-profile,
.metric-header,
.metric-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.hero-grid {
    align-items: end;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.mini-stat {
    padding: 1rem 1.1rem;
    border-radius: 0.75rem;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
}

.mini-stat strong {
    display: block;
    font-size: 1.45rem;
    margin-top: 0.25rem;
}

.mini-stat-label,
.section-kicker {
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.74rem;
    font-weight: 700;
}

.page-title {
    margin: 0.35rem 0 0.5rem;
    font-size: clamp(1.6rem, 2.5vw, 2rem);
    line-height: 1.1;
    color: var(--text-primary);
}

.section-title {
    margin: 0.25rem 0 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.page-description,
.muted-text {
    color: var(--text-secondary);
}

.metrics-grid,
.content-grid,
.inventory-grid,
.profile-grid,
.stat-grid,
.module-grid {
    display: grid;
    gap: 1rem;
}

.metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-grid.two-column,
.profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inventory-grid,
.module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.surface-card {
    padding: 1.35rem;
}

.metric-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    background: var(--brand-light);
    font-size: 1.1rem;
}

.dark-mode .metric-icon {
    background: rgba(232, 93, 4, 0.14);
}

.metric-label {
    display: block;
    color: var(--text-secondary);
}

.metric-value {
    font-size: 1.85rem;
    line-height: 1.1;
}

.metric-badge,
.chip,
.status-pill,
.tab-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.metric-badge,
.chip,
.tab-chip {
    border: 1px solid var(--border-subtle);
    background: var(--surface-2);
    color: var(--text-secondary);
}

.chip-emphasis,
.tab-chip.active {
    background: rgba(232, 93, 4, 0.10);
    border-color: rgba(232, 93, 4, 0.28);
    color: var(--brand);
}

.dark-mode .chip-emphasis,
.dark-mode .tab-chip.active {
    background: rgba(232, 93, 4, 0.16);
    border-color: rgba(232, 93, 4, 0.35);
    color: #fff;
}

.trend-positive {
    color: #9ae6b4;
}

.trend-negative {
    color: #ffd08a;
}

.sparkline {
    height: 3rem;
    display: flex;
    align-items: end;
    gap: 0.35rem;
}

.spark-bar {
    flex: 1 1 0;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(180deg, rgba(232, 93, 4, 0.92) 0%, rgba(232, 93, 4, 0.22) 100%);
}

.chart-bars {
    min-height: 17rem;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
    margin-top: 1rem;
}

.chart-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
}

.chart-bar {
    width: 100%;
    min-height: 2.5rem;
    border-radius: 1rem 1rem 0.6rem 0.6rem;
    background: linear-gradient(180deg, rgba(232, 93, 4, 0.98) 0%, rgba(232, 93, 4, 0.22) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.bar-value {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.bar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.donut-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

.donut-chart {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-inline: auto;
}

.donut-hole {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(11, 13, 19, 0.96);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.donut-hole strong {
    font-size: 2rem;
    line-height: 1;
}

.donut-hole span,
.legend-list {
    color: var(--text-secondary);
}

.legend-list,
.activity-list,
.leaderboard-list,
.department-list,
.detail-stack {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.legend-dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    display: inline-flex;
}

.activity-row,
.leaderboard-row,
.department-item,
.detail-card,
.kanban-card,
.module-card {
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-subtle);
    background: var(--surface-2);
}

.module-card-active {
    border-color: rgba(232, 93, 4, 0.28);
    background: rgba(232, 93, 4, 0.06);
}

.dark-mode .module-card-active {
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.14) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.activity-meta,
.leaderboard-stats {
    min-width: 10rem;
    text-align: right;
}

.status-pill {
    background: color-mix(in srgb, var(--status-color) 18%, transparent);
    color: var(--status-color);
    border: 1px solid color-mix(in srgb, var(--status-color) 35%, transparent);
}

.avatar-circle {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.75) 0%, rgba(59, 130, 246, 0.40) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}

.progress-thin {
    width: 100%;
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-block: 0.35rem;
}

.progress-thin > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e85d04 0%, #ff9c5a 100%);
}

.filter-grid,
.split-grid,
.payment-summary,
.kanban-board {
    display: grid;
    gap: 1rem;
}

.filter-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.split-grid {
    grid-template-columns: 280px minmax(0, 1fr);
}

.payment-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kanban-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
}

.kanban-column {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
}

.kanban-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
}

.kanban-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.kanban-card .page-title-row {
    flex-wrap: wrap;
    row-gap: 0.35rem;
    align-items: flex-start;
}

.kanban-card .page-title-row .badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

.ticket-meta,
.stack-grid {
    display: grid;
    gap: 0.75rem;
}

.ticket-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack-grid.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack-grid.three-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.department-item.active {
    border-color: rgba(232, 93, 4, 0.30);
    background: rgba(232, 93, 4, 0.06);
}

.dark-mode .department-item.active {
    background: rgba(232, 93, 4, 0.12);
}

.tabs-inline {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tab-chip {
    border: 0;
}

.dark-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-subtle);
    --bs-table-striped-bg: var(--surface-2);
    --bs-table-hover-bg: var(--surface-2);
    margin-bottom: 0;
}

.dark-table th {
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.table-avatar {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.action-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

/* Dashboard command center */
.ops-dashboard {
    gap: 1.25rem;
}

.ops-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: stretch;
    gap: 1rem;
    padding: 1.4rem;
    background:
        linear-gradient(135deg, rgba(230, 166, 46, 0.14), rgba(16, 38, 64, 0.28)),
        var(--surface-1);
}

.ops-hero-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.ops-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
}

.ops-now-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    border: 1px solid rgba(230, 166, 46, 0.22);
    border-radius: 0.75rem;
    padding: 1rem;
    background: rgba(7, 20, 38, 0.34);
}

.ops-now-header,
.ops-card-top,
.ops-order-meta,
.ops-report-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ops-now-header {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.live-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}

.ops-now-card > strong {
    font-size: 1.8rem;
    line-height: 1;
}

.ops-pressure-bar {
    height: 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.ops-pressure-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.ops-now-grid,
.ops-decision-grid,
.ops-mode-grid,
.ops-ledger,
.ops-report-groups {
    display: grid;
    gap: 0.85rem;
}

.ops-now-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-now-grid div,
.ops-mode-grid div,
.ops-ledger div {
    min-width: 0;
    border: 1px solid var(--border-subtle);
    border-radius: 0.625rem;
    padding: 0.75rem;
    background: var(--surface-2);
}

.ops-now-grid span,
.ops-mode-grid span,
.ops-ledger span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ops-now-grid strong,
.ops-mode-grid strong,
.ops-ledger strong {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.ops-decision-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ops-decision-card {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    border-top: 3px solid var(--border-subtle);
}

.ops-decision-card.good {
    border-top-color: #10b981;
}

.ops-decision-card.warning {
    border-top-color: #f59e0b;
}

.ops-decision-card.danger {
    border-top-color: #ef4444;
}

.ops-decision-card.neutral {
    border-top-color: #3b82f6;
}

.executive-dashboard {
    gap: 1rem;
}

.executive-hero {
    grid-template-columns: minmax(0, 1fr) 340px;
}

.executive-now-card {
    min-height: 100%;
}

.executive-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}

.executive-kpi-card {
    min-height: 172px;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    border-top: 3px solid var(--border-subtle);
}

.executive-kpi-card.good {
    border-top-color: #10b981;
}

.executive-kpi-card.warning {
    border-top-color: #f59e0b;
}

.executive-kpi-card.danger {
    border-top-color: #ef4444;
}

.executive-kpi-card.neutral {
    border-top-color: #3b82f6;
}

.executive-chip {
    max-width: 100%;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    color: var(--text-secondary);
    background: var(--surface-2);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.executive-alert-strip .ops-alert {
    min-height: 124px;
    justify-content: flex-start;
}

.executive-summary-grid {
    align-items: stretch;
}

.executive-summary-card {
    min-width: 0;
}

.executive-summary-card .ops-ledger {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.executive-signal-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.85rem;
}

.executive-signal {
    min-width: 0;
    border: 1px solid var(--border-subtle);
    border-radius: 0.625rem;
    padding: 0.8rem;
    background: var(--surface-2);
}

.executive-signal span,
.executive-signal small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.executive-signal strong {
    display: block;
    margin: 0.25rem 0;
    color: var(--text-primary);
    font-size: 1.35rem;
    line-height: 1.1;
}

.executive-signal small {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: none;
}

.ops-card-top {
    justify-content: space-between;
}

.ops-icon {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    color: var(--brand);
    background: var(--brand-light);
    font-size: 1.05rem;
}

.ops-alert-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.ops-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-left: 3px solid #10b981;
}

.ops-alert strong {
    display: block;
    margin: 0.25rem 0;
    font-size: 1.2rem;
}

.ops-alert.warning {
    border-left-color: #f59e0b;
}

.ops-alert.danger {
    border-left-color: #ef4444;
}

.ops-order-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ops-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    padding: 0.8rem 0.9rem;
    background: var(--surface-2);
}

.ops-order-main {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem 0.7rem;
}

.ops-order-main .muted-text {
    grid-column: 2;
}

.ops-order-meta {
    justify-content: flex-end;
    flex-wrap: wrap;
    max-width: 260px;
}

.ops-paid,
.ops-unpaid {
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.ops-paid {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}

.ops-unpaid {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.14);
}

.ops-pipeline {
    margin-top: 1rem;
}

.compact-bars {
    height: 130px;
    margin-top: 1.2rem;
}

.ops-ledger,
.ops-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-report-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-report-links {
    flex-direction: column;
    align-items: flex-start;
    margin-top: 0.8rem;
}

@media (max-width: 1200px) {
    .ops-decision-grid,
    .executive-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ops-alert-strip,
    .ops-report-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .executive-signal-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .ops-hero,
    .ops-alert-strip,
    .ops-report-groups {
        grid-template-columns: 1fr;
    }

    .ops-decision-grid,
    .executive-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .executive-summary-card .ops-ledger {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ops-order-row {
        grid-template-columns: 1fr;
    }

    .ops-order-meta {
        justify-content: flex-start;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .ops-hero {
        padding: 1rem;
    }

    .ops-decision-grid,
    .executive-kpi-grid,
    .executive-signal-grid,
    .ops-ledger,
    .ops-mode-grid,
    .ops-now-grid {
        grid-template-columns: 1fr;
    }

    .executive-summary-card .ops-ledger {
        grid-template-columns: 1fr;
    }

    .ops-alert {
        align-items: flex-start;
        flex-direction: column;
    }

    .ops-order-main {
        grid-template-columns: 1fr;
    }

    .ops-order-main .muted-text {
        grid-column: auto;
    }
}

.detail-card {
    padding: 1rem;
}

.detail-card strong,
.metric-copy strong,
.mini-stat strong,
.module-card strong {
    color: var(--text-primary);
}

.highlight-stat {
    padding: 1rem;
    border-radius: 0.75rem;
    background: rgba(232, 93, 4, 0.08);
    border: 1px solid rgba(232, 93, 4, 0.18);
}

.dark-mode .highlight-stat {
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.18) 0%, rgba(232, 93, 4, 0.06) 100%);
    border-color: rgba(232, 93, 4, 0.22);
}

.highlight-stat strong {
    display: block;
    font-size: 1.6rem;
    line-height: 1.1;
    margin-top: 0.35rem;
}

.blazor-error-boundary {
    background: linear-gradient(135deg, rgba(179, 33, 33, 0.94) 0%, rgba(99, 18, 18, 0.96) 100%);
    color: #fff;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    margin: 1rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── Slide-over panel ─────────────────────────────────────────────── */
.slide-over-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
}

.slide-over {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: calc(100vw - 2rem);
    background: var(--surface-1);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
}

.slide-over-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.35rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    gap: 1rem;
}

.slide-over-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.slide-over-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
    margin-top: 1rem;
}

.payments-terms-dialog {
    position: fixed;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 2rem));
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    z-index: 1001;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
}

.payments-terms-dialog__header,
.payments-terms-dialog__footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.payments-terms-dialog__header {
    border-bottom: 1px solid var(--border-subtle);
}

.payments-terms-dialog__body {
    padding: 1.5rem;
}

.payments-terms-dialog__footer {
    justify-content: flex-end;
    border-top: 1px solid var(--border-subtle);
}

.payments-terms-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-secondary);
}

.payments-terms-list li + li {
    margin-top: 0.75rem;
}

/* ── Payments confirm dialog ───────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.payment-confirm-dialog {
    width: min(440px, 100%);
    pointer-events: auto;
    z-index: 1001;
}

/* ── Button variants ──────────────────────────────────────────────── */
.btn-brand {
    background: var(--brand);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-weight: 600;
}

.btn-brand:hover,
.btn-brand:focus {
    background: var(--brand-strong);
    color: #fff;
}

.btn-ghost {
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: 0.5rem;
    font-weight: 500;
}

.btn-ghost:hover,
.btn-ghost:focus {
    background: var(--surface-3);
    color: var(--text-primary);
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #ef4444;
    border-radius: 0.5rem;
    font-weight: 500;
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

/* ── Search input (compact toolbar variant) ───────────────────────── */
.search-input-sm {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-primary) !important;
    border-radius: 0.5rem;
    min-width: 200px;
}

.search-input-sm::placeholder {
    color: var(--text-muted);
}

.search-input-sm:focus {
    background: var(--surface-1) !important;
    border-color: rgba(232, 93, 4, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.10) !important;
    outline: none;
}

/* ── Empty state ──────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.empty-state p {
    margin-bottom: 1rem;
}

@media (max-width: 1400px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-grid,
    .module-grid,
    .stat-grid,
    .payment-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .content-grid.two-column,
    .profile-grid,
    .split-grid,
    .donut-layout,
    .kanban-board {
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .page-shell {
        padding: 1rem;
    }

    .hero-grid,
    .page-title-row,
    .activity-row,
    .leaderboard-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-metrics,
    .metrics-grid,
    .filter-grid,
    .inventory-grid,
    .module-grid,
    .stat-grid,
    .payment-summary,
    .stack-grid.two-up,
    .stack-grid.three-up,
    .ticket-meta {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Authentication Layout & Login Page
═══════════════════════════════════════════════════════════════ */

.auth-layout-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Split wrapper ── */
.login-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ── Left panel ── */
.login-panel-left {
    position: relative;
    background-color: var(--logo-dark-bg);
    background-image: url('/images/login-bg.jpg');
    background-size: cover;
    background-position: center 30%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.login-panel-left-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(7, 20, 38, 0.88) 0%,
        rgba(7, 20, 38, 0.78) 45%,
        rgba(7, 20, 38, 0.94) 100%
    );
}

.login-panel-left-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: 3rem 3rem 2.5rem;
    height: 100%;
}

/* Brand lockup */
.login-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.login-brand-wordmark {
    display: block;
    width: clamp(180px, 18vw, 240px);
    height: auto;
    border-radius: 8px;
}

.login-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(230, 166, 46, 0.24);
}

.login-brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
}

.login-brand-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0;
}

/* Headline */
.login-panel-headline {
    max-width: 360px;
}

.login-panel-title {
    font-size: clamp(1.7rem, 2.5vw, 2.2rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    letter-spacing: 0;
}

.login-panel-sub {
    color: rgba(220, 225, 240, 0.70);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 0;
}

/* Stats grid */
.login-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.login-stat {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.login-stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand);
    line-height: 1.1;
    letter-spacing: 0;
}

.login-stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(200, 210, 230, 0.65);
    line-height: 1.4;
}

/* Feature list */
.login-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-top: auto;
}

.login-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.login-feature-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(230, 166, 46, 0.16);
    border: 1px solid rgba(230, 166, 46, 0.24);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    margin-top: 0.1rem;
}

.login-feature-item strong {
    display: block;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.login-feature-item p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(200, 210, 230, 0.62);
    line-height: 1.55;
}

/* ── Right panel ── */
.login-panel-right {
    background: var(--logo-dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.login-form-wrap {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Mobile logo (hidden on desktop) */
.login-mobile-brand {
    display: none;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.login-mobile-wordmark {
    display: block;
    width: 172px;
    height: auto;
    border-radius: 8px;
}

.login-form-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.login-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.3rem 0 0;
    letter-spacing: 0;
    line-height: 1.15;
}

.login-form-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.55;
}

/* Error banner */
.login-error-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.24);
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Field */
.login-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.login-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-input-wrap {
    position: relative;
}

.login-input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    pointer-events: none;
}

.login-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    border-radius: 10px;
    border: 1.5px solid var(--border-subtle);
    background: var(--surface-1);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
}

.login-input::placeholder {
    color: var(--text-muted);
}

.login-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(230, 166, 46, 0.14);
}

.login-field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Submit button */
.login-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.9rem 1.5rem;
    border-radius: 10px;
    border: none;
    background: var(--brand);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
    box-shadow: 0 4px 16px rgba(230, 166, 46, 0.28);
}

.login-submit-btn:hover:not(:disabled) {
    background: var(--brand-strong);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(230, 166, 46, 0.36);
}

.login-submit-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(230, 166, 46, 0.22);
}

.login-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.login-spinner {
    animation: login-spin 0.8s linear infinite;
}

@keyframes login-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.login-footer-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
    line-height: 1.55;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .login-split {
        grid-template-columns: 1fr;
    }

    .login-panel-left {
        display: none;
    }

    .login-mobile-brand {
        display: flex;
    }

    .login-panel-right {
        min-height: 100vh;
        padding: 2.5rem 1.5rem;
        align-items: flex-start;
        padding-top: 4rem;
    }
}

@media (max-width: 1200px) and (min-width: 901px) {
    .login-panel-left-content {
        padding: 2.5rem 2rem;
        gap: 2rem;
    }

    .login-panel-title {
        font-size: 1.7rem;
    }
}

/* ── Kanban order-item accordion ─────────────────────────────── */
.accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-subtle);
    background: var(--surface-2);
    color: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
}

.accordion-toggle:hover {
    background: var(--surface-3);
}

.accordion-chevron {
    display: inline-block;
    transition: transform 0.2s;
    font-style: normal;
}

.accordion-chevron.open {
    transform: rotate(-180deg);
}

.order-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    padding: 0.25rem 0.4rem;
    border-radius: 0.4rem;
    background: var(--surface-1);
}

.order-item-addon {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    padding: 0.15rem 0.4rem 0.15rem 1.4rem;
    border-left: 2px solid rgba(245, 158, 11, 0.4);
    margin-left: 0.5rem;
    color: #f59e0b;
    font-weight: 500;
    list-style: none;
}

.order-item-note {
    font-size: 0.74rem;
    padding: 0 0.4rem 0.15rem;
    color: var(--text-secondary);
    list-style: none;
    font-style: italic;
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.35rem 0.4rem 0.1rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: 0.15rem;
}

/* ── Setup Wizard ──────────────────────────────────────────────────────────── */

.setup-wizard {
    max-width: 640px;
    margin: 0 auto;
    padding: 2.5rem 1rem 4rem;
}

.setup-wizard__header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.setup-wizard__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brand);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
}

.setup-wizard__title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
}

.setup-wizard__subtitle {
    color: var(--text-secondary);
    margin: 0;
}

/* Progress bar */
.setup-wizard__progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.setup-wizard__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.setup-wizard__step-dot {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--surface-2);
    border: 2px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.setup-wizard__step--active .setup-wizard__step-dot {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.setup-wizard__step--done .setup-wizard__step-dot {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.setup-wizard__step-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.setup-wizard__step--active .setup-wizard__step-label {
    color: var(--brand);
    font-weight: 600;
}

.setup-wizard__step--done .setup-wizard__step-label {
    color: var(--success);
}

.setup-wizard__step-line {
    flex: 1;
    min-width: 24px;
    height: 2px;
    background: var(--border-subtle);
    margin-bottom: 1.4rem;
    transition: background 0.2s;
}

.setup-wizard__step-line--done {
    background: var(--success);
}

/* Card */
.setup-wizard__card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

/* Step content */
.setup-wizard__step-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
}

.setup-wizard__step-desc {
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
}

/* Fields */
.setup-wizard__field {
    margin-bottom: 1.2rem;
}

.setup-wizard__label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.setup-wizard__input {
    width: 100%;
    padding: 0.55rem 0.8rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-subtle);
    background: var(--surface-0);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}

.setup-wizard__file-input {
    display: block;
    width: 100%;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Actions */
.setup-wizard__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.setup-wizard__btn {
    padding: 0.55rem 1.4rem;
    border-radius: 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.15s, background 0.15s;
    font-family: inherit;
}

.setup-wizard__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.setup-wizard__btn--primary {
    background: var(--brand);
    color: #fff;
}

.setup-wizard__btn--primary:hover:not(:disabled) {
    background: var(--brand-strong);
}

.setup-wizard__btn--secondary {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.setup-wizard__btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* Alerts */
.setup-wizard__alert {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    margin-bottom: 1.2rem;
}

.setup-wizard__alert--error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.setup-wizard__alert--success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Summary */
.setup-wizard__summary {
    background: var(--surface-2);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.2rem;
}

.setup-wizard__summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.87rem;
    padding: 0.2rem 0;
}

.setup-wizard__summary-label {
    color: var(--text-secondary);
}

.setup-wizard__summary-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* QR */
.setup-wizard__qr-block {
    text-align: center;
    margin: 1.5rem 0;
}

.setup-wizard__qr-img {
    width: 200px;
    height: 200px;
    border-radius: 0.5rem;
    border: 4px solid var(--surface-2);
}

.setup-wizard__qr-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.setup-wizard__qr-url {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 0.5rem;
    word-break: break-all;
}

/* Scan status */
.setup-wizard__scan-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

/* Cover image preview */
.setup-wizard__cover-preview {
    margin: 1rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.setup-wizard__cover-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
}

/* Spinner */
.setup-wizard__spinner {
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Wizard Layout ─────────────────────────────────────────────────────────── */

.wizard-layout {
    min-height: 100vh;
    background: var(--surface-0);
    display: flex;
    flex-direction: column;
}

.wizard-layout__header {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-1);
}

.wizard-layout__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.layout-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: block;
    flex: 0 0 auto;
}

.layout-brand-wordmark {
    display: block;
    width: 172px;
    height: auto;
    border-radius: 8px;
    flex: 0 0 auto;
}

.wizard-layout__body {
    flex: 1;
    overflow-y: auto;
}

/* ── Register Layout ───────────────────────────────────────────────────────── */

.register-layout {
    min-height: 100vh;
    background: var(--surface-0);
    display: flex;
    flex-direction: column;
}

.register-layout__header {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.register-layout__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.register-layout__login-link {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.register-layout__login-link:hover {
    color: var(--brand);
}

.register-layout__body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.register-layout__footer {
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
}

/* ── Register Page ─────────────────────────────────────────────────────────── */

.register-page {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.register-page__card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    padding: 2.25rem 2rem;
    box-shadow: var(--card-shadow);
}

.register-page__header {
    margin-bottom: 1.75rem;
}

.register-page__kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--brand);
    display: block;
    margin-bottom: 0.4rem;
}

.register-page__title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.register-page__sub {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.55;
}

.register-page__alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.register-page__alert--error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.register-page__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.register-page__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.register-page__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.register-page__required {
    color: var(--danger);
}

.register-page__input {
    padding: 0.6rem 0.85rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-subtle);
    background: var(--surface-0);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
    width: 100%;
}

.register-page__input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.register-page__submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1.5rem;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.25rem;
}

.register-page__submit-btn:hover:not(:disabled) {
    background: var(--brand-strong);
}

.register-page__submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.register-page__spinner {
    animation: spin 0.7s linear infinite;
}

.register-page__footer-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
}

.register-page__footer-note a {
    color: var(--brand);
    text-decoration: none;
}

.register-page__footer-note a:hover {
    text-decoration: underline;
}

/* Success state */
.register-page__success {
    text-align: center;
    padding: 1rem 0;
}

.register-page__success-icon {
    color: var(--success);
    margin-bottom: 0.75rem;
}

.register-page__success-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.register-page__success-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 1.25rem;
}

.register-page__back-link {
    font-size: 0.875rem;
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
}

.register-page__back-link:hover {
    text-decoration: underline;
}

/* ── Wizard Operating Hours Grid ───────────────────────────────────────────── */

.setup-wizard__hours-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setup-wizard__hours-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.setup-wizard__hours-day {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    width: 2.8rem;
    flex-shrink: 0;
}

.setup-wizard__hours-input {
    padding: 0.3rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid var(--border-subtle);
    background: var(--surface-0);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: inherit;
    width: 7rem;
}

.setup-wizard__hours-sep {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.setup-wizard__hours-closed-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    flex: 1;
}

.setup-wizard__hours-closed-check {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    margin-left: auto;
}


/* ═══════════════════════════════════════════════════════════════════════════
   WAITER MODE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Floor map table grid ───────────────────────────────────────────────── */

.waiter-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.85rem;
}

.waiter-table-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 1rem 0.75rem;
    border-radius: 0.75rem;
    border: 2px solid var(--border-subtle);
    background: var(--surface-2);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    text-align: center;
    font-family: inherit;
}

.waiter-table-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-elevated);
}

.waiter-table-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.waiter-table-status {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.waiter-table-orders {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.waiter-table-card.status-idle .waiter-table-status {
    background: var(--surface-3);
    color: var(--text-muted);
}

.waiter-table-card.status-pending {
    border-color: rgba(245, 158, 11, 0.5);
}

.waiter-table-card.status-pending .waiter-table-status {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.waiter-table-card.status-inprogress {
    border-color: rgba(59, 130, 246, 0.5);
}

.waiter-table-card.status-inprogress .waiter-table-status {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.waiter-table-card.status-ready {
    border-color: rgba(16, 185, 129, 0.5);
}

.waiter-table-card.status-ready .waiter-table-status {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* ── Table view layout ──────────────────────────────────────────────────── */

.waiter-table-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.waiter-tv-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-1);
    flex-shrink: 0;
}

.waiter-tv-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.waiter-tv-body {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

.waiter-tv-menu {
    overflow-y: auto;
    padding: 1rem 1.25rem;
    border-right: 1px solid var(--border-subtle);
}

.waiter-tv-sidebar {
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.waiter-tv-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand);
    margin-bottom: 0.65rem;
}

/* ── Category tabs ──────────────────────────────────────────────────────── */

.waiter-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.waiter-cat-btn {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.waiter-cat-btn.active,
.waiter-cat-btn:hover {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

/* ── Menu item cards ────────────────────────────────────────────────────── */

.waiter-menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.waiter-menu-item-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.65rem;
    border: 1px solid var(--border-subtle);
    background: var(--surface-1);
    cursor: pointer;
    transition: box-shadow 0.12s, border-color 0.12s;
}

.waiter-menu-item-card:hover {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(232, 93, 4, 0.12);
}

.waiter-menu-item-img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 0.4rem;
    flex-shrink: 0;
}

.waiter-menu-item-info {
    flex: 1;
    min-width: 0;
}

.waiter-menu-item-name {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.waiter-menu-item-desc {
    font-size: 0.77rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.waiter-menu-item-price {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand);
    margin-top: 0.15rem;
}

.waiter-add-btn {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 1rem;
}

/* ── Cart ───────────────────────────────────────────────────────────────── */

.waiter-cart-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.waiter-cart-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.55rem;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
}

.waiter-cart-row-name {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.waiter-cart-row-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.qty-btn {
    background: var(--surface-3);
    border: 1px solid var(--border-subtle);
    border-radius: 0.3rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: inherit;
    line-height: 1;
}

.qty-val {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.waiter-cart-row-price {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand);
    white-space: nowrap;
}

.waiter-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-subtle);
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

/* ── Waiter order cards ─────────────────────────────────────────────────── */

.waiter-order-card {
    border-radius: 0.65rem;
    border: 1px solid var(--border-subtle);
    background: var(--surface-1);
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
}

.waiter-order-card.is-ready {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.05);
}

.waiter-order-card.is-inprogress {
    border-color: rgba(59, 130, 246, 0.35);
}

.waiter-order-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.waiter-order-items {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem 0;
    font-size: 0.83rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.item-qty {
    font-weight: 700;
    margin-right: 0.3rem;
    color: var(--brand);
}

.item-choices {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-left: 0.3rem;
}

.item-note {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-left: 1.5rem;
}

.waiter-order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
}

.waiter-order-total {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.waiter-order-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* ── Item add sheet ─────────────────────────────────────────────────────── */

.waiter-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
}

.waiter-sheet {
    background: var(--surface-1);
    border-radius: 1rem 1rem 0.5rem 0.5rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    overflow-y: auto;
}

.waiter-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.waiter-option-group {
    margin-bottom: 1rem;
}

.waiter-option-group-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
}

.waiter-option-choice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    cursor: pointer;
    font-size: 0.88rem;
}

.waiter-sheet-qty-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ── Status pill ────────────────────────────────────────────────────────── */

.status-pill {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--status-color) 40%, transparent);
    background: color-mix(in srgb, var(--status-color) 14%, transparent);
    color: var(--status-color);
    white-space: nowrap;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .waiter-tv-body {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .waiter-tv-menu {
        border-right: none;
        border-bottom: none; /* no divider needed since sidebar is now off-canvas */
    }

    /* ── Cart slide-in drawer ─────────────────────────────────────────── */
    .waiter-tv-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(88vw, 380px);
        z-index: 1050;
        background: var(--surface-1);
        border-left: 1px solid var(--border-subtle);
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
        overflow-y: auto;
        padding: 1rem 1.1rem 2rem;
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .waiter-tv-sidebar.cart-drawer-open {
        transform: translateX(0);
    }
}

/* ── Cart FAB (mobile only) ─────────────────────────────────────────────── */
.waiter-cart-fab {
    display: none; /* hidden by default; shown via media query below */
}

@media (max-width: 768px) {
    .waiter-cart-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
        z-index: 1040;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--brand);
        color: #fff;
        border: none;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
        font-size: 1.35rem;
        cursor: pointer;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .waiter-cart-fab:hover {
        transform: scale(1.07);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    }

    .waiter-cart-fab-badge {
        position: absolute;
        top: 6px;
        right: 6px;
        background: #fff;
        color: var(--brand);
        border-radius: 999px;
        font-size: 0.68rem;
        font-weight: 700;
        min-width: 17px;
        height: 17px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
        line-height: 1;
    }
}

/* ── Cart drawer backdrop (mobile) ──────────────────────────────────────── */
.waiter-cart-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .waiter-cart-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1045;
        background: rgba(0, 0, 0, 0.45);
        animation: fadeInBackdrop 0.2s ease;
    }

    @keyframes fadeInBackdrop {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
}

/* ── Drawer header (close button row) ───────────────────────────────────── */
.waiter-cart-drawer-header {
    display: none; /* only shown in mobile drawer mode */
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .waiter-cart-drawer-header {
        display: flex;
    }
}

.waiter-cart-drawer-close {
    background: var(--surface-3);
    border: 1px solid var(--border-subtle);
    border-radius: 0.4rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: background 0.12s;
}

.waiter-cart-drawer-close:hover {
    background: var(--surface-4, var(--surface-3));
}

/* ── Modal overlay ──────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-dialog {
    padding: 1.5rem;
    border-radius: 0.75rem;
    animation: modal-in 0.15s ease;
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Waiter menu discovery */
.waiter-menu-toolbar {
    position: sticky;
    top: -1rem;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    padding: 1rem 0 0.75rem;
    margin-top: -1rem;
    background: var(--surface-1);
}

.waiter-menu-search {
    min-width: 0;
    height: 42px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.55rem 0 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-muted);
}

.waiter-menu-search:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.12);
}

.waiter-menu-search input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.88rem;
}

.waiter-menu-search input::placeholder {
    color: var(--text-muted);
}

.waiter-search-clear,
.waiter-filter-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.waiter-search-clear:hover,
.waiter-filter-close:hover {
    color: var(--text-primary);
}

.waiter-filter-button {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0 0.8rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--surface-1);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 650;
    cursor: pointer;
}

.waiter-filter-button:hover,
.waiter-filter-button.active {
    border-color: var(--brand);
    color: var(--brand);
}

.waiter-filter-count {
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 0.7rem;
    line-height: 1;
}

.waiter-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: -0.25rem 0 0.65rem;
}

.waiter-active-filter {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.45rem 0.25rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border-subtle));
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand) 8%, var(--surface-1));
    color: var(--text-primary);
    font: inherit;
    font-size: 0.76rem;
    cursor: pointer;
}

.waiter-active-filter i {
    font-size: 0.9rem;
    color: var(--brand);
}

.waiter-clear-filters {
    border: 0;
    background: transparent;
    color: var(--brand);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 650;
    cursor: pointer;
}

.waiter-results-meta {
    min-height: 22px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.55rem;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.waiter-menu-empty {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.waiter-menu-empty > i {
    font-size: 1.5rem;
    color: var(--brand);
}

.waiter-menu-empty strong {
    color: var(--text-primary);
}

.waiter-menu-empty span {
    font-size: 0.82rem;
}

.waiter-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.48);
}

.waiter-filter-panel {
    width: min(460px, 100vw);
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: var(--surface-1);
    border-left: 1px solid var(--border-subtle);
    box-shadow: -10px 0 32px rgba(0, 0, 0, 0.2);
}

.waiter-filter-header,
.waiter-filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.waiter-filter-header h3 {
    margin: 0.1rem 0 0;
    font-size: 1.05rem;
    letter-spacing: 0;
    color: var(--text-primary);
}

.waiter-filter-kicker {
    display: block;
    color: var(--brand);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.waiter-filter-content {
    overflow-y: auto;
    padding: 0 1.1rem;
}

.waiter-filter-section {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 1.15rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.waiter-filter-section:last-child {
    border-bottom: 0;
}

.waiter-filter-step {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.waiter-filter-section h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    letter-spacing: 0;
}

.waiter-filter-section p {
    margin: 0.2rem 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.waiter-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.waiter-filter-option {
    min-height: 34px;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.waiter-filter-option:hover,
.waiter-filter-option.selected {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 10%, var(--surface-1));
    color: var(--brand);
}

.waiter-price-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.waiter-price-range label > span {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.waiter-price-input {
    height: 38px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.6rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.72rem;
}

.waiter-price-input:focus-within {
    border-color: var(--brand);
}

.waiter-price-input input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
}

.waiter-filter-toggles {
    display: grid;
    gap: 0.55rem;
}

.waiter-filter-toggles label {
    min-height: 48px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.waiter-filter-toggles input,
.waiter-sort-options input {
    width: 17px;
    height: 17px;
    accent-color: var(--brand);
}

.waiter-filter-toggles strong,
.waiter-filter-toggles small {
    display: block;
}

.waiter-filter-toggles strong {
    color: var(--text-primary);
    font-size: 0.8rem;
}

.waiter-filter-toggles small {
    margin-top: 0.1rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.waiter-sort-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.waiter-sort-options label {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 0.76rem;
    cursor: pointer;
}

.waiter-sort-options label.selected {
    border-color: var(--brand);
    color: var(--brand);
}

.waiter-filter-footer {
    border-top: 1px solid var(--border-subtle);
    border-bottom: 0;
}

.waiter-filter-footer .btn {
    min-width: 110px;
}

@media (max-width: 768px) {
    .waiter-menu-toolbar {
        top: 0;
    }

    .waiter-filter-button > span:not(.waiter-filter-count) {
        display: none;
    }

    .waiter-filter-button {
        width: 42px;
        padding: 0;
        position: relative;
    }

    .waiter-filter-count {
        position: absolute;
        top: -6px;
        right: -6px;
    }

    .waiter-filter-backdrop {
        align-items: flex-end;
    }

    .waiter-filter-panel {
        width: 100%;
        height: min(88vh, 760px);
        border-left: 0;
        border-top: 1px solid var(--border-subtle);
        border-radius: 8px 8px 0 0;
        box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.22);
    }

    .waiter-sort-options {
        grid-template-columns: 1fr;
    }
}
