/* Portal pages (status, password, admin). Base tokens + kit come from /intake/intake.css.
   The landing page has its own stylesheet (landing.css). */

/* ---------- status */
.st-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.st-head h1 { font-size: 26px; letter-spacing: -.03em; margin: 2px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-received { color: var(--text-2); }
.st-designing, .st-revising, .st-building { color: var(--accent); background: var(--accent-soft); }
.st-designing::before, .st-revising::before, .st-building::before { animation: pulse 1.2s infinite; }
.st-ready { color: var(--ok); background: var(--ok-soft); }
.st-review { color: var(--warn); background: var(--warn-soft); }
.st-failed { color: var(--bad); background: var(--bad-soft); }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pill::before { animation: none !important; } }

.prog { margin: 10px 0 6px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.prog > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .6s ease; }
.prog.done > i { background: var(--ok); }
.prog.fail > i { background: var(--bad); }
.activity { font-size: 17px; font-weight: 600; margin: 12px 0 2px; min-height: 1.5em; }
.activity-sub { color: var(--text-2); font-size: 14px; }

.tracker { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 0; }
.tracker li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding-bottom: 14px; position: relative; }
.tracker li::after { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--border); }
.tracker li:last-child::after { display: none; }
.tracker .dot { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border-2); background: var(--surface); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--text-3); z-index: 1; }
.tracker li.done .dot { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.tracker li.done::after { background: var(--ok); }
.tracker li.active .dot { border-color: var(--accent); color: var(--accent); }
.tracker li.active .dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; }
.tracker li.failed .dot { background: var(--bad); border-color: var(--bad); color: var(--bg); }
.tracker .lbl { padding-top: 3px; font-weight: 600; }
.tracker li.todo .lbl { color: var(--text-3); font-weight: 500; }

.log { list-style: none; margin: 0; padding: 0; font-size: 14px; max-height: 280px; overflow-y: auto; }
.log li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--text-3); font-variant-numeric: tabular-nums; }

.result { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.result h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.result .summary { color: var(--text-2); margin: 0 0 14px; }
.result .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.stats .stat { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.stats .k { font-size: 12px; color: var(--text-2); }
.stats .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

.share { display: flex; gap: 8px; align-items: stretch; }
.share input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }
.rev-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.rev-list li { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.rev-list .meta { display: flex; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 12px; margin-bottom: 4px; }
.stack { display: grid; gap: 14px; }
.stack > .card { padding: 22px; }
.stack h2 { font-size: 18px; margin: 0 0 8px; }

/* ---------- password / login pages */
main.auth { max-width: 460px; margin: 0 auto; padding: 40px 16px 64px; min-height: calc(100vh - 68px); display: flex; align-items: flex-start; }
@media (min-height: 700px) { main.auth { align-items: center; padding-top: 16px; } }
.auth-card { width: 100%; padding: 30px 26px; }
.auth-card h1 { font-size: 28px; letter-spacing: -.03em; margin: 14px 0 6px; }
.auth-card > p { margin: 0 0 14px; }
.auth-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.auth-icon svg { width: 24px; height: 24px; }
.auth-form { display: grid; gap: 10px; margin: 8px 0 14px; }
.auth-form .q-label { font-weight: 600; margin: 0; }
.pw-input { font-family: var(--mono); font-size: 20px; letter-spacing: .12em; text-align: center; }
.site-top form { margin: 0; }
/* staff pages (a logout form in the header): on a phone their links go under the logo instead of off the screen */
@media (max-width: 600px) {
  .site-top:has(form) { flex-wrap: wrap; height: auto; min-height: 68px; padding-top: 10px; padding-bottom: 10px; gap: 4px 8px; }
  .site-top:has(form) .spacer { flex-basis: 100%; }
  .site-top:has(form) .btn.sm { padding: 0 8px; }
  .site-top:has(form) .spacer + .btn { margin-left: -8px; }
}

/* ---------- admin */
.admin-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.admin-bar h1 { font-size: 22px; margin: 0; }
.admin-bar h1 .muted { font-size: 15px; font-weight: 500; }
.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-filters .input { width: auto; min-width: 200px; min-height: 38px; font-size: 15px; }
.admin-tbl td { font-size: 13px; vertical-align: top; }
.admin-tbl tr.row-needs td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
.admin-tbl .copy-line { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.admin-tbl .copy-line code { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.admin-tbl code.pw, .detail-grid code.pw { font-size: 14px; letter-spacing: .08em; font-weight: 700; color: var(--text); max-width: none; }
.admin-tbl .act-text { max-width: 220px; }
.pkg-line { margin-top: 4px; }
.pkg { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--border-2); color: var(--text-2); }
.pkg-gold { border-color: #c9a227; color: #c9a227; }
.pkg-platinum { border-color: var(--text); color: var(--text); background: var(--accent-soft); }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; max-width: 260px; }
.prog.mini { height: 6px; margin: 6px 0 2px; max-width: 160px; }
.orphans { margin-top: 12px; }
.plain-list { margin: 0; padding-left: 18px; }
@media (max-width: 860px) {
  .admin-tbl thead { display: none; }
  .admin-tbl, .admin-tbl tbody, .admin-tbl tr, .admin-tbl td { display: block; width: 100%; }
  .admin-tbl tr { padding: 10px 12px; border-bottom: 6px solid var(--bg); }
  .admin-tbl tr.row-needs { box-shadow: inset 4px 0 0 var(--warn); }
  .admin-tbl tr.row-needs td:first-child { box-shadow: none; }
  table.admin-tbl td { border: 0; position: relative; padding: 5px 0 5px 96px; min-height: 26px; text-align: left !important; }
  .admin-tbl td::before { content: attr(data-label); position: absolute; left: 0; top: 6px; width: 88px; color: var(--text-2); font-size: 12px; font-weight: 600; }
  table.admin-tbl td[colspan] { padding-left: 0; }
  .admin-tbl td[colspan]::before { content: none; }
  .admin-tbl .copy-line code { max-width: calc(100vw - 210px); }
  .admin-tbl .copy-line code.pw { max-width: none; }
  .admin-tbl .act-text { max-width: none; }
  .row-actions { max-width: none; }
  .admin-filters, .admin-filters .input { width: 100%; }
}

/* admin detail */
.detail-head h1 { margin: 2px 0 6px; font-size: 24px; }
.detail-grid { margin: 16px 0; align-items: start; }
@media (max-width: 720px) { .grid.cols-2.detail-grid { grid-template-columns: 1fr; } }
.detail-grid h2 { margin: 0 0 10px; font-size: 17px; }
.detail-grid h3 { font-size: 15px; margin: 14px 0 4px; }
.kv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv-row > .muted:first-child { min-width: 90px; }
.kv-row code { word-break: break-all; }
.approve-as { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.approve-as .input { width: auto; min-width: 180px; min-height: 38px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pre { white-space: pre-wrap; font-size: 14px; color: var(--text-2); }
.review-form { display: grid; gap: 10px; margin-bottom: 12px; }
.review-form h3 { margin: 0; font-size: 16px; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check-line input { margin-top: 3px; flex: 0 0 auto; }
details.sec { padding: 10px 16px; margin-bottom: 8px; }
details.sec summary { cursor: pointer; font-weight: 650; }
dl.kv { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 4px 14px; margin: 8px 0; font-size: 14px; }
dl.kv dt { color: var(--text-2); }
dl.kv dd { margin: 0; word-break: break-word; }
dl.kv dl.kv { margin: 0; padding-left: 10px; border-left: 2px solid var(--border); }
@media (max-width: 560px) { dl.kv { grid-template-columns: 1fr; } dl.kv dt { margin-top: 6px; } }
.admin-thumbs .thumb { display: block; color: inherit; text-decoration: none; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; max-height: 520px; overflow-y: auto; }
.timeline li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.timeline li.internal { color: var(--text-2); }
.timeline time { color: var(--text-3); font-variant-numeric: tabular-nums; margin-right: 6px; }
.timeline pre { white-space: pre-wrap; font-size: 12px; max-height: 240px; overflow: auto; background: var(--surface-2); padding: 8px; border-radius: var(--radius-sm); }
/* material catalog (architect portal: /arsitek/katalog) */
.cat-tabs { display: flex; gap: 6px; }
.cat-tabs a { padding: 5px 12px; border-radius: 999px; text-decoration: none; color: var(--text-2); border: 1px solid var(--border); font-size: 14px; }
.cat-tabs a[aria-current="page"] { color: var(--text); background: var(--surface-2); border-color: var(--border-2); }
.cat-toc { margin: 8px 0 4px; line-height: 1.9; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 12px; margin-bottom: 18px; }
.cat-entry h3 { margin: 0 0 4px; font-size: 16px; }
.cat-entry h4 { margin: 12px 0 4px; font-size: 14px; }
.cat-head { display: flex; gap: 12px; align-items: flex-start; }
.swatch { flex: none; border-radius: 8px; border: 1px solid var(--border-2); vertical-align: middle; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 2px; margin: 2px 0; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; color: var(--text); text-decoration: none; white-space: nowrap; }
.chip .swatch { border-radius: 50%; }
.chip.bad { color: var(--bad); padding-left: 8px; }
.cat-palette th { white-space: nowrap; font-weight: 600; }
.cat-palette td { min-width: 140px; }
.cat-head > .grow { flex: 1; min-width: 0; }
.cat-edit { font-weight: 500; margin-left: 4px; }
.cat-notes li { margin: 4px 0; }
/* curating the catalog (/arsitek/katalog/ubah/…): JSON as written in data/materials */
textarea.input.json-edit { font-family: var(--mono); font-size: 13px; line-height: 1.45; white-space: pre; overflow: auto; tab-size: 2; min-height: 420px; }
/* the Daftar bahan's per-material inputs for "Minta perbaikan" */
.mat-note { min-width: 200px; }
.mat-note .input { min-height: 34px; padding: 4px 8px; font-size: 13px; margin: 2px 0; width: 100%; }

/* design versions (admin job page) */
.v-tbl tr.v-active td { background: var(--ok-soft); }
.v-tbl details summary { cursor: pointer; color: var(--text-2); }
.v-tbl .pre { margin: 4px 0 0; }
.v-error, .v-msg { color: var(--bad); }
.v-msg:not(:empty) { margin: 8px 0; }
.regen-form { max-width: 720px; margin-top: 12px; }

/* ---------- funnel (admin: /admin/funnel, funnel.js): tables with bars, the visitors per day as columns */
.fn { display: grid; gap: 14px; transition: opacity .15s; }
.fn.loading { opacity: .55; }
.fn .card { padding: 18px 20px; min-width: 0; }
.fn h2 { font-size: 17px; margin: 0 0 4px; }
.fn .sub { margin: 0 0 12px; }
.fn p.small { margin: 10px 0 0; }
.fn-pair { gap: 14px; align-items: start; }
@media (max-width: 900px) { .grid.cols-2.fn-pair { grid-template-columns: 1fr; } }
.fn-foot { margin-top: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.fn .kpi { padding: 16px 18px; }
.kpi .k { font-size: 13px; font-weight: 600; color: var(--text-2); }
.kpi .v { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin: 6px 0 4px; }
.kpi .d { font-size: 13px; color: var(--text-2); }
table.fn-tbl td { vertical-align: middle; }
.fn-tbl .bar-cell { width: 32%; min-width: 110px; }
.fn-tbl td.num, .fn-tbl th.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fn-tbl tr.sum td { font-weight: 600; }
.hbar { display: block; height: 12px; border-radius: 0 4px 4px 0; background: var(--accent-soft); }
.hbar > i { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--accent); }
.hbar > i.zero { min-width: 0; }
.fn-pill { padding: 1px 8px; font-size: 11px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; margin: 4px 0 12px; border-radius: 999px; background: var(--surface-2); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow), 0 0 0 1px var(--border); }
.seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.fn-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.fn-tools .seg { margin: 0; }
.dc { margin-top: 18px; }
.dc-plot { position: relative; height: 180px; margin-left: 44px; }
.dc-grid { position: absolute; inset: 0; }
.dc-gl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.dc-gl:nth-child(1) { top: 0; }
.dc-gl:nth-child(2) { top: 50%; }
.dc-gl:nth-child(3) { top: 100%; }
.dc-gl span { position: absolute; right: calc(100% + 8px); top: -.75em; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dc-cols { position: absolute; inset: 0; display: flex; gap: 2px; }
.dc-col { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0; border: 0; background: transparent; cursor: default; }
.dc-col > i { display: block; width: min(24px, 100%); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent); }
.dc-col > i.zero { min-height: 0; }
.dc-col.today > i { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.dc-col:hover > i, .dc-col:focus-visible > i { background: var(--accent-2); }
.dc-col:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 4px; }
.dc-tip { position: absolute; top: 0; z-index: 2; min-width: 170px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); font-size: 13px; color: var(--text-2); pointer-events: none; }
.dc-tip b { display: block; margin-bottom: 4px; font-weight: 600; color: var(--text); }
.dc-tip strong { color: var(--text); font-variant-numeric: tabular-nums; }
.dc-tip .on { color: var(--text); }
.dc-x { display: flex; gap: 2px; height: 24px; margin-left: 44px; }
.dc-x span { flex: 1 1 0; min-width: 0; position: relative; }
.dc-x em { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--text-3); white-space: nowrap; }
