/* Hydration Break — admin (posadmin-style, sidebar) */

:root {
    --bg: #0e100e;
    --panel: #171a16;
    --panel-2: #1e221e;
    --text: #e9e7dc;
    --muted: #a7ab9e;
    --gold: #d4af37;
    --gold-dark: #a8862a;
    --line: #2a2f28;
    --error: #e0655f;
    --ok: #7fb069;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0; background: var(--bg); color: var(--text);
    font-family: 'Archivo', Arial, sans-serif; font-size: 15px; line-height: 1.5;
}
a { color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mt { margin-top: 2rem; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 0.8rem; }

/* Buttons & forms */
.btn {
    display: inline-block; text-decoration: none; cursor: pointer;
    font: inherit; font-weight: 700; font-size: 0.92rem;
    border-radius: 999px; padding: 0.65rem 1.3rem; border: 1px solid transparent;
}
.btn-gold { background: var(--gold); color: #14161a; }
.btn-gold:hover { background: #e3c355; }
.btn-dark { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.btn-dark:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: transparent; color: #f0a09b; border-color: #6e3532; }
.btn-danger:hover { background: #6e3532; color: #fff; }
.btn-small { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; text-align: center; }

.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.field input[type="text"], .field input[type="tel"], .field input[type="password"],
.field input[type="number"], .field input[type="date"], .field textarea, .field select {
    width: 100%; padding: 0.65rem 0.75rem; border-radius: 9px;
    border: 1px solid var(--line); background: #101210; color: var(--text); font: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.3);
}
.check-field { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }

.flash { border-radius: var(--radius); padding: 0.8rem 1rem; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--panel); }
.flash-error { border-color: var(--error); color: #f0b3af; }
.flash-success { border-color: var(--ok); color: #bfe3b6; }

/* Shell */
.admin-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.admin-side {
    background: #0a0c0a; border-right: 1px solid var(--line);
    padding: 1.2rem 1rem; display: flex; flex-direction: column; gap: 1.4rem;
    position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden;
}
.side-brand { display: flex; gap: 0.6rem; align-items: center; }
.side-brand strong { display: block; font-size: 1rem; }
.side-brand small { color: var(--muted); }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: 2px solid var(--gold); border-radius: 9px;
    color: var(--gold); font-weight: 900; flex: none;
}
.side-nav { display: flex; flex-direction: column; gap: 0.25rem; overflow-y: auto; flex: 1 1 auto; min-height: 0; padding-right: 0.2rem; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.side-nav a {
    color: var(--text); text-decoration: none; font-weight: 600;
    padding: 0.6rem 0.8rem; border-radius: 9px;
}
.side-nav a:hover { background: var(--panel); }
.side-nav a.active { background: var(--gold); color: #14161a; }
.side-foot { margin-top: auto; display: flex; flex-direction: row; align-items: center; gap: 0.9rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1rem; }
.side-foot a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.side-foot a:hover { color: var(--gold); }
.side-user { font-weight: 700; }

.admin-main { min-width: 0; }
.admin-top {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.6rem; border-bottom: 1px solid var(--line);
    background: rgba(14,16,14,0.95); position: sticky; top: 0; z-index: 20;
}
.side-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer; }
.admin-content { padding: 1.6rem; max-width: 1400px; }

/* Panels & stats */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1.4rem; }
.panel.narrow { max-width: 720px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.stat-label { display: block; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.stat-value { display: block; font-size: 1.8rem; font-weight: 800; color: var(--gold); margin: 0.3rem 0; }
.stat-sub { color: var(--muted); font-size: 0.88rem; }

/* Tables */
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.admin-table th, .admin-table td { padding: 0.65rem 0.7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table thead th { color: var(--gold); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.admin-table input[type="number"], .admin-table input[type="text"] {
    padding: 0.4rem 0.5rem; border-radius: 7px; border: 1px solid var(--line);
    background: #101210; color: var(--text); font: inherit; font-size: 0.9rem; width: 130px;
}
.price-edit-table input[type="number"] { width: 100px; }

.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-booked { background: #274d1f; color: #bfe3b6; }
.badge-hold { background: #57450f; color: #f0d488; }
.badge-cancelled { background: #57201d; color: #f0b3af; }
.badge-expired { background: #333833; color: #c9ccc2; }
.badge-pending { background: #173d5c; color: #a9d3f5; }
.badge-played { background: #14524b; color: #a3e8dc; }
.badge-refunded { background: #463a5e; color: #d3c2f0; }

/* Bookings page — posadmin-style status tabs */
.status-tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 1rem; }
.status-tabs .tab {
    padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid var(--line);
    color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.92rem; background: var(--panel);
}
.status-tabs .tab:hover { border-color: var(--gold); color: var(--gold); }
.status-tabs .tab.active { background: var(--gold); color: #14161a; border-color: var(--gold); }
.status-tabs .tab-count {
    display: inline-block; min-width: 1.5em; text-align: center; padding: 0 0.3em;
    border-radius: 999px; background: rgba(0, 0, 0, .28); font-size: 0.82em; margin-left: 0.3em;
}

.actions-cell { min-width: 220px; }
.inline-form { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; margin: 0.15rem 0.3rem 0.15rem 0; }

.filter-bar { display: flex; gap: 0.8rem; align-items: end; flex-wrap: wrap; margin-bottom: 1.2rem; }
.filter-bar label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.9rem; }
.filter-bar input, .filter-bar select {
    padding: 0.55rem 0.7rem; border-radius: 9px; border: 1px solid var(--line);
    background: #101210; color: var(--text); font: inherit;
}

.row-form { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.row-form input {
    padding: 0.55rem 0.7rem; border-radius: 9px; border: 1px solid var(--line);
    background: #101210; color: var(--text); font: inherit;
}

.media-preview { border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 1rem; background: #fff; }
.media-preview.qr { width: 180px; padding: 6px; }
.media-preview.hero { width: 100%; max-height: 260px; object-fit: cover; background: #101210; }
.media-preview.video { width: 100%; background: #000; }
.gallery-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.8rem; margin: 0.8rem 0 1rem; }
.gallery-admin figure { margin: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.gallery-admin img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.2rem; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 2rem; width: min(420px, 100%); }
.login-card .side-brand { margin-bottom: 1.4rem; }

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side {
        position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 260px; height: auto;
        transform: translateX(-100%); transition: transform 0.2s ease;
    }
    body.side-open .admin-side { transform: translateX(0); }
    .side-toggle { display: inline-block; }
    .admin-content { padding: 1.1rem; }
}
.media-preview.logo { width: 180px; padding: 10px; background: #101210; }
.side-brand .brand-logo { height: 40px; width: auto; display: block; border-radius: 8px; }
.hold-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .8rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.hold-row:first-of-type { border-top: none; }
.hold-info { flex: 1 1 220px; }
.side-search { display: flex; gap: .35rem; padding: 0 1rem .7rem; }
.side-search input { flex: 1; min-width: 0; background: #171917; border: 1px solid var(--line); border-radius: 8px; color: #f2ead8; padding: .38rem .5rem; font: inherit; font-size: .82rem; }
.side-search button { padding: .38rem .7rem; font-size: .82rem; }
.ongoing-panel { border: 2px solid #d4af37; box-shadow: 0 0 0 4px rgba(212, 175, 55, .14), 0 10px 30px rgba(0, 0, 0, .35); }
.ongoing-panel .panel-head h2 { color: #d4af37; }
.side-site-btn { display: block; margin: 0 1rem 1rem; text-align: center; }
.target-bar { height: 10px; background: #26282a; border-radius: 99px; overflow: hidden; margin-top: .4rem; }
.target-bar > span { display: block; height: 100%; background: #d4af37; }
.panel textarea { background: #171917; border: 1px solid var(--line); border-radius: 8px; color: #f2ead8; padding: .7rem; font: inherit; }

/* =====================================================================
   V16 — premium polish (black + gold), compact sidebar, mobile backdrop
   ===================================================================== */
:root {
    --gold-hi: #f3dc8a;
    --grad-gold: linear-gradient(135deg, #f6e2a0 0%, #d4af37 48%, #a8841f 100%);
    --glow: 0 18px 40px -22px rgba(0, 0, 0, .9);
}
body.admin-body {
    background:
        radial-gradient(900px 420px at 88% -8%, rgba(212, 175, 55, .10), transparent 60%),
        radial-gradient(700px 400px at -10% 110%, rgba(212, 175, 55, .05), transparent 60%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(212, 175, 55, .35); }

/* Sidebar */
.admin-side {
    background: linear-gradient(180deg, #0e0f0d 0%, #070807 100%);
    border-right: 1px solid rgba(212, 175, 55, .16);
}
.side-brand strong { font-weight: 800; letter-spacing: .2px; }
.side-brand .brand-logo, .brand-mark {
    border: 1px solid rgba(212, 175, 55, .35); border-radius: 12px;
    box-shadow: 0 8px 20px -10px rgba(212, 175, 55, .45);
}
.side-close { display: none; margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: .3rem .5rem; border-radius: 8px; }

/* Compact search: slim pill with an icon button */
.side-search {
    display: flex; align-items: center; gap: .3rem; padding: 0 .3rem 0 .3rem; margin: 0 0 .2rem;
    height: 38px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 999px;
    background: rgba(255, 255, 255, .03); transition: border-color .2s, box-shadow .2s;
}
.side-search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .14); }
.side-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; box-shadow: none; padding: .2rem .2rem .2rem .7rem; font-size: .82rem; }
.side-search-btn {
    flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%;
    background: var(--grad-gold); color: #1a1405; cursor: pointer;
}
.side-search-btn:hover { filter: brightness(1.08); }

/* Nav */
.side-nav a { position: relative; transition: background .18s, color .18s; }
.side-nav a:hover { background: rgba(212, 175, 55, .08); color: #fff; }
.side-nav a.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, .22), rgba(212, 175, 55, .04));
    color: var(--gold-hi);
}
.side-nav a.active::before {
    content: ""; position: absolute; left: -1rem; top: 9px; bottom: 9px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--grad-gold);
}

/* Footer links on ONE line: admin · View Site · Log Out */
.side-foot { flex-wrap: nowrap; white-space: nowrap; gap: .55rem; font-size: .85rem; }
.side-foot .side-user { max-width: 88px; overflow: hidden; text-overflow: ellipsis; }
.side-foot a, .side-foot .side-user { font-size: .85rem; }
.side-foot > * + *::before { content: "·"; margin-right: .55rem; color: var(--muted); opacity: .6; }
.side-foot a:hover { color: var(--gold-hi); }

/* Top bar */
.admin-top { background: rgba(8, 9, 8, .72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.admin-top h1 { font-weight: 800; letter-spacing: .2px; }

/* Cards & stats */
.panel, .stat-card {
    background: linear-gradient(180deg, #1b1e1a, #131512);
    border: 1px solid rgba(212, 175, 55, .16); box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .04);
    border-radius: 16px;
}
.stat-card { position: relative; overflow: hidden; transition: transform .2s, border-color .2s; }
.stat-card::after {
    content: ""; position: absolute; right: -28px; top: -28px; width: 90px; height: 90px; border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, .16), transparent 70%); pointer-events: none;
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(212, 175, 55, .4); }
.stat-value { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Buttons */
.btn { transition: transform .15s, filter .2s, background .2s, border-color .2s, box-shadow .2s; }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--grad-gold); box-shadow: 0 8px 22px -10px rgba(212, 175, 55, .8); }
.btn-gold:hover { background: var(--grad-gold); filter: brightness(1.07); }
.btn[disabled], button[disabled] { opacity: .55; cursor: not-allowed; }

/* Inputs */
.field input, .field textarea, .field select, .filter-bar input, .filter-bar select, .row-form input { transition: border-color .2s, box-shadow .2s; }
select {
    appearance: none; -webkit-appearance: none; padding-right: 2rem !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23d4af37' stroke-width='1.8' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat; background-position: right .8rem center;
}
input[type="date"], input[type="month"], input[type="time"] { color-scheme: dark; }

/* Tables */
.admin-table thead th { background: rgba(212, 175, 55, .05); }
.admin-table tbody tr { transition: background .15s; }
.admin-table tbody tr:hover { background: rgba(212, 175, 55, .05); }

/* Badges & flashes */
.badge::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .4rem; vertical-align: 1px; }
.flash { animation: hbRise .35s ease both; }
@keyframes hbRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Login */
.login-card { background: linear-gradient(180deg, #181a17, #0e0f0d); border-color: rgba(212, 175, 55, .22); box-shadow: 0 30px 80px -30px #000; }

/* Mobile menu: dimmed backdrop; tapping it closes the menu */
.side-backdrop { display: none; }
@media (max-width: 900px) {
    .admin-side { width: min(82vw, 300px); transition: transform .3s cubic-bezier(.22, .8, .3, 1); overscroll-behavior: contain; }
    body.side-open .admin-side { box-shadow: 24px 0 60px rgba(0, 0, 0, .7); }
    body.side-open { position: fixed; width: 100%; overflow: hidden; }
    .side-backdrop {
        display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .62); touch-action: none;
        -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
        opacity: 0; pointer-events: none; transition: opacity .25s;
    }
    body.side-open .side-backdrop { opacity: 1; pointer-events: auto; }
    .side-close { display: block; }
    .side-nav a.active::before { left: -1rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
    .admin-side, .admin-top, .side-backdrop, .no-print, .flash { display: none !important; }
    body.admin-body { background: #fff; color: #000; }
    .panel { background: #fff; border: 1px solid #bbb; box-shadow: none; color: #000; }
    .admin-table th, .admin-table td { color: #000; border-color: #ccc; }
    .muted { color: #444; }
}
