:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e222b;
  --border: #2a2f3a;
  --text: #e6e9ef;
  --muted: #8b93a3;
  --accent: #4f8cff;
  --green: #2ecc71;
  --red: #ff5b6e;
  --amber: #ffb020;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #8a5cff);
  color: white; font-weight: 800; display: grid; place-items: center; font-size: 18px;
}
.brand strong { display: block; line-height: 1.1; }
.brand .sub { color: var(--muted); font-size: 12px; }

nav { display: flex; gap: 6px; }
nav a {
  color: var(--muted); text-decoration: none; padding: 8px 14px;
  border-radius: 8px; font-weight: 500;
}
nav a:hover { color: var(--text); background: var(--surface-2); }
nav a.active { color: white; background: var(--accent); }

main { max-width: 1200px; margin: 0 auto; padding: 28px; }

.page-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.card.stat { display: flex; flex-direction: column; gap: 4px; }
.card.stat .num { font-size: 28px; font-weight: 700; }
.card.stat .label { color: var(--muted); font-size: 13px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

.badges { display: flex; gap: 8px; align-items: center; }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.ok { background: rgba(46,204,113,.15); color: var(--green); }
.badge.err { background: rgba(255,91,110,.15); color: var(--red); }
.badge.warn { background: rgba(255,176,32,.15); color: var(--amber); }
.badge.link { background: var(--surface-2); color: var(--accent); text-decoration: none; }

table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface-2); }
.row-fail td { background: rgba(255,91,110,.06); }

a { color: var(--accent); }

.thumb { width: 52px; }
.thumb img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: white; }
.noimg { color: var(--muted); }

.pill { padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.pill.pass { background: rgba(46,204,113,.16); color: var(--green); }
.pill.fail { background: rgba(255,91,110,.16); color: var(--red); }
.pill.off { background: var(--surface-2); color: var(--muted); }

.sev { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.sev-error { color: var(--red); }
.sev-warn { color: var(--amber); }
.sev-info { color: var(--muted); }

.tag { background: var(--surface-2); padding: 2px 8px; border-radius: 6px; font-size: 11px; color: var(--muted); }
.indent { color: var(--muted); margin-right: 6px; }

.toolbar { display: flex; gap: 8px; margin-bottom: 16px; }
.toolbar input[type="search"] {
  flex: 1; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 9px 12px; border-radius: 8px; font-size: 14px;
}
.toolbar input[name="brand"] { flex: 0 1 200px; }
.toolbar select {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; border-radius: 8px; font-size: 14px; max-width: 240px;
}
.toolbar input[type="file"] {
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-size: 13px;
}
.toolbar input[type="file"]::file-selector-button {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px; margin-right: 10px; cursor: pointer;
}
button, .btn {
  background: var(--accent); color: white; border: none; padding: 9px 16px;
  border-radius: 8px; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 14px;
}
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

.pager { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 18px; }
.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty h1 { color: var(--text); }
code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-family: ui-monospace, monospace; }

/* --- Review queue --- */
.review-stats { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.review-card { display: grid; grid-template-columns: 280px 1fr; gap: 24px; padding: 22px; }
.review-media img { width: 100%; max-height: 280px; object-fit: contain; background: white; border-radius: 10px; }
.review-media .noimg-box {
  width: 100%; height: 200px; display: grid; place-items: center;
  background: var(--surface-2); border-radius: 10px; color: var(--muted);
}
.review-body h2 { font-size: 18px; margin: 0 0 14px; }
.review-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; margin: 0 0 18px; }
.review-meta div { display: flex; flex-direction: column; gap: 2px; }
.review-meta dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.review-meta dd { margin: 0; }
.review-form .field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.review-form .field > span { color: var(--muted); font-size: 12px; }
.review-form select, .review-form textarea {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; border-radius: 8px; font-size: 14px; font-family: inherit; width: 100%;
}
.review-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.btn.approve { background: var(--green); }
.btn.reject { background: var(--red); }
.btn.needs-edit { background: var(--amber); color: #1a1a1a; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.row-actions { white-space: nowrap; display: flex; gap: 6px; }
.scan-edit { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.scan-edit input, .scan-edit select {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 7px 10px; border-radius: 8px; font-size: 14px;
}
.scan-edit input[name="name"] { flex: 1 1 220px; }
.scan-edit input[name="category"] { flex: 1 1 160px; }
.scan-edit input[name="est_value"] { width: 150px; }
.htmx-request.review-actions, .htmx-request .btn { opacity: .6; }

@media (max-width: 820px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .review-card { grid-template-columns: 1fr; }
}

/* --- Mobile / iPhone --- */
@media (max-width: 768px) {
  main { padding: 14px; }

  /* Header: brand on top, nav as a horizontally scrollable row */
  .topbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .brand .sub { display: none; }
  nav {
    width: 100%; overflow-x: auto; flex-wrap: nowrap; gap: 4px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  nav::-webkit-scrollbar { display: none; }
  nav a { padding: 8px 12px; white-space: nowrap; flex: 0 0 auto; }

  .page-head { flex-wrap: wrap; gap: 6px; }
  h1 { font-size: 19px; }

  /* Wide tables scroll horizontally instead of overflowing the screen */
  table.data { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* Stack toolbars; full-width controls; 16px prevents iOS zoom-on-focus */
  .toolbar { flex-wrap: wrap; }
  .toolbar input[type="search"],
  .toolbar input[name="brand"],
  .toolbar select,
  .toolbar input[type="file"] { flex: 1 1 100%; max-width: none; }
  .toolbar button, .toolbar .btn { flex: 1 1 auto; }

  /* iOS zooms the page when focusing inputs smaller than 16px */
  input, select, textarea, button { font-size: 16px; }

  .cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card { padding: 14px; }
  .card.stat .num { font-size: 22px; }

  .review-media img, .review-media .noimg-box { max-height: 220px; }
  .review-meta { grid-template-columns: 1fr 1fr; }
  .review-actions .btn { flex: 1 1 calc(50% - 10px); text-align: center; }
}

@media (max-width: 380px) {
  .cards { grid-template-columns: 1fr; }
  .review-meta { grid-template-columns: 1fr; }
}

/* ===================== Public demo page ===================== */
[x-cloak] { display: none !important; }

body.demo { background: var(--bg); }
.demo-wrap { max-width: 640px; margin: 0 auto; padding: 18px 16px 48px; }

.demo-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.demo-header .logo {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), #8a5cff);
  color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 20px;
}
.demo-header strong { display: block; font-size: 17px; }
.demo-header .sub { color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 5px; margin-bottom: 18px; }
.tabs button {
  flex: 1; background: transparent; color: var(--muted); border: none; padding: 11px;
  border-radius: 8px; font-weight: 600; font-size: 15px; cursor: pointer;
}
.tabs button.active { background: var(--accent); color: #fff; }

.upload-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer;
  border: 2px dashed var(--border); border-radius: 14px; padding: 30px 16px;
  background: var(--surface); color: var(--text); text-align: center; font-weight: 600;
}
.upload-btn:active { border-color: var(--accent); }
.upload-ico { font-size: 30px; }
.preview { width: 100%; max-height: 320px; object-fit: contain; border-radius: 12px;
  margin-top: 12px; background: #000; }
.scan-btn {
  width: 100%; margin-top: 14px; padding: 15px; font-size: 17px; font-weight: 700;
  border: none; border-radius: 12px; background: var(--accent); color: #fff; cursor: pointer;
}
.scan-btn:disabled { opacity: .6; }

.progress { margin-top: 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; text-align: center; }
.spinner {
  width: 38px; height: 38px; margin: 0 auto 12px; border-radius: 50%;
  border: 4px solid var(--surface-2); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-step { font-weight: 600; font-size: 15px; margin-bottom: 12px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 6px; transition: width .5s ease; }

.results-head { font-weight: 700; margin: 20px 0 10px; }
.item-list { display: flex; flex-direction: column; gap: 12px; }
.item-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.item-card.clickable { cursor: pointer; }
.item-card.clickable:active { border-color: var(--accent); }

.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.lightbox-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 92vw; }
.lightbox-inner img { max-width: 92vw; max-height: 74vh; object-fit: contain; border-radius: 12px; background: #000; }
.lightbox-name { color: #fff; font-weight: 600; text-align: center; }
.item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.item-crop { width: 56px; height: 56px; object-fit: cover; border-radius: 10px;
  background: #000; flex: 0 0 auto; border: 1px solid var(--border); }
.item-name { font-weight: 700; font-size: 16px; line-height: 1.25; flex: 1; }
.item-daily .big { font-size: 22px; font-weight: 800; color: var(--green); }
.item-daily .per { color: var(--muted); font-size: 13px; }
.item-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chip { background: var(--surface-2); color: var(--muted); border-radius: 20px;
  padding: 3px 11px; font-size: 12px; }
.chip.cond { text-transform: capitalize; }
.item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 6px; }
.item-grid .k { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; }
.item-grid .v { font-weight: 600; }
.item-q { margin-top: 12px; font-style: italic; font-size: 12px; }

.notice { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; color: var(--muted); margin-top: 16px; text-align: center; }
.notice.error { color: var(--red); border-color: rgba(255,91,110,.4); }
.demo-footer { margin-top: 26px; text-align: center; }

.scan-groups { display: flex; flex-direction: column; gap: 24px; }
.scan-group { display: flex; flex-direction: column; gap: 12px; }
.scan-photo {
  width: 100%; max-height: 300px; object-fit: cover; border-radius: 14px;
  border: 1px solid var(--border); background: #000;
}

/* ===================== App Admin (operations) ===================== */
.nav-sep { width: 1px; align-self: stretch; background: var(--border); margin: 4px 8px; flex: 0 0 auto; }

.num { text-align: right; }
table.data th.num, table.data td.num { text-align: right; }
.nowrap { white-space: nowrap; }
.clickrow { cursor: pointer; }
.avcell, .cvcell { width: 1%; white-space: nowrap; }
table.data.compact td { padding: 8px 10px; }
.backlink { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 14px; }
.backlink:hover { color: var(--text); }
.mono.small, .small.mono { word-break: break-all; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--text);
}
a.kpi:hover { border-color: var(--accent); }
.kpi-num { font-size: 26px; font-weight: 800; line-height: 1.1; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi-sub.up { color: var(--green); }

/* 2-column section grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-2 > .card { margin: 0; }

/* Avatars + covers */
.av { border-radius: 50%; object-fit: cover; background: var(--surface-2); vertical-align: middle; flex: 0 0 auto; }
.av-fallback {
  display: inline-grid; place-items: center; color: #fff; font-weight: 700; text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent), #8a5cff);
}
.cv { border-radius: 8px; object-fit: cover; background: #000; vertical-align: middle; flex: 0 0 auto; border: 1px solid var(--border); }
.cv-empty { display: inline-grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 700; }

.urow { display: flex; align-items: center; gap: 10px; }
.urow-name { font-weight: 600; }
.uchip { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.uchip:hover .uchip-name { color: var(--accent); }
.uchip-text { display: flex; flex-direction: column; line-height: 1.2; }
.uchip-name { font-weight: 600; }
.uchip-sub { color: var(--muted); font-size: 11px; }

/* Status pills */
.st { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: capitalize; line-height: 1.5; }
.st-requested, .st-paused { background: rgba(255,176,32,.16); color: var(--amber); }
.st-approved, .st-rented { background: rgba(79,140,255,.18); color: var(--accent); }
.st-active { background: rgba(46,204,113,.18); color: var(--green); }
.st-returned { background: rgba(45,212,191,.16); color: #2dd4bf; }
.st-completed { background: rgba(46,204,113,.30); color: #8affc0; }
.st-declined, .st-removed { background: rgba(255,91,110,.16); color: var(--red); }
.st-cancelled, .st-draft { background: rgba(139,147,163,.18); color: var(--muted); }

/* Sort + filter chips */
.sortbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.sortlink { color: var(--muted); text-decoration: none; padding: 3px 9px; border-radius: 6px; }
.sortlink:hover { background: var(--surface-2); color: var(--text); }
.sortlink.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.filterchips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); padding: 6px 12px; border-radius: 20px;
  font-size: 13px; text-transform: capitalize;
}
.fchip:hover { color: var(--text); }
.fchip span { background: var(--surface-2); border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.fchip.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.fchip.on span { background: rgba(255,255,255,.25); }

/* Activity chart */
.legend { display: flex; gap: 12px; align-items: center; }
.lg { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.lg::before { content: ''; width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-signup::before { background: var(--accent); }
.lg-listing::before { background: #8a5cff; }
.lg-booking::before { background: var(--green); }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 6px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.chart-bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; }
.cb { width: 6px; border-radius: 2px 2px 0 0; min-height: 0; }
.cb-signup { background: var(--accent); }
.cb-listing { background: #8a5cff; }
.cb-booking { background: var(--green); }
.chart-x { color: var(--muted); font-size: 10px; }

/* Horizontal bars (pipeline) */
.hbar-row { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); padding: 5px 0; }
.hbar-row:hover .hbar-label { opacity: .85; }
.hbar-label { width: 92px; flex: 0 0 auto; }
.hbar-track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 6px; background: var(--accent); min-width: 2px; }
.hbar-requested, .hbar-paused { background: var(--amber); }
.hbar-approved, .hbar-rented { background: var(--accent); }
.hbar-active, .hbar-completed { background: var(--green); }
.hbar-returned { background: #2dd4bf; }
.hbar-declined, .hbar-removed { background: var(--red); }
.hbar-cancelled, .hbar-draft { background: var(--muted); }
.hbar-num { width: 32px; text-align: right; flex: 0 0 auto; font-weight: 600; }
.mini-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: 13px; }
.mini-stats strong { color: var(--text); }

/* Tiles */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); }
.tile .cv, .tile .cv-empty { width: 100% !important; height: 120px !important; }
.tile:hover .tile-title { color: var(--accent); }
.tile-title { font-weight: 600; font-size: 13px; line-height: 1.25; }

/* Detail pages */
.detail-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.detail-head-body { flex: 1; min-width: 220px; }
.detail-head-body h1 { margin-bottom: 6px; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; min-width: 240px; }
.detail-meta dt, .kv dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.detail-meta dd, .kv dd { margin: 0; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { background: var(--surface-2); color: var(--muted); border-radius: 20px; padding: 3px 11px; font-size: 12px; }
.chip.ok { background: rgba(46,204,113,.15); color: var(--green); }
.chip.warn { background: rgba(255,176,32,.15); color: var(--amber); }

.gallery { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.gallery-item { position: relative; display: block; }
.gallery-item img { width: 150px; height: 150px; object-fit: cover; border-radius: 10px; background: #000; border: 1px solid var(--border); }
.cover-badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.7); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 5px; }

.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.price-grid .k { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.price-grid .v { font-weight: 600; font-size: 15px; }
.price-grid .v.big { font-size: 22px; color: var(--green); }

.owner-block { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); margin-bottom: 6px; }
a.owner-block:hover .urow-name { color: var(--accent); }
.party { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.party-role { color: var(--muted); font-size: 11px; width: 56px; flex: 0 0 auto; text-transform: uppercase; letter-spacing: .04em; }

/* Booking timeline */
.timeline { display: flex; list-style: none; padding: 0; margin: 0; }
.tl { flex: 1; position: relative; text-align: center; color: var(--muted); font-size: 12px; text-transform: capitalize; }
.tl::before { content: ''; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.tl:first-child::before { display: none; }
.tl-dot { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); margin: 0 auto 8px; position: relative; z-index: 1; }
.tl-label { display: block; }
.tl-sub { display: block; color: var(--muted); font-size: 10px; }
.tl.done .tl-dot { background: var(--green); border-color: var(--green); }
.tl.done::before { background: var(--green); }
.tl.current .tl-label { color: var(--text); font-weight: 700; }
.tl.current .tl-dot { box-shadow: 0 0 0 4px rgba(46,204,113,.2); }
.timeline-dead .tl.done .tl-dot { background: var(--muted); border-color: var(--muted); }
.timeline-dead .tl.done::before { background: var(--muted); }

.banner { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; }
.banner-bad { background: rgba(255,91,110,.12); border: 1px solid rgba(255,91,110,.4); color: #ffd0d6; }

.weekdays { display: flex; gap: 6px; }
.wd { width: 36px; text-align: center; padding: 6px 0; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.wd.on { background: rgba(46,204,113,.18); color: var(--green); font-weight: 700; }
.plain { list-style: none; padding-left: 0; margin: 6px 0 0; }
.plain li { padding: 2px 0; color: var(--muted); font-size: 13px; }

.review-line { padding: 10px 0; border-bottom: 1px solid var(--border); }
.review-line:last-child { border-bottom: none; }
.stars { color: var(--amber); letter-spacing: 1px; }

.codeblock { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; font-family: ui-monospace, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.codeblock.json { max-height: 380px; overflow: auto; white-space: pre; }

@media (max-width: 820px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .kv, .detail-meta { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .kpis { grid-template-columns: 1fr; }
}

/* App Admin login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 14px;
}
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .logo {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), #8a5cff);
  color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 20px;
}
.login-brand strong { display: block; line-height: 1.1; }
.login-brand .sub { color: var(--muted); font-size: 12px; }
.login-field { display: flex; flex-direction: column; gap: 5px; }
.login-field span { color: var(--muted); font-size: 12px; }
.login-field input {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 11px 12px; border-radius: 8px; font-size: 15px;
}
.login-field input:focus { outline: none; border-color: var(--accent); }
.login-btn {
  margin-top: 6px; background: var(--accent); color: #fff; border: none;
  padding: 12px; border-radius: 8px; font-weight: 700; font-size: 15px; cursor: pointer;
}
.login-error {
  background: rgba(255,91,110,.12); border: 1px solid rgba(255,91,110,.4);
  color: #ffd0d6; padding: 10px 12px; border-radius: 8px; font-size: 13px;
}
.nav-logout { color: var(--muted); }
