/* ==========================================================================
   Turf Booking System — Global Stylesheet
   Variable names must match includes/header.php (which injects DB-driven
   overrides for --primary-color / theme mode from the settings table).
   ========================================================================== */

:root {
    /* Theme (overridden at runtime by header.php from `settings` table) */
    --primary-color: #0B3D2E;
    --primary-hover: #084028;
    --primary-soft: rgba(11, 61, 46, 0.15);

    /* Surfaces — dark theme base */
    --bg-dark: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-hover: #242424;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;

    /* Lines */
    --border-color: #2a2a2a;

    /* Semantic */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Radii + shadow */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.45);

    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 64px;
}

/* Light mode (admin can toggle theme_mode = light) */
[data-theme="light"] {
    --bg-dark: #f5f6f7;
    --bg-card: #ffffff;
    --bg-hover: #eef0f2;
    --text-primary: #14181c;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --border-color: #e2e5e9;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
}

/* --------------------------------------------------------------- Base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--primary-color); text-decoration: none; transition: color .25s; }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4, h5, h6 { line-height: 1.3; font-weight: 600; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: 1440px; margin: 0 auto; padding: 0 1.5rem; }

/* ------------------------------------------------------------- Buttons ---- */
.btn {
    padding: .75rem 1.5rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    transition: all .25s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); color: #fff; transform: translateY(-2px); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.btn-outline { background: transparent; color: var(--primary-color); border: 1px solid var(--primary-color); }
.btn-outline:hover:not(:disabled) { background: var(--primary-color); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger  { background: var(--error);   color: #fff; }
.btn-danger:hover:not(:disabled) { color: #fff; opacity: .9; }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .5rem .65rem; }

/* --------------------------------------------------------------- Forms ---- */
.form-group { margin-bottom: 1.5rem; }
.form-group label,
.form-label {
    display: block;
    margin-bottom: .5rem;
    color: var(--text-secondary);
    font-size: .9rem;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: .75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all .25s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { min-height: 110px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23808080' d='M6 9L1 4h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.form-hint { display: block; margin-top: .35rem; font-size: .8rem; color: var(--text-muted); }
.form-error { display: block; margin-top: .35rem; font-size: .8rem; color: var(--error); }
input[type="color"].form-control { height: 46px; padding: .25rem; cursor: pointer; }
.checkbox-row { display: flex; align-items: center; gap: .5rem; color: var(--text-secondary); font-size: .9rem; }
.checkbox-row input { cursor: pointer; width: 16px; height: 16px; accent-color: var(--primary-color); }

/* --------------------------------------------------------- Cards / grid ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all .3s;
}
.card-flush { padding: 0; overflow: hidden; }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.card-header h3, .card-header h2 { font-size: 1.1rem; margin: 0; }
.card-title { font-size: 1.1rem; font-weight: 600; margin: 0; }
.card-sub { color: var(--text-muted); font-size: .85rem; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* -------------------------------------------------------------- Alerts ---- */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .95rem;
}
.alert-success { background: rgba(16,185,129,.1);  border: 1px solid var(--success); color: var(--success); }
.alert-error   { background: rgba(239,68,68,.1);   border: 1px solid var(--error);   color: var(--error); }
.alert-danger  { background: rgba(239,68,68,.1);   border: 1px solid var(--error);   color: var(--error); }
.alert-warning { background: rgba(245,158,11,.1);  border: 1px solid var(--warning); color: var(--warning); }
.alert-info    { background: rgba(59,130,246,.1);  border: 1px solid var(--info);    color: var(--info); }

/* ------------------------------------------------------------- Badges ----- */
.badge {
    padding: .25rem .75rem;
    border-radius: var(--radius-sm);
    font-size: .78rem;
    font-weight: 500;
    display: inline-block;
    white-space: nowrap;
}
.badge-primary { background: var(--primary-soft);      color: var(--primary-color); }
.badge-success { background: rgba(16,185,129,.2);      color: var(--success); }
.badge-error, .badge-danger { background: rgba(239,68,68,.2); color: var(--error); }
.badge-warning { background: rgba(245,158,11,.2);      color: var(--warning); }
.badge-info    { background: rgba(59,130,246,.2);      color: var(--info); }
.badge-muted   { background: var(--bg-hover);          color: var(--text-muted); }

/* -------------------------------------------------------------- Tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: var(--bg-hover); }
.table td { color: var(--text-secondary); }
.table td strong { color: var(--text-primary); font-weight: 600; }
.table-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* --------------------------------------------------------------- Modal ---- */
.modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.72);
    z-index: 2000;
    padding: 1rem;
    overflow-y: auto;
}
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 560px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.modal-header h3 { margin: 0; font-size: 1.15rem; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.35rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; }

/* -------------------------------------------------------- Public navbar ---- */
.navbar {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky; top: 0; z-index: 1000;
}
.navbar .container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.navbar .logo {
    font-size: 1.4rem; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: .5rem;
}
.navbar .logo:hover { color: var(--text-primary); }
.navbar .logo i { color: var(--primary-color); }
.navbar .logo img { height: 34px; width: auto; }
.navbar .nav-links { display: flex; gap: 1.75rem; list-style: none; align-items: center; }
.navbar .nav-links a { color: var(--text-secondary); font-size: .95rem; }
.navbar .nav-links a:hover { color: var(--primary-color); }
.navbar .nav-links a.btn-primary { color: #fff; padding: .55rem 1.35rem; border-radius: var(--radius); font-size: .9rem; }
.navbar .nav-links a.active { color: var(--primary-color); }
.nav-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.4rem; cursor: pointer; }

.nav-bell { position: relative; color: var(--text-secondary); font-size: 1.1rem; }
.nav-bell .dot {
    position: absolute; top: -6px; right: -8px;
    background: var(--error); color: #fff;
    font-size: .65rem; font-weight: 600;
    min-width: 16px; height: 16px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* -------------------------------------------------------------- Footer ---- */
.footer { background: var(--bg-card); border-top: 1px solid var(--border-color); padding: 2rem 0; margin-top: 4rem; }
.footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer p { color: var(--text-muted); font-size: .9rem; margin: 0; }
.footer-links { display: flex; gap: 1.5rem; list-style: none; flex-wrap: wrap; }
.footer-links a { color: var(--text-secondary); font-size: .9rem; }
.footer-links a:hover { color: var(--primary-color); }

/* ----------------------------------------------------- Dashboard layout ---- */
.dash { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 1.25rem 0;
    position: fixed; top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 1100;
    transition: transform .3s ease;
}
.sidebar-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 0 1.25rem 1.25rem;
    margin-bottom: .75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.15rem; font-weight: 600; color: var(--text-primary);
}
.sidebar-brand i { color: var(--primary-color); }
.sidebar-label {
    padding: 1rem 1.25rem .4rem;
    font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--text-muted); font-weight: 600;
}
.sidebar-nav { list-style: none; }
.sidebar-nav a {
    display: flex; align-items: center; gap: .8rem;
    padding: .7rem 1.25rem;
    color: var(--text-secondary);
    font-size: .92rem;
    border-left: 3px solid transparent;
    transition: all .2s;
}
.sidebar-nav a i { width: 18px; text-align: center; font-size: .95rem; }
.sidebar-nav a:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-nav a.active {
    background: var(--primary-soft);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}
.sidebar-footer { padding: 1rem 1.25rem 0; margin-top: 1rem; border-top: 1px solid var(--border-color); }

.dash-main { flex: 1; margin-left: var(--sidebar-width); min-width: 0; display: flex; flex-direction: column; }
.dash-content { padding: 1.75rem; flex: 1; }

.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.75rem; gap: 1rem;
    position: sticky; top: 0; z-index: 900;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.topbar h1 { font-size: 1.15rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.sidebar-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.3rem; cursor: pointer; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1050; }
.sidebar-backdrop.active { display: block; }

.user-chip { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary-color); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: .85rem; flex-shrink: 0;
}
.user-chip-name { font-size: .88rem; line-height: 1.2; }
.user-chip-role { font-size: .72rem; color: var(--text-muted); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    display: none; position: absolute; right: 0; top: calc(100% + .5rem);
    min-width: 210px; background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: .4rem 0; z-index: 1200;
}
.dropdown.active .dropdown-menu { display: block; }
.dropdown-item {
    display: flex; align-items: center; gap: .6rem;
    width: 100%; padding: .6rem 1rem; background: none; border: none;
    color: var(--text-secondary); font-size: .88rem; font-family: inherit;
    text-align: left; cursor: pointer;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-divider { height: 1px; background: var(--border-color); margin: .4rem 0; }
.dropdown-head { padding: .6rem 1rem; font-size: .78rem; color: var(--text-muted); }

/* ----------------------------------------------------------- Stat cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1.25rem; margin-bottom: 1.75rem; }
.stat {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.stat-info { min-width: 0; }
.stat-label { color: var(--text-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .35rem; }
.stat-value { font-size: 1.65rem; font-weight: 700; line-height: 1.15; color: var(--text-primary); }
.stat-meta { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }
.stat-meta.up { color: var(--success); }
.stat-meta.down { color: var(--error); }
.stat-icon {
    width: 44px; height: 44px; border-radius: var(--radius);
    background: var(--primary-soft); color: var(--primary-color);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.stat-icon.success { background: rgba(16,185,129,.15); color: var(--success); }
.stat-icon.warning { background: rgba(245,158,11,.15); color: var(--warning); }
.stat-icon.error   { background: rgba(239,68,68,.15);  color: var(--error); }
.stat-icon.info    { background: rgba(59,130,246,.15); color: var(--info); }

/* Charts */
.chart-box { position: relative; height: 300px; }
.chart-box-sm { position: relative; height: 240px; }

/* Empty state */
.empty {
    text-align: center; padding: 3rem 1.5rem; color: var(--text-muted);
}
.empty i { font-size: 2.5rem; margin-bottom: 1rem; display: block; opacity: .6; }
.empty h3 { color: var(--text-secondary); font-size: 1.05rem; margin-bottom: .4rem; }
.empty p { font-size: .9rem; margin-bottom: 1.25rem; }

/* Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    width: 36px; height: 36px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; margin: 0; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- Slot picker ---- */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .65rem; }
.slot {
    padding: .7rem .5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: .85rem;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    user-select: none;
    min-height: 46px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
}
.slot:hover:not(.disabled) { border-color: var(--primary-color); color: var(--text-primary); }
.slot.selected { background: var(--primary-color); border-color: var(--primary-color); color: #fff; font-weight: 500; }
.slot.in-range { background: var(--primary-soft); border-color: var(--primary-color); color: var(--primary-color); }
.slot.disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.slot.booked { border-color: var(--error); color: var(--error); opacity: .55; cursor: not-allowed; }
.slot.blocked { border-style: dashed; opacity: .5; cursor: not-allowed; }
.slot .slot-tag { font-size: .68rem; color: var(--warning); }
.slot.selected .slot-tag, .slot.in-range .slot-tag { color: inherit; }

.slot-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .78rem; color: var(--text-muted); margin-top: 1rem; }
.slot-legend span { display: flex; align-items: center; gap: .4rem; }
.legend-box { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border-color); display: inline-block; }
.legend-box.free { background: var(--bg-dark); }
.legend-box.sel { background: var(--primary-color); border-color: var(--primary-color); }
.legend-box.bkd { background: rgba(239,68,68,.35); border-color: var(--error); }
.legend-box.blk { background: transparent; border-style: dashed; }

/* Date strip */
.date-strip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; -webkit-overflow-scrolling: touch; }
.date-pill {
    flex: 0 0 auto; min-width: 62px; padding: .6rem .5rem;
    border: 1px solid var(--border-color); border-radius: var(--radius);
    background: var(--bg-dark); text-align: center; cursor: pointer;
    transition: all .2s; color: var(--text-secondary);
}
.date-pill:hover { border-color: var(--primary-color); }
.date-pill.active { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.date-pill .dp-day { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.date-pill .dp-num { font-size: 1.15rem; font-weight: 600; line-height: 1.2; }
.date-pill .dp-mon { font-size: .68rem; opacity: .8; }

/* ------------------------------------------------------------- Turf card ---- */
.turf-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all .3s;
    cursor: pointer;
    display: flex; flex-direction: column;
}
.turf-card:hover { transform: translateY(-4px); border-color: var(--primary-color); box-shadow: var(--shadow); }
.turf-image {
    width: 100%; height: 190px;
    background: var(--bg-hover);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 2.5rem;
    position: relative; overflow: hidden;
}
.turf-image img { width: 100%; height: 100%; object-fit: cover; }
.turf-image .fav-btn {
    position: absolute; top: .6rem; right: .6rem;
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(0,0,0,.55); border: none; color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: .9rem; transition: all .2s;
}
.turf-image .fav-btn:hover { background: rgba(0,0,0,.8); }
.turf-image .fav-btn.on { color: var(--error); }
.turf-content { padding: 1.15rem; flex: 1; display: flex; flex-direction: column; }
.turf-header { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: .7rem; }
.turf-name { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); margin: 0; }
.turf-status { font-size: .75rem; padding: .22rem .6rem; border-radius: var(--radius-sm); white-space: nowrap; }
.status-open   { background: rgba(16,185,129,.2); color: var(--success); }
.status-closed { background: rgba(239,68,68,.2);  color: var(--error); }
.turf-details { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; font-size: .88rem; }
.turf-detail-item { display: flex; align-items: center; gap: .5rem; color: var(--text-secondary); }
.turf-detail-item i { width: 16px; color: var(--primary-color); }
.turf-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 1rem; margin-top: auto; border-top: 1px solid var(--border-color);
}
.turf-price { font-size: 1.15rem; font-weight: 600; color: var(--primary-color); }
.turf-rating { display: flex; align-items: center; gap: .25rem; color: var(--warning); font-size: .88rem; }

/* --------------------------------------------------------- Misc widgets ---- */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: .5rem .85rem; border: 1px solid var(--border-color);
    border-radius: var(--radius); color: var(--text-secondary); font-size: .88rem;
}
.pagination a:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pagination .current { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }

.tabs { display: flex; gap: .4rem; border-bottom: 1px solid var(--border-color); margin-bottom: 1.5rem; overflow-x: auto; }
.tab {
    padding: .7rem 1.1rem; background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--text-secondary); cursor: pointer; font-size: .92rem; font-family: inherit; white-space: nowrap;
}
.tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); font-weight: 500; }

.toast-wrap { position: fixed; top: 1rem; right: 1rem; z-index: 3000; display: flex; flex-direction: column; gap: .6rem; }
.toast {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius); padding: .85rem 1.1rem;
    box-shadow: var(--shadow-lg); font-size: .9rem; color: var(--text-primary);
    display: flex; align-items: center; gap: .6rem; min-width: 240px; max-width: 340px;
    animation: toastIn .25s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

.progress { height: 8px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary-color); border-radius: 4px; transition: width .4s; }

.timeline { list-style: none; }
.timeline li { padding: .8rem 0 .8rem 1.25rem; border-left: 2px solid var(--border-color); position: relative; }
.timeline li::before {
    content: ''; position: absolute; left: -5px; top: 1.15rem;
    width: 8px; height: 8px; border-radius: 50%; background: var(--primary-color);
}
.timeline .tl-meta { font-size: .78rem; color: var(--text-muted); }

/* ----------------------------------------------------------- Utilities ----- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary-c { color: var(--primary-color); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error, .text-danger { color: var(--error); }
.fw-600 { font-weight: 600; }
.fs-sm { font-size: .85rem; }
.fs-xs { font-size: .78rem; }

.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.p-1 { padding: .5rem; } .p-2 { padding: 1rem; } .p-3 { padding: 1.5rem; } .p-4 { padding: 2rem; }

.d-flex { display: flex; } .d-none { display: none; } .d-block { display: block; }
.flex-col { flex-direction: column; } .flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.flex-1 { flex: 1; min-width: 0; }
.w-100 { width: 100%; }
.divider { height: 1px; background: var(--border-color); margin: 1.25rem 0; }
.nowrap { white-space: nowrap; }
.hide-scroll::-webkit-scrollbar { display: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* -------------------------------------------------- Mobile bottom navbar ---- */
.bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: .45rem .25rem calc(.45rem + env(safe-area-inset-bottom));
    z-index: 1300;
}
.bottom-nav ul { display: flex; list-style: none; }
.bottom-nav li { flex: 1; }
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: .2rem;
    padding: .4rem .2rem; color: var(--text-muted); font-size: .68rem;
}
.bottom-nav a i { font-size: 1.05rem; }
.bottom-nav a.active { color: var(--primary-color); }

/* ---------------------------------------------------------- Breakpoints ---- */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .dash-main { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .dash-content { padding: 1.25rem; }
    .topbar { padding: 0 1.25rem; }
}

@media (max-width: 768px) {
    .navbar .nav-links {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 1rem; gap: 0;
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow);
    }
    .navbar .nav-links.active { display: flex; }
    .navbar .nav-links li { width: 100%; padding: .75rem 0; border-bottom: 1px solid var(--border-color); }
    .navbar .nav-links li:last-child { border-bottom: none; }
    .nav-toggle { display: block; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .container, .container-wide { padding: 0 1rem; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .footer .container { flex-direction: column; text-align: center; }
    .user-chip-text { display: none; }
    .chart-box { height: 260px; }

    /* Tables collapse into cards */
    .table-cards thead { display: none; }
    .table-cards tbody tr {
        display: block; margin-bottom: .85rem; padding: .85rem;
        border: 1px solid var(--border-color); border-radius: var(--radius);
        background: var(--bg-card);
    }
    .table-cards tbody tr:hover { background: var(--bg-card); }
    .table-cards td {
        display: flex; justify-content: space-between; gap: 1rem;
        padding: .4rem 0; border: none; text-align: right;
    }
    .table-cards td::before {
        content: attr(data-label);
        color: var(--text-muted); font-size: .78rem; text-transform: uppercase;
        letter-spacing: .04em; text-align: left; flex-shrink: 0;
    }
    .table-cards .table-actions { justify-content: flex-end; }

    /* Bottom nav shown on user panel */
    body.has-bottom-nav { padding-bottom: 4.25rem; }
    body.has-bottom-nav .bottom-nav { display: block; }
}

@media (max-width: 576px) {
    .slot-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
    .stat-value { font-size: 1.4rem; }
    .dash-content { padding: 1rem; }
    .modal-content { max-height: 94vh; }
    .btn { padding: .7rem 1.15rem; }
}

@media print {
    .sidebar, .topbar, .navbar, .footer, .bottom-nav, .no-print { display: none !important; }
    .dash-main { margin-left: 0; }
    body { background: #fff; color: #000; }
}

/* ============================================================
   Part 2 — components introduced by the panels & booking flow
   ============================================================ */

/* Hero / page headers */
.page-head { padding: 2.5rem 0 1.5rem; }
.page-head h1 { font-size: 1.85rem; margin-bottom: .35rem; }
.page-head p { color: var(--text-muted); }
.breadcrumb { display: flex; gap: .5rem; font-size: .85rem; color: var(--text-muted); margin-bottom: .75rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary-color); }

/* Filter bar / sidebar */
.filter-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.75rem; align-items: start; }
.filter-panel { position: sticky; top: 5rem; }
.filter-panel .form-group { margin-bottom: 1.1rem; }
.filter-toggle { display: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
    padding: .35rem .8rem; border-radius: 999px; font-size: .8rem;
    background: var(--bg-hover); color: var(--text-secondary);
    border: 1px solid var(--border-color); cursor: pointer;
}
.chip.active { background: var(--primary-soft); border-color: var(--primary-color); color: var(--primary-color); }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

/* Star ratings */
.stars { color: var(--warning); font-size: .85rem; letter-spacing: .05em; }
.rating-value { color: var(--text-secondary); font-size: .85rem; }
.muted { color: var(--text-muted); }

/* Slot picker extras */
.date-pill .dp-day, .date-pill .dp-num, .date-pill .dp-mon { display: block; }
.slot-time { font-weight: 500; }
.slot-price { font-size: .72rem; color: var(--text-muted); }
.slot.selected .slot-price, .slot.in-range .slot-price { color: inherit; }
.slot.peak { border-color: var(--warning); }
.slot-loading { display: flex; align-items: center; gap: .75rem; color: var(--text-muted); font-size: .9rem; padding: 1.5rem 0; }
.slot-loading .spinner { margin: 0; }

/* Price summary */
.price-row { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; font-size: .9rem; color: var(--text-secondary); }
.price-row strong { color: var(--text-primary); }
.price-row.total { border-top: 1px solid var(--border-color); margin-top: .35rem; padding-top: .75rem; font-size: 1.05rem; }
.price-row.total strong { color: var(--primary-color); font-size: 1.2rem; }
.price-window { font-size: .85rem; color: var(--primary-color); margin-bottom: .5rem; }

/* Bar chart */
.bars { display: flex; align-items: flex-end; gap: .5rem; height: 100%; padding-top: 1.25rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.bar {
    width: 100%; max-width: 46px; border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-soft));
    transition: height .4s ease;
}
.bar-col:hover .bar { background: var(--primary-hover); }
.bar-label { font-size: .68rem; color: var(--text-muted); margin-top: .4rem; white-space: nowrap; }
.bar-value { font-size: .68rem; color: var(--text-secondary); margin-bottom: .25rem; }

/* Heatmap */
.heatmap { display: grid; grid-template-columns: 42px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: .62rem; }
.heat-cell { aspect-ratio: 1; border-radius: 3px; background: var(--bg-hover); }
.heat-head, .heat-row-label { color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.heat-row-label { justify-content: flex-start; }

/* Booking confirmation */
.ticket { max-width: 620px; margin: 0 auto; }
.ticket-head { text-align: center; padding: 2rem 1.5rem 1.25rem; }
.ticket-head .tick {
    width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 1rem;
    background: rgba(16,185,129,.15); color: var(--success);
    display: flex; align-items: center; justify-content: center; font-size: 1.75rem;
}
.ticket-ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.25rem; letter-spacing: .08em; color: var(--primary-color); }
.ticket-qr { display: flex; justify-content: center; padding: 1.25rem 0; }
.ticket-qr img { background: #fff; padding: .5rem; border-radius: var(--radius); }
.detail-list { display: grid; gap: .1rem; }
.detail-row { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px dashed var(--border-color); font-size: .9rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--text-muted); }
.detail-row strong { color: var(--text-primary); text-align: right; }

/* Gallery */
.gallery { display: grid; grid-template-columns: 2fr 1fr; gap: .75rem; }
.gallery-main, .gallery-thumbs img { border-radius: var(--radius); overflow: hidden; }
.gallery-main img { width: 100%; height: 340px; object-fit: cover; border-radius: var(--radius); }
.gallery-thumbs { display: grid; gap: .75rem; }
.gallery-thumbs img { width: 100%; height: 105px; object-fit: cover; cursor: pointer; }
.gallery-empty {
    height: 340px; border-radius: var(--radius); background: var(--bg-hover);
    display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 2.5rem;
}

/* Amenities & review list */
.amenity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.amenity { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--text-secondary); }
.amenity i { color: var(--primary-color); width: 18px; text-align: center; }
.review { padding: 1.1rem 0; border-bottom: 1px solid var(--border-color); }
.review:last-child { border-bottom: none; }
.review-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; flex-wrap: wrap; }
.review-author { font-weight: 600; font-size: .92rem; }
.review-body { color: var(--text-secondary); font-size: .9rem; }
.review-response {
    margin-top: .75rem; padding: .75rem 1rem; border-left: 3px solid var(--primary-color);
    background: var(--bg-hover); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .88rem;
}
.rating-bar-row { display: flex; align-items: center; gap: .6rem; font-size: .8rem; color: var(--text-muted); }
.rating-bar-row .progress { flex: 1; }

/* Star input */
.star-input { display: flex; gap: .3rem; font-size: 1.6rem; color: var(--border-color); cursor: pointer; }
.star-input i.on { color: var(--warning); }

/* Toast leaving animation */
.toast.leaving { opacity: 0; transform: translateX(20px); transition: opacity .3s, transform .3s; }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; }
.cal-head { text-align: center; font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; padding: .35rem 0; }
.cal-day {
    min-height: 84px; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    padding: .4rem; font-size: .75rem; background: var(--bg-card);
}
.cal-day.other { opacity: .35; }
.cal-day.today { border-color: var(--primary-color); }
.cal-num { font-weight: 600; color: var(--text-secondary); margin-bottom: .25rem; }
.cal-pill {
    display: block; background: var(--primary-soft); color: var(--primary-color);
    border-radius: 3px; padding: .12rem .3rem; margin-bottom: .15rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .68rem;
}
.cal-more { color: var(--text-muted); font-size: .66rem; }

/* Permission grid */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.perm-item {
    display: flex; align-items: flex-start; gap: .6rem; padding: .75rem;
    border: 1px solid var(--border-color); border-radius: var(--radius); font-size: .87rem;
}
.perm-item input { margin-top: .15rem; accent-color: var(--primary-color); }

/* Image upload preview */
.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.upload-tile { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-color); }
.upload-tile img { width: 100%; height: 92px; object-fit: cover; display: block; }
.upload-tile .rm {
    position: absolute; top: .3rem; right: .3rem; background: rgba(0,0,0,.65); color: #fff;
    border: none; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: .75rem;
}

@media (max-width: 992px) {
    .filter-layout { grid-template-columns: 1fr; }
    .filter-panel { position: static; }
    .filter-toggle { display: inline-flex; }
    .filter-panel.collapsed { display: none; }
    .gallery { grid-template-columns: 1fr; }
    .gallery-thumbs { grid-template-columns: repeat(4, 1fr); }
    .gallery-thumbs img { height: 80px; }
}

@media (max-width: 768px) {
    .heatmap { grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: .5rem; }
    .cal-day { min-height: 62px; padding: .25rem; }
    .page-head { padding: 1.75rem 0 1rem; }
    .page-head h1 { font-size: 1.45rem; }
}

/* ============================================================
   Part 3 — panel-only helpers (user / manager / admin shells)
   ============================================================ */

/* Page heading inside a dashboard: title block + right-aligned actions */
.panel-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.panel-head h2 { font-size: 1.4rem; margin: 0 0 .25rem; }
.panel-head p { color: var(--text-muted); font-size: .88rem; margin: 0; }
.panel-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Horizontal tab strip for list scopes */
.tabs {
    display: flex; gap: .35rem; flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.tabs a {
    padding: .65rem 1rem; font-size: .9rem; color: var(--text-secondary);
    border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--text-primary); }
.tabs a.active { color: var(--primary-color); border-bottom-color: var(--primary-color); font-weight: 500; }
.tabs .count { font-size: .75rem; color: var(--text-muted); margin-left: .3rem; }

/* Inline filter bar above tables */
.toolbar {
    display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end;
    margin-bottom: 1.25rem;
}
.toolbar .form-control, .toolbar select { min-width: 150px; }
.toolbar-grow { flex: 1 1 220px; min-width: 0; }

/* Two-column form layout inside panels */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; }
.form-grid-full { grid-column: 1 / -1; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.form-section { border-top: 1px solid var(--border-color); margin-top: 1.75rem; padding-top: 1.5rem; }
.form-section:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.form-section h4 { font-size: .95rem; margin-bottom: .25rem; }

/* Compact key/value list used across detail views */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.kv-item .kv-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.kv-item .kv-value { font-size: .95rem; color: var(--text-primary); margin-top: .2rem; word-break: break-word; }

/* Notification list */
.notif-list { list-style: none; }
.notif {
    display: flex; gap: .9rem; padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}
.notif:last-child { border-bottom: none; }
.notif-icon {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: var(--primary-soft); color: var(--primary-color);
    display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.notif-body { min-width: 0; flex: 1; }
.notif-title { font-size: .92rem; color: var(--text-primary); font-weight: 500; }
.notif-text { font-size: .85rem; color: var(--text-secondary); margin-top: .15rem; }
.notif-time { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }
.notif.unread .notif-title::after {
    content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--primary-color); margin-left: .45rem; vertical-align: middle;
}

/* Mini list rows (payouts, staff, logs) */
.list-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.list-row:last-child { border-bottom: none; }
.list-row-main { min-width: 0; }
.list-row-title { font-size: .92rem; color: var(--text-primary); }
.list-row-sub { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

@media (max-width: 768px) {
    .panel-head { align-items: flex-start; }
    .toolbar .form-control, .toolbar select { min-width: 0; width: 100%; }
    .toolbar { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   Admin panel extras
   ============================================================ */

/* Clickable queue tiles on the admin dashboard */
.queue-card {
    display: flex; align-items: center; gap: 1rem;
    color: inherit; text-decoration: none;
    transition: border-color .2s, transform .2s;
}
.queue-card:hover { border-color: var(--primary-color); transform: translateY(-2px); }
.queue-card .stat-value { font-size: 1.5rem; font-weight: 600; line-height: 1.1; }

/* Colour pickers on the appearance screen */
.swatch-row { display: flex; align-items: center; gap: .6rem; }
.swatch-row input[type="color"] {
    width: 46px; height: 40px; flex-shrink: 0; padding: 0; cursor: pointer;
    border: 1px solid var(--border-color); border-radius: 8px; background: none;
}
.swatch-row .form-control { flex: 1; min-width: 0; }

/* Live theme preview */
.theme-preview {
    border: 1px solid var(--border-color); border-radius: var(--radius);
    padding: 1.25rem; display: grid; gap: .85rem;
}
.theme-preview .pv-bar { height: 10px; border-radius: 999px; }
.theme-preview .pv-row { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Settings sub-navigation */
.sub-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.sub-nav a {
    padding: .5rem .9rem; border-radius: 999px; font-size: .85rem;
    border: 1px solid var(--border-color); color: var(--text-secondary); text-decoration: none;
}
.sub-nav a.active { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.sub-nav a:hover:not(.active) { border-color: var(--primary-color); color: var(--text-primary); }


