/* ============================================================
   DineSwift – Shared Dashboard Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --bg-dark:      #0d1117;
    --bg-card:      #161b22;
    --bg-card2:     #1e2530;
    --bg-sidebar:   #0d1117;
    --accent:       #f59e0b;
    --accent-hover: #d97706;
    --accent-green: #10b981;
    --accent-red:   #ef4444;
    --accent-blue:  #3b82f6;
    --accent-purple:#8b5cf6;
    --text-primary: #f0f6fc;
    --text-muted:   #8b949e;
    --border:       rgba(255,255,255,0.08);
    --glass-bg:     rgba(255,255,255,0.04);
    --glass-border: rgba(255,255,255,0.12);
    --shadow:       0 8px 32px rgba(0,0,0,0.4);
    --radius:       14px;
    --radius-sm:    8px;
    --sidebar-w:    260px;
    --header-h:     64px;
    --transition:   all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}
.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-logo .logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent), #e07b00);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.sidebar-logo .logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}
.sidebar-logo .logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}
.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 8px 6px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: var(--transition);
}
.nav-item:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}
.nav-item.active {
    background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(245,158,11,0.05));
    color: var(--accent);
    border-left: 3px solid var(--accent);
}
.nav-item .icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}
.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
}
.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.user-info .user-name  { font-size: 0.85rem; font-weight: 600; }
.user-info .user-role  { font-size: 0.72rem; color: var(--text-muted); text-transform: capitalize; }

/* ── Main Content ─────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top Header ──────────────────────────────────────────────── */
.topbar {
    height: var(--header-h);
    background: rgba(13,17,23,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-title { font-size: 1.1rem; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-warning  { background: rgba(245,158,11,0.2); color: var(--accent); }
.badge-success  { background: rgba(16,185,129,0.2); color: var(--accent-green); }
.badge-danger   { background: rgba(239,68,68,0.2);  color: var(--accent-red); }
.badge-info     { background: rgba(59,130,246,0.2); color: var(--accent-blue); }
.badge-purple   { background: rgba(139,92,246,0.2); color: var(--accent-purple); }

/* ── Page Content ─────────────────────────────────────────────── */
.page-content {
    flex: 1;
    padding: 28px;
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-title { font-size: 1.5rem; font-weight: 700; }
.page-subtitle { color: var(--text-muted); font-size: 0.875rem; margin-top: 2px; }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card.yellow::before { background: var(--accent); }
.stat-card.green::before  { background: var(--accent-green); }
.stat-card.blue::before   { background: var(--accent-blue); }
.stat-card.purple::before { background: var(--accent-purple); }
.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
}
.stat-card.yellow .stat-icon { background: rgba(245,158,11,0.15); color: var(--accent); }
.stat-card.green  .stat-icon { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.stat-card.blue   .stat-icon { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.stat-card.purple .stat-icon { background: rgba(139,92,246,0.15); color: var(--accent-purple); }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.stat-change { font-size: 0.75rem; margin-top: 8px; }
.stat-change.up   { color: var(--accent-green); }
.stat-change.down { color: var(--accent-red); }

/* ── Cards / Panels ─────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.card-title { font-size: 1rem; font-weight: 600; }
.card-body  { padding: 24px; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--glass-bg); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}
.btn-primary   { background: var(--accent);        color: #000; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-success   { background: var(--accent-green);  color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger    { background: var(--accent-red);    color: #fff; }
.btn-danger:hover  { background: #dc2626; }
.btn-blue      { background: var(--accent-blue);   color: #fff; }
.btn-blue:hover    { background: #2563eb; }
.btn-ghost {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--bg-card2); }

/* ── Status Badges ────────────────────────────────────────────── */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-pending  { background: rgba(245,158,11,0.15); color: var(--accent); }
.status-pending::before  { background: var(--accent); animation: pulse 2s infinite; }
.status-preparing{ background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.status-preparing::before{ background: var(--accent-blue); animation: pulse 2s infinite; }
.status-ready    { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.status-ready::before    { background: var(--accent-green); }
.status-served   { background: rgba(139,92,246,0.15); color: var(--accent-purple); }
.status-served::before   { background: var(--accent-purple); }
.status-paid     { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.status-paid::before     { background: var(--accent-green); }
.status-unpaid   { background: rgba(239,68,68,0.15);  color: var(--accent-red); }
.status-unpaid::before   { background: var(--accent-red); }
.status-cancelled{ background: rgba(107,114,128,0.15); color: #6b7280; }

/* ── Order Cards (Kitchen) ──────────────────────────────────── */
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}
.order-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-2px); box-shadow: var(--shadow); }
.order-card.pending   { border-left: 4px solid var(--accent); }
.order-card.preparing { border-left: 4px solid var(--accent-blue); }
.order-card.ready     { border-left: 4px solid var(--accent-green); }
.order-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.table-badge {
    background: linear-gradient(135deg, var(--accent), #e07b00);
    color: #000;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
}
.order-items-list { padding: 16px 20px; }
.order-item-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.875rem; }
.order-item-row .qty { background: var(--glass-bg); padding: 2px 8px; border-radius: 4px; font-weight: 600; font-size: 0.8rem; }
.order-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.time-elapsed { font-size: 0.75rem; color: var(--text-muted); }
.time-elapsed.urgent { color: var(--accent-red); font-weight: 600; }

/* ── Image Upload Preview ──────────────────────────────────── */
.img-upload-wrap {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.img-upload-wrap:hover { border-color: var(--accent); background: rgba(245,158,11,0.04); }
.img-preview { max-height: 180px; margin: 0 auto; border-radius: var(--radius-sm); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 32px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.25s ease;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.3rem; line-height: 1; }
.modal-close:hover { color: var(--text-primary); }

/* ── Login Page ─────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 30% 20%, rgba(245,158,11,0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(59,130,246,0.06) 0%, transparent 60%),
                var(--bg-dark);
    padding: 20px;
}
.login-box {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 32px 96px rgba(0,0,0,0.5);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .emoji { font-size: 3rem; }
.login-logo h1 { font-size: 1.5rem; font-weight: 800; margin-top: 8px; }
.login-logo p { color: var(--text-muted); font-size: 0.85rem; }
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 20px;
}
.alert-error   { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.25);  color: var(--accent-red); }
.alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.25); color: var(--accent-green); }

/* ── Notifications / Toast ──────────────────────────────────── */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease;
    max-width: 320px;
}
.toast-success { background: var(--accent-green); }
.toast-error   { background: var(--accent-red); }
.toast-info    { background: var(--accent-blue); }

/* ── Real-time indicator ─────────────────────────────────────── */
.live-dot { width: 8px; height: 8px; background: var(--accent-green); border-radius: 50%; animation: pulse 2s infinite; }
.live-label { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--accent-green); font-weight: 600; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}
@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease forwards; }

/* ── Chart container ─────────────────────────────────────────── */
.chart-wrap { position: relative; height: 280px; }

/* ── QR Code card ───────────────────────────────────────────── */
.qr-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}
.qr-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.qr-card img { border-radius: 8px; margin: 0 auto 12px; width: 180px; height: 180px; background: #fff; padding: 8px; }
.qr-table-label { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.qr-hotel-label { font-size: 0.75rem; color: var(--text-muted); }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .orders-grid { grid-template-columns: 1fr; }
    .page-content { padding: 16px; }
}
