:root {
    --primary: #5c1015;
    --primary-dark: #4a0d11;
    --accent: #e8b84b;
    --accent-red: #d6394a;
    --navy: #1b2559;
    --muted: #6b7280;
    --bg: #f4f5f8;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    color: #2b2b2b;
}

/* Top header */
.top-header {
    background: var(--primary);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-header .brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.3px;
}
.top-header .brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.12);
    border-radius: 9px;
    margin-right: 10px;
    color: #fff;
}
.top-header .user-badge {
    background: #fff;
    color: #1b2559;
    font-weight: 600;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: capitalize;
}
.top-header .btn-logout {
    background: var(--accent-red);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 600;
}
.top-header .btn-logout:hover { background: #c22c3d; color: #fff; }

/* Layout */
.app-wrapper {
    display: flex;
    min-height: calc(100vh - 62px);
}

.sidebar {
    width: 230px;
    background: var(--primary);
    flex-shrink: 0;
    padding: 18px 12px;
}
.sidebar .nav-link {
    color: #f0d9db;
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 0.94rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}
.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
    font-size: 0.95rem;
}
.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar .nav-link.active {
    background: var(--accent-red);
    color: #fff;
    font-weight: 600;
}
.sidebar hr {
    border-top: 1px solid rgba(255,255,255,0.15);
    margin: 8px 6px 12px;
}

.main-content {
    flex-grow: 1;
    padding: 26px 28px;
}

/* Page header block (icon + title + subtitle) */
.page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}
.page-header .page-icon {
    width: 42px;
    height: 42px;
    background: var(--navy);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.page-header h4 {
    margin: 0;
    color: var(--navy);
    font-weight: 700;
}
.page-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

/* Auth pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.auth-card {
    background: #fff;
    border-radius: 10px;
    padding: 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.auth-card h3 { color: var(--primary-dark); font-weight: 700; }

/* Dashboard stat cards */
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border-left: 5px solid var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-card .icon-badge {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-card h3 { margin: 0; font-size: 1.6rem; color: var(--navy); font-weight: 700; }
.stat-card p { margin: 0; color: var(--muted); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.5px; font-weight: 600; }

.stat-card.stat-red    { border-left-color: #e6435a; }
.stat-card.stat-red    .icon-badge { background: rgba(230,67,90,0.12); color: #e6435a; }
.stat-card.stat-blue   { border-left-color: #2f80ed; }
.stat-card.stat-blue   .icon-badge { background: rgba(47,128,237,0.12); color: #2f80ed; }
.stat-card.stat-green  { border-left-color: #22c55e; }
.stat-card.stat-green  .icon-badge { background: rgba(34,197,94,0.12); color: #22c55e; }
.stat-card.stat-purple { border-left-color: #8b5cf6; }
.stat-card.stat-purple .icon-badge { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.stat-card.stat-orange { border-left-color: #f2a93c; }
.stat-card.stat-orange .icon-badge { background: rgba(242,169,60,0.15); color: #ce8623; }

.stat-card-action {
    background: #2f80ed;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.stat-card-action .btn {
    width: 100%;
    height: 100%;
    padding: 20px;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    background: transparent;
}
.stat-card-action:hover { background: #2569c9; }

.card-panel {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.panel-header .panel-icon {
    width: 30px;
    height: 30px;
    background: var(--navy);
    color: #fff;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.panel-header h6 {
    margin: 0;
    color: var(--navy);
    font-weight: 700;
}

table.table thead { background: #f8f9fb; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; }
table.table thead th { border-bottom: 1px solid #eee; font-weight: 600; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
}
.badge-available, .status-pill.badge-completed { background: #22c55e !important; }
.badge-occupied, .status-pill.badge-cancelled { background: #b3413b !important; }
.badge-pending, .status-pill.badge-pending { background: #f5a623 !important; color:#333 !important; }
.badge-preparing, .status-pill.badge-preparing { background: #2c8fbf !important; }
.badge-ready, .status-pill.badge-ready { background: #8b5cf6 !important; }
.badge-completed { background: #22c55e !important; }
.badge-cancelled { background: #6c757d !important; }

.btn-view {
    border: 1px solid #2f80ed;
    color: #2f80ed;
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #fff;
}
.btn-view:hover { background: #2f80ed; color: #fff; }

/* Order item builder */
.order-items-table input.qty-input { width: 70px; }
.item-picker-row select { min-width: 220px; }

/* Receipt */
.receipt-box {
    max-width: 380px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    font-family: 'Courier New', monospace;
    border: 1px solid #ddd;
}
.receipt-box h4, .receipt-box p { text-align: center; margin: 2px 0; }
.receipt-box table { width: 100%; font-size: 0.85rem; }
.receipt-box hr { border-top: 1px dashed #999; }

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .receipt-box { border: none; }
}

@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        left: -230px;
        top: 62px;
        bottom: 0;
        transition: left 0.2s ease;
        z-index: 99;
        overflow-y: auto;
    }
    .sidebar.show { left: 0; }
    .stat-card { flex-wrap: wrap; }
}

