/* ============================================
   style.css — The Palm & Anchor RMS
   Colonial Beach Aesthetic — Full Overhaul
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    --sand:         #F5F0E8;
    --sand-mid:     #EAE3D1;
    --sand-dark:    #D5C9AE;
    --wood:         #3D2B1A;
    --wood-mid:     #5C3D24;
    --wood-light:   #8B5E3C;
    --ocean:        #1B6B67;
    --ocean-mid:    #2B8C87;
    --ocean-light:  #3AAFA9;
    --ocean-pale:   #E8F4F4;
    --cream:        #FFFDF7;
    --white:        #FFFFFF;
    --text:         #2A2118;
    --text-mid:     #5A4A38;
    --text-muted:   #8A7A6A;
    --green:        #2E7D52;
    --green-light:  #E8F5EE;
    --red:          #C0392B;
    --red-light:    #FDECEA;
    --amber:        #D4850A;
    --amber-light:  #FDF3E3;

    --glass:        rgba(255,253,247,0.82);
    --glass-dark:   rgba(247,242,232,0.92);
    --glass-border: rgba(255,255,255,0.6);

    --shadow-xs:    0 1px 3px rgba(61,43,26,0.08);
    --shadow-sm:    0 2px 8px rgba(61,43,26,0.10);
    --shadow-md:    0 4px 16px rgba(61,43,26,0.13);
    --shadow-lg:    0 8px 32px rgba(61,43,26,0.18);
    --shadow-xl:    0 16px 48px rgba(61,43,26,0.22);

    --radius-xs:    4px;
    --radius-sm:    8px;
    --radius-md:    12px;
    --radius-lg:    18px;
    --radius-xl:    24px;
    --radius-full:  9999px;

    --font-head:    'Playfair Display', Georgia, serif;
    --font-body:    'Inter', system-ui, sans-serif;

    --ease:         cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast:       0.15s;
    --t-normal:     0.25s;
    --t-slow:       0.4s;

    --header-h:     68px;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: var(--font-body);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(27,107,103,0.15) 0%, transparent 50%),
        url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=1920&q=80&auto=format&fit=crop')
        no-repeat center center fixed;
    background-size: cover;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity:0; transform:translateY(14px); }
    to   { opacity:1; transform:translateY(0); }
}
@keyframes slideInRight {
    from { opacity:0; transform:translateX(20px); }
    to   { opacity:1; transform:translateX(0); }
}
@keyframes pulseRed {
    0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.4), var(--shadow-md); }
    50%     { box-shadow: 0 0 0 10px rgba(192,57,43,0), var(--shadow-md); }
}
@keyframes liveDot {
    0%,100% { opacity:1; }
    50%     { opacity:0.3; }
}
@keyframes toastIn {
    from { opacity:0; transform:translateY(20px) translateX(-50%); }
    to   { opacity:1; transform:translateY(0) translateX(-50%); }
}

/* ===== HEADER ===== */
.top-nav {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.8rem;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    z-index: 100;
    flex-shrink: 0;
}

.logo { display:flex; align-items:center; gap:0.8rem; }
.logo-icon { font-size:1.8rem; line-height:1; }
.logo h1 {
    font-family: var(--font-head);
    font-size: 1.5rem;
    color: var(--wood);
    line-height: 1.1;
    font-style: italic;
}
.logo .subtitle {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--green-light);
    color: var(--green);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(46,125,82,0.2);
}
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: liveDot 1.5s infinite;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative; /* anchor for dropdown */
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--sand-mid);
    padding: 0.4rem 0.9rem 0.4rem 0.4rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    user-select: none;
    border: 1.5px solid transparent;
}
.user-profile:hover { background: var(--sand-dark); }
.user-profile.open {
    background: var(--ocean-pale);
    border-color: var(--ocean-light);
    color: var(--ocean);
}
.user-profile.open .user-avatar { background: var(--ocean-mid); }

.profile-caret {
    font-size: 0.7rem;
    transition: transform var(--t-normal) var(--ease);
    color: var(--text-muted);
}
.user-profile.open .profile-caret { transform: rotate(180deg); }

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ocean);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    transition: background var(--t-fast);
}

/* ===== PROFILE DROPDOWN ===== */
.profile-dropdown {
    /* JS sets top/right dynamically via getBoundingClientRect */
    position: fixed;
    width: 320px;
    background: rgba(255, 253, 247, 0.98);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.6) inset;
    overflow: hidden;
    z-index: 9999;
    /* Hidden by default */
    display: none;
    transform-origin: top right;
}
.profile-dropdown.open {
    display: block;
    animation: dropdownIn 0.22s var(--ease-spring) both;
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}


/* Profile Card Header */
.profile-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.4rem 1.4rem 1.2rem;
    background: linear-gradient(135deg, var(--ocean) 0%, var(--ocean-mid) 100%);
    position: relative;
    overflow: hidden;
}
.profile-card-header::before {
    content: '';
    position: absolute;
    right: -20px; top: -20px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.profile-card-header::after {
    content: '';
    position: absolute;
    right: 30px; bottom: -30px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.profile-avatar-lg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-head);
    flex-shrink: 0;
}

.profile-card-info { flex: 1; }
.profile-name {
    font-family: var(--font-head);
    font-size: 1.1rem;
    color: white;
    font-style: italic;
    margin-bottom: 4px;
}
.profile-role-badge {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.75);
    background: rgba(255,255,255,0.15);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255,255,255,0.25);
}

/* Detail Rows */
.profile-details {
    padding: 1rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    border-bottom: 1px solid rgba(213,201,174,0.4);
}
.profile-detail-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.8rem;
    color: var(--text-mid);
}
.detail-icon {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Stats */
.profile-stats {
    display: flex;
    align-items: center;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid rgba(213,201,174,0.4);
    gap: 0;
}
.profile-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ocean);
    font-family: var(--font-head);
}
.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}
.profile-stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(213,201,174,0.5);
}

/* Action Buttons */
.profile-actions {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.profile-action-btn {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-mid);
    cursor: pointer;
    text-align: left;
    transition: all var(--t-fast) var(--ease);
    display: flex;
    align-items: center;
}
.profile-action-btn:hover {
    background: var(--sand-mid);
    color: var(--wood);
}
.profile-action-btn.danger { color: var(--red); }
.profile-action-btn.danger:hover {
    background: var(--red-light);
    color: var(--red);
}


/* ===== WORKSPACE ===== */
.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== MENU SIDEBAR ===== */
.menu-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--glass-dark);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-right: 1px solid var(--glass-border);
    box-shadow: 4px 0 20px rgba(61,43,26,0.06);
}

.sidebar-header {
    padding: 1.4rem 1.4rem 0.5rem;
}
.sidebar-header .section-title {
    font-family: var(--font-head);
    font-size: 1.4rem;
    color: var(--wood);
    margin-bottom: 2px;
    font-style: italic;
}
.sidebar-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

/* Filter Tabs */
.menu-filters {
    display: flex;
    gap: 0.4rem;
    padding: 0 1.4rem 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.menu-filters::-webkit-scrollbar { display:none; }

.filter-btn {
    flex-shrink: 0;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--sand-dark);
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.78rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text-mid);
    transition: all var(--t-fast) var(--ease);
    white-space: nowrap;
}
.filter-btn:hover {
    background: var(--ocean-pale);
    border-color: var(--ocean-light);
    color: var(--ocean);
}
.filter-btn.active {
    background: var(--ocean);
    border-color: var(--ocean);
    color: white;
    box-shadow: 0 2px 8px rgba(27,107,103,0.35);
}

/* Menu Items */
.menu-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem 1.4rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* === MENU ITEM CARD === */
.menu-item-card {
    background: var(--white);
    border: 1px solid rgba(213,201,174,0.6);
    border-radius: var(--radius-md);
    padding: 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: grab;
    user-select: none;
    transition: all var(--t-normal) var(--ease);
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
    animation: fadeInUp var(--t-slow) var(--ease) both;
    /* Fixed height so all cards are uniform */
    height: 76px;
    flex-shrink: 0;
}
.menu-item-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--ocean);
    opacity: 0;
    transition: opacity var(--t-fast) var(--ease);
}
.menu-item-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-md);
    border-color: var(--ocean-light);
}
.menu-item-card:hover::before { opacity: 1; }
.menu-item-card:active { cursor: grabbing; transform: scale(0.98); }
.menu-item-card.dragging { opacity: 0.4; transform: scale(0.97); }

.menu-item-img {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
    background: var(--sand);
}

.menu-item-body { flex: 1; min-width: 0; }
.menu-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.menu-item-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-item-right { display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex-shrink:0; }
.menu-item-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ocean);
}
.drag-hint {
    font-size: 1rem;
    color: var(--sand-dark);
    letter-spacing: -2px;
    transition: color var(--t-fast);
}
.menu-item-card:hover .drag-hint { color: var(--ocean-light); }

/* ===== FLOOR PLAN ===== */
.floor-plan {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.4rem;
    min-width: 0;
    background: rgba(245,240,232,0.25);
}

.floor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.2rem;
}
.floor-header .section-title {
    font-family: var(--font-head);
    font-size: 1.4rem;
    color: var(--wood);
    font-style: italic;
}

.legend {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var(--glass);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}
.indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-mid);
}
.indicator::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.indicator.available::before { background: var(--green); }
.indicator.occupied::before  { background: var(--red); }

/* TABLE MAP — CSS Grid, fixed rows so nothing overflows */
.table-map {
    flex: 1;
    background: var(--glass);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.8);
    padding: 1.2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 1rem;
    overflow: hidden;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(27,107,103,0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(61,43,26,0.04) 0%, transparent 50%),
        radial-gradient(rgba(61,43,26,0.06) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 28px 28px;
}

/* Each grid cell wrapper — constrains its table child strictly */
.table-cell {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
}
/* Round table cells: force square so the circle is even */
.table-cell-round {
    aspect-ratio: 1;
    max-height: 100%;
    max-width: 100%;
    width: auto;
}

/* === RESTAURANT TABLE CARD === */
.restaurant-table {
    background: var(--white);
    border: 2px solid rgba(139,94,60,0.3);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: all var(--t-normal) var(--ease-spring);
    box-shadow: var(--shadow-sm);
    padding: 0.8rem 0.5rem;
    position: relative;
    /* Fill the cell wrapper completely */
    width: 100%;
    height: 100%;
    overflow: hidden;
    animation: fadeInUp 0.5s var(--ease) both;
}
.restaurant-table::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.5) 0%, transparent 60%);
    pointer-events: none;
}

/* Round tables: just apply border-radius — the cell handles the square sizing */
.restaurant-table.round {
    border-radius: 50%;
    padding: 0.5rem;
}

/* VIP Booth gold tint */
.restaurant-table.vip {
    border-color: rgba(212,133,10,0.5);
    background: linear-gradient(135deg, #FFFBF2 0%, #FFF3D4 100%);
}

.restaurant-table:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--shadow-lg);
    border-color: var(--ocean-mid);
    z-index: 10;
}
.restaurant-table.drag-over {
    border-color: var(--ocean) !important;
    background: var(--ocean-pale) !important;
    transform: scale(1.06) !important;
    box-shadow: 0 0 0 3px rgba(27,107,103,0.3), var(--shadow-lg) !important;
}
.restaurant-table.occupied {
    animation: pulseRed 2.5s ease-in-out infinite;
    border-color: rgba(192,57,43,0.5);
}
.restaurant-table.occupied:hover {
    animation: none;
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--shadow-lg);
}
.restaurant-table.selected {
    border-color: var(--ocean) !important;
    box-shadow: 0 0 0 3px rgba(27,107,103,0.25), var(--shadow-lg) !important;
    animation: none !important;
}

/* Table Number */
.table-icon {
    font-size: 1.3rem;
    line-height: 1;
}
.table-name {
    font-family: var(--font-head);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--wood);
    text-align: center;
    line-height: 1.2;
}
.table-seats {
    font-size: 0.62rem;
    color: var(--text-muted);
}
/* Smaller text inside circles */
.restaurant-table.round .table-icon { font-size: 1.1rem; }
.restaurant-table.round .table-name { font-size: 0.78rem; }
.restaurant-table.round .table-seats { font-size: 0.58rem; }
.table-status {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.1rem;
}
.table-status.available {
    background: var(--green-light);
    color: var(--green);
}
.table-status.occupied-status {
    background: var(--red-light);
    color: var(--red);
}
.table-item-count {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--ocean);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

/* ===== ORDER PANEL ===== */
.order-panel {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--glass-dark);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-left: 1px solid var(--glass-border);
    box-shadow: -4px 0 20px rgba(61,43,26,0.06);
    overflow: hidden;
}

/* Empty State */
.panel-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
    gap: 0.75rem;
}
.empty-illustration {
    font-size: 3.5rem;
    opacity: 0.4;
    filter: grayscale(40%);
}
.panel-empty-state h3 {
    font-family: var(--font-head);
    font-size: 1.2rem;
    color: var(--wood-mid);
    font-style: italic;
}
.panel-empty-state p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 240px;
}
.tip-box {
    background: var(--amber-light);
    border: 1px solid rgba(212,133,10,0.2);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-size: 0.78rem;
    color: var(--amber);
    line-height: 1.5;
    margin-top: 0.5rem;
}

/* Active Panel */
.panel-active-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideInRight var(--t-slow) var(--ease) both;
}

.panel-header {
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid rgba(213,201,174,0.4);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: rgba(255,255,255,0.4);
}
.panel-table-title {
    font-family: var(--font-head);
    font-size: 1.35rem;
    color: var(--wood);
    font-style: italic;
}
.panel-table-guests {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.btn-close {
    background: rgba(213,201,174,0.4);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-mid);
    transition: all var(--t-fast) var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.btn-close:hover { background: var(--red-light); color: var(--red); }

.panel-drop-hint {
    margin: 0.75rem 1rem;
    padding: 0.6rem 1rem;
    border: 1.5px dashed var(--sand-dark);
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    color: var(--text-muted);
    text-align: center;
    transition: all var(--t-fast);
}
.panel-drop-hint.active-drop {
    border-color: var(--ocean);
    background: var(--ocean-pale);
    color: var(--ocean);
}

/* Order List */
.order-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.7rem;
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(213,201,174,0.4);
    box-shadow: var(--shadow-xs);
    animation: fadeInUp var(--t-normal) var(--ease) both;
    transition: all var(--t-fast) var(--ease);
}
.order-item:hover { box-shadow: var(--shadow-sm); }

.order-item-img {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    flex-shrink: 0;
}
.order-item-info { flex: 1; min-width: 0; }
.order-item-info h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1px;
}
.order-item-price { font-size: 0.76rem; color: var(--ocean); font-weight: 600; }

.btn-remove-item {
    background: none;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: all var(--t-fast) var(--ease);
    flex-shrink: 0;
}
.btn-remove-item:hover { background: var(--red-light); color: var(--red); }

.empty-order {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 1.5rem 0;
    font-style: italic;
}

/* Order Summary */
.order-summary {
    padding: 1rem 1.4rem 1.2rem;
    background: rgba(255,255,255,0.5);
    border-top: 1px solid rgba(213,201,174,0.4);
    flex-shrink: 0;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    font-size: 0.88rem;
    color: var(--text-mid);
}
.input-row label { color: var(--text-muted); font-size: 0.82rem; }
.summary-value { font-weight: 500; color: var(--text); }
.summary-divider {
    height: 1px;
    background: var(--sand-dark);
    margin: 0.75rem 0;
}
.total-row {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--wood);
    margin-bottom: 1rem;
}
.total-value { font-size: 1.2rem; color: var(--ocean); }

.num-input {
    width: 72px;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--sand-dark);
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-size: 0.88rem;
    text-align: right;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border var(--t-fast);
}
.num-input:focus { border-color: var(--ocean); box-shadow: 0 0 0 2px rgba(27,107,103,0.15); }

.panel-actions { display:flex; flex-direction:column; gap:0.6rem; }

/* Buttons */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    padding: 0.65rem 1.2rem;
    letter-spacing: 0.2px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--ocean) 0%, var(--ocean-mid) 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(27,107,103,0.4);
    width: 100%;
    padding: 0.85rem;
    font-size: 0.9rem;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--ocean-mid) 0%, var(--ocean-light) 100%);
    box-shadow: 0 5px 16px rgba(27,107,103,0.5);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-danger {
    background: transparent;
    border: 1.5px solid rgba(192,57,43,0.35);
    color: var(--red);
    width: 100%;
    padding: 0.7rem;
    font-size: 0.85rem;
}
.btn-danger:hover {
    background: var(--red-light);
    border-color: var(--red);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid rgba(61,43,26,0.3);
    color: var(--wood-mid);
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
}
.btn-outline:hover {
    background: var(--sand-mid);
    border-color: var(--wood-mid);
}

/* Scrollbars */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sand-dark); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--wood-light); }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--wood);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    transition: all 0.3s var(--ease);
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =============================================
   SETTINGS MODAL
   ============================================= */
.modal-overlay {
    /* display:none ensures it is fully hidden — no layout, no paint, no events */
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 10, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 8000;
    align-items: center;
    justify-content: center;
    /* Fade in animation when opened */
    animation: modalFadeIn 0.25s var(--ease) both;
}
.modal-overlay.open {
    display: flex;
}
@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.settings-modal {
    width: min(800px, 95vw);
    max-height: 88vh;
    background: var(--cream);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.5) inset;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp 0.3s var(--ease-spring) both;
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(28px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 1.6rem;
    background: linear-gradient(135deg, var(--wood) 0%, var(--wood-mid) 100%);
    flex-shrink: 0;
}
.settings-header-left { display: flex; align-items: center; gap: 1rem; }
.settings-icon {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    border: 1px solid rgba(255,255,255,0.2);
}
.settings-title { font-family: var(--font-head); font-size: 1.3rem; color: white; font-style: italic; margin-bottom: 2px; }
.settings-subtitle { font-size: 0.78rem; color: rgba(255,255,255,0.65); }
.settings-close-btn {
    width: 34px; height: 34px; border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white; font-size: 1.4rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--t-fast) var(--ease); line-height: 1;
}
.settings-close-btn:hover { background: rgba(255,255,255,0.25); }

.settings-tabs {
    display: flex;
    padding: 0 1.6rem;
    border-bottom: 1px solid var(--sand-dark);
    background: var(--sand);
    flex-shrink: 0;
    gap: 0.25rem;
}
.settings-tab {
    background: none; border: none;
    padding: 0.9rem 1.2rem;
    font-family: var(--font-body); font-size: 0.88rem; font-weight: 500;
    color: var(--text-muted); cursor: pointer;
    border-bottom: 2.5px solid transparent; margin-bottom: -1px;
    transition: all var(--t-fast) var(--ease); white-space: nowrap;
}
.settings-tab:hover { color: var(--wood-mid); }
.settings-tab.active { color: var(--ocean); border-bottom-color: var(--ocean); font-weight: 600; }

.settings-body { flex: 1; overflow-y: auto; padding: 1.4rem 1.6rem 2rem; }

.settings-card {
    background: white;
    border: 1px solid rgba(213,201,174,0.5);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}
.settings-card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.2rem;
    background: var(--sand);
    border-bottom: 1px solid rgba(213,201,174,0.5);
}
.settings-card-header h3 { font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; color: var(--wood-mid); }
.settings-card-hint { font-size: 0.76rem; color: var(--text-muted); }

.add-dish-form { padding: 1.2rem; display: flex; flex-direction: column; gap: 0.75rem; }
.form-row { display: flex; gap: 0.75rem; }
.form-group { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; }
.form-label { font-size: 0.78rem; font-weight: 600; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
    width: 100%; padding: 0.6rem 0.8rem;
    border: 1.5px solid var(--sand-dark); border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 0.88rem; color: var(--text);
    background: white; outline: none;
    transition: border var(--t-fast), box-shadow var(--t-fast);
}
.form-input:focus { border-color: var(--ocean); box-shadow: 0 0 0 3px rgba(27,107,103,0.12); }
.form-input::placeholder { color: var(--text-muted); }
.form-select { cursor: pointer; }
.form-actions { display: flex; gap: 0.75rem; align-items: center; padding-top: 0.25rem; }

.search-box {
    display: flex; align-items: center; gap: 0.4rem;
    background: white; border: 1.5px solid var(--sand-dark);
    border-radius: var(--radius-full); padding: 0.3rem 0.8rem;
}
.search-input {
    border: none; outline: none;
    font-family: var(--font-body); font-size: 0.82rem; color: var(--text);
    background: transparent; width: 160px;
}
.search-input::placeholder { color: var(--text-muted); }

/* Dish rows */
.dish-list { max-height: 300px; overflow-y: auto; }
.dish-row {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.7rem 1.2rem;
    border-bottom: 1px solid rgba(213,201,174,0.3);
    transition: background var(--t-fast);
    animation: fadeInUp 0.3s var(--ease) both;
}
.dish-row:last-child { border-bottom: none; }
.dish-row:hover { background: var(--sand); }
.dish-row.hidden-dish { opacity: 0.4; }
.dish-row-img { width: 42px; height: 42px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; background: var(--sand); }
.dish-row-info { flex: 1; min-width: 0; }
.dish-row-name { font-size: 0.86rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dish-row-meta { font-size: 0.71rem; color: var(--text-muted); margin-top: 1px; }
.dish-row-price { font-size: 0.9rem; font-weight: 700; color: var(--ocean); flex-shrink: 0; min-width: 50px; text-align: right; }
.dish-row-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.dish-category-badge {
    font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
    padding: 0.18rem 0.5rem; border-radius: var(--radius-full);
    background: var(--ocean-pale); color: var(--ocean); flex-shrink: 0;
}

/* Toggle Switch */
.toggle-wrap { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.toggle-cb { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider {
    display: block; width: 40px; height: 22px;
    background: var(--sand-dark); border-radius: 11px;
    position: relative; transition: background var(--t-normal) var(--ease);
}
.toggle-slider::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: white; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform var(--t-normal) var(--ease-spring);
}
.toggle-cb:checked + .toggle-slider { background: var(--ocean); }
.toggle-cb:checked + .toggle-slider::after { transform: translateX(18px); }

/* Category rows */
.category-list { padding: 0.75rem 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.category-row {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.8rem 1rem;
    background: var(--sand); border-radius: var(--radius-md);
    border: 1.5px solid rgba(213,201,174,0.4);
    transition: all var(--t-fast) var(--ease);
    animation: fadeInUp 0.3s var(--ease) both;
}
.category-row:hover { border-color: var(--ocean-light); background: var(--ocean-pale); }
.category-row.hidden-cat { opacity: 0.4; }
.category-icon-box {
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    background: white; border: 1px solid rgba(213,201,174,0.6);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.category-row-info { flex: 1; }
.category-row-name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.category-row-count { font-size: 0.72rem; color: var(--text-muted); }

/* Operating hours */
.hours-grid { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 0.75rem; }
.hours-row { display: flex; align-items: center; gap: 0.75rem; }
.day-label { font-size: 0.84rem; font-weight: 500; color: var(--text-mid); min-width: 130px; }
.time-input { width: 120px !important; padding: 0.5rem 0.65rem !important; font-size: 0.84rem !important; }
.time-sep { font-size: 0.78rem; color: var(--text-muted); }

/* Small icon delete button */
.btn-icon-danger {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid rgba(192,57,43,0.25); background: transparent;
    color: var(--red); font-size: 0.75rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--t-fast) var(--ease); flex-shrink: 0;
}
.btn-icon-danger:hover { background: var(--red-light); border-color: var(--red); }
