/* ponytail: BBadr.ttf is Vazirmatn (SIL OFL) renamed to satisfy the original
   'BBadr' reference; upgrade path: rename the family + file properly. */
@font-face {
    font-family: 'BBadr';
    src: url('/static/BBadr.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
/* ================================================================
   RIRA CAFE — PROFESSIONAL DESIGN SYSTEM v2
   ================================================================ */

/* --- Google Font --- */

/* --- Design Tokens --- */
:root {
    /* === RIRA CAFE BRAND PALETTE === */
    /* Brand: Espresso → Amber → Terracotta */
    --brand-50: #FFF8F0;
    --brand-100: #FEECD4;
    --brand-200: #FDD9A8;
    --brand-300: #FBC072;
    --brand-400: #F9A825;
    --brand-500: #F57F17;
    --brand-600: #E65100;
    --brand-700: #BF360C;
    --brand-800: #8B2500;
    --brand-900: #4E1A00;

    /* Brown: Coffee tones */
    --brown-50: #FAF6F3;
    --brown-100: #F0E8E1;
    --brown-200: #DFD0C4;
    --brown-300: #C4A88C;
    --brown-400: #A18060;
    --brown-500: #7D5A3C;
    --brown-600: #5D3D22;
    --brown-700: #3E2510;
    --brown-800: #2A1A0B;
    --brown-900: #1A0F06;

    /* Semantic */
    --success: #28A745;
    --success-light: #4CAF50;
    --danger: #B71C1C;
    --danger-light: #E53935;
    --info: #1976D2;
    --info-light: #42A5F5;
    --warning: #F57F17;
    --warning-light: #F9A825;

    /* Surface: warm whites */
    --bg: #FAF6F3;
    --bg-alt: #F0E8E1;
    --surface: #FFFFFF;
    --surface-hover: #FDFBF9;
    --border: #E8DDD2;
    --border-light: #F0E8E1;

    /* Text */
    --text-primary: #2A1A0B;
    --text-secondary: #5D3D22;
    --text-muted: #A18060;
    --text-inverse: #FFFFFF;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(42,26,11,0.05);
    --shadow-sm: 0 1px 3px rgba(42,26,11,0.08), 0 1px 2px rgba(42,26,11,0.04);
    --shadow-md: 0 4px 6px -1px rgba(42,26,11,0.08), 0 2px 4px -2px rgba(42,26,11,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(42,26,11,0.08), 0 4px 6px -4px rgba(42,26,11,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(42,26,11,0.1), 0 8px 10px -6px rgba(42,26,11,0.06);
    --shadow-2xl: 0 25px 50px -12px rgba(42,26,11,0.2);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Motion */
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'BBadr', 'Lalezar', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Subtle background texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(245,127,23,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(42,26,11,0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(249,168,37,0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body > * { position: relative; z-index: 1; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

/* --- Links --- */
a { color: var(--brand-800); text-decoration: none; transition: color var(--duration-fast) ease; }
a:hover { color: var(--brand-600); }

/* --- Header --- */
header {
    background: linear-gradient(135deg, var(--brown-800) 0%, var(--brown-700) 40%, var(--brown-600) 100%);
    color: var(--text-inverse);
    padding: 0 1.75rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 24px rgba(62,39,35,0.25);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,193,7,0.3), transparent);
}

header h1 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-inverse);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

header .back {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--duration-fast) ease;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
}
header .back:hover { color: white; background: rgba(255,255,255,0.1); }

header .logout {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    backdrop-filter: blur(4px);
}
header .logout:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.2);
    color: white;
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* --- Cards --- */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    border: 1px solid var(--border-light);
    transition: all var(--duration-normal) var(--ease-out);
}
.card:hover {
    box-shadow: var(--shadow-md);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    min-height: 44px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.2px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 100%);
    pointer-events: none;
    border-radius: inherit;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none; }
.btn:active::after { display: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--brand-800) 0%, var(--brand-700) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255,143,0,0.25);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(255,143,0,0.35); }

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #1B5E20 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(46,125,50,0.25);
}
.btn-success:hover { box-shadow: 0 6px 20px rgba(46,125,50,0.35); }

.btn-blue {
    background: linear-gradient(135deg, var(--info) 0%, #0D47A1 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(21,101,192,0.25);
}

.btn-gray {
    background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-light) 0%, var(--danger) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(229,57,53,0.25);
}

.btn-danger-outline {
    background: transparent;
    color: var(--danger-light);
    border: 2px solid var(--danger-light);
}
.btn-danger-outline:hover {
    background: var(--danger-light);
    color: white;
}

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; min-height: 36px; border-radius: var(--radius-sm); }

.btn-lg { padding: 0.8rem 1.8rem; font-size: 1rem; min-height: 52px; border-radius: var(--radius-md); }

/* --- Status Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-pending { background: #FFF8E1; color: #E65100; border: 1px solid #FFE0B2; }
.badge-in_progress { background: #E3F2FD; color: #1565C0; border: 1px solid #BBDEFB; }
.badge-ready { background: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }
.badge-paid { background: #F5F5F5; color: #616161; border: 1px solid #E0E0E0; }
.badge-awaiting_verification {
    background: #FFF3E0; color: #E65100; border: 1px solid #FFE0B2;
    animation: badgePulse 2s ease-in-out infinite;
}
.badge-payment_rejected { background: #FFEBEE; color: #C62828; border: 1px solid #FFCDD2; }

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,152,0,0.3); }
    50% { box-shadow: 0 0 0 6px rgba(255,152,0,0); }
}

/* --- Order Cards --- */
.order-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--brand-700);
    transition: all var(--duration-normal) var(--ease-out);
    animation: cardEnter var(--duration-slow) var(--ease-out) backwards;
}
.order-card:nth-child(1) { animation-delay: 0ms; }
.order-card:nth-child(2) { animation-delay: 40ms; }
.order-card:nth-child(3) { animation-delay: 80ms; }
.order-card:nth-child(4) { animation-delay: 120ms; }
.order-card:nth-child(5) { animation-delay: 160ms; }
.order-card:nth-child(6) { animation-delay: 200ms; }
.order-card:nth-child(7) { animation-delay: 240ms; }
.order-card:nth-child(8) { animation-delay: 280ms; }

.order-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.order-table {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.order-items { margin: 0.5rem 0; }
.order-items li {
    padding: 0.4rem 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-light);
}
.order-items li:last-child { border-bottom: none; }

.order-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.order-total {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--brown-700);
    margin-top: 0.5rem;
}

/* --- Forms --- */
input, select, textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--text-primary);
    transition: all var(--duration-fast) ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-700);
    box-shadow: 0 0 0 3px rgba(255,143,0,0.1);
}

label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-group { margin-bottom: 1rem; }

/* --- Menu Grid --- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.menu-item {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    user-select: none;
    position: relative;
}
.menu-item:hover {
    border-color: var(--brand-600);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.menu-item:active { transform: scale(0.97); }
.menu-item.selected {
    border-color: var(--brand-700);
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    box-shadow: 0 0 0 3px rgba(255,143,0,0.12), var(--shadow-md);
}

.menu-item .name {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}
.menu-item .price {
    color: var(--brand-800);
    font-weight: 600;
    font-size: 0.85rem;
}

/* --- Category Headers --- */
.category-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brown-700);
    margin: 1.5rem 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}
.category-title::before {
    content: '';
    width: 4px;
    height: 1.2em;
    background: linear-gradient(180deg, var(--brand-700), var(--brand-500));
    border-radius: 2px;
    flex-shrink: 0;
}

/* --- Stats Row --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all var(--duration-normal) var(--ease-out);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    animation: cardEnter var(--duration-slow) var(--ease-out) backwards;
}
.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 60ms; }
.stat-card:nth-child(3) { animation-delay: 120ms; }
.stat-card:nth-child(4) { animation-delay: 180ms; }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-800), var(--brand-500));
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--brown-700) 0%, var(--brand-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-card .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all var(--duration-fast) ease;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
    color: var(--brand-800);
    border-bottom-color: var(--brand-800);
    font-weight: 700;
}

/* --- Tab Views --- */
[id$="View"] {
    animation: fadeSlideUp 0.3s var(--ease-out);
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Tables Grid --- */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.table-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.1rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all var(--duration-normal) var(--ease-out);
    border: 1.5px solid var(--border);
    cursor: pointer;
}
.table-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-400);
}
.table-card:active { transform: scale(0.97); }

.table-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--brown-700);
}
.table-status {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}
.table-orders {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* --- Landing Page --- */
.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255,143,0,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(93,64,55,0.05) 0%, transparent 50%),
        var(--bg);
}

.landing-logo {
    width: 120px;
    height: 120px;
    border-radius: 30%;
    object-fit: cover;
    border: 4px solid var(--brand-700);
    box-shadow: 0 8px 32px rgba(255,143,0,0.2);
    margin-bottom: 1.5rem;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.landing h1 {
    font-size: 2.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--brown-700) 0%, var(--brand-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
    letter-spacing: -0.5px;
}

.landing .tagline {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    max-width: 550px;
    width: 100%;
}

.role-btn {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--duration-normal) var(--ease-out);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.role-btn:hover {
    border-color: var(--brand-600);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.role-btn:active { transform: scale(0.97); }

.role-btn .icon { font-size: 2rem; }
.role-btn .label { font-weight: 700; font-size: 0.9rem; }

/* --- PIN Modal --- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(45,27,14,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn var(--duration-fast) ease;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 92%;
    max-width: 360px;
    text-align: center;
    box-shadow: var(--shadow-2xl);
    animation: modalEnter var(--duration-slow) var(--ease-spring);
}
.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--brown-800);
    font-weight: 800;
    font-size: 1.3rem;
}

.pin-input-group { margin-bottom: 1.2rem; }
.pin-input-group input {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--brown-50);
    font-family: inherit;
    font-weight: 700;
    transition: all var(--duration-fast) ease;
}
.pin-input-group input:focus {
    border-color: var(--brand-700);
    box-shadow: 0 0 0 4px rgba(255,143,0,0.1);
    background: white;
}

.pin-error { color: var(--danger-light); font-size: 0.9rem; margin-bottom: 1rem; font-weight: 500; }
.pin-actions { display: flex; gap: 0.75rem; justify-content: center; }
.pin-actions .btn { flex: 1; }

/* --- Menu Price Editor --- */
.menu-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
    transition: all var(--duration-fast) ease;
}
.menu-price-row:hover { box-shadow: var(--shadow-sm); border-color: var(--border); }

.menu-price-name {
    font-weight: 500;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 1rem;
    font-size: 0.9rem;
}

.menu-price-input { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.menu-price-input input {
    width: 85px;
    padding: 0.4rem 0.6rem;
    text-align: right;
    font-weight: 600;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}
.menu-price-input input:focus { border-color: var(--brand-700); box-shadow: 0 0 0 3px rgba(255,143,0,0.1); }

.currency-label { color: var(--text-muted); font-weight: 500; font-size: 0.85rem; }

/* --- Quantity Controls --- */
.qty-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.qty-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--brand-700);
    background: white;
    color: var(--brand-700);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-out);
    line-height: 1;
    padding: 0;
}
.qty-btn:hover { background: var(--brand-700); color: white; transform: scale(1.08); }
.qty-btn:active { transform: scale(0.9); }

.qty-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-800);
    min-width: 28px;
    text-align: center;
}

/* --- Subcategory Title --- */
.subcategory-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0.75rem 0 0.4rem;
    padding: 0.35rem 0.75rem;
    border-left: 3px solid var(--brand-600);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: rgba(255,143,0,0.04);
}

/* --- Syrup Chips --- */
.syrup-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.9rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}
.syrup-chip input { display: none; }
.syrup-chip:hover { border-color: var(--brand-600); transform: translateY(-1px); }
.syrup-chip.selected {
    border-color: var(--brand-700);
    background: linear-gradient(135deg, #FFF8E1, #FFECB3);
    color: var(--brand-800);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255,143,0,0.15);
}

/* --- Toast Notifications --- */
.toast-notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    max-width: 360px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border-left: 5px solid var(--brand-700);
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    z-index: 10000;
    animation: toastIn var(--duration-slow) var(--ease-spring);
}

@keyframes toastIn {
    from { transform: translateX(110%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(110%); opacity: 0; }
}

.toast-icon { font-size: 1.5rem; flex-shrink: 0; }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); margin-bottom: 0.15rem; }
.toast-body {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--duration-fast) ease;
}
.toast-close:hover { color: var(--text-primary); }

/* --- Empty State --- */
.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    animation: fadeIn var(--duration-slow) ease;
}
.empty .icon { font-size: 3rem; margin-bottom: 0.5rem; }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-light); }
th {
    background: var(--brown-50);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}
tr:hover td { background: var(--surface-hover); }

/* --- Loading Skeleton --- */
.skeleton {
    background: linear-gradient(90deg, var(--brown-50) 25%, #EDE7E3 50%, var(--brown-50) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
    min-height: 70px;
    margin-bottom: 0.75rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalEnter {
    from { transform: scale(0.88) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--brown-200); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brown-300); }

/* --- Table Detail --- */
.table-detail-order {
    background: linear-gradient(135deg, #FFF8E1, #FFECB3);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255,143,0,0.12);
}
.table-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.9rem;
}
.table-detail-total {
    font-weight: 700;
    color: var(--brown-700);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.08);
    text-align: right;
}

/* --- Sales --- */
.sales-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.sales-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}
.sales-card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sales-item-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
}
.sales-item-row:last-child { border-bottom: none; }
.sales-item-row .name { flex: 1; }
.sales-item-row .qty { color: var(--text-muted); margin: 0 0.75rem; font-weight: 600; }
.sales-item-row .rev { font-weight: 700; color: var(--brown-700); }

/* --- Notification Badge --- */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-light);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: badgePop 0.3s var(--ease-spring);
}

@keyframes badgePop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .container { padding: 1rem; }
    .menu-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    header { padding: 0 1rem; height: 56px; }
    header h1 { font-size: 1.1rem; }
    .btn { min-height: 48px; padding: 0.7rem 1.2rem; }
    .btn-sm { min-height: 40px; }
    .tables-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .order-actions { gap: 0.4rem; }
    .order-actions .btn { flex: 1; min-width: 0; }
    .toast-notification { max-width: calc(100vw - 2rem); right: 1rem; left: 1rem; }
    .stat-card .value { font-size: 1.5rem; }
    .landing h1 { font-size: 1.8rem; }
    .landing-logo { width: 90px; height: 90px; }
    .sales-breakdown { grid-template-columns: 1fr; }
}

/* --- RTL --- */
[dir="rtl"] header { flex-direction: row-reverse; }
[dir="rtl"] .back { margin-right: 0; margin-left: auto; }
[dir="rtl"] .order-header { flex-direction: row-reverse; }
[dir="rtl"] .order-items li { flex-direction: row-reverse; }
[dir="rtl"] .order-actions { flex-direction: row-reverse; }
[dir="rtl"] .btn-row { flex-direction: row-reverse; }
[dir="rtl"] .modal-btns { flex-direction: row-reverse; }
[dir="rtl"] .subcategory-title { border-left: none; border-right: 3px solid var(--brand-600); }
[dir="rtl"] .category-title { flex-direction: row-reverse; }
[dir="rtl"] .category-title::before { margin-right: 0; margin-left: 0; }

/* === FUN ELEMENTS (shared across all pages) === */
.sound-toggle {
    position: fixed; bottom: 20px; right: 20px; z-index: 100;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--surface); border: 2px solid var(--border);
    font-size: 1.4rem; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); transition: all 0.3s;
}
.sound-toggle:hover { transform: scale(1.1); }
.sound-toggle.muted { opacity: 0.5; }
.confetti-piece {
    position: fixed; width: 10px; height: 10px;
    z-index: 9999; pointer-events: none;
    animation: confettiFall 2.5s ease-out forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.streak-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white; padding: 0.4rem 0.8rem; border-radius: 20px;
    font-size: 0.85rem; font-weight: 700;
    animation: streakPulse 2s ease-in-out infinite;
}
@keyframes streakPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.order-card.animate-in {
    animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.order-card.completed-flash {
    animation: flashGreen 0.6s ease;
}
@keyframes flashGreen {
    0% { background: rgba(76, 175, 80, 0.3); }
    100% { background: var(--surface); }
}

/* Manager analytics: positive/negative delta coloring */
.pos { color: #2e7d32; }
.neg { color: #c62828; }
