@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Lora:ital,wght@0,500;0,600;1,400&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css');

/* ── Variables ─────────────────────────────────────────── */
:root {
    --primary:   #0284c7;
    --primary-d: #0284c7;
    --primary-l: #f7f7ff;
    --accent:    #f0a500;
    --danger:    #dc2626;
    --success:   #0284c7;
    --info:      #0284c7;
    --text:      #1e293b;
    --muted:     #64748b;
    --border:    #e2e8f0;
    --bg:        #eff1ef;
    --white:     hsl(70, 60%, 98%);
    --radius:    10px;
    --shadow:    0 2px 12px rgba(0,0,0,.07);
    --shadow-md: 0 4px 20px rgba(0,0,0,.11);
    --shadow-lg: 0 8px 40px rgba(0,0,0,.15);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #854d0e;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
    background: var(--primary-d);
    color: rgb(255, 255, 255);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 62px;
    position: sticky;
    top: 0;
    z-index: 300;
    box-shadow: 0 2px 16px rgba(0,0,0,.2);
}
.topbar-brand {
    display: flex; align-items: center; gap: 11px;
    text-decoration: none; color: white;
    font-weight: 800; font-size: 17px; letter-spacing: -.3px;
}
.topbar-brand .logo {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.18);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.topbar-nav { display: flex; gap: 2px; align-items: center; }
.topbar-nav a {
    color: rgba(255,255,255,.75);
    text-decoration: none;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    transition: .15s;
    display: flex; align-items: center; gap: 6px;
}
.topbar-nav a:hover  { background: rgba(255,255,255,.13); color: white; }
.topbar-nav a.active { background: rgba(255,255,255,.18); color: white; }
.topbar-nav .btn-book {
    background: var(--accent);
    color: #1a1a1a !important;
    font-weight: 700;
    margin-left: 8px;
    padding: 8px 18px;
    border-radius: 8px;
}
.topbar-nav .btn-book:hover { background: #d99200; }

/* ── Page Header ───────────────────────────────────────── */
.page-header {
    background: linear-gradient(120deg, var(--primary-d) 0%, var(--primary) 100%);
    color: white; padding: 40px 28px; text-align: center;
}
.page-header h1 { font-family: 'Lora', serif; font-size: 30px; font-weight: 600; margin-bottom: 6px; }
.page-header p  { font-size: 15px; opacity: .85; }

/* ── Layout ────────────────────────────────────────────── */
.wrap    { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 34px 0; }
.grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3  { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.grid-4  { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* ── Cards ─────────────────────────────────────────────── */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-head {
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-body { padding: 20px; }

/* ── Stat Card ─────────────────────────────────────────── */
.stat-card {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 20px;
    display: flex; align-items: center; gap: 14px;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-card .val { font-size: 30px; font-weight: 800; line-height: 1; }
.stat-card .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Forms ─────────────────────────────────────────────── */
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.form-group label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.form-control {
    padding: 10px 14px; border: 1.5px solid var(--border);
    border-radius: 8px; font-size: 14px; font-family: inherit;
    color: var(--text); background: var(--white); transition: .15s; width: 100%;
}
.form-control:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(#0284c7); }
.form-control::placeholder { color: #b0c5ba; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 20px; border-radius: 8px; border: none;
    cursor: pointer; font-size: 13.5px; font-weight: 600;
    font-family: inherit; transition: .15s; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-d); transform: translateY(-1px); }
.btn-accent   { background: var(--accent); color: #1a1a1a; }
.btn-accent:hover { background: #d99200; transform: translateY(-1px); }
.btn-danger   { background: var(--danger);  color: white; }
.btn-success  { background: var(--success); color: white; }
.btn-ghost    { background: var(--border);  color: var(--text); }
.btn-ghost:hover { background: #cbd5e1; }
.btn-outline  { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-l); }
.btn-sm  { padding: 6px 13px; font-size: 12.5px; }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }

/* ── Badges ────────────────────────────────────────────── */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-in_queue  { background: #ede9fe; color: #5b21b6; }
.badge-serving   { background: #dcfce7; color: #0284c7 }
.badge-done      { background: #f1f5f9; color: #475569; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-walkin    { background: #fef9c3; color: #854d0e; }
.badge-scheduled { background: #e0f2fe; color: #075985; }

/* ── Queue Board ───────────────────────────────────────── */
.q-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.q-card  {
    background: white; border-radius: 12px; box-shadow: var(--shadow);
    border-top: 4px solid var(--primary); overflow: hidden; transition: .2s;
}
.q-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.q-card.busy  { border-color: var(--accent); }
.q-card.idle  { border-color: #cbd5e1; }
.q-card-top   { padding: 14px 16px; }
.q-card-top .doc  { font-weight: 700; font-size: 14px; }
.q-card-top .spec { font-size: 12px; color: var(--muted); }
.q-nums { display: grid; grid-template-columns: 1fr 1fr 1fr; background: #f8faf9; padding: 12px 0; text-align: center; }
.q-num .n { font-size: 28px; font-weight: 800; line-height: 1; }
.q-num .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.q-num.serving .n { color: var(--primary); }
.q-num.waiting .n { color: var(--accent); }
.q-num.done .n    { color: #94a3b8; }
.q-footer { padding: 9px 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ── Table ─────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { background: #f8faf9; padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; font-size: 13.5px; }
.tbl tr:last-child td { border: none; }
.tbl tr:hover td { background: #fafcfb; }

/* ── Alerts ────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #0284c7; }
.alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #dc2626; }
.alert-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1d4ed8; }
.alert-warn    { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }

/* ── Live dot ──────────────────────────────────────────── */
.live-dot { display: inline-block; width: 8px; height: 8px; background: #0284c7; border-radius: 50%; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.4)} }

/* ── Spinner ───────────────────────────────────────────── */
.spin { display:inline-block;width:16px;height:16px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spinning .7s linear infinite; }
@keyframes spinning { to { transform: rotate(360deg); } }

/* ── Admin Sidebar Layout ──────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 62px); }
.sidebar { background: #0284c7; padding: 12px 0; position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; display: flex; flex-direction: column; }
.sidebar a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; color: #94a3b8;
    text-decoration: none; font-size: 13.5px; font-weight: 500; transition: .15s; border-left: 3px solid transparent;
}
.sidebar a:hover  { background: rgba(255,255,255,.07); color: white; border-left-color: rgba(255,255,255,.2); }
.sidebar a.active { background: rgba(#0284c7); color: white; border-left-color: var(--primary); }
.sidebar a .ic    { width: 20px; text-align: center; font-size: 15px; }
.sidebar-label    { padding: 18px 20px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: #3d5a50; font-weight: 700; }
.admin-body       { padding: 26px; overflow-y: auto; background: var(--bg); }

/* ── Slot grid ─────────────────────────────────────────── */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 7px; }
.slot-btn {
    padding: 7px 4px; border: 1.5px solid var(--border);
    border-radius: 7px; background: white; font-size: 12px;
    cursor: pointer; text-align: center; font-family: inherit;
    font-weight: 500; transition: .15s;
}
.slot-btn:hover:not(.taken) { border-color: var(--primary); color: var(--primary); }
.slot-btn.selected { background: var(--primary); border-color: var(--primary); color: white; }
.slot-btn.taken    { background: #f1f5f9; color: #cbd5e1; cursor: not-allowed; text-decoration: line-through; }

/* ── Step Indicator ────────────────────────────────────── */
.steps { display: flex; gap: 0; margin-bottom: 28px; }
.step {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    position: relative;
}
.step:not(:last-child)::after {
    content: ''; position: absolute; top: 18px; left: 50%; width: 100%;
    height: 2px; background: var(--border); z-index: 0;
}
.step.done::after  { background: var(--primary); }
.step-num {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--border); color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; position: relative; z-index: 1; transition: .2s;
}
.step.active .step-num { background: var(--primary); color: white; box-shadow: 0 0 0 4px var(--primary-l); }
.step.done .step-num   { background: var(--success); color: white; }
.step-label { font-size: 11px; color: var(--muted); margin-top: 6px; font-weight: 600; text-align: center; }
.step.active .step-label { color: var(--primary); }

/* ── Modal ─────────────────────────────────────────────── */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.55); z-index: 999;
    align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: white; border-radius: 16px;
    max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg); animation: modalIn .25s ease;
}
@keyframes modalIn { from{opacity:0;transform:scale(.95)translateY(-10px)} to{opacity:1;transform:scale(1)translateY(0)} }
.modal-head {
    padding: 18px 24px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; background: white; z-index: 1;
}
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-close   { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: #f1f5f3; color: var(--danger); }
.modal-body { padding: 24px; }

/* ── Footer ────────────────────────────────────────────── */
footer { background: #0284c7; color: #0284c7; text-align: center; padding: 20px; font-size: 13px; margin-top: 48px; }
footer a { color: #f9fdfb; text-decoration: none; font-weight: 500; }
footer a:hover { color: #f5faf7; }

/* ── Section headings ──────────────────────────────────── */
.sec-title {
    font-family: 'Lora', serif; font-size: 24px; font-weight: 600;
    color: var(--primary-d); margin-bottom: 6px;
}
.sec-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

/* ── Divider ───────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Toggle switch ─────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #e2e8f0; border-radius: 22px; transition: .3s; }
.slider:before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s; }
input:checked + .slider { background: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

/* ── Responsive ────────────────────────────────────────── */
.hamburger-btn { display:none; background:rgba(255,255,255,.15); border:none; color:white; width:38px; height:38px; border-radius:8px; font-size:18px; cursor:pointer; align-items:center; justify-content:center; flex-shrink:0; }
.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:298; }
.sidebar-overlay.open { display:block; }

@media (max-width: 768px) {
    .form-row  { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .topbar  { padding: 0 16px; }
    .topbar-nav a:not(.btn-book):not(.active) { display: none; }
    .hamburger-btn { display: flex; }
    .sidebar {
        display: flex !important;
        position: fixed;
        top: 0; left: -260px;
        height: 100vh;
        width: 250px;
        z-index: 299;
        transition: left .25s ease;
        padding-top: 62px;
    }
    .sidebar.mobile-open { left: 0; }
    .admin-body { padding: 16px; }
    .stat-card { padding: 14px; }
    .card-head { flex-wrap: wrap; gap: 8px; }
    .tbl { font-size: 12px; }
    .tbl th, .tbl td { padding: 8px 10px; }
}
@media (max-width: 480px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .admin-topbar-brand div div:last-child { display: none; }
}
