:root {
  --ink: #211f20;
  --muted: #716b64;
  --paper: #fff;
  --canvas: #f6f1e9;
  --gold: #ad6b1d;
  --gold-light: #ead0a3;
  --line: #e7ded2;
  --green: #1f7a50;
  --orange: #b56619;
  --red: #b23b3b;
  --shadow: 0 22px 60px rgba(57, 41, 24, .11);
}

* { box-sizing: border-box; }
html { min-width: 320px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-width: 320px; margin: 0; overflow-x: hidden; color: var(--ink); background: var(--canvas); font-family: Tahoma, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.admin-header, button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
.admin-container { width: min(1180px, calc(100% - 36px)); margin-inline: auto; }
.admin-header { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-brand img { width: 55px; height: 44px; object-fit: contain; }
.admin-brand span { display: grid; gap: 3px; }
.admin-brand strong { font-size: 17px; }
.admin-brand small { color: var(--muted); font-size: 11px; }
.admin-nav { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 5px; background: #f4efe8; border-radius: 13px; }
.admin-nav a { padding: 9px 12px; color: var(--muted); border-radius: 9px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.admin-nav a:hover, .admin-nav a.active { color: #fff; background: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.header-actions a { padding: 10px 13px; border-radius: 10px; }
.header-actions a:hover { background: #f3eee7; }
.logout-link { color: var(--red); }
.admin-main { padding: 55px 0 calc(90px + env(safe-area-inset-bottom, 0px)); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.page-heading h1 { margin: 9px 0 9px; font-size: clamp(30px, 4vw, 49px); line-height: 1.2; }
.page-heading p { margin: 0; color: var(--muted); }
.today-card { min-width: 190px; display: grid; gap: 5px; padding: 17px 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(57,41,24,.05); }
.today-card span { color: var(--muted); font-size: 11px; }
.flash { margin: 28px 0 0; padding: 15px 18px; border-radius: 13px; font-size: 13px; font-weight: 700; }
.flash.success { color: #155f3d; background: #e5f5ec; border: 1px solid #bfe2ce; }
.flash.error { color: #8d2d2d; background: #fff0f0; border: 1px solid #efc9c9; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 36px 0 45px; }
.stat-card { display: flex; align-items: center; justify-content: space-between; min-height: 100px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; transition: transform .2s, border-color .2s; }
.stat-card:hover { transform: translateY(-3px); }
.stat-card.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(173,107,29,.1); }
.stat-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.stat-card strong { font-size: 31px; }
.stat-card.pending strong { color: var(--orange); }
.stat-card.confirmed strong { color: var(--green); }
.stat-card.cancelled strong { color: var(--red); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-title h2 { margin: 0; font-size: 24px; }
.section-title span { color: var(--muted); font-size: 12px; }
.booking-list { display: grid; gap: 16px; }
.booking-card { padding: 22px; background: #fff; border: 1px solid var(--line); border-right: 5px solid #aaa; border-radius: 18px; box-shadow: 0 10px 35px rgba(57,41,24,.05); }
.booking-card.status-pending { border-right-color: var(--orange); }
.booking-card.status-confirmed { border-right-color: var(--green); }
.booking-card.status-cancelled { border-right-color: var(--red); opacity: .82; }
.booking-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.booking-topline > div { display: flex; align-items: center; gap: 10px; }
.booking-topline code { color: var(--muted); font-family: Consolas, monospace; font-size: 12px; }
.booking-topline time { color: var(--muted); font-size: 11px; }
.status-pill { display: inline-flex; padding: 7px 10px; border-radius: 999px; font-size: 10px; font-weight: 900; }
.status-pill.pending { color: #87470e; background: #fff0dc; }
.status-pill.confirmed { color: #17603e; background: #e4f5eb; }
.status-pill.cancelled { color: #8d2d2d; background: #ffeded; }
.booking-grid { display: grid; grid-template-columns: 1.1fr 1fr .9fr; gap: 28px; padding: 20px 0; }
.booking-grid section { min-width: 0; }
.booking-grid small, .booking-note small { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; }
.booking-grid h3 { margin: 0 0 6px; font-size: 19px; }
.booking-grid strong { display: block; margin-bottom: 6px; }
.booking-grid p { margin: 4px 0; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.booking-grid a:hover { color: var(--gold); text-decoration: underline; }
.date-block strong { direction: ltr; text-align: right; }
.booking-note { padding: 13px 15px; background: #faf7f2; border-radius: 11px; }
.booking-note p { margin: 0; color: #554f48; font-size: 12px; line-height: 1.7; }
.payment-proof-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 13px; padding: 13px 15px; color: #155f3d; background: #e8f6ee; border: 1px solid #c2e3d0; border-radius: 12px; }
.payment-proof-row > div { display: grid; gap: 3px; min-width: 0; }
.payment-proof-row small, .payment-proof-row span { font-size: 10px; }
.payment-proof-row strong { overflow-wrap: anywhere; font-size: 12px; }
.payment-proof-row a { flex: 0 0 auto; padding: 10px 14px; color: #fff; background: var(--green); border-radius: 9px; font-size: 11px; font-weight: 900; }
.booking-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.booking-actions form { margin: 0; }
.action-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: 12px; font-weight: 900; }
.action-button.confirm { color: #fff; background: var(--green); }
.action-button.confirmation { color: #fff; background: linear-gradient(135deg, #211f20, #744619); }
.action-button.cancel { color: #8b4c12; background: #fff5e6; border-color: #efd3ad; }
.action-button.delete { color: var(--red); background: transparent; border-color: #e8c5c5; }
.action-button:hover { filter: brightness(.96); transform: translateY(-1px); }
.empty-admin { padding: 70px 25px; text-align: center; background: #fff; border: 1px dashed #d4c9bb; border-radius: 20px; }
.empty-admin strong { display: block; font-size: 21px; }
.empty-admin p { color: var(--muted); }

.login-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) calc(24px + env(safe-area-inset-left, 0px)); background: radial-gradient(circle at 20% 10%, #ead3ad 0, transparent 34%), #211f20; }
.login-shell { width: min(440px, 100%); }
.login-card { padding: 38px; background: #fff; border-radius: 26px; box-shadow: var(--shadow); }
.login-logo { width: 120px; height: 95px; margin: 0 auto 25px; object-fit: contain; }
.login-card h1 { margin: 7px 0 9px; font-size: 34px; }
.login-card > p { margin: 0 0 23px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.login-form { display: grid; gap: 15px; }
.login-form label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 800; }
.login-form input { width: 100%; height: 50px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; outline: 0; }
.login-form input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(173,107,29,.12); }
.primary-button { min-height: 51px; color: #fff; background: linear-gradient(135deg, #8f5113, #bd7b2a); border: 0; border-radius: 12px; cursor: pointer; font-weight: 900; }
.back-link { display: block; margin-top: 18px; color: var(--muted); text-align: center; font-size: 12px; }

.compact-heading { align-items: flex-start; }
.compact-heading h1 { max-width: 800px; }
.editor-list { display: grid; gap: 15px; margin-top: 35px; }
.editor-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 35px rgba(57,41,24,.045); }
.editor-card[open] { border-color: #d8bc95; box-shadow: 0 18px 45px rgba(57,41,24,.08); }
.editor-card summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; cursor: pointer; list-style: none; }
.editor-card summary::-webkit-details-marker { display: none; }
.editor-card summary > span:first-child { display: grid; gap: 5px; }
.editor-card summary small { color: var(--muted); font-size: 10px; }
.editor-card summary strong { font-size: 18px; }
.editor-summary-status { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; font-size: 10px; font-weight: 900; }
.editor-summary-status.live { color: #17603e; background: #e4f5eb; }
.editor-summary-status.hidden { color: #8d2d2d; background: #ffeded; }
.editor-form { padding: 5px 22px 24px; border-top: 1px solid var(--line); }
.form-grid { display: grid; gap: 15px; margin-top: 20px; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 11px; font-weight: 800; }
.form-grid input, .form-grid textarea, .form-grid select { width: 100%; min-height: 48px; padding: 11px 13px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 11px; outline: 0; }
.form-grid textarea { min-height: 115px; resize: vertical; line-height: 1.75; }
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(173,107,29,.1); }
.form-grid label > small { color: #8b8278; font-weight: 400; line-height: 1.5; }
.toggle-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 21px; }
.toggle-grid label { display: inline-flex; align-items: center; gap: 8px; padding: 11px 13px; background: #f7f2eb; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 11px; font-weight: 800; }
.toggle-grid input { accent-color: var(--gold); }
.form-save-row { display: flex; align-items: center; gap: 18px; margin-top: 23px; }
.form-save-row .primary-button { min-width: 230px; padding: 0 20px; }
.form-save-row span { color: var(--muted); font-size: 11px; }

.image-manager { padding: 24px 22px 28px; background: #fcfaf7; border-top: 1px solid var(--line); }
.image-manager-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.image-manager-heading h2 { margin: 5px 0 7px; font-size: 20px; }
.image-manager-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.image-manager-kicker { color: var(--gold); font-size: 10px; font-weight: 900; }
.image-count { flex: 0 0 auto; padding: 8px 11px; color: #76501f; background: #f7ead7; border-radius: 999px; font-size: 10px; }
.image-upload-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-top: 19px; padding: 15px; background: #fff; border: 1px dashed #d7c3a7; border-radius: 14px; }
.image-file-picker { display: grid; gap: 7px; min-width: 0; color: var(--ink); font-size: 11px; font-weight: 900; }
.image-file-picker input { width: 100%; min-height: 46px; padding: 8px; color: var(--muted); background: #f8f4ee; border: 1px solid var(--line); border-radius: 10px; }
.image-file-picker small { color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.6; }
.image-upload-button { min-width: 190px; padding-inline: 19px; }
.image-upload-button:disabled { cursor: wait; filter: grayscale(.35); opacity: .7; }
.image-upload-progress { grid-column: 1 / -1; padding: 11px 12px; border-radius: 10px; font-size: 11px; font-weight: 700; line-height: 1.6; }
.image-upload-progress.working { color: #72501e; background: #fff5e5; }
.image-upload-progress.success { color: #155f3d; background: #e5f5ec; }
.image-upload-progress.warning { color: #7d4b13; background: #fff1d9; }
.image-upload-progress.error { color: #8d2d2d; background: #fff0f0; }
.admin-image-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.admin-image-card { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 7px 20px rgba(57,41,24,.05); }
.admin-image-preview { position: relative; height: 135px; aspect-ratio: 4 / 3; overflow: hidden; background: #e9e1d7; }
.admin-image-preview img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
.admin-image-preview > span { position: absolute; top: 7px; right: 7px; min-width: 23px; height: 23px; display: grid; place-items: center; padding-inline: 5px; color: #fff; background: rgba(33,31,32,.78); border-radius: 999px; font-size: 9px; font-weight: 900; }
.admin-image-preview > b { position: absolute; right: 7px; bottom: 7px; padding: 5px 7px; color: #4d310f; background: #f6d79f; border-radius: 7px; font-size: 8px; }
.image-delete-form { padding: 8px; }
.image-delete-button { width: 100%; min-height: 36px; color: var(--red); background: #fff5f5; border: 1px solid #edcccc; border-radius: 8px; cursor: pointer; font-size: 10px; font-weight: 900; }
.image-delete-button:hover { color: #fff; background: var(--red); }
.image-empty-state { margin-top: 18px; padding: 25px; color: var(--muted); background: #fff; border: 1px dashed #d7c9b8; border-radius: 13px; text-align: center; font-size: 11px; }

.settings-main { max-width: 960px; }
.settings-form { display: grid; gap: 18px; margin-top: 35px; }
.settings-card { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 19px; box-shadow: 0 12px 40px rgba(57,41,24,.05); }
.settings-card-heading { display: flex; align-items: flex-start; gap: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.settings-card-heading > span { display: grid; flex: 0 0 35px; height: 35px; place-items: center; color: #fff; background: var(--gold); border-radius: 10px; font-weight: 900; }
.settings-card-heading h2 { margin: 0 0 5px; font-size: 19px; }
.settings-card-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.form-help { align-self: end; min-height: 48px; padding: 13px; color: #625a52; background: #f7f2eb; border-radius: 10px; font-size: 11px; line-height: 1.65; }
.switch-row { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 15px; background: #edf7f1; border: 1px solid #cce7d7; border-radius: 12px; cursor: pointer; }
.switch-row input { width: 19px; height: 19px; accent-color: var(--green); }
.switch-row > span { display: grid; gap: 3px; }
.switch-row strong { font-size: 12px; }
.switch-row small { color: var(--muted); font-size: 10px; }
.security-hint { margin-top: 17px; padding: 12px 14px; color: #68512f; background: #fff6e7; border: 1px solid #eddbbd; border-radius: 10px; font-size: 10px; line-height: 1.7; }
.settings-save { min-width: 250px; padding-inline: 25px; justify-self: start; }

@media (max-width: 820px) {
  .header-inner { flex-wrap: wrap; gap: 9px 15px; padding: 10px 0; }
  .admin-nav { order: 3; width: 100%; overflow-x: auto; justify-content: flex-start; -webkit-overflow-scrolling: touch; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .booking-grid { grid-template-columns: 1fr 1fr; }
  .booking-grid section:last-child { grid-column: 1 / -1; }
  .form-grid.metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-image-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .admin-container { width: min(100% - 22px, 1180px); }
  .admin-brand img { width: 45px; height: 38px; }
  .admin-brand strong { font-size: 14px; }
  .header-actions { gap: 3px; }
  .header-actions a { padding: 8px; }
  .header-actions a:first-child { display: none; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .today-card { min-width: 0; }
  .stats-grid { gap: 8px; margin-top: 24px; }
  .stat-card { min-height: 82px; padding: 14px; }
  .stat-card strong { font-size: 25px; }
  .booking-topline { align-items: flex-start; flex-direction: column; }
  .booking-grid { grid-template-columns: 1fr; gap: 17px; }
  .booking-grid section:last-child { grid-column: auto; }
  .booking-actions, .booking-actions form, .action-button { width: 100%; }
  .payment-proof-row { align-items: stretch; flex-direction: column; }
  .payment-proof-row a { text-align: center; }
  .login-card { padding: 28px 22px; }
  .editor-card summary { padding: 17px 15px; }
  .editor-form { padding: 4px 15px 19px; }
  .form-grid input, .form-grid textarea, .form-grid select, .login-form input, .image-file-picker input { font-size: 16px; }
  .form-grid.two-columns, .form-grid.metrics-grid { grid-template-columns: 1fr; }
  .form-save-row { align-items: stretch; flex-direction: column; }
  .form-save-row .primary-button, .settings-save { width: 100%; min-width: 0; }
  .settings-card { padding: 18px 15px; }
  .toggle-grid { display: grid; }
  .image-manager { padding: 20px 15px 23px; }
  .image-manager-heading { align-items: stretch; flex-direction: column; gap: 11px; }
  .image-count { align-self: flex-start; }
  .image-upload-form { grid-template-columns: 1fr; padding: 12px; }
  .image-upload-button { width: 100%; min-width: 0; }
  .admin-image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .admin-image-preview { height: 118px; }
}

@media (max-width: 360px) {
  .admin-image-grid { grid-template-columns: 1fr; }
}
