/* Ready-made sample apps (/for/<slug>). One shell for every sector; --brand comes from the firm's own logo/website. */
:root {
  --brand: #1F5FBF;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 22%, #fff);
  --ink: #101828; --ink-2: #344054; --muted: #667085; --faint: #98A2B3;
  --bg: #F6F7F9; --surface: #fff; --line: #E4E7EC; --line-2: #F0F2F5;
  --ok: #067647; --ok-bg: #ECFDF3; --warn: #B54708; --warn-bg: #FFFAEB; --bad: #B42318; --bad-bg: #FEF3F2;
  --r: 12px; --shadow: 0 1px 2px rgba(16,24,40,.05); --shadow-lg: 0 12px 32px -8px rgba(16,24,40,.18);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }

/* sample strip */
.strip { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 16px; background: #101828; color: #E4E7EC; font-size: 13px; }
.strip b { color: #fff; font-weight: 600; }
.strip .sbtn { background: #fff; color: #101828; border: 0; border-radius: 999px; padding: 5px 12px; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.strip .sbtn:hover { background: #F2F4F7; }
.strip .sback { color: #fff; font-weight: 600; text-decoration: none; opacity: .85; margin-right: 4px; }
.strip .sback:hover { opacity: 1; text-decoration: underline; }

/* shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 37px); }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 37px; height: calc(100vh - 37px); }
.logo-box { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; min-height: 56px; }
.logo-box img { max-width: 100%; max-height: 52px; object-fit: contain; display: block; }
.mono { width: 36px; height: 36px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.logo-box .bn { font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand .bn small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.appname { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 0 10px 6px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; cursor: pointer;
  border: 0; background: none; width: 100%; text-align: left; }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; }
.nav:hover { background: var(--line-2); }
.nav.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav .count { margin-left: auto; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 1px 7px; }
.side .grow { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--line); margin-top: 8px; font-size: 13px; }
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.me small { display: block; color: var(--muted); }

.main { padding: 28px 32px 120px; max-width: 1180px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head h1 { font-size: 24px; font-weight: 700; }
.head p { margin: 4px 0 0; color: var(--muted); }

/* building blocks */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi .l { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.kpi.warn .v { color: var(--warn); }
.kpi .h { font-size: 11.5px; color: var(--faint); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card > .ch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card > .ch h2 { font-size: 15px; font-weight: 600; }
.card > .cb { padding: 16px 18px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ai { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--brand); background: var(--brand-soft);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.ai::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--brand); background: var(--brand); color: #fff;
  border-radius: 8px; padding: 7px 13px; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.o { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn.o:hover { background: var(--line-2); filter: none; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: default; }
.pulse { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 45%, transparent); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--ink-2); background: var(--surface); }

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line-2); }
.item:last-child { border-bottom: 0; }
.item .tx { flex: 1; min-width: 0; }
.item .t { font-weight: 600; }
.item .s { color: var(--muted); font-size: 13px; }
.item.done { opacity: .55; }
.item.done .t { text-decoration: line-through; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--brand); }
.dot.warn { background: #F79009; } .dot.bad { background: #F04438; } .dot.ok { background: #17B26A; }

table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FCFCFD; white-space: nowrap; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #FAFBFC; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tw { overflow-x: auto; }

.tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.search { flex: 1; min-width: 180px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; background: var(--surface); }
.search:focus, .inp:focus, textarea:focus, select:focus { outline: 2px solid var(--brand-line); border-color: var(--brand); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.inp, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--surface); width: 100%; }
textarea { resize: vertical; line-height: 1.5; }
label.f { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 12px; }
label.f .inp, label.f textarea { margin-top: 5px; }

/* board */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.col { background: #EEF0F3; border-radius: var(--r); padding: 10px; }
.col h3 { font-size: 13px; font-weight: 600; padding: 4px 6px 10px; display: flex; justify-content: space-between; }
.bc { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.bc .t { font-weight: 600; font-size: 13.5px; }
.bc .s { color: var(--muted); font-size: 12.5px; margin: 2px 0 8px; }
.bc .r { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; }

/* drawer, modal, toast */
.scrim { position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 50; opacity: 0; transition: opacity .2s; }
.scrim.in { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); z-index: 51; box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
.drawer.in { transform: none; }
.drawer .dh { padding: 20px 22px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer .dh h2 { font-size: 18px; }
.drawer .db { padding: 18px 22px 40px; overflow-y: auto; }
.x { margin-left: auto; border: 0; background: var(--line-2); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 16px; flex: none; }
.sec { margin-bottom: 22px; }
.sec h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.check:last-child { border-bottom: 0; }
.tick { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.tick.ok { background: var(--ok-bg); color: var(--ok); } .tick.wait { background: var(--warn-bg); color: var(--warn); }
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }
.tl { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 16px; }
.tl div { position: relative; padding-bottom: 12px; font-size: 13.5px; }
.tl div::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }

.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%); width: min(460px, calc(100vw - 32px)); background: var(--surface); z-index: 52;
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 24px; opacity: 0; transition: opacity .2s, transform .2s; max-height: calc(100vh - 40px); overflow-y: auto; }
.modal.in { opacity: 1; transform: translate(-50%, -50%); }
.modal h2 { font-size: 19px; margin-bottom: 6px; }
.modal p { color: var(--muted); margin: 0 0 16px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: #101828; color: #fff; padding: 11px 16px; border-radius: 10px;
  z-index: 60; opacity: 0; transition: opacity .2s, transform .2s; font-weight: 500; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); }
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.toast::before { content: "✓"; color: #6CE9A6; font-weight: 700; margin-right: 8px; }

/* feedback dock */
.fb { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 16px 18px; transform: translateY(16px); opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; }
.fb.in { opacity: 1; transform: none; pointer-events: auto; }
.fb h3 { font-size: 15px; margin-bottom: 4px; padding-right: 24px; }
.fb p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.fb .ans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fb .ans button { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 0; font-weight: 600; cursor: pointer; }
.fb .ans button:hover, .fb .ans button.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.fb .x { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; font-size: 14px; }

/* sector bits */
.receipt { width: 40px; height: 50px; border-radius: 4px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  background-image: repeating-linear-gradient(#fff 0 6px, #EAECF0 6px 7px); background-size: 70% 100%; background-repeat: no-repeat; background-position: center 8px; flex: none; }
.conf { font-size: 12px; font-weight: 600; }
.conf.hi { color: var(--ok); } .conf.lo { color: var(--warn); }
tr.posted td { opacity: .45; }
tr.posted td:last-child { opacity: 1; }
.nw { white-space: nowrap; }
.gap { border: 1px solid #FECDCA; background: linear-gradient(0deg, var(--surface), var(--surface)) padding-box; border-radius: var(--r); margin-bottom: 14px; overflow: hidden; }
.gap .gh { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--bad-bg); }
.gap.fixed { border-color: #ABEFC6; } .gap.fixed .gh { background: var(--ok-bg); }
.gap .time { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.opt .tx { flex: 1; }
.opt.best { background: var(--brand-soft); }
.rota { overflow-x: auto; }
.rg { display: grid; grid-template-columns: 150px repeat(15, minmax(52px, 1fr)); min-width: 940px; font-size: 12px; }
.rg .hh { color: var(--muted); padding: 8px 4px; border-bottom: 1px solid var(--line); font-weight: 600; }
.rg .nm { padding: 10px 12px; border-bottom: 1px solid var(--line-2); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg .ln { grid-column: 2 / -1; position: relative; border-bottom: 1px solid var(--line-2); background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 15 - 1px), var(--line-2) calc(100% / 15 - 1px) calc(100% / 15)); }
.vb { position: absolute; top: 6px; bottom: 6px; border-radius: 6px; background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand);
  font-size: 11px; font-weight: 600; padding: 2px 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: default; }
.vb.done { background: #F2F4F7; border-color: var(--line); color: var(--muted); }
.vb.gapb { background: repeating-linear-gradient(45deg, #FEE4E2 0 6px, #FEF3F2 6px 12px); border-color: #FDA29B; color: var(--bad); cursor: pointer; }
.wave { display: flex; align-items: center; gap: 3px; height: 38px; margin: 6px 0 12px; }
.wave i { width: 3px; border-radius: 3px; background: var(--brand-line); }
.voice { background: #FCFCFD; border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; color: var(--ink-2); font-size: 13.5px; font-style: italic; }
.flag { background: var(--warn-bg); border: 1px solid #FEDF89; color: #93370D; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 12px 0; }
.flags li { margin-bottom: 8px; }
.src { color: var(--muted); font-size: 12px; border-bottom: 1px dotted var(--faint); cursor: help; }
.enq { cursor: pointer; }
.enq.on { background: var(--brand-soft); }
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.split > .l { border-right: 1px solid var(--line-2); }
.split > .r > .cb { padding: 18px 22px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

.ended { display: grid; place-items: center; min-height: 100vh; }
.ended-box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px; max-width: 440px; text-align: center; }

/* phone */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 35; flex-direction: row; padding: 6px 8px;
    border-right: 0; border-top: 1px solid var(--line); justify-content: space-around; gap: 0; }
  .side .logo-box, .side .appname, .side .grow, .side .me { display: none; }
  .nav { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 4px; text-align: center; width: auto; flex: 1; }
  .nav .count { position: absolute; margin: 0 0 0 22px; font-size: 10px; padding: 0 5px; }
  .nav { position: relative; }
  .mbrand { display: flex !important; }
  .main { padding: 18px 16px 150px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .v { font-size: 23px; }
  .grid2, .split { grid-template-columns: 1fr; }
  .split > .l { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .board { grid-template-columns: 1fr; }
  .fb { left: 12px; right: 12px; width: auto; bottom: 74px; }
  .hide-m { display: none; }
  .t td, .t th { padding: 10px; }
}
.mbrand { display: none; align-items: center; gap: 10px; margin-bottom: 14px; }
.mbrand img { max-height: 34px; max-width: 60%; object-fit: contain; }
