:root {
    --sidebar: #0b1325;
    --sidebar-soft: #121e35;
    --accent: #6d4cff;
    --accent-2: #8b5cf6;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f9fbff;
    --text: #111827;
    --muted: #667085;
    --border: #e6eaf2;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --green: #22b455;
    --red: #ff3152;
    --orange: #ff7a00;
    --blue: #2474f5;
}

body[data-theme="dark"] {
    --sidebar: #070b15;
    --sidebar-soft: #111827;
    --bg: #0e1422;
    --surface: #151c2b;
    --surface-soft: #101827;
    --text: #eef2ff;
    --muted: #aab4c8;
    --border: #293348;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.2s ease, color 0.2s ease;
}

button,
input,
select {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1050;
    width: 250px;
    padding: 22px 14px 18px;
    color: #fff;
    background: linear-gradient(180deg, var(--sidebar), #0d1628);
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow-y: auto;
    scrollbar-width: none;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
}

.sidebar-brand,
.branch-card,
.admin-profile,
.date-box,
.branch-select,
.stat-card,
.dashboard-card {
    display: flex;
    align-items: center;
}

.sidebar-brand {
    gap: 14px;
    position: relative;
}

.sidebar-close {
    display: none;
    margin-left: auto;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #9b5cff, #6336ff);
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 12px 24px rgba(109, 76, 255, 0.35);
}

.brand-name {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 800;
    line-height: 1;
}

.sidebar-brand span,
.branch-card span,
.admin-profile span,
.date-box span {
    display: block;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.8rem;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-nav .nav-link {
    min-height: 46px;
    padding: 0 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.78);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-nav .nav-link i {
    width: 18px;
    font-size: 0.95rem;
}

.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link:hover {
    color: #fff;
    background: linear-gradient(135deg, #7c4dff, #5b35f5);
}

body.sidebar-collapsed .sidebar {
    width: 92px;
    padding-left: 14px;
    padding-right: 14px;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
}

body.sidebar-collapsed .sidebar-brand > div:last-child,
body.sidebar-collapsed .sidebar-nav .nav-link span,
body.sidebar-collapsed .plan-card,
body.sidebar-collapsed .branch-card {
    display: none;
}

body.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 0;
}

body.sidebar-collapsed .top-header,
body.sidebar-collapsed .content-shell {
    margin-left: 92px;
}

.plan-card,
.branch-card {
    margin-top: auto;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
}

.plan-card span {
    padding: 4px 8px;
    border-radius: 7px;
    background: #724cff;
    font-size: 0.72rem;
}

.plan-card p,
.plan-card small {
    margin: 14px 0 8px;
    color: rgba(255, 255, 255, 0.74);
}

.plan-progress {
    height: 7px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
}

.plan-progress i {
    display: block;
    width: 78%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c4dff, #8b5cf6);
}

.plan-card button {
    width: 100%;
    margin-top: 12px;
    border: 0;
    border-radius: 10px;
    padding: 10px;
    color: #fff;
    background: rgba(124, 77, 255, 0.24);
    font-weight: 800;
}

.branch-card {
    margin-top: 0;
    gap: 12px;
}

.branch-thumb,
.branch-mini,
.food-thumb {
    background: linear-gradient(135deg, #f59e0b, #7c2d12);
}

.branch-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
}

.top-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    min-height: 66px;
    margin-left: 250px;
    padding: 8px 22px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 26px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

.top-left {
    display: flex;
    align-items: center;
    gap: 28px;
    min-width: 0;
}

.content-shell {
    margin-left: 250px;
    padding: 18px 26px 34px;
    background: var(--bg);
}

.dashboard-workspace {
    min-height: calc(100vh - 104px);
    background: var(--bg);
}

.summary-card-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.summary-card-row > .card {
    min-height: 142px;
    border: 1px solid #edf1f7;
    border-radius: 16px;
    padding: 22px 20px 16px;
    background:
        radial-gradient(circle at 86% 18%, color-mix(in srgb, currentColor 10%, transparent), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 14px;
    align-items: start;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

body[data-theme="dark"] .summary-card-row > .card {
    border-color: #273244;
    background:
        radial-gradient(circle at 86% 18%, color-mix(in srgb, currentColor 16%, transparent), transparent 34%),
        linear-gradient(180deg, #172033 0%, #111827 100%);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.summary-card-row > .card.purple { color: #7657f4; }
.summary-card-row > .card.blue { color: #3186ee; }
.summary-card-row > .card.orange { color: #fb8500; }
.summary-card-row > .card.green { color: #37a62f; }
.summary-card-row > .card.rose { color: #f43f5e; }

.summary-card-row > .card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: currentColor;
    opacity: 0.82;
}

.summary-card-row > .card::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 42px;
    height: 1px;
    background: #eef1f7;
}

body[data-theme="dark"] .summary-card-row > .card::after {
    background: #283349;
}

.summary-card-row > .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.11);
}

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: inherit;
    font-size: 1.2rem;
    background: currentColor;
    box-shadow: 0 12px 24px color-mix(in srgb, currentColor 24%, transparent);
    position: relative;
}

.summary-icon::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    pointer-events: none;
}

.summary-icon i {
    position: relative;
    z-index: 1;
    color: #fff;
}

.summary-copy {
    min-width: 0;
}

.summary-copy span {
    display: block;
    color: #1f2937;
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.2;
}

body[data-theme="dark"] .summary-copy span {
    color: #e5e7eb;
}

.summary-copy strong {
    display: block;
    margin-top: 7px;
    color: #0f172a;
    font-size: clamp(1.5rem, 1.75vw, 1.95rem);
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}

body[data-theme="dark"] .summary-copy strong {
    color: #ffffff;
}

.summary-copy small {
    display: block;
    margin-top: 11px;
    color: #667085;
    font-size: 0.8rem;
    font-weight: 750;
}

body[data-theme="dark"] .summary-copy small {
    color: #aeb9cc;
}

.summary-card-row > .card.purple .summary-copy small,
.summary-card-row > .card.green .summary-copy small {
    color: #16a34a;
}

.summary-card-row > .card.orange .summary-copy small {
    color: #ef3152;
}

.table-overview-card {
    margin-top: 8px;
    padding: 20px;
    border: 1px solid #edf1f7;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

body[data-theme="dark"] .table-overview-card {
    border-color: #273244;
    background: #111827;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.table-overview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
    min-width: 0;
}

.table-overview-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 850;
    flex: 0 0 auto;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.table-actions::-webkit-scrollbar {
    display: none;
}

.table-filter,
.table-view-btn {
    min-height: 32px;
    border: 1px solid #e5eaf3;
    border-radius: 9px;
    color: var(--text);
    background: var(--surface);
    font-size: 0.74rem;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.table-filter {
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.table-filter.active {
    border-color: #ddd7ff;
    color: #6d4cff;
    background: #eeeaff;
}

.table-view-btn {
    width: 32px;
    display: inline-grid;
    place-items: center;
    color: #8b95a7;
    flex: 0 0 32px;
}

.table-view-btn.active {
    color: #23405f;
    background: #f4f8ff;
}

body[data-theme="dark"] .table-filter,
body[data-theme="dark"] .table-view-btn {
    border-color: #293448;
    color: #e5e7eb;
    background: #172033;
}

body[data-theme="dark"] .table-filter.active {
    border-color: #50418f;
    color: #c9bdff;
    background: #241f3c;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.available { background: #2bb955; }
.status-dot.running { background: #f43f5e; }
.status-dot.pending { background: #fb8500; }
.status-dot.reserved { background: #3b82f6; }

.table-overview-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(86px, 1fr));
    gap: 24px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.table-overview-grid::-webkit-scrollbar {
    width: 6px;
}

.table-overview-grid::-webkit-scrollbar-track {
    background: transparent;
}

.table-overview-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cbd5e1;
}

body[data-theme="dark"] .table-overview-grid {
    scrollbar-color: #475569 transparent;
}

body[data-theme="dark"] .table-overview-grid::-webkit-scrollbar-thumb {
    background: #475569;
}

.table-tile {
    min-height: 124px;
    border: 1px solid;
    border-radius: 12px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
    background: #f8fff9;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.table-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
}

.table-tile.is-hidden {
    display: none;
}

.table-no {
    color: currentColor;
    font-size: clamp(1.35rem, 1.5vw, 1.8rem);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 8px 18px color-mix(in srgb, currentColor 22%, transparent);
}

.table-status {
    color: currentColor;
    font-size: 0.78rem;
    font-weight: 850;
}

.table-tile strong {
    color: #101828;
    font-size: 0.88rem;
    line-height: 1;
}

.table-tile small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #475467;
    font-size: 0.74rem;
    font-weight: 700;
}

.table-tile.available {
    color: #249546;
    border-color: #d8f1df;
    background: linear-gradient(135deg, #f6fff8, #effbf3);
}

.table-tile.running {
    color: #f43f5e;
    border-color: #ffcbd4;
    background: linear-gradient(135deg, #fff7f8, #fff0f2);
}

.table-tile.pending {
    color: #fb8500;
    border-color: #ffdfb7;
    background: linear-gradient(135deg, #fffaf3, #fff4e7);
}

.table-tile.reserved {
    color: #3b82f6;
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #f5f9ff, #edf5ff);
}

body[data-theme="dark"] .table-tile strong {
    color: #fff;
}

body[data-theme="dark"] .table-tile small {
    color: #aeb9cc;
}

body[data-theme="dark"] .table-tile.available {
    background: linear-gradient(135deg, #102419, #0f1f17);
    border-color: #1f5c35;
}

body[data-theme="dark"] .table-tile.running {
    background: linear-gradient(135deg, #2a1219, #211017);
    border-color: #773040;
}

body[data-theme="dark"] .table-tile.pending {
    background: linear-gradient(135deg, #2a1d0c, #21180d);
    border-color: #7a4b16;
}

body[data-theme="dark"] .table-tile.reserved {
    background: linear-gradient(135deg, #101d32, #0f1a2c);
    border-color: #28558d;
}

.icon-button,
.theme-toggle,
.branch-select,
.search-box {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.03);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.icon-button:hover,
.theme-toggle:hover,
.branch-select:hover,
.search-box:focus-within {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.icon-button,
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.notification-button span {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
}

.branch-select {
    height: 48px;
    min-width: 222px;
    padding: 0 14px 0 10px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.branch-name-short {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branch-mini {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex: 0 0 auto;
}

.search-box {
    width: 100%;
    height: 48px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    min-width: 0;
}

.date-box {
    gap: 11px;
    padding-right: 20px;
    border-right: 1px solid var(--border);
}

.date-box i {
    font-size: 1.25rem;
}

.date-box span,
.admin-profile span {
    color: var(--muted);
}

.admin-profile {
    border: 0;
    background: transparent;
    color: var(--text);
    gap: 12px;
    padding: 0;
    text-align: left;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #111827, #8b5cf6);
    font-weight: 900;
    flex: 0 0 auto;
}

.profile-avatar i {
    font-size: 1.12rem;
}

.admin-copy {
    min-width: 122px;
}

.admin-copy strong {
    display: block;
    line-height: 1.1;
}

.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    background: var(--surface);
    color: var(--text);
}

.dropdown-item {
    border-radius: 8px;
    color: var(--text);
    font-weight: 650;
}

.dropdown-item:hover,
.dropdown-item.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.branch-menu {
    min-width: 222px;
}

.admin-menu {
    min-width: 210px;
}

.notification-menu {
    width: 320px;
}

.notification-head {
    padding: 8px 10px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.notification-head small {
    color: var(--accent);
    font-weight: 800;
}

.notification-item {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 10px;
    align-items: center;
    white-space: normal;
}

.notification-item i {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.notification-item small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.78rem;
}

.notification-view-all {
    width: 100%;
    margin-top: 6px;
    border: 0;
    border-radius: 8px;
    padding: 9px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    font-weight: 800;
}

.theme-toggle .theme-moon,
body[data-theme="dark"] .theme-toggle .theme-sun {
    display: none;
}

body[data-theme="dark"] .theme-toggle .theme-moon {
    display: inline;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 18px;
}

.stat-card,
.dashboard-card {
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stat-card {
    min-height: 136px;
    padding: 24px;
    gap: 18px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.35rem;
}

.purple { background: linear-gradient(135deg, #7c4dff, #8b5cf6); }
.blue { background: linear-gradient(135deg, #4da3ff, #2474f5); }
.orange { background: linear-gradient(135deg, #ff9d2f, #ff6b00); }
.green { background: linear-gradient(135deg, #4cc96f, #22a34a); }
.rose { background: linear-gradient(135deg, #ff5470, #ef3152); }

.stat-card span,
.stat-card small,
.section-heading a,
.food-row span,
.order-row span,
.order-row time,
.payment-card span {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin: 6px 0;
    font-size: 1.55rem;
    line-height: 1.1;
}

.stat-card small {
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 474px;
    gap: 22px;
    margin-top: 20px;
    align-items: start;
}

.left-column,
.right-column {
    display: grid;
    gap: 18px;
}

.dashboard-card {
    padding: 20px;
    display: block;
}

.section-heading {
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.section-heading.compact {
    margin-bottom: 14px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 850;
}

.section-heading h2 span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.section-heading a {
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--accent);
}

.status-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.status-filters button,
.mini-select {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 0 14px;
    color: var(--text);
    background: var(--surface-soft);
    font-weight: 750;
}

.status-filters button.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

.dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.dot.available { background: var(--green); }
.dot.running { background: var(--red); }
.dot.pending { background: var(--orange); }
.dot.paid { background: var(--blue); }

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
    gap: 18px;
}

.restaurant-table {
    min-height: 158px;
    border-radius: 11px;
    border: 1px solid;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    background: var(--surface-soft);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.restaurant-table:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 24px rgba(15, 23, 42, 0.08);
}

.restaurant-table i {
    margin-bottom: 6px;
    font-size: 2.2rem;
}

.restaurant-table .table-number {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 30px;
    border-radius: 7px;
    color: #fff;
    font-weight: 900;
    font-size: 0.82rem;
}

.restaurant-table strong,
.restaurant-table b {
    display: block;
}

.restaurant-table small {
    color: var(--muted);
}

.restaurant-table.available {
    color: var(--green);
    border-color: color-mix(in srgb, var(--green) 28%, var(--border));
    background: color-mix(in srgb, var(--green) 9%, var(--surface));
}

.restaurant-table.running {
    color: var(--red);
    border-color: color-mix(in srgb, var(--red) 30%, var(--border));
    background: color-mix(in srgb, var(--red) 9%, var(--surface));
}

.restaurant-table.pending {
    color: var(--orange);
    border-color: color-mix(in srgb, var(--orange) 30%, var(--border));
    background: color-mix(in srgb, var(--orange) 9%, var(--surface));
}

.restaurant-table.paid {
    color: var(--blue);
    border-color: color-mix(in srgb, var(--blue) 30%, var(--border));
    background: color-mix(in srgb, var(--blue) 9%, var(--surface));
}

.restaurant-table.available .table-number { background: var(--green); }
.restaurant-table.running .table-number { background: var(--red); }
.restaurant-table.pending .table-number { background: var(--orange); }
.restaurant-table.paid .table-number { background: var(--blue); }

.bottom-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr 0.62fr;
    gap: 18px;
}

.chart-area {
    height: 150px;
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
}

.chart-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.78rem;
}

.chart-bars {
    display: flex;
    align-items: end;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    background-image: linear-gradient(var(--border) 1px, transparent 1px);
    background-size: 100% 30px;
    padding: 10px 4px 0;
}

.chart-bars i {
    flex: 1;
    min-width: 12px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(180deg, #6d4cff, rgba(109, 76, 255, 0.12));
}

.food-row,
.order-row {
    display: grid;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.food-row {
    grid-template-columns: 38px 1fr auto auto;
}

.food-row:last-child,
.order-row:last-child {
    border-bottom: 0;
}

.food-thumb {
    width: 38px;
    height: 38px;
    border-radius: 8px;
}

.quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quick-grid button {
    min-height: 76px;
    border: 0;
    border-radius: 12px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    font-weight: 800;
}

.quick-grid i {
    display: block;
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.order-row {
    grid-template-columns: 44px 1fr auto auto;
}

.order-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.order-icon.running,
small.running {
    color: var(--red);
}

.order-icon.paid,
small.paid {
    color: var(--blue);
}

.order-icon.pending,
small.pending {
    color: var(--orange);
}

.order-icon {
    background: color-mix(in srgb, currentColor 12%, var(--surface));
}

.order-meta {
    text-align: right;
}

.order-meta small {
    display: block;
    font-weight: 800;
}

.queue-grid,
.payment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.queue-grid div,
.payment-grid div,
.total-strip {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: var(--surface-soft);
}

.queue-grid strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
}

.queue-grid span {
    color: var(--muted);
    font-size: 0.86rem;
}

.available { color: var(--green); }
.running { color: var(--red); }
.pending { color: var(--orange); }

.payment-grid {
    grid-template-columns: 1fr 1fr;
}

.payment-grid strong {
    display: block;
    margin: 5px 0;
    font-size: 1.2rem;
}

.payment-grid small,
.total-strip small {
    color: var(--green);
    font-weight: 800;
}

.total-strip {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 12px;
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.total-strip i {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}

.order-modal .modal-content,
.order-modal .modal-header,
.order-modal .modal-body {
    background: var(--bg);
    color: var(--text);
}

.order-modal .modal-content {
    border: 0;
    border-radius: 0;
}

.order-modal .modal-header {
    border-bottom: 1px solid var(--border);
}

.order-modal-title {
    font-size: 1.35rem;
    font-weight: 850;
}

.order-modal-subtitle,
.order-label {
    color: var(--muted);
}

.order-top-strip,
.order-panel,
.selected-box,
.total-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.order-input,
.order-select {
    min-height: 48px;
    border-radius: 10px;
    border-color: var(--border);
    color: var(--text);
    background-color: var(--surface-soft);
}

.order-panel-dark {
    background: linear-gradient(180deg, var(--sidebar-soft), var(--sidebar));
    color: #fff;
}

.catalog-item,
.menu-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    text-align: left;
    background: var(--surface-soft);
    color: var(--text);
}

.catalog-item {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.catalog-item span {
    display: block;
    color: rgba(255, 255, 255, 0.66);
}

.catalog-item.active {
    background: linear-gradient(135deg, #7c4dff, #6336ff);
}

.menu-item {
    display: flex;
    justify-content: space-between;
}

.selected-box {
    min-height: 180px;
    color: var(--muted);
    background: var(--surface-soft);
}

.total-card {
    width: 220px;
    padding: 16px;
    background: color-mix(in srgb, var(--blue) 10%, var(--surface));
}

.btn-brand {
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, #6d4cff, #4f35d7);
}

@media (max-width: 1700px) {
    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr) 390px;
    }

    .table-grid {
        grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
        gap: 14px;
    }

    .restaurant-table {
        min-height: 142px;
    }

    .bottom-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quick-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1399.98px) {
    .top-header {
        grid-template-columns: auto 1fr;
        gap: 16px;
    }

    .top-left {
        gap: 16px;
    }

    .branch-select {
        min-width: 190px;
    }

    .date-box {
        padding-right: 14px;
    }

    .top-actions {
        gap: 12px;
    }

    .summary-card-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr) 350px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-card strong {
        font-size: 1.35rem;
    }

    .right-column .dashboard-card {
        padding: 16px;
    }

    .order-row {
        grid-template-columns: 40px 1fr auto;
    }

    .order-row time {
        grid-column: 2 / 4;
    }
}

@media (max-width: 1199.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    body.sidebar-collapsed .sidebar {
        width: 250px;
        padding: 22px 14px 18px;
    }

    body.sidebar-collapsed .sidebar-brand {
        justify-content: flex-start;
    }

    body.sidebar-collapsed .sidebar-brand > div:last-child,
    body.sidebar-collapsed .sidebar-nav .nav-link span,
    body.sidebar-collapsed .plan-card {
        display: block;
    }

    body.sidebar-collapsed .branch-card {
        display: flex;
    }

    body.sidebar-collapsed .sidebar-nav .nav-link {
        justify-content: flex-start;
        padding: 0 14px;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-close {
        display: inline-grid;
        place-items: center;
    }

    .top-header,
    .content-shell {
        margin-left: 0;
    }

    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 1045;
        background: rgba(2, 6, 23, 0.48);
    }

    .top-header {
        grid-template-columns: auto 1fr;
        gap: 14px;
    }

    .top-left {
        gap: 14px;
    }

    .branch-select {
        min-width: 210px;
    }

    .dashboard-grid,
    .right-column,
    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .right-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payment-card {
        grid-column: 1 / -1;
    }

    .summary-card-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
}

@media (max-width: 767.98px) {
    .top-header,
    .content-shell {
        padding-left: 14px;
        padding-right: 14px;
    }

    .top-header {
        min-height: auto;
        gap: 12px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .branch-select {
        min-width: 0;
        max-width: 170px;
        overflow: hidden;
        white-space: nowrap;
    }

    .top-left {
        gap: 10px;
    }

    .top-actions {
        justify-content: flex-end;
        gap: 8px;
    }

    .icon-button,
    .theme-toggle {
        width: 40px;
        height: 40px;
    }

    .date-box {
        display: none !important;
    }

    .admin-profile {
        gap: 0;
    }

    .admin-copy,
    .admin-profile .bi-chevron-down {
        display: none;
    }

    .stats-grid,
    .summary-card-row,
    .payment-grid,
    .queue-grid {
        grid-template-columns: 1fr;
    }

    .summary-card-row > .card {
        min-height: 126px;
        padding: 20px 18px 14px;
    }

    .table-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .restaurant-table {
        min-height: 130px;
    }

    .restaurant-table .table-number {
        top: 35px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .status-filters {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .status-filters button {
        white-space: nowrap;
    }

    .order-row {
        grid-template-columns: 44px 1fr auto;
    }

    .order-row time {
        grid-column: 2 / 4;
    }

    .food-row {
        grid-template-columns: 38px 1fr;
    }

    .food-row span,
    .food-row b {
        grid-column: 2;
    }

    .right-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .top-header {
        grid-template-columns: 1fr auto;
    }

    .branch-select {
        max-width: 132px;
    }

    .theme-toggle {
        display: none;
    }

    .notification-menu {
        width: min(320px, calc(100vw - 24px));
    }

    .table-grid {
        grid-template-columns: 1fr;
    }
}
