:root {
  color-scheme: light;
  --bg: #f1f2ee; --paper: #fff; --ink: #17211b; --muted: #545e58; --line: #dcdfd7;
  --pine: #22362b; --pine-2: #2f4a3a; --moss: #e2e9de; --amber: #e39a3b;
  --ok: #1f6b43; --warn: #8a4d0c; --bad: #a3322a;
  --head: "Bricolage Grotesque", system-ui, sans-serif; --body: "DM Sans", system-ui, -apple-system, sans-serif;
  --unitw: 150px; --dayw: 46px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; margin-top: 18px; }
p { margin: 0 0 .6em; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; letter-spacing: .02em; }
.sub { color: var(--muted); }
.eyebrow { font-size: 13px; color: var(--muted); margin: 0; }
.demo-strip { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; align-items: center; padding: 8px 16px; background: var(--amber); color: #1f1405; font-size: 13px; text-align: center; }
.demo-strip a { font-weight: 700; min-height: 32px; display: inline-flex; align-items: center; }

/* shell */
.shell { display: block; }
.side { position: sticky; top: 0; z-index: 10; background: var(--pine); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; padding: 12px 16px 6px; }
.brand img { border-radius: 8px; }
.brand strong { display: block; font-family: var(--head); font-size: 17px; line-height: 1.1; }
.brand span { font-size: 12px; color: #c6d2c8; }
.nav { display: flex; gap: 4px; overflow-x: auto; padding: 6px 12px 10px; scrollbar-width: thin; }
.nav a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; text-decoration: none; color: #dfe7e0; font-weight: 500; font-size: 14px; }
.nav a:hover { background: rgba(255, 255, 255, .1); }
.nav a[aria-current="page"] { background: #fff; color: var(--pine); }
.count { background: var(--amber); color: #1f1405; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 0 7px; line-height: 20px; }
.view { padding: 20px 16px 48px; max-width: 1200px; min-width: 0; outline: none; }
.vh { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.vh .sub { max-width: 60ch; margin: 0; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--pine); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--pine-2); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-soft { background: var(--moss); color: var(--pine); }
.btn-soft:hover { background: #d4dfcf; }
.btn-danger { background: #f6e1de; color: var(--bad); }
.btn-danger:hover { background: #efcfca; }
.btn-s { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 500; }
.btn-s:hover { border-color: var(--pine); }

/* cards & kpis */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; min-width: 0; }
a.kpi:hover { border-color: var(--pine); }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi strong { font: 700 clamp(1.3rem, 1rem + 1.4vw, 1.9rem)/1.1 var(--head); overflow-wrap: anywhere; }
.kpi small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-alert { background: #fdf0de; border-color: var(--amber); }
.cols { display: grid; gap: 16px; }
.cols .card { margin-bottom: 0; }
.cols + .card, .cols + .sub + .cols { margin-top: 16px; }
.empty { color: var(--muted); margin: 0; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row small { display: block; color: var(--muted); font-size: 13px; }
.row small.warn, small.warn { color: var(--warn); font-weight: 500; }
.rows .row:has(.row-btn) { padding: 0; }
.row-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 6px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: 10px; min-height: 56px; }
.row-btn:hover { background: #f5f6f2; }
.row-main { min-width: 0; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; flex: none; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eceee8; color: #3f4741; white-space: nowrap; }
.st-confirmed { background: #d9efe0; color: var(--ok); }
.st-checked_in { background: #d6e6f5; color: #1d4f7c; }
.st-verifying { background: #fde7c7; color: var(--warn); }
.st-hold { background: #f2ecd9; color: #6d5a1c; }
.st-ota { background: #fbe1e6; color: #8f2440; }
.st-cancelled, .st-expired { background: #eceae6; color: #5f625e; }

/* filters */
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; }
.chip { flex: none; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 500; }
.chip span { color: var(--muted); font-size: 13px; }
.chip.on { background: var(--pine); color: #fff; border-color: var(--pine); }
.chip.on span { color: #cbd7cd; }
.search input { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid #bcc2b8; border-radius: 12px; background: #fff; margin-bottom: 12px; }

/* timeline */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }
.tl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; margin-bottom: 8px; }
.tl { width: max(100%, calc(var(--unitw) + var(--days, 21) * var(--dayw))); }
.tl-row { display: grid; grid-auto-rows: 56px; position: relative; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-head { grid-auto-rows: 48px; background: #f7f8f5; position: sticky; top: 0; }
.tl-unit { grid-column: 1; grid-row: 1; position: sticky; left: 0; z-index: 2; background: #fff; padding: 8px 10px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.tl-head .tl-unit { background: #f7f8f5; font-weight: 700; font-size: 13px; }
.tl-unit strong { font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-unit small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-date { grid-row: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; border-left: 1px solid #eef0eb; }
.tl-date small { font-weight: 500; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.tl-date.is-we { background: #f0f2ec; }
.tl-date.is-today { background: var(--pine); color: #fff; }
.tl-date.is-today small { color: #cfdbd1; }
.tl-cell { grid-row: 1; border: 0; border-left: 1px solid #eef0eb; background: transparent; cursor: pointer; }
.tl-cell:hover { background: #eef3ea; }
.tl-cell.is-today { background: #f5f8f2; }
.tl-bar { min-width: 0; grid-row: 1; z-index: 1; align-self: center; height: 38px; margin: 0 2px; border: 0; border-radius: 10px; padding: 0 10px; font-size: 12px; font-weight: 700; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.tl-bar.cut-l { margin-left: 2px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tl-bar:hover { filter: brightness(.95); }
.k-booked { background: #2f6a4a; color: #fff; }
.k-verifying { background: #f3c47f; color: #3d2405; }
.k-hold { background: repeating-linear-gradient(135deg, #f4e7bf 0 6px, #ead9a4 6px 12px); color: #4a3b0a; }
.k-ota { background: #c9475f; color: #fff; }
.k-blocked { background: repeating-linear-gradient(135deg, #e6e7e2 0 6px, #d6d8d1 6px 12px); color: #3f4440; }
.is-conflict { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--bad); }

/* forms */
.setform { display: grid; gap: 10px; }
.setform fieldset { border: 0; padding: 0; margin: 0; }
.setform legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.setform label:not(.radio) { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.setform input:not([type=radio]), .setform select { min-height: 44px; padding: 0 12px; border: 1px solid #bcc2b8; border-radius: 10px; background: #fff; font-weight: 400; width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; }
.radio input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--pine); flex: none; }
.radio small { display: block; color: var(--muted); font-size: 13px; }
.radio:has(input:checked) { border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--pine); }
.price-table { display: grid; gap: 6px; }
.price-table [role=row] { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; align-items: center; }
.pt-head { font-size: 12px; font-weight: 700; color: var(--muted); }
.price-table [role=rowheader] { font-size: 14px; font-weight: 500; }
.actions { margin-top: 6px; }
.ci-form label { font-weight: 700; display: block; margin-bottom: 4px; }
.ci-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ci-row input { flex: 1 1 180px; min-height: 48px; padding: 0 14px; border: 1px solid #bcc2b8; border-radius: 10px; font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }
#cam { width: 100%; max-width: 420px; border-radius: 12px; margin-top: 12px; background: #000; }
.alert { padding: 12px 14px; border-radius: 12px; background: #f6e1de; color: #6e1f19; margin: 12px 0; }
.alert-info { background: #fdf0de; color: #5c3407; }
.alert-ok { background: #d9efe0; color: #154a2f; }
.notif { align-items: flex-start; justify-content: flex-start; }
.ch { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.ch-wa { background: #d6f3df; color: #146c37; }
.ch-email { background: #dde8f6; color: #1d4f7c; }
.msg { margin: 4px 0 0; padding: 8px 10px; background: #f5f6f2; border-radius: 10px; font-size: 14px; }

/* dialog */
.dlg { border: 0; padding: 0; width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; background: #fff; color: var(--ink); }
.dlg::backdrop { background: rgba(12, 18, 14, .5); }
.dlg-close { position: absolute; right: 10px; top: 10px; margin: 0; }
.dlg-close button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #f1f2ee; cursor: pointer; }
.dlg-body { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.dlg-body h2 { padding-right: 48px; font-size: 1.4rem; margin-bottom: 6px; }
.dlg-body h2:focus { outline: none; }
.detail { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; margin: 14px 0; }
.detail dt { color: var(--muted); font-size: 14px; }
.detail dd { margin: 0; font-weight: 500; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hist { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.hist li { padding: 0 0 10px 14px; position: relative; font-size: 14px; }
.hist li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--pine); }
.hist time { display: block; font-size: 12px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--pine); color: #fff; padding: 12px 16px; border-radius: 12px; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, .2); transition: .25s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }

@media (min-width: 700px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .cols { grid-template-columns: 1fr 1fr; }
  .dlg { max-width: 600px; margin: auto; border-radius: 20px; }
  .dlg-body { padding: 24px; }
  :root { --unitw: 180px; }
}
@media (min-width: 1000px) {
  .shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
  .side { height: 100vh; }
  .brand { padding: 20px 18px 16px; }
  .nav { flex-direction: column; overflow: visible; padding: 0 12px; }
  .nav a { border-radius: 10px; justify-content: space-between; }
  .view { padding: 28px 32px 64px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
