:root {
  color-scheme: light;
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  color: #142431;
  background: #f3f6f7;
  --navy: #142a3e;
  --ink: #142431;
  --muted: #506373;
  --line: #d9e1e6;
  --action: #08685c;
  --surface: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--action); }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #39ae9a;
  outline-offset: 3px;
}

.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--navy); padding: 27px 16px; color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 750; letter-spacing: .04em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: #70e0c8; color: var(--navy); font-size: 19px; }
.brand small, .account small { display: block; margin-top: 3px; font-size: .78rem; font-weight: 500; letter-spacing: 0; }
.brand small { color: #c2d2df; }
.sidebar nav { display: grid; gap: 5px; margin-top: 42px; }
.sidebar nav a { padding: 11px 12px; border-radius: 7px; color: #cfdeea; text-decoration: none; }
.sidebar nav a:hover, .sidebar nav a[aria-current="page"] { color: #fff; background: #27465d; }

.main { min-width: 0; padding: 0 clamp(16px, 4vw, 52px) 44px; }
.topbar { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.mode-switch { color: var(--action); font-size: .88rem; font-weight: 650; }
.preview { color: var(--muted); font-size: .86rem; }
.account { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.account small { color: var(--muted); }
.avatar { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; overflow: hidden; border-radius: 50%; background: #d3eae4; color: #17473e; font-weight: 750; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.view { max-width: 1120px; }
.page-header { padding: 36px 0 22px; }
h1, h2, p { margin: 0; }
h1 { margin-bottom: 8px; letter-spacing: -.035em; line-height: 1.11; font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.12rem; letter-spacing: -.015em; }
.page-header p, .card-heading p, .profile-reminder p, .empty-history { color: var(--muted); line-height: 1.5; }

.booking-grid { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 1.65fr); gap: 17px; align-items: start; }
.card { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.details, .profile-card, .history-card { padding: 22px; }
.field { display: grid; gap: 7px; margin-top: 17px; min-width: 0; }
.field > span { font-size: .9rem; font-weight: 650; }
.field small { color: var(--muted); font-weight: 400; }
.field :is(input, select, textarea) { width: 100%; min-width: 0; min-height: 42px; padding: 9px 10px; border: 1px solid #bac9d1; border-radius: 7px; background: #fff; color: var(--ink); }
.field input[readonly] { background: #f0f4f6; }
.field textarea { resize: vertical; }
.profile-reminder { margin-top: 22px; padding: 14px; border-radius: 8px; background: #edf6f4; font-size: .88rem; }
.profile-reminder a { display: inline-block; margin-top: 7px; font-weight: 650; }
.profile-reminder p { margin-top: 4px; }

.card-heading { display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 22px; }
.card-heading p { margin-top: 5px; font-size: .88rem; }
.item-count { font-size: .82rem; color: #21473e; background: #e0f3ed; padding: 5px 9px; border-radius: 7px; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #f0f4f6; color: #384c5c; font-size: .78rem; }
td, th { padding: 13px 14px; border-bottom: 1px solid var(--line); }
td:first-child, th:first-child { padding-left: 22px; }
td small { display: block; color: var(--muted); margin-top: 4px; }
.missing { color: #8a3900; }
.feedback { color: #174f45; font-size: .88rem; line-height: 1.45; }
.feedback[data-error="true"] { color: #922b1b; }
.feedback:empty { display: none; }
.items-card .feedback { margin: 16px 22px 0; }
.actions { display: flex; justify-content: end; margin-top: 16px; }
.items-card .actions { padding: 0 22px 22px; }
button { min-height: 42px; border: 0; border-radius: 7px; padding: 10px 16px; background: var(--action); color: #fff; font-weight: 700; cursor: pointer; }
button:hover:not(:disabled) { background: #05574d; }
button:disabled { background: #dce4e8; color: #53626a; cursor: default; }
.secondary { background: var(--surface); border: 1px solid #bac9d1; color: var(--ink); }
.secondary:hover:not(:disabled) { background: #edf2f5; }
.button-link { background: transparent; color: var(--action); min-height: 32px; padding: 3px 8px; }
.button-link:hover:not(:disabled) { background: #edf6f4; }
.profile-card { max-width: 690px; }
.profile-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.profile-card .feedback { margin-top: 14px; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { display: grid; gap: 5px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.history-list li:first-child { padding-top: 0; }
.history-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.history-list span { color: var(--muted); }

.admin-header { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.admin-header button { flex-shrink: 0; }
.list-tools { display: flex; gap: 14px; align-items: end; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.list-tools label { display: grid; gap: 6px; color: var(--muted); font-size: .86rem; font-weight: 600; }
.list-tools label:first-child { flex: 0 1 300px; min-width: 0; }
.list-tools input, .list-tools select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #bac9d1; border-radius: 7px; background: #fff; color: var(--ink); }
.list-tools input { width: min(100%, 320px); }
.view-feedback { margin-top: 12px; }
.status { display: inline-block; padding: 4px 8px; font-size: .78rem; border-radius: 5px; background: #edf1f4; color: #455767; white-space: nowrap; }
.status-active { background: #e0f3ed; color: #21473e; }
.empty-row { color: var(--muted); }
td.location-depth-1 { padding-left: 32px; }
td.location-depth-2 { padding-left: 44px; }

dialog { width: min(calc(100% - 28px), 645px); max-height: calc(100% - 26px); padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
dialog::backdrop { background: #172d40a6; }
.editor { padding: 24px; }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.editor .actions { gap: 8px; }
.editor-feedback { margin-top: 12px; }
.editor-subheading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 6px; }
.editor-subheading h3 { margin: 0; font-size: 1rem; }
.component-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(72px, 95px) auto; gap: 4px 10px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); }
.component-row .field { margin-top: 0; }
.component-hint { grid-column: 1 / -1; color: var(--muted); }

@media (max-width: 820px) {
  .app { grid-template-columns: 168px minmax(0, 1fr); }
  .booking-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .app { display: block; }
  .sidebar { padding: 12px 14px 7px; }
  .sidebar nav { display: flex; flex-wrap: wrap; margin-top: 12px; }
  .sidebar nav a { padding: 8px; font-size: .86rem; }
  .topbar { min-height: 58px; flex-wrap: wrap; padding: 8px 0; }
  .topbar-actions { flex-wrap: wrap; gap: 9px; }
  .preview { max-width: 140px; }
  .account strong { font-size: .85rem; }
  .page-header { padding-top: 25px; }
  .details, .profile-card, .history-card, .card-heading { padding: 16px; }
  td, th { padding: 11px 9px; }
  td:first-child, th:first-child { padding-left: 16px; }
  .items-card .actions { padding: 0 16px 16px; }
  .profile-inputs { grid-template-columns: minmax(0, 1fr); }
  .admin-header { align-items: start; flex-direction: column; }
  .list-tools { flex-wrap: wrap; padding: 12px 16px; }
  .list-tools label, .list-tools label:first-child { flex: 1 1 145px; }
  .card:has(.list-tools) th:last-child, .card:has(.list-tools) td:last-child { position: sticky; right: 0; background: #fff; }
  .editor { padding: 17px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .component-row { grid-template-columns: minmax(0, 1fr) minmax(67px, 80px); gap: 8px; }
  .component-hint { grid-area: 2 / 1 / 3 / 2; align-self: center; }
  .remove-component { grid-area: 2 / 2 / 3 / 3; min-height: 36px; padding: 6px 8px; }
}
