:root {
    --bg: #f5f7fa;
    --surface: #fff;
    --ink: #172337;
    --muted: #5d6d82;
    --line: #e2e8f0;
    --brand: #2457a6;
    --brand-hover: #1e478a;
    --red: #2457a6;
    --red-ink: #fff;
    --gold: #925b12;
    --green: #18794e;
    --shadow: 0 8px 28px rgba(23, 35, 55, .07);
    box-sizing: border-box;
    color-scheme: light;
}
*, *::before, *::after { box-sizing: inherit; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #111827;
        --surface: #1b2638;
        --ink: #eef3fb;
        --muted: #b4c0d1;
        --line: #344155;
        --brand: #82b3ff;
        --brand-hover: #a7caff;
        --red: #82b3ff;
        --red-ink: #111827;
        --gold: #f2bd65;
        --green: #75d6a7;
        --shadow: 0 8px 28px rgba(0, 0, 0, .18);
        color-scheme: dark;
    }
}
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 Arial, "Helvetica Neue", "Segoe UI", sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.brand { color: var(--ink); font-size: 22px; font-weight: 800; letter-spacing: .2px; text-decoration: none; }
.brand span { color: var(--brand); }
.brand small { margin-left: 8px; color: var(--muted); font-size: 13px; letter-spacing: 1px; }
.eyebrow { margin: 0 0 5px; color: var(--brand-hover); font-size: 14px; font-weight: 700; letter-spacing: .8px; }
.muted { color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border: 1px solid transparent; border-radius: 7px; font-weight: 600; text-decoration: none; }
.primary { background: var(--red); color: var(--red-ink); }
.subtle { border-color: var(--line); background: var(--surface); color: var(--ink); }
.success { background: var(--green); color: var(--red-ink); }
.danger-outline { border-color: #bf7374; background: var(--surface); color: #923b3b; }
.full-width { width: 100%; margin-top: 20px; }
.admin-header { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); background: var(--surface); }
.admin-header-inner { display: flex; width: 100%; max-width: 1200px; min-height: 68px; margin: auto; padding: 10px 24px; align-items: center; justify-content: space-between; gap: 20px; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user-name { color: var(--muted); font-size: 14px; }
.admin-user-name strong { color: var(--ink); }
.admin-user form, .card-actions form { margin: 0; }
.dashboard { width: 100%; max-width: 1320px; margin: 0 auto; padding: 38px 28px 72px; }
.dashboard-overview { scroll-margin-top: 24px; }
.page-heading { margin-bottom: 24px; }
.page-heading .eyebrow { margin-bottom: 7px; }
.page-heading h1, .login-card h1 { margin: 0; font-size: 32px; line-height: 1.2; }
.page-heading .muted { margin: 5px 0 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 28px; }
.stat-card { display: grid; min-height: 136px; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.stat-card:hover { transform: translateY(-2px); border-color: #a9bfdc; box-shadow: 0 12px 30px rgba(23, 35, 55, .1); }
.stat-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.stat-card span { color: var(--muted); font-size: 14px; font-weight: 600; }
.stat-card strong { color: var(--ink); font-size: 32px; line-height: 1.1; }
.stat-card small { align-self: end; color: var(--brand); font-size: 13px; font-weight: 600; }
.stat-card-attention { border-left: 4px solid var(--gold); }
.dashboard-tools { display: grid; grid-template-columns: minmax(220px, .68fr) minmax(0, 1.32fr); align-items: center; gap: 18px; margin: 0 0 36px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.dashboard-search { min-width: 0; }
.dashboard-search > label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 700; }
.dashboard-search > input { min-height: 44px; padding: 9px 12px; }
.search-results { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.dashboard-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dashboard-nav-label { margin-right: 2px; color: var(--muted); font-size: 13px; font-weight: 700; }
.dashboard-nav a { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.dashboard-nav a:hover { border-color: var(--brand); background: var(--surface); color: var(--brand-hover); }
.dashboard-nav a span { color: var(--muted); font-size: 12px; }
.admin-section { margin-top: 34px; scroll-margin-top: 24px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-size: 24px; }
.count { color: var(--muted); font-size: 15px; }
.managed-list { display: grid; gap: 12px; }
.managed-card, .empty-state { min-width: 0; overflow-wrap: anywhere; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.managed-card[hidden] { display: none; }
.managed-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.managed-title h3 { margin: 0; font-size: 19px; }
.managed-title p { margin: 2px 0 0; }
.status { flex: 0 0 auto; padding: 4px 10px; border-radius: 99px; font-size: 14px; font-weight: 600; }
.status.approved { background: #e3f2eb; color: #185c42; }
.status.pending { background: #fff0d9; color: #71400e; }
.status.new { background: #e8f0fb; color: #244d83; }
.status.confirmed { background: #e3f2eb; color: #185c42; }
.status.declined { background: #f7e8e5; color: #873d37; }
.status.completed { background: #e8f0fb; color: #244d83; }
details { margin-top: 12px; }
summary { color: var(--brand-hover); cursor: pointer; font-weight: 600; }
.edit-form { margin: 14px 0 10px; padding: 14px; border-radius: 8px; background: var(--bg); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.edit-form label, .login-card label { display: grid; gap: 4px; margin-bottom: 10px; font-weight: 600; }
.edit-form input, .edit-form select, .edit-form textarea, .login-card input { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.edit-form input[type="file"] { max-width: 100%; }
.edit-form textarea { resize: vertical; }
.card-actions { display: flex; gap: 8px; margin-top: 14px; }
.booking-reference { margin-left: 7px; color: var(--muted); font-size: 14px; font-weight: 600; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.inline-form select { width: auto; min-width: 145px; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.content-manager { margin: 14px 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.admin-thumb { width: 96px; height: 68px; flex: 0 0 auto; border-radius: 7px; object-fit: cover; }
.checkbox-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; }
.checkbox-label input { width: 17px; height: 17px; margin: 0; }
.admin-gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin-top: 14px; }
.admin-gallery-grid .managed-card { min-width: 0; }
.gallery-admin-image { width: 100%; height: 190px; border-radius: 7px; object-fit: cover; }
.gallery-upload { margin-top: 12px; border-radius: 9px; }
.settings-form { border-radius: 9px; }
.settings-subheading { margin: 14px 0 4px; font-size: 18px; }
.settings-help { margin: 0 0 10px; font-size: 14px; }
.request-card > p { margin: 12px 0 4px; }
.request-card > form { margin-top: 12px; }
.login-page { display: grid; min-height: 100vh; padding: 24px; align-content: center; justify-items: center; }
.back-link { position: absolute; top: 24px; left: max(24px, calc((100vw - 460px) / 2)); color: var(--muted); text-decoration: none; }
.login-card { width: min(100%, 420px); padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.login-card .brand { margin-bottom: 26px; }
.login-card .muted { margin: 8px 0 20px; }
.login-card label { margin: 14px 0 5px; }
.notice { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 5; max-width: min(440px, calc(100% - 40px)); padding: 12px 18px; border-radius: 8px; background: var(--brand); color: var(--red-ink); box-shadow: var(--shadow); }
@media (max-width: 960px) {
    .admin-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-tools { grid-template-columns: 1fr; gap: 12px; }
}
.notice.error { background: #873d37; color: #fff; }
.notice.success { background: #185c42; color: #fff; }
@media (max-width: 760px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-header-inner { padding: 10px 16px; }
    .dashboard { padding: 24px 16px 48px; }
    .admin-user > span { display: none; }
    .page-heading h1 { font-size: 29px; }
    .dashboard-tools { padding: 14px; }
}
@media (max-width: 480px) {
    .admin-header-inner { flex-wrap: wrap; gap: 5px; padding: 8px 14px; }
    .admin-header-inner > .brand { flex: 1 0 100%; }
    .admin-user { gap: 5px; }
    .admin-user { width: 100%; justify-content: flex-start; }
    .admin-user .button { padding: 7px 9px; font-size: 14px; }
    .stats { gap: 8px; }
    .stat-card { min-height: 122px; padding: 13px; }
    .stat-card strong { font-size: 28px; }
    .field-grid { grid-template-columns: 1fr; gap: 0; }
    .managed-title { flex-direction: column; }
    .admin-gallery-grid { grid-template-columns: 1fr; }
    .card-actions { flex-wrap: wrap; }
    .card-actions form, .card-actions .button { flex: 1 1 130px; }
    .inline-form { align-items: stretch; flex-direction: column; }
    .inline-form select, .inline-form .button { width: 100%; }
    .login-page { padding: 18px 14px; padding-top: max(64px, env(safe-area-inset-top, 0px)); }
    .login-card { padding: 22px; }
    .back-link { top: max(16px, env(safe-area-inset-top, 0px)); left: 16px; }
    .notice { right: 12px; bottom: max(12px, env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 24px); }
}
