:root {
    --sidebar-width: 260px;
    --primary-color: #0d6efd;
    --sidebar-bg: #ffffff;
    --body-bg: #f8fafc;
    --app-header-height: 56px;
}

body {
    background-color: var(--body-bg);
    color: #334155;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

#wrapper {
    width: 100%;
    min-width: 0;
    overflow-x: clip;
}

#page-content-wrapper {
    width: auto !important;
    min-width: 0;
    flex: 1 1 0%;
}

/* Sidebar Styling */
.sidebar {
    box-sizing: border-box;
    display: flex;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid #e2e8f0;
    background: #ffffff;
    transition: transform 0.25s ease-out;
}

.sidebar-brand {
    display: flex;
    min-height: 64px;
    flex: 0 0 auto;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-brand-link {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.sidebar-brand .brand-badge {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 1.15rem;
}

.sidebar-brand-name {
    overflow: hidden;
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    padding: 12px 10px 20px;
}

.sidebar-section {
    overflow: hidden;
    margin: 12px 8px 6px;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-section:first-child {
    margin-top: 4px;
}

.sidebar-link {
    display: flex;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 550;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link i {
    flex: 0 0 20px;
    width: 20px;
    color: #64748b;
    font-size: 1.1rem;
    text-align: center;
}

.sidebar-link span {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-link:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.sidebar-link:hover i,
.sidebar-link.active i {
    color: var(--primary-color);
}

.sidebar-link.active {
    background: #e0f2fe;
    color: var(--primary-color);
    font-weight: 650;
}

.sidebar-backdrop {
    display: none;
}

.app-header-start {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.app-header-title {
    overflow: hidden;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-header-back {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
}

.app-header-back:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.app-bottom-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1045;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
}

.app-bottom-bar .btn {
    min-height: 44px;
    min-width: 0;
    flex: 0 1 auto;
}

.app-bottom-bar .btn-primary {
    flex: 1 1 auto;
    max-width: 420px;
}

.app-bottom-bar:has(.btn:only-child) .btn-primary {
    max-width: none;
    width: 100%;
}

body.has-app-bottom-bar #page-content-wrapper main {
    padding-bottom: 88px !important;
}

body.has-app-bottom-bar #page-content-wrapper > footer {
    display: none;
}

body.dish-selection-active .app-bottom-bar {
    display: none;
}

@media (min-width: 769px) {
    .app-bottom-bar {
        left: var(--sidebar-width);
        padding-right: 24px;
        padding-left: 24px;
    }
}

/* Avatar Circle */
.avatar-circle {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
}

/* Stat Cards */
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08) !important;
}

.stat-icon {
    width: 54px;
    height: 54px;
}

/* Table styling */
.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #64748b;
    border-top: none;
}

.table td {
    padding: 1rem 0.75rem;
}

/* Dropdown Menu Z-Index & Table Overflow Fix */
.dropdown-menu {
    z-index: 1060 !important;
}

.card:has(.table-responsive) {
    overflow: visible;
}

/* Drag and Drop Visual Indicator */
.dish-table-row.drag-over-top {
    position: relative;
}
.dish-table-row.drag-over-top td {
    border-top: 3px solid #0d6efd !important;
}
.dish-table-row.drag-over-top td:first-child::before {
    content: "➔";
    position: absolute;
    left: 2px;
    top: -10px;
    font-size: 14px;
    color: #0d6efd;
    font-weight: bold;
    z-index: 10;
}

.dish-table-row.drag-over-bottom {
    position: relative;
}
.dish-table-row.drag-over-bottom td {
    border-bottom: 3px solid #0d6efd !important;
}
.dish-table-row.drag-over-bottom td:first-child::after {
    content: "➔";
    position: absolute;
    left: 2px;
    bottom: -10px;
    font-size: 14px;
    color: #0d6efd;
    font-weight: bold;
    z-index: 10;
}

.dish-table-row.is-dragging {
    opacity: 0.45;
    background-color: #f1f5f9;
}

/* Previewable Images (Click to view large in Modal) */
.previewable-image,
img[data-preview] {
    cursor: pointer !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.previewable-image:hover,
img[data-preview]:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* =============================================================================
   Table Thumbnails & Placeholders (Shared across Dishes, Categories, Restaurants)
   ============================================================================= */
.table-img-thumb {
    width: 44px;
    height: 44px;
    min-width: 44px;
    max-width: 44px;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.table-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.table-img-thumb-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-img-thumb-placeholder i {
    color: #cbd5e1;
    font-size: 1.15rem;
}

/* Auth Page */
.auth-body {
    background-color: #f1f5f9;
}

/* =============================================================================
   Menu Content Editor & Dish Items (Responsive Alignment & Placeholders)
   ============================================================================= */
.menu-dish-item {
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.menu-dish-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.menu-dish-thumb {
    width: 44px;
    height: 44px;
    min-width: 44px;
    max-width: 44px;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-dish-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.menu-dish-thumb-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-dish-thumb-placeholder i {
    color: #cbd5e1;
    font-size: 1.15rem;
}

.menu-dish-price {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    text-align: right;
    letter-spacing: -0.2px;
}

.dish-drag-handle {
    cursor: grab;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        z-index: 1050;
        top: 0;
        bottom: 0;
        left: 0;
        width: var(--sidebar-width);
        min-width: var(--sidebar-width);
        max-width: var(--sidebar-width);
        margin-left: 0;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.25s ease-out;
        flex: 0 0 var(--sidebar-width);
    }
    .sidebar.toggled {
        transform: translateX(0);
    }

    #page-content-wrapper { width: 100%; min-width: 0; flex: 1 1 auto; }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1040;
        display: none;
        background: rgba(15, 23, 42, 0.42);
    }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar-backdrop {
        display: block;
    }
}

@media (max-width: 768px) {
    #page-content-wrapper > footer { display: none; }

    .table td, 
    .table th {
        padding: 0.65rem 0.5rem;
    }
}

@media (max-width: 576px) {
    .menu-dish-thumb,
    .table-img-thumb {
        width: 38px;
        height: 38px;
        min-width: 38px;
        max-width: 38px;
        border-radius: 0.375rem;
    }

    .menu-dish-thumb-placeholder i,
    .table-img-thumb-placeholder i {
        font-size: 1rem;
    }

    .menu-dish-item {
        padding: 0.65rem 0.75rem !important;
    }

    .menu-dish-price {
        font-size: 0.925rem;
    }

    .dish-drag-handle {
        width: 16px;
    }
}

/* Dashboard layout */
.dashboard-page,
.dashboard-page .row,
.dashboard-page [class*="col-"] { min-width: 0; }

.dashboard-welcome { margin: 0 0 1.5rem; }
.dashboard-date-wrap { text-align: right; }
.dashboard-date { display: inline-flex; align-items: center; gap: 5px; }
.dashboard-stat-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.dashboard-stat-link:focus-visible { outline: 3px solid rgba(13, 110, 253, 0.45); outline-offset: 3px; border-radius: 1rem; }
.dashboard-stat-card { min-width: 0; }
.dashboard-stat-copy { min-width: 0; }
.dashboard-stat-label-short { display: none; }
.dashboard-panel-header { min-height: 56px; padding: 1.1rem 1.5rem 0; }
.dashboard-all-link { display: inline-flex; min-height: 40px; align-items: center; gap: 4px; color: #0d6efd; font-size: 0.82rem; font-weight: 600; text-decoration: none; }
.dashboard-restaurant-list { display: none; }
.dashboard-restaurant-item { display: flex; min-width: 0; min-height: 60px; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #e9ecef; color: #334155; text-decoration: none; }
.dashboard-restaurant-item:last-child { border-bottom: 0; }
.dashboard-restaurant-item:hover { color: #0d6efd; }
.dashboard-restaurant-icon { display: flex; width: 40px; height: 40px; flex: 0 0 40px; align-items: center; justify-content: center; border: 1px solid #dbeafe; border-radius: 8px; background: #eff6ff; color: #0d6efd; font-size: 1rem; }
.dashboard-restaurant-info { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; gap: 2px; }
.dashboard-restaurant-name { overflow: hidden; font-size: 0.86rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-restaurant-meta { overflow: hidden; color: #64748b; font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-restaurant-item .badge { flex: 0 0 auto; white-space: nowrap; }
.restaurant-row-meta { display: none !important; }

@media (min-width: 769px) and (max-width: 1024px) {
    .dashboard-restaurant-col { flex: 0 0 100%; max-width: 100%; }
    .dashboard-restaurant-col { order: 1; }
}

@media (max-width: 768px) {
    .dashboard-page { margin: -8px -12px 0; }
    .dashboard-welcome { row-gap: 2px; margin: 0 0 12px; }
    .dashboard-welcome h1 { margin-bottom: 1px !important; font-size: 1.3rem; line-height: 1.2; }
    .dashboard-welcome p { display: -webkit-box; overflow: hidden; max-width: 34rem; font-size: 0.8rem; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .dashboard-date-wrap { margin-top: 5px; text-align: left; }
    .dashboard-date { min-height: 34px; padding: 5px 10px; font-size: 0.72rem; }
    .dashboard-stats { --bs-gutter-x: 10px; --bs-gutter-y: 10px; margin-bottom: 14px !important; }
    .dashboard-stat-col { min-width: 0; }
    .dashboard-stat-card { height: 108px !important; border-radius: 8px !important; }
    .dashboard-stat-body { height: 108px; min-height: 108px; align-items: center !important; gap: 6px; padding: 12px 13px !important; }
    .dashboard-stat-label { display: block; overflow: hidden; max-width: 100%; font-size: 0.63rem !important; line-height: 1.2; text-overflow: ellipsis; }
    .dashboard-stat-label-full { display: none; }
    .dashboard-stat-label-short { display: inline; }
    .dashboard-stat-copy h2 { margin-top: 5px !important; font-size: 1.5rem; line-height: 1; }
    .dashboard-stat-card .stat-icon { width: 40px; height: 40px; min-width: 40px; padding: 0.5rem !important; border-radius: 8px !important; }
    .dashboard-stat-card .stat-icon i { font-size: 1.1rem !important; }
    .dashboard-stat-footer { display: none; }
    .dashboard-lower { --bs-gutter-x: 10px; --bs-gutter-y: 12px; }
    .dashboard-panel-header { min-height: 42px; padding: 5px 12px 0; }
    .dashboard-panel-header h2 { font-size: 0.98rem; }
    .dashboard-all-link { min-height: 44px; font-size: 0.75rem; }
    .dashboard-restaurant-body { padding: 5px 12px 8px !important; }
    .dashboard-restaurant-table { display: none; }
    .dashboard-restaurant-list { display: block; }
    .dashboard-restaurant-item { min-height: 58px; gap: 9px; padding: 7px 0; }
    .dashboard-restaurant-icon { width: 36px; height: 36px; flex-basis: 36px; }
    .dashboard-restaurant-name { font-size: 0.82rem; }
    .dashboard-restaurant-meta { font-size: 0.68rem; }
    .dashboard-restaurant-item .badge { font-size: 0.66rem; }
    #sidebarToggle { min-width: 44px; min-height: 44px; padding: 0.5rem; }
}

@media (max-width: 480px) {
    .dashboard-page { margin-right: -12px; margin-left: -12px; }
    .dashboard-stats { --bs-gutter-x: 9px; --bs-gutter-y: 9px; }
    .dashboard-stat-card,
    .dashboard-stat-body { height: 104px !important; min-height: 104px; }
    .dashboard-stat-body {
        display: grid !important;
        grid-template-columns: 36px minmax(0, 1fr);
        grid-template-rows: auto 1fr;
        align-content: center;
        align-items: center;
        justify-content: stretch !important;
        column-gap: 8px;
        row-gap: 5px;
        padding: 10px 11px !important;
    }
    .dashboard-stat-copy { display: contents; }
    .dashboard-stat-label {
        grid-column: 1 / -1;
        grid-row: 1;
        overflow: visible;
        max-width: 100%;
        font-size: 0.6rem !important;
        line-height: 1.15;
        white-space: nowrap;
    }
    .dashboard-stat-card .stat-icon {
        grid-column: 1;
        grid-row: 2;
        width: 36px;
        height: 36px;
        min-width: 36px;
        align-self: center;
    }
    .dashboard-stat-copy h2 {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        margin: 0 !important;
        font-size: 1.3rem;
        line-height: 1;
    }
    .dashboard-restaurant-item { min-height: 56px; }
}

/* Compact backend forms and dish list on small viewports */
.backend-page-heading { min-width: 0; }
.backend-page-context { color: #64748b; }
.backend-form { min-width: 0; }
.button-label-mobile { display: none; }
.dishes-page-shell { min-width: 0; width: 100%; }

.list-selection-bar {
    display: none;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0 0 12px;
    padding: 6px 10px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #eff6ff;
}

.list-selection-bar.is-selection-active {
    display: flex;
}

.list-selection-count {
    min-width: 0;
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 650;
}

.list-selection-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.list-selection-actions .btn {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    font-weight: 650;
    white-space: nowrap;
}

@media (min-width: 1200px) {
    .dishes-page-shell { max-width: 1600px; margin-right: auto; margin-left: auto; }
}

@media (max-width: 768px) {
    #page-content-wrapper main { min-width: 0; }
    #page-content-wrapper main > .container-fluid { min-width: 0; max-width: 100%; }

    .backend-page-heading { gap: 4px !important; margin-bottom: 14px !important; }
    .backend-page-heading > a:first-child { min-height: 40px; margin: 0 0 2px !important; padding: 5px 9px; font-size: 0.76rem; }
    .backend-page-heading h1 { margin-bottom: 1px !important; font-size: 1.25rem; line-height: 1.2; }
    .backend-page-heading p { margin-bottom: 0 !important; font-size: 0.76rem; line-height: 1.3; }
    .backend-page-context { font-weight: 550; }

    #page-content-wrapper main .backend-form .row { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }
    #page-content-wrapper main .backend-form .card { margin-bottom: 16px !important; border-radius: 12px !important; }
    #page-content-wrapper main .backend-form .card-header { padding: 15px 17px 0 !important; }
    #page-content-wrapper main .backend-form .card-header h2 { font-size: 0.98rem; }
    #page-content-wrapper main .backend-form .card-body { padding: 16px 17px !important; }
    #page-content-wrapper main .backend-form .mb-3 { margin-bottom: 14px !important; }
    #page-content-wrapper main .backend-form .mb-4 { margin-bottom: 16px !important; }
    #page-content-wrapper main .backend-form .form-label { margin-bottom: 4px; font-size: 0.75rem; }
    #page-content-wrapper main .backend-form .form-control,
    #page-content-wrapper main .backend-form .form-select { min-height: 44px; padding: 8px 11px; border-radius: 8px !important; font-size: 0.88rem; }
    #page-content-wrapper main .backend-form textarea.form-control { min-height: 70px; }
    #page-content-wrapper main .backend-form .form-text { margin-top: 4px; font-size: 0.67rem; }
    #page-content-wrapper main .backend-form .form-check { min-height: 44px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px !important; }
    #page-content-wrapper main .backend-form .form-check-input { width: 2.1em; height: 1.15em; margin: 0; flex: 0 0 auto; }
    #page-content-wrapper main .backend-form .form-check-label { font-size: 0.8rem; }
    #page-content-wrapper main .backend-form .form-control-color { width: 44px; min-height: 44px; padding: 5px; }
    #page-content-wrapper main .backend-form .btn { min-height: 44px; }
    .restaurant-form-actions { display: flex !important; flex-direction: row; gap: 8px !important; }
    .restaurant-form-actions > * { min-width: 0; flex: 1 1 50%; }
    .category-form-actions > * { min-width: 0; flex: 1 1 50%; }

    .dishes-page-heading { margin-bottom: 12px !important; }
    .dishes-page-heading p { display: none; }
    .dishes-page-heading > div:last-child { width: auto; }
    .dishes-create-button { min-height: 44px; padding: 8px 11px !important; font-size: 0.79rem; white-space: nowrap; }

    .dish-filter-card { margin-bottom: 12px !important; border-radius: 12px !important; }
    .dish-filter-card .card-body { padding: 10px !important; }
    .dish-filter-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(88px, 110px); gap: 8px; margin: 0; }
    .dish-filter-form > [class*="col-"] { width: auto; max-width: none; min-width: 0; flex: none; padding: 0; }
    .dish-filter-restaurant { grid-column: 1 / -1; display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 8px; }
    .dish-filter-category { grid-column: 1; grid-row: 2; }
    .dish-filter-status { grid-column: 2; grid-row: 2; }
    .dish-filter-search { grid-column: 1; grid-row: 3; }
    .dish-filter-reset { grid-column: 2; grid-row: 3; align-self: end; }
    .dish-filter-form .form-label { margin: 0; font-size: 0.68rem !important; line-height: 1.2; }
    .dish-filter-form .form-control,
    .dish-filter-form .form-select,
    .dish-filter-form .btn { min-height: 44px; padding: 7px 9px; font-size: 0.78rem; }
    .dish-filter-form .input-group .btn { width: 44px; }
    .dish-filter-reset .btn { width: 44px !important; margin-left: auto; }

    #dishesTable { width: 100%; table-layout: fixed; }
    #dishesTable thead { display: none; }
    #dishesTable tbody { display: block; }
    #dishesTable tbody tr.dish-table-row {
        display: grid;
        gap: 0 6px;
        min-width: 0;
        padding: 8px 6px;
        border-bottom: 1px solid #e9ecef;
    }
    #dishesTable tbody td { display: block; min-width: 0; padding: 0 !important; border: 0; }
    #dishesTable tbody td:nth-child(1) { display: none; }
    #dishesTable tbody td:nth-child(2),
    #dishesTable tbody td:nth-child(5),
    #dishesTable tbody td:nth-child(6),
    #dishesTable tbody td:nth-child(8) { display: none !important; }
    #dishesTable tbody td:nth-child(3) { grid-area: image; grid-row: 1 / span 2; display: flex; align-items: center; }
    #dishesTable tbody td:nth-child(4) { grid-area: name; align-self: center; overflow: hidden; }
    #dishesTable tbody td:nth-child(7) { grid-area: price; align-self: start; overflow: hidden; color: #475569 !important; font-size: 0.75rem; text-align: left !important; }
    #dishesTable tbody td:nth-child(9) { grid-area: actions; display: flex; align-items: center; justify-content: center; }
    #dishesTable tbody td:nth-child(1) > .d-flex { flex-direction: column; justify-content: center; gap: 5px !important; }
    #dishesTable .drag-handle { width: 20px; height: 22px; display: flex; align-items: center; justify-content: center; }
    #dishesTable .form-check { min-height: 24px; display: flex; align-items: center; margin: 0; }
    #dishesTable .form-check-input { width: 18px; height: 18px; margin: 0; }
    #dishesTable .table-img-thumb { width: 38px; height: 38px; min-width: 38px; max-width: 38px; }
    #dishesTable tbody td:nth-child(4) > .fw-bold { min-width: 0; flex-wrap: nowrap !important; overflow: hidden; font-size: 0.77rem; }
    #dishesTable tbody td:nth-child(4) > .fw-bold > a { max-width: 100% !important; min-width: 0; font-size: inherit; }
    #dishesTable tbody td:nth-child(4) .badge { max-width: 44px; overflow: hidden; text-overflow: ellipsis; }
    #dishesTable tbody td:nth-child(4) > .text-muted { max-width: 100% !important; overflow: hidden; font-size: 0.66rem !important; line-height: 1.2; }
    #dishesTable tbody td:nth-child(4) .d-md-none { min-width: 0; max-height: 20px; overflow: hidden; }
    #dishesTable tbody td:nth-child(7) .text-muted { display: inline; margin-left: 3px; font-size: 0.64rem !important; }

}

@media (max-width: 480px) {
    #page-content-wrapper main { padding: 12px !important; }
    .dish-filter-card .card-body { padding: 9px !important; }
    .dish-filter-restaurant { grid-template-columns: 68px minmax(0, 1fr); }
    #dishesTable tbody tr.dish-table-row { gap: 0 5px; padding-right: 5px; padding-left: 5px; }
    #dishesTable .table-img-thumb { width: 36px; height: 36px; min-width: 36px; max-width: 36px; }
    .dish-batch-action-bar .card-body { gap: 6px !important; }
    .restaurant-street-col { width: 68%; max-width: 68%; flex: 0 0 68%; }
    .restaurant-zip-col { width: 32%; max-width: 32%; flex: 0 0 32%; }
    .restaurant-city-col,
    .restaurant-country-col,
    .restaurant-phone-col,
    .restaurant-email-col { width: 50%; max-width: 50%; flex: 0 0 50%; }
    .restaurant-website-col { width: 100%; max-width: 100%; flex: 0 0 100%; }
    .category-name-col { width: 68%; max-width: 68%; flex: 0 0 68%; }
    .category-sort-col { width: 32%; max-width: 32%; flex: 0 0 32%; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    #dishesTable th,
    #dishesTable td { padding-right: 5px !important; padding-left: 5px !important; }
    #dishesTable thead th:nth-child(5),
    #dishesTable tbody td:nth-child(5),
    #dishesTable thead th:nth-child(6),
    #dishesTable tbody td:nth-child(6) { display: none !important; }
    #dishesTable .dish-mobile-meta { display: flex !important; min-width: 0; max-width: 100%; gap: 4px; overflow: hidden; }
    #dishesTable .dish-mobile-meta .badge { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #dishesTable thead th:nth-child(5) { white-space: nowrap; }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    #page-content-wrapper main { padding-right: 16px !important; padding-left: 16px !important; }
    #dishesTable th,
    #dishesTable td { padding-right: 6px !important; padding-left: 6px !important; }
    #dishesTable thead th:nth-child(5) { white-space: nowrap; }
    #dishesTable thead th:nth-child(6),
    #dishesTable tbody td:nth-child(6) { display: none !important; }
}

@media (max-width: 768px) {
    .backend-page-description { display: none; }
    .backend-page-context { display: block; margin-top: 2px; font-size: 0.76rem; line-height: 1.25; }

    #page-content-wrapper main .backend-form .row { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }
    #page-content-wrapper main .backend-form .card { margin-bottom: 16px !important; border-radius: 12px !important; }
    #page-content-wrapper main .backend-form .card-header { padding: 15px 17px 0 !important; }
    #page-content-wrapper main .backend-form .card-header h2 { font-size: 0.98rem; }
    #page-content-wrapper main .backend-form .card-body { padding: 16px 17px !important; }
    #page-content-wrapper main .backend-form .mb-3 { margin-bottom: 14px !important; }
    #page-content-wrapper main .backend-form .mb-4 { margin-bottom: 16px !important; }
    #page-content-wrapper main .backend-form .form-label { margin-bottom: 4px; font-size: 0.75rem; }
    #page-content-wrapper main .backend-form .form-control,
    #page-content-wrapper main .backend-form .form-select { min-height: 44px; padding: 8px 11px; border-radius: 8px !important; font-size: 0.88rem; }
    #page-content-wrapper main .backend-form textarea.form-control { min-height: 70px; }
    #page-content-wrapper main .backend-form .form-text { margin-top: 4px; font-size: 0.67rem; }
    #page-content-wrapper main .backend-form .form-check { min-height: 44px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px !important; }
    #page-content-wrapper main .backend-form .form-check-input { width: 2.1em; height: 1.15em; margin: 0; flex: 0 0 auto; }
    #page-content-wrapper main .backend-form .form-check-label { font-size: 0.8rem; }
    #page-content-wrapper main .backend-form .form-control-color { width: 44px; min-height: 44px; padding: 5px; }
    #page-content-wrapper main .backend-form .btn { min-height: 44px; }
    .restaurant-form .form-control[type="file"] { padding: 7px 8px !important; font-size: 0.74rem !important; }
    .restaurant-form .bg-light.rounded-4.border { padding: 10px !important; border-radius: 10px !important; }
    .restaurant-form-actions,
    .category-form-actions,
    .dish-form-actions,
    .menu-form-actions { display: flex !important; flex-direction: row; gap: 8px !important; }
    .restaurant-form-actions > *,
    .category-form-actions > *,
    .dish-form-actions > *,
    .menu-form-actions > * { min-width: 0; flex: 1 1 50%; }
    .category-form-actions .btn,
    .restaurant-form-actions .btn,
    .dish-form-actions .btn,
    .menu-form-actions .btn { padding: 8px 9px !important; font-size: 0.77rem; white-space: normal; }
    .category-form-actions .btn,
    .restaurant-form-actions .btn,
    .dish-form-actions .btn,
    .menu-form-actions .btn { min-height: 44px; height: 44px; }
    .button-label-desktop { display: none; }
    .button-label-mobile { display: inline; }
}

/* Mobile and tablet list interactions share the 992 px breakpoint with app.js. */
@media (max-width: 991.98px) {
    .restaurant-list-heading { gap: 4px !important; margin-bottom: 12px !important; }
    .restaurant-list-heading h1 { font-size: 1.25rem; }
    .restaurant-list-heading p { display: none; }
    .restaurant-create-button { min-height: 44px; padding: 8px 11px !important; font-size: 0.78rem; }

    .restaurant-list-table,
    .restaurant-list-table > table { width: 100%; min-width: 0 !important; }
    .restaurant-list-table thead { display: none; }
    .restaurant-list-table tbody { display: block; }
    .restaurant-list-row {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        grid-template-areas: "logo details actions";
        align-items: center;
        gap: 0 9px;
        min-width: 0;
        padding: 7px 6px;
        border-bottom: 1px solid #e9ecef;
        background-color: #ffffff;
        transition: background-color 0.12s ease;
    }
    .restaurant-list-row:hover { background-color: #f1f5f9 !important; }
    .restaurant-list-row:last-child { border-bottom: 0; }
    .restaurant-list-row > td {
        display: block !important;
        min-width: 0;
        width: auto;
        padding: 0 !important;
        border: 0;
        background-color: transparent !important;
        box-shadow: none !important;
    }
    .restaurant-list-logo { grid-area: logo; }
    .restaurant-list-details { grid-area: details; overflow: hidden; }
    .restaurant-list-row > .restaurant-list-city,
    .restaurant-list-row > .restaurant-list-contact,
    .restaurant-list-row > .restaurant-list-categories,
    .restaurant-list-row > .restaurant-list-dishes,
    .restaurant-list-row > .restaurant-list-status { display: none !important; }
    .restaurant-list-actions { grid-area: actions; display: flex !important; align-items: center; justify-content: center !important; }
    .restaurant-list-row .table-img-thumb { width: 40px; height: 40px; min-width: 40px; max-width: 40px; }
    .restaurant-list-row .restaurant-company-name,
    .restaurant-list-row .restaurant-slug { display: none; }
    .restaurant-list-row .restaurant-row-meta { display: flex !important; min-width: 0; align-items: center; gap: 4px !important; margin-top: 3px !important; flex-wrap: nowrap !important; overflow: hidden; }
    .restaurant-city-meta { overflow: hidden; color: #64748b; font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
    .restaurant-count-meta,
    .restaurant-state-meta { flex: 0 0 auto; padding: 2px 5px; font-size: 0.61rem; font-weight: 600; white-space: nowrap; }
    .restaurant-list-actions .dropdown { display: flex; align-items: center; justify-content: center; }
    .restaurant-list-actions .restaurant-action-trigger { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 !important; border-radius: 8px !important; font-size: 1.05rem; }
    .restaurant-list-actions .dropdown-menu { display: none !important; }

    #dishesTable { width: 100%; table-layout: fixed; }
    #dishesTable thead { display: none; }
    #dishesTable tbody { display: block; }
    #dishesTable tbody tr.dish-table-row {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) auto 36px;
        grid-template-rows: auto auto;
        grid-template-areas: "image title price actions" "image meta price actions";
        gap: 2px 8px;
        min-width: 0;
        padding: 8px 6px;
        border-bottom: 1px solid #e9ecef;
        background-color: #ffffff;
        transition: background-color 0.12s ease;
        cursor: pointer;
    }
    #dishesTable tbody tr.dish-table-row:hover { background-color: #f1f5f9 !important; }
    #dishesTable tbody tr.dish-table-row.table-primary-subtle,
    #dishesTable tbody tr.dish-table-row[aria-selected="true"] { background-color: rgba(13, 110, 253, 0.08) !important; }
    #dishesTable tbody td { display: block; min-width: 0; padding: 0 !important; border: 0; background-color: transparent !important; box-shadow: none !important; }
    #dishesTable tbody td:nth-child(1) { display: none; }
    #dishesTable tbody td:nth-child(9) { grid-area: actions; display: flex; align-items: center; justify-content: center; }
    #dishesTable tbody td:nth-child(2),
    #dishesTable tbody td:nth-child(5),
    #dishesTable tbody td:nth-child(6),
    #dishesTable tbody td:nth-child(8) { display: none !important; }
    #dishesTable tbody td:nth-child(3) { grid-area: image; grid-row: 2 / span 2; display: flex; align-items: flex-start; }
    #dishesTable tbody td:nth-child(4) { display: contents; }
    #dishesTable tbody td:nth-child(7) { grid-area: price; align-self: end; justify-self: stretch; overflow: hidden; color: #475569 !important; font-size: 0.75rem; text-align: right !important; white-space: nowrap; }
    #dishesTable tbody td:nth-child(1) > .d-flex { flex-direction: row; justify-content: flex-start; gap: 2px !important; }
    #dishesTable .drag-handle { width: 20px; height: 24px; flex: 0 0 20px; display: flex; align-items: center; justify-content: center; }
    #dishesTable .form-check { display: none !important; }
    #dishesTable .form-check-input { width: 20px; height: 20px; margin: 0; border-radius: 50%; }
    body.dish-selection-active #dishesTable .form-check { display: flex !important; min-height: 28px; align-items: center; justify-content: center; }
    #dishesTable .table-img-thumb { width: 36px; height: 36px; min-width: 36px; max-width: 36px; }
    #dishesTable .dish-mobile-title { grid-area: title; display: flex; min-width: 0; align-self: end; flex-wrap: nowrap !important; overflow: hidden; font-size: 0.78rem; line-height: 1.15; }
    #dishesTable .dish-mobile-title > a { max-width: 100% !important; min-width: 0; overflow: hidden; font-size: inherit; text-overflow: ellipsis; white-space: nowrap; }
    #dishesTable .dish-mobile-title .badge { max-width: 48px; flex: 0 0 auto; overflow: hidden; text-overflow: ellipsis; }
    #dishesTable .dish-mobile-description { grid-area: description; align-self: center; max-width: 100% !important; overflow: hidden; font-size: 0.66rem !important; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
    #dishesTable .dish-mobile-meta { display: flex !important; grid-area: meta; min-width: 0; max-height: 18px; align-self: start; flex-wrap: nowrap !important; overflow: hidden; margin-top: 0 !important; }
    #dishesTable .dish-mobile-meta .badge { max-width: 62px; overflow: hidden; font-size: 0.62rem !important; text-overflow: ellipsis; white-space: nowrap; }
    #dishesTable tbody td:nth-child(7) .text-muted { display: inline; margin-left: 2px; font-size: 0.62rem !important; }
    #dishesTable tbody tr[aria-selected="true"] .form-check-input { border-color: #0d6efd; background-color: #0d6efd; }
    #dishesTable tbody tr:focus-visible { outline: 2px solid rgba(13, 110, 253, 0.45); outline-offset: -2px; }

    .mobile-action-sheet-root { position: fixed; inset: 0; z-index: 1090; display: none; }
    .mobile-action-sheet-root.is-open { display: block; }
    .mobile-action-sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.42); }
    .mobile-action-sheet { position: absolute; right: 0; bottom: 0; left: 0; display: flex; max-height: min(78dvh, 640px); flex-direction: column; overflow-y: auto; padding: 7px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; background: #ffffff; box-shadow: 0 -12px 35px rgba(15, 23, 42, 0.18); transform: translateY(105%); transition: transform 0.2s ease; overscroll-behavior: contain; }
    .mobile-action-sheet-root.is-open .mobile-action-sheet { transform: translateY(0); }
    .mobile-action-sheet-grip { display: flex; height: 12px; flex: 0 0 12px; justify-content: center; }
    .mobile-action-sheet-grip span { width: 34px; height: 4px; border-radius: 4px; background: #cbd5e1; }
    .mobile-action-sheet-header { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0 8px; }
    .mobile-action-sheet-heading { min-width: 0; }
    .mobile-action-sheet-header h2 { overflow: hidden; margin: 0; color: #1e293b; font-size: 1rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-action-sheet-header p { overflow: hidden; margin: 2px 0 0; color: #64748b; font-size: 0.73rem; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-action-sheet-close { display: inline-flex; width: 44px; height: 44px; flex: 0 0 44px; align-items: center; justify-content: center; border: 1px solid #e2e8f0; border-radius: 8px; background: #ffffff; color: #475569; }
    .mobile-action-sheet-items,
    .mobile-action-sheet-danger-items { display: flex; flex-direction: column; }
    .mobile-action-sheet-danger-items { margin-top: 7px; padding-top: 7px; border-top: 1px solid #e9ecef; }
    .mobile-action-sheet-items.d-none,
    .mobile-action-sheet-danger-items.d-none { display: none !important; }
    .mobile-action-sheet-item { display: flex; min-height: 52px; align-items: center; gap: 12px; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: #334155; font-size: 0.88rem; font-weight: 550; text-align: left; text-decoration: none; width: 100%; }
    .mobile-action-sheet-item:hover,
    .mobile-action-sheet-item:focus-visible { background: #f1f5f9; color: #0f172a; }
    .mobile-action-sheet-item > i { width: 22px; color: #64748b; font-size: 1rem; text-align: center; }
    .mobile-action-sheet-item.is-danger,
    .mobile-action-sheet-item.is-danger > i { color: #b91c1c; }
    body.mobile-action-sheet-open { overflow: hidden; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .restaurant-list-table,
    .restaurant-list-table > table { width: 100%; min-width: 0 !important; }
    .restaurant-list-table thead { display: none; }
    .restaurant-list-table tbody { display: block; }
    .restaurant-list-row {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        grid-template-areas: "logo details actions";
        align-items: center;
        gap: 0 9px;
        min-width: 0;
        padding: 7px 6px;
        border-bottom: 1px solid #e9ecef;
        background-color: #ffffff;
        transition: background-color 0.12s ease;
    }
    .restaurant-list-row:hover { background-color: #f1f5f9 !important; }
    .restaurant-list-row:last-child { border-bottom: 0; }
    .restaurant-list-row > td {
        display: block !important;
        min-width: 0;
        width: auto;
        padding: 0 !important;
        border: 0;
        background-color: transparent !important;
        box-shadow: none !important;
    }
    .restaurant-list-logo { grid-area: logo; }
    .restaurant-list-details { grid-area: details; overflow: hidden; }
    .restaurant-list-row > .restaurant-list-city,
    .restaurant-list-row > .restaurant-list-contact,
    .restaurant-list-row > .restaurant-list-categories,
    .restaurant-list-row > .restaurant-list-dishes,
    .restaurant-list-row > .restaurant-list-status { display: none !important; }
    .restaurant-list-actions { grid-area: actions; display: flex !important; align-items: center; justify-content: center !important; }
    .restaurant-list-row .restaurant-company-name,
    .restaurant-list-row .restaurant-slug { display: none; }
    .restaurant-list-row .restaurant-row-meta { display: flex !important; min-width: 0; align-items: center; gap: 5px; margin-top: 3px !important; flex-wrap: nowrap; overflow: hidden; }
    .restaurant-list-actions .restaurant-action-trigger { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 !important; border-radius: 8px !important; }
}

/* =============================================================================
   App chrome, compact lists and editor pages
   ============================================================================= */
.app-page-header {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1.25rem;
}

.app-page-header h1 {
    margin: 0;
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.app-page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
}

.app-page-kicker:hover { color: var(--primary-color); }

.app-create-btn {
    display: inline-flex;
    min-height: 42px;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 650;
    white-space: nowrap;
}

.app-filter-bar {
    display: flex;
    min-width: 0;
    align-items: end;
    gap: 10px;
    margin-bottom: 1rem;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.app-filter-bar form,
.app-filter-field {
    width: 100%;
    min-width: 0;
}

.app-filter-bar .form-label {
    margin-bottom: 4px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 650;
}

.app-filter-bar .form-select,
.app-filter-bar .form-control {
    min-height: 42px;
    border-radius: 10px;
}

.app-list-card {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.app-list-card .table {
    --bs-table-bg: transparent;
    margin: 0;
}

.app-list-card .table > :not(caption) > * > * {
    background: transparent;
}

.app-action-trigger {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #475569;
}

.app-action-trigger:hover,
.app-action-trigger:focus-visible {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

#page-content-wrapper main .app-editor,
.app-editor {
    max-width: 1080px;
}

.app-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "aside" "secondary";
    gap: 14px;
}

.app-editor-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.app-editor-aside { grid-area: aside; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.app-editor-secondary { grid-area: secondary; min-width: 0; }

#page-content-wrapper main .app-editor .card,
.app-editor-card,
.app-editor .card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: none !important;
}

#page-content-wrapper main .app-editor .card-header,
.app-editor .card-header {
    padding: 14px 16px 0 !important;
    background: transparent !important;
}

.app-editor .card-header h2,
.app-section-title {
    margin: 0;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 700;
}

#page-content-wrapper main .app-editor .card-body,
.app-editor .card-body {
    padding: 14px 16px 16px !important;
}

.app-editor .form-label {
    margin-bottom: 4px;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 650;
}

.app-editor .form-text { display: none; }

.app-editor .nav-tabs {
    gap: 4px;
    border-bottom: 1px solid #e2e8f0;
}

.app-editor .nav-tabs .nav-link {
    padding: 8px 12px;
    border: 0;
    color: #64748b;
    font-size: 0.82rem;
}

.app-editor .nav-tabs .nav-link.active {
    color: #0f172a;
    box-shadow: inset 0 -2px 0 var(--primary-color);
}

.app-property-grid .form-check {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.app-property-grid .form-check-input { margin: 0; }

.app-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 8px;
}

.app-chip {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.app-chip .form-check-input {
    margin: 0;
    flex: 0 0 auto;
}

.app-chip .form-check-label {
    min-width: 0;
    overflow: hidden;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-property-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.app-sticky-actions {
    display: flex;
    gap: 8px;
}

.app-sticky-actions > * {
    min-width: 0;
    flex: 1 1 auto;
}

.category-list-table,
.menu-list-table {
    width: 100%;
    min-width: 0;
}

#priceVariantsTable .variant-stack-fields {
    display: contents;
}

@media (min-width: 992px) {
    .app-editor-grid.is-split {
        grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
        grid-template-areas: "main aside";
        align-items: start;
    }
    .app-editor-grid.is-split:has(.app-editor-secondary) {
        grid-template-areas: "main aside" "secondary aside";
    }

    .app-editor-aside {
        position: sticky;
        top: 84px;
    }
}

@media (max-width: 991.98px) {
    #page-content-wrapper main { padding: 12px !important; }
    #page-content-wrapper header.navbar { padding-right: 12px !important; padding-left: 12px !important; }

    .app-page-header {
        align-items: center;
        margin-bottom: 12px;
    }
    .app-page-header h1 { font-size: 1.2rem; }
    .app-page-header p,
    .backend-page-description { display: none !important; }
    .app-create-btn {
        min-height: 40px;
        padding: 7px 10px;
        font-size: 0.8rem;
    }
    .app-create-btn .btn-label { display: none; }

    .app-filter-bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        margin-bottom: 10px;
        padding: 10px;
    }
    .app-filter-field { min-width: 0; }
    .app-filter-bar .form-select,
    .app-filter-bar .form-control,
    .app-filter-bar .btn { min-height: 44px; }

    .app-list-card { border-radius: 14px; }
    .category-list-table thead,
    .menu-list-table thead,
    .layout-list-table thead,
    .import-list-table thead,
    .usage-list-table thead { display: none; }
    .category-list-table tbody,
    .menu-list-table tbody,
    .layout-list-table tbody,
    .import-list-table tbody,
    .usage-list-table tbody { display: block; }

    .category-list-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        grid-template-areas: "details actions";
        align-items: center;
        gap: 0 10px;
        min-width: 0;
        padding: 10px 10px;
        border-bottom: 1px solid #eef2f7;
        background: #ffffff;
    }
    .menu-list-row,
    .layout-list-row,
    .import-list-row {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        grid-template-areas: "icon details actions";
        align-items: center;
        gap: 0 10px;
        min-width: 0;
        padding: 10px 10px;
        border-bottom: 1px solid #eef2f7;
        background: #ffffff;
    }
    .usage-list-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "details price";
        align-items: center;
        gap: 0 10px;
        min-width: 0;
        padding: 10px 12px;
        border-bottom: 1px solid #eef2f7;
        background: #ffffff;
    }
    .category-list-row:last-child,
    .menu-list-row:last-child,
    .layout-list-row:last-child,
    .import-list-row:last-child,
    .usage-list-row:last-child { border-bottom: 0; }
    .category-list-row > td,
    .menu-list-row > td,
    .layout-list-row > td,
    .import-list-row > td,
    .usage-list-row > td {
        display: block !important;
        width: auto;
        min-width: 0;
        padding: 0 !important;
        border: 0;
        background: transparent !important;
        box-shadow: none !important;
    }
    .category-list-icon,
    .menu-list-icon,
    .layout-list-icon,
    .import-list-icon { grid-area: icon; }
    .category-list-details,
    .menu-list-details,
    .layout-list-details,
    .import-list-details,
    .usage-list-details { grid-area: details; overflow: hidden; }
    .usage-list-price { grid-area: price; font-size: 0.84rem; }
    .category-list-row > .category-list-extra,
    .menu-list-row > .menu-list-extra,
    .layout-list-row > .layout-list-extra,
    .import-list-row > .import-list-extra,
    .usage-list-row > .usage-list-extra { display: none !important; }
    .category-list-actions,
    .menu-list-actions,
    .layout-list-actions,
    .import-list-actions {
        grid-area: actions;
        display: flex !important;
        align-items: center;
        justify-content: center !important;
    }
    .category-list-actions .dropdown-menu,
    .menu-list-actions .dropdown-menu,
    .layout-list-actions .dropdown-menu,
    .import-list-actions .dropdown-menu,
    .dish-list-actions .dropdown-menu { display: none !important; }
    .app-action-trigger {
        width: 44px;
        height: 44px;
    }

    .app-row-title {
        overflow: hidden;
        color: #0f172a;
        font-size: 0.88rem;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .app-row-meta {
        display: flex !important;
        min-width: 0;
        align-items: center;
        gap: 5px;
        margin-top: 3px;
        overflow: hidden;
    }
    .app-row-meta .badge,
    .app-row-meta span {
        flex: 0 0 auto;
        overflow: hidden;
        max-width: 46%;
        font-size: 0.68rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .restaurant-list-row,
    #dishesTable tbody tr.dish-table-row {
        padding: 10px 10px;
        border-bottom-color: #eef2f7;
    }

    .app-editor-grid { gap: 10px; }
    #page-content-wrapper main .app-editor .card,
    .app-editor .card { margin-bottom: 0 !important; border-radius: 14px !important; }
    #page-content-wrapper main .app-editor .card-header,
    .app-editor .card-header { padding: 12px 14px 0 !important; }
    #page-content-wrapper main .app-editor .card-body,
    .app-editor .card-body { padding: 12px 14px 14px !important; }
    .app-editor .row { --bs-gutter-x: 10px; --bs-gutter-y: 10px; }
    #page-content-wrapper main .app-editor .mb-3,
    #page-content-wrapper main .app-editor .mb-4,
    .app-editor .mb-3,
    .app-editor .mb-4 { margin-bottom: 12px !important; }
    .app-editor textarea.form-control { min-height: 64px; }

    .app-chip-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .app-chip {
        min-height: 42px;
        padding: 6px 8px;
    }
    .app-chip .form-check-label { font-size: 0.74rem; }

    .app-sticky-actions {
        position: sticky;
        z-index: 20;
        right: 0;
        bottom: 0;
        left: 0;
        margin: 4px -12px 0;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid #e2e8f0;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(10px);
    }
    .app-sticky-actions .btn { min-height: 44px; }

    #priceVariantsTable thead { display: none; }
    #priceVariantsTable tbody { display: block; }
    #priceVariantsTable tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: 8px;
        margin-bottom: 8px;
        padding: 10px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #f8fafc;
    }
    #priceVariantsTable tbody td {
        display: block;
        padding: 0 !important;
        border: 0;
    }
    #priceVariantsTable tbody td:nth-child(1) { grid-column: 1; }
    #priceVariantsTable tbody td:nth-child(2),
    #priceVariantsTable tbody td:nth-child(3) {
        grid-column: 1;
    }
    #priceVariantsTable tbody td:last-child {
        grid-column: 2;
        grid-row: 1 / span 3;
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;
    }
    #priceVariantsTable .form-control,
    #priceVariantsTable .input-group { min-height: 42px; }

    .dish-form-media .form-text,
    .restaurant-form .form-text { display: none; }
}

@media (max-width: 576px) {
    .app-chip-grid { grid-template-columns: 1fr; }
    .restaurant-street-col,
    .restaurant-zip-col,
    .restaurant-city-col,
    .restaurant-country-col,
    .restaurant-phone-col,
    .restaurant-email-col,
    .restaurant-website-col,
    .category-name-col,
    .category-sort-col {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
    .restaurant-street-col { width: 68%; max-width: 68%; flex: 0 0 68%; }
    .restaurant-zip-col { width: 32%; max-width: 32%; flex: 0 0 32%; }
}

/* =============================================================================
   Shared list chrome: sticky toolbar, mobile search/filter, FAB
   ============================================================================= */
.app-header-icon {
    position: relative;
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #334155;
}

.app-header-icon:hover,
.app-header-icon[aria-expanded="true"] {
    background: #f1f5f9;
    color: #0f172a;
}

.app-header-icon-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #0d6efd;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 16px;
}

#page-content-wrapper > header.navbar {
    z-index: 1030;
    min-height: var(--app-header-height);
}

.list-toolbar {
    display: flex;
    min-width: 0;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.list-toolbar-filters {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
}

.list-toolbar-field {
    min-width: 0;
    flex: 1 1 140px;
    margin: 0;
}

.list-toolbar-select,
.list-toolbar-search .form-control {
    min-height: 36px;
    border-radius: 8px;
    font-size: 0.82rem;
}

.list-toolbar-search {
    position: relative;
    display: flex;
    min-width: 180px;
    flex: 0 1 240px;
    margin: 0;
}

.list-toolbar-search .form-control {
    padding-right: 36px;
}

.list-toolbar-search-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #64748b;
}

.list-toolbar-create {
    display: inline-flex;
    min-height: 36px;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 650;
    white-space: nowrap;
}

.list-create-full { display: none; }
.list-create-short { display: inline; }

.list-mobile-search,
.list-filter-sheet-root,
.list-fab { display: none; }

body.is-list-page.has-app-bottom-bar #page-content-wrapper main {
    padding-bottom: 1.5rem !important;
}

@media (min-width: 992px) {
    .list-toolbar {
        position: sticky;
        top: var(--app-header-height);
        z-index: 1020;
    }

    .list-selection-bar.is-selection-active {
        position: sticky;
        top: calc(var(--app-header-height) + 52px);
        z-index: 1015;
    }

    .list-create-short { display: inline; }
    .list-create-full { display: none; }
}

@media (min-width: 1400px) {
    .list-toolbar-field { flex-basis: 180px; }
    .list-toolbar-search { flex-basis: 280px; }
    .list-create-short { display: none; }
    .list-create-full { display: inline; }
}

@media (max-width: 991.98px) {
    .list-toolbar { display: none; }
    .list-mobile-search {
        display: none;
        align-items: center;
        gap: 8px;
        margin: 0 0 10px;
    }
    body.list-search-open .list-mobile-search {
        display: flex;
    }
    .list-mobile-search .form-control {
        min-height: 44px;
    }
    .list-mobile-search .btn {
        width: 44px;
        height: 44px;
        padding: 0;
    }

    .list-filter-sheet-root {
        position: fixed;
        inset: 0;
        z-index: 1085;
        display: none;
    }
    .list-filter-sheet-root.is-open { display: block; }
    .list-filter-sheet-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, 0.42);
    }
    .list-filter-sheet {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        max-height: min(78dvh, 640px);
        flex-direction: column;
        padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
        background: #fff;
        box-shadow: 0 -12px 35px rgba(15, 23, 42, 0.18);
    }
    .list-filter-sheet-grip {
        display: flex;
        height: 12px;
        justify-content: center;
    }
    .list-filter-sheet-grip span {
        width: 34px;
        height: 4px;
        border-radius: 4px;
        background: #cbd5e1;
    }
    .list-filter-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 8px;
    }
    .list-filter-sheet-header h2 {
        margin: 0;
        font-size: 1.05rem;
        font-weight: 750;
    }
    .list-filter-sheet-close {
        width: 40px;
        height: 40px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #fff;
    }
    .list-filter-sheet-form {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .list-filter-sheet-field span {
        display: block;
        margin-bottom: 4px;
        color: #64748b;
        font-size: 0.75rem;
        font-weight: 650;
    }
    .list-filter-sheet-field .form-select { min-height: 44px; }
    .list-filter-sheet-actions {
        display: flex;
        gap: 8px;
        margin-top: 4px;
    }
    .list-filter-sheet-actions .btn {
        min-height: 44px;
        flex: 1 1 50%;
    }
    body.list-filter-open { overflow: hidden; }

    .list-fab {
        position: fixed;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        z-index: 1040;
        display: inline-flex;
        width: 56px;
        height: 56px;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 50%;
        background: #0d6efd;
        color: #fff;
        box-shadow: 0 10px 24px rgba(13, 110, 253, 0.32);
        text-decoration: none;
        font-size: 1.4rem;
    }
    body.list-selection-active .list-fab,
    body.dish-selection-active .list-fab,
    body.list-filter-open .list-fab,
    body.mobile-action-sheet-open .list-fab { display: none; }

    body.is-list-page #page-content-wrapper main {
        padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
    }

    body.is-list-page .table-responsive {
        overflow: visible;
    }

    body.list-selection-active.is-list-page #page-content-wrapper main,
    body.dish-selection-active.is-list-page #page-content-wrapper main {
        padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
    }

    .list-selection-bar.is-selection-active {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1065;
        min-height: 56px;
        margin: 0;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
        border: 0;
        border-top: 1px solid #dbeafe;
        border-radius: 0;
        background: #fff;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
    }

    .list-selection-actions .btn { min-height: 40px; }

    #page-content-wrapper > header.navbar {
        padding-right: 12px !important;
        padding-left: 12px !important;
    }
    #page-content-wrapper > header .dropdown-toggle::after { display: none; }
    #page-content-wrapper > header .avatar-circle {
        width: 32px;
        height: 32px;
        margin-right: 0 !important;
        font-size: 0.78rem;
    }

    #dishesTable tbody tr.dish-table-row {
        grid-template-columns: 44px minmax(0, 1fr) auto 36px;
        grid-template-rows: auto auto;
        grid-template-areas: "image title price actions" "image meta price actions";
        gap: 2px 10px;
        padding: 10px 8px 10px 12px;
    }
    #dishesTable tbody td:nth-child(1) { display: none !important; }
    #dishesTable tbody td:nth-child(9) {
        display: flex !important;
        grid-area: actions;
        align-items: center;
        justify-content: center;
    }
    body.dish-selection-active #dishesTable tbody tr.dish-table-row {
        grid-template-columns: 28px 44px minmax(0, 1fr) auto 36px;
        grid-template-areas: "controls image title price actions" "controls image meta price actions";
    }
    body.dish-selection-active #dishesTable tbody td:nth-child(1) {
        display: flex !important;
        grid-area: controls;
        align-items: center;
    }
    body.dish-selection-active #dishesTable .drag-handle { display: none; }
    #dishesTable tbody td:nth-child(3) { grid-area: image; grid-row: auto; align-items: center; }
    #dishesTable .dish-mobile-title { font-size: 0.88rem; }
    #dishesTable .dish-mobile-title .badge { display: none; }
    #dishesTable .dish-mobile-description { display: none; }
    #dishesTable tbody td:nth-child(7) { grid-area: price; align-self: center; font-size: 0.88rem; }
    #dishesTable .dish-mobile-meta {
        display: flex !important;
        max-height: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
        overflow: hidden;
    }
    #dishesTable .dish-mobile-restaurant,
    #dishesTable .dish-mobile-facts {
        max-width: 100%;
        overflow: hidden;
        color: #64748b;
        font-size: 0.72rem;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    #dishesTable .dish-list-actions .app-action-trigger {
        width: 36px;
        height: 36px;
    }
}

