:root {
    --color-primary: #8B4513;
    --color-primary-dark: #6B3410;
    --color-accent: #C9A961;
    --color-accent-light: #E5D4A1;
    --color-bg: #FAF6F0;
    --color-surface: #FFFFFF;
    --color-text: #2C1810;
    --color-text-muted: #7A5E4F;
    --color-border: #E8DDD0;
    --color-success: #4A7C59;
    --color-danger: #B23A3A;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(44,24,16,0.08);
    --shadow-md: 0 4px 12px rgba(44,24,16,0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, sans-serif; background: var(--color-bg);
       color: var(--color-text); line-height: 1.6; padding-bottom: 80px; }
.header { position: sticky; top: 0; z-index: 100; background: var(--color-primary);
          color: white; box-shadow: var(--shadow-sm); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 12px 16px;
                display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; color: white; text-decoration: none;
        font-weight: 700; font-size: 18px; }
.logo-icon { font-size: 24px; }
.header-nav { display: flex; gap: 12px; align-items: center; }
.nav-link { color: white; text-decoration: none; padding: 6px 12px; border-radius: var(--radius-sm);
            font-size: 14px; transition: background 0.2s; }
.nav-link:hover { background: rgba(255,255,255,0.15); }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.cart-badge { background: var(--color-accent); color: var(--color-text); border-radius: 999px;
              padding: 2px 8px; font-size: 12px; font-weight: 700; min-width: 22px; text-align: center; }
.lang-link { border: 1px solid rgba(255,255,255,0.3); }
.hero { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
        color: white; padding: 32px 16px; text-align: center;
        border-bottom: 4px solid var(--color-accent); }
.hero-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px; }
.hero-tagline { font-size: 15px; color: var(--color-accent-light); margin-bottom: 4px; }
.hero-hours { font-size: 13px; opacity: 0.85; }
.search-section { max-width: 1200px; margin: -20px auto 0; padding: 0 16px;
                  position: relative; z-index: 10; }
.search-input { width: 100%; padding: 14px 18px; border: 1px solid var(--color-border);
                border-radius: var(--radius-md); font-size: 15px; background: var(--color-surface);
                box-shadow: var(--shadow-md); }
.search-input:focus { outline: none; border-color: var(--color-accent);
                      box-shadow: 0 0 0 3px rgba(201,169,97,0.2); }
.categories-section { position: sticky; top: 60px; z-index: 50; background: var(--color-bg);
                      padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.categories-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px; scrollbar-width: none; }
.categories-scroll::-webkit-scrollbar { display: none; }
.cat-pill { flex-shrink: 0; padding: 10px 20px; border: 1px solid var(--color-border);
            border-radius: 999px; background: var(--color-surface); color: var(--color-text);
            font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.cat-pill:hover { border-color: var(--color-accent); }
.cat-pill.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.menu-section { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.category-block { margin-bottom: 40px; }
.category-title { font-size: 22px; font-weight: 700; color: var(--color-primary-dark);
                  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--color-accent); }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
@media (max-width: 600px) { .products-grid { grid-template-columns: 1fr; } }
.product-card { background: var(--color-surface); border-radius: var(--radius-lg); overflow: hidden;
                box-shadow: var(--shadow-sm); transition: all 0.2s; border: 1px solid var(--color-border);
                display: flex; flex-direction: column; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-image { height: 160px; background: linear-gradient(135deg, var(--color-accent-light), var(--color-accent));
                 display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-placeholder { font-size: 64px; opacity: 0.6; }
.product-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.product-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; color: var(--color-text); }
.product-desc { font-size: 13px; color: var(--color-text-muted); margin-bottom: 12px; line-height: 1.5; }
.product-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px;
                  margin-top: auto; padding-top: 8px; }
.product-price { font-size: 18px; font-weight: 700; color: var(--color-primary-dark); }
.add-btn { padding: 8px 16px; background: var(--color-primary); color: white; border: none;
           border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer;
           transition: all 0.2s; white-space: nowrap; }
.add-btn:hover { background: var(--color-primary-dark); }
.add-btn:active { transform: scale(0.96); }
.add-btn.added { background: var(--color-success); }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--color-surface);
              border-top: 1px solid var(--color-border); display: none; padding: 8px 0; z-index: 90;
              box-shadow: 0 -2px 8px rgba(0,0,0,0.05); }
@media (max-width: 768px) { .bottom-nav { display: flex; justify-content: space-around; } }
.bottom-link { display: flex; flex-direction: column; align-items: center; padding: 4px 12px;
               color: var(--color-text-muted); text-decoration: none; font-size: 11px; gap: 2px; }
.bottom-link.active { color: var(--color-primary); }
.bottom-icon { font-size: 20px; }
.flash-container { position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
                   z-index: 200; pointer-events: none; }
.flash { background: var(--color-text); color: white; padding: 12px 20px; border-radius: var(--radius-md);
         margin-bottom: 8px; box-shadow: var(--shadow-md); animation: slideDown 0.3s ease; font-size: 14px; }
.flash.success { background: var(--color-success); }
.flash.error { background: var(--color-danger); }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.footer { background: var(--color-primary-dark); color: var(--color-accent-light);
          text-align: center; padding: 24px 16px; margin-top: 40px; font-size: 13px; line-height: 1.8; }
.footer-copyright { margin-top: 12px; font-size: 12px; opacity: 0.7; }
.page-container { max-width: 800px; margin: 0 auto; padding: 24px 16px; }
.page-title { font-size: 26px; font-weight: 800; color: var(--color-primary-dark); margin-bottom: 24px; }

/* ═══════════════════════════════════════════════
   ADMIN DASHBOARD STYLES
   ═══════════════════════════════════════════════ */

.admin-body {
    background: #F5F3EF;
    padding-bottom: 0;
}

.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
}

/* Sidebar */
.admin-sidebar {
    background: var(--color-primary-dark);
    color: white;
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 800;
    color: white;
    text-decoration: none;
}

.admin-logo-icon { font-size: 24px; }

.admin-nav {
    padding: 16px 0;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--color-accent-light);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-right: 3px solid transparent;
}

.admin-nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.admin-nav-item.active {
    background: rgba(255,255,255,0.12);
    color: white;
    border-right-color: var(--color-accent);
    font-weight: 600;
}

.admin-nav-icon { font-size: 18px; width: 24px; }

.admin-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: auto;
    font-size: 13px;
}

.admin-user-name { font-weight: 600; color: white; }
.admin-user-role { color: var(--color-accent-light); font-size: 12px; margin-top: 2px; }

.admin-logout {
    display: block;
    margin-top: 12px;
    color: var(--color-accent-light);
    text-decoration: none;
    font-size: 12px;
}

.admin-logout:hover { color: white; }

/* Main content */
.admin-main {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 768px) {
    .admin-main { padding: 16px; }
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text);
}

.admin-subtitle {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-right: 4px solid var(--color-primary);
}

.stat-card.revenue { border-right-color: var(--color-success); }
.stat-card.active { border-right-color: var(--color-accent); }
.stat-card.delivered { border-right-color: #4A90E2; }

.stat-label {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.1;
}

.stat-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-right: 4px;
}

/* Data tables */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border-collapse: collapse;
}

.data-table thead {
    background: var(--color-bg);
}

.data-table th {
    padding: 14px 16px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover { background: var(--color-bg); }

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-draft { background: #E8DDD0; color: #6B3410; }
.status-submitted { background: #FFF3CD; color: #856404; }
.status-confirmed { background: #D1ECF1; color: #0C5460; }
.status-preparing { background: #FFE5B4; color: #8B4513; }
.status-ready { background: #D4EDDA; color: #155724; }
.status-out_for_delivery { background: #CCE5FF; color: #004085; }
.status-delivered { background: #D4EDDA; color: #155724; }
.status-cancelled { background: #F8D7DA; color: #721C24; }

/* Filter pills */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.2s;
}

.filter-pill:hover { border-color: var(--color-accent); }

.filter-pill.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* KDS — Kanban board */
.kds-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    min-height: calc(100vh - 200px);
}

@media (max-width: 1200px) {
    .kds-container { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
    .kds-container { grid-template-columns: 1fr; }
}

.kds-column {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 12px;
    min-height: 400px;
}

.kds-column-header {
    font-size: 16px;
    font-weight: 700;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    color: white;
}

.kds-column.submitted .kds-column-header { background: #856404; }
.kds-column.confirmed .kds-column-header { background: #0C5460; }
.kds-column.preparing .kds-column-header { background: #8B4513; }
.kds-column.ready .kds-column-header { background: #155724; }

.kds-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    border-right: 3px solid var(--color-primary);
}

.kds-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 700;
}

.kds-order-id { color: var(--color-primary); }

.kds-customer {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.kds-items {
    list-style: none;
    font-size: 13px;
    margin-bottom: 8px;
}

.kds-items li {
    padding: 4px 0;
    border-bottom: 1px dashed var(--color-border);
}

.kds-items li:last-child { border-bottom: none; }

.kds-items-qty {
    font-weight: 700;
    color: var(--color-primary-dark);
}

.kds-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.kds-btn {
    flex: 1;
    padding: 6px 8px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    background: var(--color-primary);
    color: white;
    transition: background 0.2s;
}

.kds-btn:hover { background: var(--color-primary-dark); }

.kds-btn.cancel { background: #B23A3A; }

.kds-empty {
    text-align: center;
    padding: 40px 10px;
    color: var(--color-text-muted);
    font-size: 13px;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    font-size: 48px;
    margin-bottom: 8px;
}

.login-title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--color-primary-dark);
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 32px;
}

.login-error {
    background: #F8D7DA;
    color: #721C24;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
}

/* Empty state */
.admin-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--color-text-muted);
    font-size: 15px;
}

.admin-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Order detail grid */
.order-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .order-detail-grid { grid-template-columns: 1fr; }
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.info-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-accent);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}

.info-row:last-child { border-bottom: none; }

.info-row-label { color: var(--color-text-muted); }
.info-row-value { font-weight: 600; }
