/* Club Prometheus staff admin. Warm neutral base, black ink, one bronze accent. */
:root {
	--bg: #f5f3ef;
	--surface: #ffffff;
	--surface-2: #faf9f6;
	--ink: #151515;
	--ink-2: #3d3b38;
	--muted: #77736c;
	--line: #e6e2da;
	--line-2: #efece6;
	--accent: #2f6f6a;
	--accent-soft: #e3efed;
	--ok: #2e7a50; --ok-soft: #e6f2ea;
	--warn: #a66a12; --warn-soft: #fbf0dc;
	--bad: #b0413e; --bad-soft: #f8e6e4;
	--info: #3b5f86; --info-soft: #e7eef6;
	--radius: 14px;
	--radius-sm: 9px;
	--shadow: 0 1px 2px rgba(20, 18, 14, .04), 0 4px 16px rgba(20, 18, 14, .04);
	--side: 248px;
	--font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--display: 'Manrope', 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.01em; margin: 0; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.sandbox-bar { background: var(--ink); color: #e9e2d4; text-align: center; font-size: 12px; padding: 6px 12px; letter-spacing: .02em; }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; background: linear-gradient(90deg, #121212 var(--side), transparent var(--side)); }
.side { width: var(--side); flex: none; background: #121212; color: #d8d4cc; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 8px 18px; color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font: 800 13px var(--display); letter-spacing: .04em; }
.brand-text b { display: block; font: 700 14px var(--display); }
.brand-text small { color: #8f8a80; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.nav, .nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav-group a, .nav-sub summary { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: #bdb8ae; font-weight: 500; cursor: pointer; }
.nav a:hover, .nav-group a:hover, .nav-sub summary:hover { background: #1f1f1f; color: #fff; }
.nav a.is-on { background: #262422; color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-group { margin-top: 22px; }
.nav-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #6f6b64; padding: 0 10px 6px; }
.nav-sub summary { list-style: none; }
.nav-sub summary::-webkit-details-marker { display: none; }
.nav-sub a { padding-left: 39px; font-size: 13px; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid #262626; }
.side-user a b, .side-user b { display: block; color: #fff; font-size: 13px; }
.side-user small { display: block;  color: #8f8a80; font-size: 11px; }
.side-user .icon-btn { margin-left: auto; color: #bdb8ae; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2c2925; color: #e9dcc5; display: grid; place-items: center; font-weight: 700; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 16px; padding: 22px 32px 6px; }
.top-title h1 { font-size: 26px; font-weight: 800; }
.top-title p { margin: 2px 0 0; color: var(--muted); }
.top-fresh { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top-fresh + .top-search { margin-left: 0; }
.top-search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; width: 320px; color: var(--muted); }
.top-search input[type=search], .top-search input[type=search]:focus { -webkit-appearance: none; appearance: none; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: transparent; padding: 10px 0; min-height: 0; width: 100%; font: inherit; color: var(--ink); }
.top-search:focus-within { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.content { padding: 18px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.flash { margin: 8px 32px 0; background: var(--ok-soft); color: var(--ok); border-radius: var(--radius-sm); padding: 10px 14px; display: flex; gap: 8px; align-items: center; font-weight: 500; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; cursor: pointer; color: inherit; display: inline-grid; place-items: center; }
.only-mobile, .btn.only-mobile { display: none; }
.tabbar { display: none; }
.scrim { display: none; }

/* ---------- Cards and grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; }
.card-h h2 { font-size: 15px; font-weight: 700; }
.card-h .muted { font-size: 12.5px; }
.card-h .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 4px 18px 18px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; }
.link:hover { text-decoration: underline; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; text-decoration: none; display: block; }
.kpi-l { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; display: flex; align-items: center; gap: 6px; }
.kpi-v { font: 800 28px/1.15 var(--display); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.is-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.is-dark .kpi-l, .kpi.is-dark .kpi-s { color: #a9a39a; }
.kpi.is-alert { border-color: #ecc9c6; background: linear-gradient(180deg, #fff, var(--bad-soft)); }
.kpi.is-alert .kpi-v { color: var(--bad); }
.kpi .spark { position: absolute; right: 14px; bottom: 14px; width: 64px; height: 24px; }
.kpi:has(.spark) .kpi-s { padding-right: 72px; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.kpi.is-dark .spark polyline { stroke: #d6b98a; }

/* Pills and chips */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill .ic { width: 13px; height: 13px; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-muted { background: #f0ede7; color: var(--ink-2); }
.pill-dark { background: var(--ink); color: #fff; }
.vchip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.vchip::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--v); }
.ready { display: inline-flex; gap: 4px; }
.ready-i { display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; padding: 4px 6px; font-size: 12px; font-weight: 600; }
.ready-i .ic { width: 15px; height: 15px; }
.ready-i.is-ok { background: var(--ok-soft); color: var(--ok); }
.ready-i.is-bad { background: var(--bad-soft); color: var(--bad); }

/* Alerts strip */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); }
.alert.is-bad { border-left-color: var(--bad); }
.alert.is-info { border-left-color: var(--info); }
.alert .ic { color: var(--warn); }
.alert.is-bad .ic { color: var(--bad); }
.alert.is-info .ic { color: var(--info); }
.alert b { font-weight: 600; }
.alert .end { margin-left: auto; }

/* Lists of guests */
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line-2); text-decoration: none; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row-bar { width: 4px; height: 38px; border-radius: 4px; background: var(--v, var(--line)); }
.row-main b { font-weight: 600; }
.row-meta { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.row-meta span { display: inline-flex; align-items: center; gap: 4px; }
.row-meta .ic { width: 13px; height: 13px; }
.row-end { display: flex; align-items: center; gap: 8px; }
.empty { padding: 26px 18px; text-align: center; color: var(--muted); }

/* Villa status board */
.villas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.villa { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; box-shadow: var(--shadow); border-top: 4px solid var(--v); display: flex; flex-direction: column; gap: 10px; }
.villa-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.villa-h h3 { font-size: 15px; font-weight: 700; }
.villa dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 12.5px; }
.villa dt { color: var(--muted); }
.villa dd { margin: 0; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Step progress */
.steps { display: flex; gap: 3px; }
.steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps i.is-done { background: var(--ok); }
.steps i.is-now { background: var(--warn); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--surface-2); }
.t tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.t .sub { color: var(--muted); font-size: 12px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.seg { display: inline-flex; background: #ebe7df; border-radius: 10px; padding: 3px; }
.seg a, .seg button { border: 0; background: none; font: inherit; font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg .is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg .count { color: var(--muted); font-weight: 500; margin-left: 4px; }
select, input[type=text], input[type=number], input[type=date], input[type=password], input[type=search], textarea {
	font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; min-height: 38px;
}
textarea { width: 100%; min-height: 70px; resize: vertical; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label.fld { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
label.fld small { font-weight: 400; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: 600 13px var(--font); border-radius: 9px; padding: 9px 14px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 38px; }
.btn:hover { background: #2a2a2a; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.sm { padding: 5px 10px; min-height: 30px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Timeline (calendar) */
.tl { --cols: 14; --lw: 150px; min-width: 100%; }
.tl-wrap { overflow-x: auto; }
.tl-head, .tl-row { display: grid; grid-template-columns: var(--lw) repeat(var(--cols), minmax(var(--cw, 34px), 1fr)); }
.tl-head div { font-size: 11px; color: var(--muted); text-align: center; padding: 8px 0 6px; border-left: 1px solid var(--line-2); line-height: 1.2; }
.tl-head div b { display: block; color: var(--ink); font-size: 13px; }
.tl-head .is-we { background: var(--surface-2); }
.tl-head .is-today b, .tl-head .is-today { color: var(--accent); }
.tl-row { position: relative; border-top: 1px solid var(--line-2); min-height: 48px; }
.tl-row > .cell { border-left: 1px solid var(--line-2); }
.tl-row > .cell.is-we { background: var(--surface-2); }
.tl-row > .cell.is-today { background: var(--accent-soft); }
.tl-row > .cell.is-off { background: repeating-linear-gradient(135deg, #ece8e0 0 5px, #f7f5f0 5px 10px); }
.tl-name { display: flex; flex-direction: column; justify-content: center; padding: 0 12px; font-weight: 600; font-size: 13px; position: sticky; left: 0; background: var(--surface); z-index: 2; }
.tl-name small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.tl-bars { position: absolute; left: var(--lw); right: 0; top: 0; bottom: 0; pointer-events: none; }
.tl-bar { position: absolute; top: 8px; bottom: 8px; border-radius: 8px; background: var(--v); color: #fff; font-size: 11.5px; font-weight: 600; padding: 0 8px; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-decoration: none; pointer-events: auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.tl-bar.is-pending { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.0) 0 6px, rgba(255,255,255,.18) 6px 12px); }
.tl-bar .ic { width: 13px; height: 13px; }
.tl-bar.is-past { opacity: .5; }

/* Kanban for turnovers */
.board { display: grid; grid-template-columns: repeat(6, minmax(168px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.lane { background: #ece8e0; border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 140px; }
.lane-h { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 12.5px; padding: 2px 4px; }
.lane-h .count { background: var(--surface); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; }
.tcard { background: var(--surface); border-radius: 11px; padding: 11px 12px; border: 1px solid var(--line); border-left: 4px solid var(--v); display: flex; flex-direction: column; gap: 7px; box-shadow: var(--shadow); }
.tcard h4 { font-size: 13.5px; }
.tcard .meta { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.tcard form { margin: 0; }

/* Turnover detail */
.tsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tsteps li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px dashed var(--line); }
.tsteps li:first-child { border-top: 0; }
.tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; }
.tick .ic { width: 14px; height: 14px; }
.is-done .tick { background: var(--ok); border-color: var(--ok); }
.is-now .tick { border-color: var(--warn); }
.tsteps small { color: var(--muted); display: block; font-size: 12px; }

/* Checklist */
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.check-group h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 6px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ok); margin: 0; flex: none; }
.check:has(input:checked) { background: var(--ok-soft); border-color: #cfe5d7; }
.check .fail { margin-left: auto; font-size: 11.5px; color: var(--bad); display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.check .fail input { width: 15px; height: 15px; accent-color: var(--bad); }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }

/* Charts */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: #bcd6d2; }
.chart .bar.is-hi { fill: var(--accent); }
.chart .bar.is-dim { fill: #ebe4d8; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart .dot { fill: var(--ink); }
.chart .band { fill: var(--accent-soft); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.donut { width: 150px; height: 150px; transform: rotate(0deg); }
.donut circle { fill: none; }
.donut-bg { stroke: var(--line-2); stroke-width: 5.5; }
.ring { position: relative; width: 54px; height: 54px; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.6; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--ok); stroke-linecap: round; }
.ring b { font-size: 12px; font-weight: 700; }
.bars-h { display: flex; flex-direction: column; gap: 10px; }
.bar-h { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-h .track { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.bar-h .track i { display: block; height: 100%; background: var(--v, var(--accent)); border-radius: 5px; }

/* Pricing */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; font: 600 13px var(--font); padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.is-on { color: var(--ink); border-bottom-color: var(--accent); }
.tab { display: none; padding-top: 16px; }
.tab.is-on { display: block; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.vcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; border-top: 4px solid var(--v); background: var(--surface); }
.vcard-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; margin: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 18px; }
.savebar { position: sticky; bottom: 0; z-index: 5; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 -4px 20px rgba(0,0,0,.05); }
.savebar .end { margin-left: auto; display: flex; gap: 8px; }
.pcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.pday { border: 1px solid var(--line); border-radius: 9px; padding: 7px 8px; font-size: 11.5px; background: var(--surface); min-height: 62px; }
.pday b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.pday.is-event { background: var(--accent-soft); border-color: #e3d4bb; }
.pday.is-wk { background: var(--warn-soft); border-color: #f0dcb4; }
.pday.is-lm { background: var(--info-soft); border-color: #cfdcea; }
.pday.is-floor { box-shadow: inset 0 0 0 2px var(--bad-soft); }
.pday .tag { font-size: 10.5px; color: var(--muted); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 30% 20%, #1d3b3f, #0d1718 60%); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 18px; padding: 30px; box-shadow: 0 30px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 22px; }
.login-card .btn { width: 100%; padding: 12px; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 9px; padding: 9px 12px; font-size: 13px; }

/* Guest detail drawer */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
dl.kv { margin: 0; display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; }

/* Mobile-first cards for tables */
.mcards { display: none; }

/* Messages */
.badge { margin-left: auto; background: var(--bad); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.inbox { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 16px; height: calc(100vh - 230px); min-height: 520px; }
.inbox-list { overflow-y: auto; }
.thread { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); text-decoration: none; border-left: 3px solid transparent; }
.thread:hover { background: var(--surface-2); }
.thread.is-on { background: var(--accent-soft); border-left-color: var(--v); }
.thread-top { display: flex; justify-content: space-between; gap: 8px; }
.thread-meta { display: flex; gap: 8px; align-items: center; }
.thread-text { color: var(--ink-2); font-size: 12.5px; display: flex; gap: 6px; align-items: baseline; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; }
.inbox-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.chat-h h2 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-h > div:not(.end):not(.chat-meta) { flex: 1 1 120px; min-width: 0; }
.chat-h .end { flex-wrap: wrap; justify-content: flex-end; }
.chat-h .end .btn.sm { min-height: 30px; padding: 5px 10px; }
.chat-meta { flex-basis: 100%; min-width: 0; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.chat-meta > * { flex: none; }
.chat { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.bubble { max-width: 74%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; position: relative; }
.bubble.is-in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.is-out { align-self: flex-end; background: var(--ink); color: #f3efe7; border-bottom-right-radius: 4px; }
.bubble.is-note { background: var(--warn-soft); color: var(--ink); border: 1px dashed #e2c48f; }
.bubble-at { display: block; font-size: 11px; opacity: .6; margin-top: 4px; }
.bubble-tag { display: block; font-size: 11px; font-weight: 700; color: var(--warn); margin-bottom: 3px; }
.compose { border-top: 1px solid var(--line); padding: 8px 16px 10px; display: flex; flex-direction: column; gap: 6px; }
.compose textarea { min-height: 64px; height: 76px; transition: height .18s ease; }
/* Typing: the box grows upwards by half so more of the reply is visible. */
.compose textarea:focus { height: 171px; }
.compose input[type=text], .compose .btn { min-height: 32px; }
.compose .ai-bar input[type=text] { padding: 5px 11px; }
.compose .ai-bar .btn, .compose [data-send] { padding: 6px 14px; }
.templates { display: flex; gap: 6px; flex-wrap: nowrap; min-width: 0; align-items: center; overflow-x: auto; scrollbar-width: none; }
.templates::-webkit-scrollbar { display: none; }
.templates > * { flex: none; }
.templates button { border: 0; cursor: pointer; font-family: inherit; }
.templates button:hover { background: var(--accent-soft); }
.ai-bar { display: flex; gap: 8px; }
.ai-bar input { flex: 1; min-width: 0; }
.ai-msg { padding: 8px 12px; border-radius: 8px; background: var(--info-soft); color: var(--info); }
.ai-msg.is-bad { background: var(--bad-soft); color: var(--bad); }
textarea.is-drafted { border-color: var(--accent); background: #fffdf8; }
.compose-bar { display: flex; gap: 12px; align-items: center; }
.compose-bar .btn { margin-left: auto; }
@media (max-width: 900px) {
	.inbox { grid-template-columns: 1fr; height: auto; min-height: 0; }
	.inbox.has-open .inbox-list { display: none; }
	.inbox:not(.has-open) .inbox-chat { display: none; }
	.inbox-chat { height: calc(100vh - 200px); }
	.chat-h .end { order: 3; flex: 1 1 100%; min-width: 0; flex-wrap: nowrap !important; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin-left: 0 !important; }
	.chat-h .end::-webkit-scrollbar { display: none; }
	.chat-h .end > * { flex: none; }
	.bubble { max-width: 88%; }
}

/* Owner pages */
.public-top { background: #121212; color: #fff; padding: 28px 32px 30px; }
.public-top .brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.public-top h1 { font-size: 34px; font-weight: 800; letter-spacing: .02em; }
.public-top p { color: #b9b3a8; margin: 6px 0 0; }
.public-body { max-width: 1240px; margin: 0 auto; padding: 22px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.public-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 0 30px; }
@media (max-width: 900px) { .public-top { padding: 20px 16px; } .public-top h1 { font-size: 26px; } .public-body { padding: 14px 14px 40px; } }

/* People and tabs */
.tabboxes { display: flex; flex-wrap: wrap; gap: 4px; max-width: 520px; }
.tabbox { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 7px; background: #f0ede7; cursor: pointer; }
.tabbox:has(input:checked) { background: var(--ok-soft); color: var(--ok); }
.tabbox.is-admin { background: #f5f1ea; color: var(--muted); }
.tabbox.is-admin:has(input:checked) { background: var(--accent-soft); color: var(--accent); }
.tabbox input { margin: 0; accent-color: var(--ok); }
.tabbox:has(input:disabled) { cursor: default; }
table.users td { vertical-align: top; }
table.users tr.is-off td, .t tr.is-off td { opacity: .55; }
table.users tr.is-new td { background: var(--surface-2); }

@media (max-width: 1180px) {
	.g-main { grid-template-columns: 1fr; }
	.top-search { width: 240px; }
}
@media (max-width: 900px) {
	.app { background: none; }
	.g2, .g3, .detail { grid-template-columns: 1fr; }
	.side { position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
	body.nav-open .side { transform: none; }
	body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
	.only-mobile { display: inline-grid; }
	.btn.only-mobile { display: inline-flex; }
	.top { padding: 14px 16px 4px; gap: 10px; flex-wrap: wrap; }
	.top-title h1 { font-size: 21px; }
	.top-search { order: 3; width: 100%; margin: 4px 0 0; }
	.top-fresh { order: 4; width: 100%; margin: 0; justify-content: space-between; }
	.content { padding: 14px 14px 96px; gap: 14px; }
	.flash { margin: 8px 14px 0; }
	.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.kpi-v { font-size: 23px; }
	.kpi .spark { display: none; }
	.row { padding: 12px 14px; grid-template-columns: 4px minmax(0, 1fr); }
	.row-end { grid-column: 2; }
	.tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: rgba(18,18,18,.97); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
	.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #9d988f; text-decoration: none; font-size: 10.5px; font-weight: 600; padding: 4px 0; }
	.tabbar a.is-on { color: #fff; }
	.tabbar .ic { width: 21px; height: 21px; }
	.hide-mobile { display: none !important; }
	.mcards { display: flex; flex-direction: column; }
	.bar-h { grid-template-columns: 90px 1fr 60px; }
	dl.kv { grid-template-columns: 110px 1fr; }
	.savebar { bottom: 64px; }
	.tl { --lw: 104px; }
	.pcal { gap: 4px; }
	.pday { padding: 5px; min-height: 54px; }
	.pday b { font-size: 12px; }
}
@media print {
	.side, .tabbar, .top-search, .sandbox-bar, .savebar { display: none !important; }
	.content { padding: 0; }
	.card { box-shadow: none; }
}

/* Footer line under every page */
.app-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 0 6px; }
.app-foot b { color: var(--ink, inherit); font-weight: 600; }
