/* ==========================================================================
   Parking Rental Reservation System — mobile-first styles
   ========================================================================== */

:root {
  --brand: #1b4dff;
  --brand-dark: #1539b8;
  --brand-soft: #e8eeff;
  --ink: #1a2233;
  --ink-soft: #5b6b85;
  --line: #e3e8f2;
  --bg: #f4f6fb;
  --card: #ffffff;

  --ok: #16a34a;
  --ok-soft: #e6f7ec;
  --busy: #dc2626;
  --busy-soft: #fdecec;
  --pend: #d97706;
  --pend-soft: #fdf3e2;
  --in: #2563eb;
  --in-soft: #e7efff;
  --out: #7c3aed;
  --out-soft: #f1eafd;
  --off: #6b7280;
  --off-soft: #eceef1;

  --radius: 14px;
  --shadow: 0 1px 3px rgba(20, 30, 60, .08), 0 8px 24px rgba(20, 30, 60, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100dvh; overflow-x: hidden; }

button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
a { color: var(--brand); }

h1, h2, h3 { margin: 0; font-weight: 700; }

.hidden { display: none !important; }

/* Focus visibility (keyboard access) */
:focus-visible {
  outline: 3px solid rgba(27, 77, 255, .45);
  outline-offset: 1px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  min-height: 42px;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
  transition: background .15s, transform .05s, box-shadow .15s;
  touch-action: manipulation;
  user-select: none;
}

.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.secondary {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
.btn.secondary:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }

.btn.danger { background: var(--busy); }
.btn.danger:hover { background: #b91c1c; }

.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}
.btn.ghost:hover { background: var(--off-soft); color: var(--ink); }

.btn.small { min-height: 34px; padding: 5px 11px; font-size: 13px; border-radius: 8px; }

.btn .spin { display: none; }
.btn.loading .spin { display: inline-block; }
.btn.loading .label { opacity: .7; }

.spin {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rot .7s linear infinite;
}
.btn.secondary .spin, .btn.ghost .spin { border-color: rgba(27, 77, 255, .25); border-top-color: var(--brand); }

@keyframes rot { to { transform: rotate(360deg); } }

/* ==========================================================================
   Login
   ========================================================================== */

#login-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(27, 77, 255, .25), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(124, 58, 237, .18), transparent 60%),
    linear-gradient(160deg, #0d1530 0%, #16224a 60%, #1b2a5e 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(5, 10, 30, .45);
  padding: 34px 30px 30px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.logo-badge {
  width: 46px; height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand), var(--out));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
  flex: none;
}

.login-card h1 { font-size: 21px; line-height: 1.25; }
.login-sub { color: var(--ink-soft); margin: 4px 0 22px; font-size: 14px; }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { margin-bottom: 15px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
}

.field .req { color: var(--busy); }

.control {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s;
}

.control:focus { border-color: var(--brand); outline: none; }
.control[readonly] { background: var(--off-soft); color: var(--ink-soft); }
.control.invalid { border-color: var(--busy); }

textarea.control { min-height: 70px; resize: vertical; }

.field-error {
  color: var(--busy);
  font-size: 12.5px;
  margin-top: 4px;
  display: none;
}
.field-error.show { display: block; }

.field-hint { color: var(--ink-soft); font-size: 12px; margin-top: 4px; }

.pw-wrap { position: relative; }
.pw-wrap .control { padding-right: 74px; }
.pw-toggle {
  position: absolute;
  top: 50%; right: 6px;
  transform: translateY(-50%);
  border: 0; background: transparent;
  color: var(--brand);
  font-size: 13px; font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 14px;
}
@media (min-width: 560px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: span 2; }
}

.form-banner {
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13.5px;
  margin-bottom: 14px;
  display: none;
}
.form-banner.error { display: block; background: var(--busy-soft); color: #991b1b; }
.form-banner.success { display: block; background: var(--ok-soft); color: #166534; }
.form-banner:empty { display: none; } /* never show an empty banner strip */

/* ==========================================================================
   App shell
   ========================================================================== */

#app-screen { display: flex; min-height: 100dvh; }

.sidebar {
  display: none;
  width: 232px;
  flex: none;
  background: #101a38;
  color: #c4cdE4;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.sidebar .brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px;
  color: #fff; font-weight: 800; font-size: 16px;
}
.sidebar .brand .logo-badge { width: 38px; height: 38px; font-size: 19px; border-radius: 10px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; flex: 1; }

.side-nav button {
  display: flex; align-items: center; gap: 11px;
  background: transparent; border: 0;
  color: #b7c1dd;
  padding: 11px 12px;
  border-radius: 9px;
  font-weight: 600; font-size: 14px;
  text-align: left;
}
.side-nav button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav button.active { background: var(--brand); color: #fff; }
.side-nav .nav-ico { width: 21px; text-align: center; flex: none; }

.sidebar .side-foot { padding: 12px 10px calc(12px + var(--safe-b)); border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 246, 251, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.topbar .page-title { font-size: 17px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand-mini { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.topbar .brand-mini .logo-badge { width: 32px; height: 32px; font-size: 16px; border-radius: 9px; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 5px;
  font-size: 13px; font-weight: 600;
  max-width: 45vw;
}
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--out));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex: none;
}
.user-chip .uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .role-tag { font-size: 10.5px; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; }

.content { padding: 14px 14px calc(84px + var(--safe-b)); flex: 1; }

/* Mobile bottom nav */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
  box-shadow: 0 -4px 18px rgba(20, 30, 60, .08);
}
.bottom-nav button {
  flex: 1;
  border: 0; background: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 7px;
  font-size: 10.5px; font-weight: 600;
  color: var(--ink-soft);
  min-height: 52px;
}
.bottom-nav button.active { color: var(--brand); }
.bottom-nav .nav-ico { font-size: 19px; }

@media (min-width: 900px) {
  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  .topbar .brand-mini { display: none; }
  .content { padding: 20px 24px 40px; }
}

/* ==========================================================================
   Cards / stats
   ========================================================================== */

/* Realtime Manila clock */
.clock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  background: linear-gradient(120deg, #101a38, #1b2a5e);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px 18px;
  margin-bottom: 12px;
}
.clock-bar .clock-date { font-weight: 700; font-size: 15px; }
.clock-bar .clock-time {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}
.clock-bar .clock-time > span:first-child { font-size: 22px; font-weight: 800; letter-spacing: .02em; }
.clock-bar .clock-tz { font-size: 11px; color: #b7c1dd; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (min-width: 700px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px 15px;
  display: flex; flex-direction: column; gap: 3px;
  min-height: 74px;
}
button.stat-card {
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: transform .1s, box-shadow .15s;
}
button.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(20, 30, 60, .14);
}
button.stat-card:active { transform: translateY(0); }

.stat-card .num { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-card .lbl { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.stat-card.accent-ok .num { color: var(--ok); }
.stat-card.accent-busy .num { color: var(--busy); }
.stat-card.accent-brand .num { color: var(--brand); }
.stat-card.accent-off .num { color: var(--off); }

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.panel-head h2 { font-size: 16px; }

/* ==========================================================================
   Calendar
   ========================================================================== */

.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cal-month-label {
  font-size: 16.5px;
  font-weight: 800;
  min-width: 150px;
  text-align: center;
}

.cal-toolbar .grow { flex: 1; }

.cal-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 62vh;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

table.cal {
  border-collapse: separate;
  border-spacing: 0;
  min-width: max-content;
}

table.cal th, table.cal td { padding: 0; }

table.cal thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  border-bottom: 1.5px solid var(--line);
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 700;
  text-align: center;
  min-width: 42px;
  padding: 6px 3px;
}
table.cal thead th .dnum { display: block; font-size: 14px; color: var(--ink); }
table.cal thead th.today { background: var(--brand-soft); color: var(--brand); }
table.cal thead th.today .dnum { color: var(--brand); }

table.cal thead th.slot-col,
table.cal tbody th.slot-col {
  position: sticky;
  left: 0;
  z-index: 6;
  background: #fff;
  text-align: left;
  min-width: 108px;
  max-width: 148px;
  padding: 7px 10px;
  border-right: 1.5px solid var(--line);
  font-size: 13px;
}
table.cal thead th.slot-col { z-index: 7; }
table.cal tbody th.slot-col .s-name { display: block; font-size: 11px; color: var(--ink-soft); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.cal tbody th.slot-col .s-flag { font-size: 10px; font-weight: 700; color: var(--off); }

table.cal tbody td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #eef1f7;
}

.cal-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 42px;
  height: 44px;
  border: 0;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 13px;
  font-weight: 700;
  position: relative;
}
.cal-cell:hover { filter: brightness(.94); }

.cal-cell.busy { background: var(--busy-soft); color: var(--busy); }
.cal-cell.pending { background: var(--pend-soft); color: var(--pend); }
.cal-cell.checkin { background: var(--in-soft); color: var(--in); }
.cal-cell.checkout-free {
  background: linear-gradient(105deg, var(--out-soft) 0 38%, var(--ok-soft) 42% 100%);
  color: var(--ok);
}
.cal-cell.off { background: var(--off-soft); color: var(--off); cursor: not-allowed; }
.cal-cell.past { opacity: .55; }
.cal-cell.today-col { box-shadow: inset 0 0 0 2px rgba(27, 77, 255, .35); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-soft);
}
.legend .key { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.legend .swatch {
  width: 15px; height: 15px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800;
}
.sw-ok { background: var(--ok-soft); color: var(--ok); }
.sw-busy { background: var(--busy-soft); color: var(--busy); }
.sw-pend { background: var(--pend-soft); color: var(--pend); }
.sw-in { background: var(--in-soft); color: var(--in); }
.sw-out { background: var(--out-soft); color: var(--out); }
.sw-off { background: var(--off-soft); color: var(--off); }

/* ==========================================================================
   Lists & tables
   ========================================================================== */

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
@media (min-width: 760px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr auto; align-items: end; } }

.filter-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 3px;
}
.filter-field .control { width: 100%; }

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
  border-bottom: 1.5px solid var(--line);
  padding: 8px 10px;
  white-space: nowrap;
}
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: #f8faff; }
table.data .rowlink { cursor: pointer; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  white-space: nowrap;
}
.badge.b-confirmed { background: var(--ok-soft); color: #15803d; }
.badge.b-pending { background: var(--pend-soft); color: #b45309; }
.badge.b-checked_in { background: var(--in-soft); color: #1d4ed8; }
.badge.b-checked_out { background: var(--out-soft); color: #6d28d9; }
.badge.b-cancelled { background: var(--off-soft); color: #4b5563; }
.badge.b-no_show { background: var(--busy-soft); color: #b91c1c; }
.badge.b-archived { background: var(--off-soft); color: #4b5563; }
.badge.b-available { background: var(--ok-soft); color: #15803d; }
.badge.b-maintenance { background: var(--pend-soft); color: #b45309; }
.badge.b-inactive { background: var(--off-soft); color: #4b5563; }
.badge.b-paid { background: var(--ok-soft); color: #15803d; }
.badge.b-unpaid { background: var(--busy-soft); color: #b91c1c; }
.badge.b-partial { background: var(--pend-soft); color: #b45309; }
.badge.b-refunded { background: var(--off-soft); color: #4b5563; }

/* Mobile card list (bookings) */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.list-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  display: flex; flex-direction: column; gap: 6px;
  background: #fff;
  cursor: pointer;
}
.list-card:hover { border-color: var(--brand); }
.list-card .lc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list-card .lc-title { font-weight: 700; }
.list-card .lc-sub { font-size: 12.5px; color: var(--ink-soft); }
.list-card .lc-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-soft); }

@media (min-width: 860px) {
  .card-list.desktop-table { display: none; }
}
@media (max-width: 859.98px) {
  .table-wrap.desktop-only { display: none; }
}

.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 14px;
  font-size: 13.5px; color: var(--ink-soft);
}

/* Slots grid */
.slot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) { .slot-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .slot-grid { grid-template-columns: repeat(3, 1fr); } }

.slot-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.slot-card .sc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.slot-card .sc-code { font-size: 17px; font-weight: 800; }
.slot-card .sc-meta { font-size: 12.5px; color: var(--ink-soft); }
.slot-card .sc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* Today groups */
.today-group { margin-bottom: 18px; }
.today-group h3 { font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.today-group .count-pill {
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 11.5px; border-radius: 999px; padding: 2px 9px; font-weight: 700;
}

/* Reports */
.util-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; }
.util-row .u-code { width: 64px; font-weight: 700; flex: none; }
.util-row .u-bar { flex: 1; height: 12px; background: var(--off-soft); border-radius: 999px; overflow: hidden; }
.util-row .u-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--out)); border-radius: 999px; }
.util-row .u-val { width: 74px; text-align: right; color: var(--ink-soft); font-weight: 600; flex: none; }

/* ==========================================================================
   States: loading / empty / error
   ========================================================================== */

.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, #edf0f7 25%, #f7f9fd 50%, #edf0f7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  min-height: 44px;
  margin-bottom: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.state-box {
  text-align: center;
  padding: 34px 16px;
  color: var(--ink-soft);
}
.state-box .st-ico { font-size: 34px; margin-bottom: 8px; }
.state-box .st-title { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.state-box .btn { margin-top: 12px; }

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 16, 38, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn .15s ease;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 24px; }
}
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  background: #fff;
  width: 100%;
  max-width: 640px;
  max-height: 92dvh;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp .18s ease;
}
@media (min-width: 640px) { .modal { border-radius: 18px; max-height: 88dvh; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } }

.modal.small { max-width: 420px; }

.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.modal-head h2 { font-size: 16.5px; flex: 1; }
.modal-close {
  border: 0; background: var(--off-soft);
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 15px; color: var(--ink-soft);
  flex: none;
}
.modal-close:hover { background: var(--busy-soft); color: var(--busy); }

.modal-body { padding: 16px 18px; overflow-y: auto; }

.modal-foot {
  display: flex; gap: 9px; justify-content: flex-end; flex-wrap: wrap;
  padding: 12px 18px calc(14px + var(--safe-b));
  border-top: 1px solid var(--line);
  flex: none;
}

/* Booking detail rows */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-bottom: 6px;
}
.detail-grid .d-item .d-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); font-weight: 700; margin-bottom: 2px; }
.detail-grid .d-item .d-val { font-size: 14px; font-weight: 600; word-break: break-word; }
.detail-grid .full { grid-column: 1 / -1; }

.action-grid { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }

.audit-item {
  border-left: 3px solid var(--brand-soft);
  padding: 6px 0 6px 12px;
  margin-left: 4px;
  font-size: 13px;
}
.audit-item .a-when { color: var(--ink-soft); font-size: 11.5px; }
.audit-item .a-what { font-weight: 600; }
.audit-item .a-diff { color: var(--ink-soft); font-size: 12px; word-break: break-word; }

/* ==========================================================================
   Toasts
   ========================================================================== */

#toast-region {
  position: fixed;
  z-index: 90;
  left: 12px; right: 12px;
  bottom: calc(66px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
@media (min-width: 900px) { #toast-region { left: auto; right: 22px; bottom: 22px; align-items: flex-end; } }

.toast {
  pointer-events: auto;
  background: #101a38;
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(5, 10, 30, .35);
  display: flex; align-items: center; gap: 9px;
  max-width: 480px;
  animation: slideUp .2s ease;
}
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }

/* Toggle switch — the higher-specificity selector beats `.field label`
   (display:block), which otherwise breaks the row layout */
label.switch-row,
.field label.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 34px;
  margin-bottom: 0;
  position: relative;
}
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
  width: 44px; height: 24px;
  border-radius: 999px;
  background: #cdd5e4;
  position: relative;
  transition: background .15s;
  flex: none;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: left .15s;
}
.switch-row input:checked + .switch { background: var(--ok); }
.switch-row input:checked + .switch::after { left: 23px; }
.switch-row input:focus-visible + .switch { outline: 3px solid rgba(27, 77, 255, .45); outline-offset: 1px; }

/* Settings page */
.settings-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 14px;
}

/* Print: only booking details */
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; inset: 0; padding: 24px; }
}
