:root {
    --app-bg: #f4f6fb;
    --app-bg-accent: #edf2ff;
    --surface: #ffffff;
    --surface-alt: #f8faff;
    --line: #dde3f0;
    --text: #162036;
    --muted: #63708c;
    --accent: #0d6efd;
    --accent-strong: #0a58ca;
    --ok: #198754;
    --warn: #ffc107;
    --danger: #dc3545;
    --sidebar-bg: #0f172a;
    --sidebar-text: #d8def2;
    --sidebar-muted: #9aa7c7;
    --sidebar-active: #1e293b;
    --sidebar-border: #223156;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Nunito", "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 5% 0%, #dbe7ff 0, transparent 30%),
        radial-gradient(circle at 100% 0%, #e6f6ff 0, transparent 26%),
        var(--app-bg);
}

.admin-body {
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    --bs-offcanvas-width: 280px;
    background: linear-gradient(180deg, #101a31 0%, #0f172a 100%);
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-border);
}

.app-sidebar .offcanvas-body {
    overflow-y: auto;
}

.sidebar-brand {
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #f1f5ff;
    font-size: 1.1rem;
}

.sidebar-subtitle {
    color: var(--sidebar-muted);
    font-size: 0.82rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    padding: 0 0.8rem;
    margin-bottom: 0.45rem;
}

.sidebar-subtitle-sm {
    color: var(--sidebar-muted);
    font-size: 0.72rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 0.55rem 0.8rem 0.2rem;
    margin-top: 0.35rem;
    opacity: 0.8;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    border-radius: 0.65rem;
    font-weight: 600;
    padding: 0.62rem 0.82rem;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link.nav-link-sub {
    padding-left: 1.6rem;
    font-size: 0.93rem;
    font-weight: 600;
}

.sidebar-nav .nav-link i {
    width: 1.2rem;
    margin-right: 0.45rem;
}

.sidebar-nav .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav .nav-link.active {
    color: #ffffff;
    background: var(--sidebar-active);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar-user-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.8rem;
    color: var(--sidebar-text);
}

.app-content {
    width: 100%;
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--line);
}

.content-wrapper {
    padding: 1.4rem;
}

.content-inner {
    animation: fadePageIn 0.45s ease;
}

.content-inner>* {
    animation: slideCardUp 0.42s ease both;
}

.content-inner>*:nth-child(2) {
    animation-delay: 0.05s;
}

.content-inner>*:nth-child(3) {
    animation-delay: 0.1s;
}

.app-card,
.card {
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 10px 28px rgba(26, 43, 79, 0.06);
}

.app-card .card-header,
.card-header {
    background: var(--surface-alt);
    border-bottom: 1px solid var(--line);
}

.metric-card .metric-icon {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.metric-card .metric-value {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.1;
}

.metric-card p {
    margin-bottom: 0;
}

.orders-summary-card .card-body {
    padding: 1rem 1.1rem;
}

.orders-summary-card .metric-value {
    font-size: 1.3rem;
}

.order-payment-stack>* {
    min-width: 0;
}

.payment-history-wrapper {
    max-width: 100%;
    overflow-x: auto;
}

.payment-history-table {
    min-width: 980px;
}

.payment-history-table th,
.payment-history-table td {
    white-space: nowrap;
}

.payment-history-table .payment-reference-cell {
    min-width: 140px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.payment-history-table .payment-note-cell {
    min-width: 220px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.dataTables_wrapper .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.dataTables_wrapper .dt-buttons .btn {
    margin: 0;
}

.dataTables_wrapper .dt-toolbar,
.dataTables_wrapper .dt-footer {
    margin-left: 0;
    margin-right: 0;
    padding: 0.75rem 1rem;
}

.dataTables_wrapper .dt-toolbar>[class*="col-"],
.dataTables_wrapper .dt-footer>[class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.dataTables_wrapper .dt-table-row {
    margin-left: 0;
    margin-right: 0;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_info {
    color: var(--muted);
    font-weight: 600;
}

.dataTables_wrapper .dataTables_length {
    padding-left: 0.25rem;
}

.dataTables_wrapper .dataTables_length select {
    min-width: 84px;
    margin-left: 0.35rem;
    margin-right: 0.35rem;
    padding: 0.35rem 2rem 0.35rem 0.7rem;
    border: 1px solid #cfd7e8;
    border-radius: 0.6rem;
    background-color: #ffffff;
}

.dataTables_wrapper .dataTables_info {
    padding-left: 0.75rem;
}

.dataTables_wrapper .dataTables_paginate {
    padding-right: 0.75rem;
}

.dataTables_wrapper .dataTables_paginate .pagination {
    margin-bottom: 0;
    gap: 0.35rem;
}

.dataTables_wrapper .dataTables_paginate .page-link {
    min-width: 2.15rem;
    text-align: center;
    border-color: #d3daea;
    border-radius: 0.6rem;
    color: #33415f;
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.dataTables_wrapper .dt-buttons .btn.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.dataTables_wrapper .dt-buttons .btn.btn-primary:hover,
.dataTables_wrapper .dt-buttons .btn.btn-primary:focus {
    background-color: var(--accent-strong);
    border-color: var(--accent-strong);
    color: #ffffff;
}

@media (max-width: 767.98px) {

    .dataTables_wrapper .dt-toolbar,
    .dataTables_wrapper .dt-footer {
        padding: 0.65rem 0.75rem;
    }

    .dataTables_wrapper .dt-buttons {
        justify-content: flex-start;
        margin-top: 0.5rem;
    }

    .dataTables_wrapper .dataTables_info {
        padding-left: 0.25rem;
        margin-bottom: 0.5rem;
    }

    .dataTables_wrapper .dataTables_paginate {
        padding-right: 0.25rem;
    }

    .dataTables_wrapper .dataTables_paginate .pagination {
        justify-content: flex-start;
    }

    .payment-history-table {
        min-width: 860px;
    }
}

.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--line);
}

.table thead th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--muted);
    background: var(--surface-alt);
}

.permissions-matrix .permissions-feature-col {
    min-width: 160px;
}

.permissions-matrix .permissions-action-col {
    min-width: 90px;
    text-align: center;
}

.permissions-matrix tbody tr:hover {
    background: var(--app-bg-accent);
}

.form-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #33415f;
}

.form-control,
.form-select,
textarea {
    border-radius: 0.7rem;
    border-color: #cfd7e8;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: #8db7ff;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.16);
}

.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
    border-radius: 0.7rem;
    border-color: #cfd7e8;
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    box-shadow: none;
}

.ts-wrapper.focus .ts-control,
.ts-control.focus,
.ts-control:focus-within {
    border-color: #8db7ff;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.16);
}

.ts-wrapper.single .ts-control input,
.ts-dropdown .option,
.ts-dropdown .create {
    color: var(--text);
}

.ts-dropdown {
    border-radius: 0.8rem;
    border-color: #cfd7e8;
    box-shadow: 0 14px 30px rgba(26, 43, 79, 0.12);
}

.ts-dropdown .active {
    background: #edf4ff;
    color: #0b4cb3;
}

.ts-wrapper.plugin-remove_button .item .remove-button {
    border-left-color: #cfd7e8;
}

.btn {
    border-radius: 0.7rem;
    font-weight: 700;
}

.btn-light {
    border: 1px solid #d3daea;
    background: #fff;
}

.status-badge {
    border-radius: 999px;
    font-weight: 700;
    padding: 0.38rem 0.58rem;
    font-size: 0.75rem;
}

.status-badge-open {
    background: #fff4d4;
    color: #7c6200;
}

.status-badge-served,
.status-badge-seated {
    background: #dcf7ea;
    color: #145c37;
}

.status-badge-paid {
    background: #dbeafe;
    color: #134b9d;
}

.status-badge-cancelled {
    background: #fde2e5;
    color: #9f2230;
}

.menu-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 0.65rem;
    border: 1px solid #d7dfef;
    background: #f5f8ff;
}

.menu-composition {
    max-width: 260px;
    white-space: normal;
    color: #4b5b7e;
}

.public-body {
    min-height: 100vh;
    color: #25212a;
    background:
        radial-gradient(circle at 0% 0%, #fff0ed 0, transparent 30%),
        radial-gradient(circle at 100% 0%, #fef4dd 0, transparent 35%),
        #fffaf7;
}

.public-topbar {
    position: sticky;
    top: 0;
    z-index: 1050;
    border-bottom: 1px solid #f0ddcf;
    background: rgba(255, 250, 247, 0.93);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.public-brand {
    text-decoration: none;
    color: #922226;
    font-weight: 900;
    letter-spacing: 0.4px;
    font-size: 1.05rem;
}

.public-main {
    padding: 1.6rem 0 2.5rem;
}

.public-hero {
    padding: 1rem 0 2rem;
}

.public-kicker {
    color: #bf3d3d;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 800;
    font-size: 0.8rem;
}

.public-hero-card {
    border: 1px solid #ecd8c7;
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 14px 24px rgba(69, 40, 21, 0.08);
}

.public-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.public-stats span {
    border: 1px dashed #e6c9be;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.88rem;
    color: #6d4d44;
}

.public-menu-section {
    padding: 0.25rem 0 2rem;
}

.public-category-block {
    margin-bottom: 2.2rem;
}

.dish-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #efddd0;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 12px 24px rgba(80, 42, 21, 0.08);
}

.dish-image-wrap {
    width: 100%;
    height: 180px;
    background: #fff3ee;
}

.dish-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dish-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #d56e57;
    font-size: 2rem;
}

.dish-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.95rem 1rem 1.05rem;
}

.dish-price {
    font-weight: 900;
    color: #b03125;
    white-space: nowrap;
}

.dish-description {
    color: #67534a;
    font-size: 0.9rem;
    line-height: 1.35;
}

.dish-size {
    align-self: flex-start;
    border: 1px solid #e9d6ca;
    border-radius: 999px;
    padding: 0.22rem 0.62rem;
    font-size: 0.74rem;
    color: #7a5c50;
    background: #fff7f4;
}

.public-footer {
    border-top: 1px solid #f0ddcf;
    background: #fff4ee;
}

.alert {
    border-radius: 0.8rem;
    border-width: 1px;
}

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 20%, #dbe8ff 0, transparent 38%),
        radial-gradient(circle at 90% 10%, #d9f4ff 0, transparent 35%),
        linear-gradient(180deg, #f5f9ff 0%, #eef4ff 100%);
}

.auth-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.auth-card {
    width: min(480px, 100%);
}

.auth-note {
    background: #f7fbff;
    border: 1px dashed #bfd2f4;
    border-radius: 0.75rem;
    padding: 0.8rem;
    color: #4a6089;
    font-size: 0.9rem;
}

@keyframes fadePageIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideCardUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 992px) {
    .app-shell {
        display: flex;
        align-items: stretch;
    }

    .app-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
    }
}

@media (max-width: 991.98px) {
    .content-wrapper {
        padding: 1rem;
    }

    .app-topbar {
        position: sticky;
    }
}