/* KV One demo: shared styles. Designed by IndusLabs. */
:root {
  --ink: #0f1b2d; --ink-2: #44546a; --ink-3: #7a879a; --line: #e3e8ef; --bg: #f4f6fa; --card: #ffffff;
  --brand: #0b4f8a; --brand-2: #0e7cc4; --accent: #0f9d8a; --accent-bg: #e6f6f3;
  --warn: #b26a00; --warn-bg: #fff4e0; --bad: #c23b3b; --bad-bg: #fdecec; --good: #1f8a4c; --good-bg: #e7f6ec;
  --radius: 14px; --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 4px 16px rgba(15, 27, 45, .06);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 15px; font-weight: 650; color: var(--ink); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 9px 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: #c8d1dd; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #0a4475; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.block { width: 100%; justify-content: center; padding: 12px; }
.btn[disabled] { opacity: .55; cursor: wait; }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; background: #eef2f7; color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: #e8f1fb; color: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; }
.dot.live { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 138, 76, .5); } 70% { box-shadow: 0 0 0 8px rgba(31, 138, 76, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 138, 76, 0); } }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea { border: 1px solid #cfd7e2; border-radius: 10px; padding: 10px 12px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #bcd9f2; border-color: var(--brand-2); }
.alert { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 8px 0; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.good { background: var(--good-bg); color: var(--good); }

table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; color: var(--ink-3); font-weight: 600; font-size: 12px; text-transform: none; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 8px; border-bottom: 1px solid #f0f3f7; vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t th.r, table.t td.r { text-align: right; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 1000; box-shadow: var(--shadow); max-width: 90vw; }
.toast.bad { background: var(--bad); }

.brandmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; letter-spacing: -.01em; }
.brandmark .logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--accent)); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; }
.credit { text-align: center; color: var(--ink-3); font-size: 12px; padding: 18px 0 8px; }

/* ---------- phone frame for the three mobile apps ---------- */
.stage { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 32px; padding: 24px; background: radial-gradient(circle at 20% 10%, #e7eef8, #f4f6fa 60%); }
.stage .side { max-width: 320px; }
.stage .side h1 { font-size: 26px; margin-bottom: 8px; }
.stage .side p { color: var(--ink-2); }
.phone { width: 390px; height: min(820px, calc(100vh - 48px)); background: #fff; border-radius: 44px; border: 10px solid #0f1b2d; box-shadow: 0 30px 60px rgba(15, 27, 45, .25); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.phone .status { height: 30px; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; font-size: 12px; font-weight: 600; color: var(--ink); flex: none; }
.phone .screen { flex: 1; overflow-y: auto; background: var(--bg); }
.phone .tabs { flex: none; display: flex; border-top: 1px solid var(--line); background: #fff; }
.phone .tabs button { flex: 1; border: 0; background: none; padding: 9px 0 11px; font-size: 11px; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.phone .tabs button svg { width: 22px; height: 22px; }
.phone .tabs button.on { color: var(--brand); font-weight: 650; }
.apphead { padding: 14px 16px 10px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.apphead h1 { font-size: 18px; }
.pad { padding: 14px 14px 20px; }
.stack > * + * { margin-top: 12px; }
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list .item { padding: 12px 14px; border-bottom: 1px solid #eef1f5; display: flex; gap: 10px; align-items: center; }
.list .item:last-child { border-bottom: 0; }
.list .item.tap { cursor: pointer; }
.list .item.tap:hover { background: #f8fafc; }
.sheet-back { position: absolute; inset: 0; background: rgba(15, 27, 45, .45); z-index: 50; display: flex; align-items: flex-end; }
.sheet { background: #fff; width: 100%; max-height: 88%; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 18px 16px 22px; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet h3 { font-size: 17px; margin-bottom: 10px; }
.chip-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip-tabs::-webkit-scrollbar { display: none; }
.tile.tap { cursor: pointer; } .tile.tap:hover { border-color: #c8d1dd; }
.chip-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.chip-tabs button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.bigstat { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.tile .k { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.tile .v { font-size: 20px; font-weight: 750; margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wa { background: #efe7dd; min-height: 100%; padding: 12px; }
.wa .bub { background: #fff; border-radius: 10px; padding: 8px 10px; margin: 0 40px 8px 0; font-size: 14px; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.wa .bub.in { background: #d9fdd3; margin: 0 0 8px 40px; }
.wa .bub .time { font-size: 10.5px; color: #667; text-align: right; margin-top: 2px; }
.steps .s { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; }
.steps .s .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #fff; flex: none; margin-top: 1px; }
.steps .s .ic.ok { background: var(--good); } .steps .s .ic.no { background: var(--bad); } .steps .s .ic.run { background: var(--ink-3); }

@media (max-width: 760px) {
  .stage { padding: 0; display: block; background: var(--bg); }
  .stage .side { display: none; }
  .phone { width: 100%; height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .phone .status { display: none; }
}

/* ---------- HQ dashboard ---------- */
.hq-top { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 22px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20; }
.hq-wrap { padding: 18px 22px 30px; max-width: 1560px; margin: 0 auto; }
.kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .k { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.kpi .v { font-size: 23px; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; }
.kpi .s { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.hq-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-top: 14px; }
.hq-grid3 { display: grid; grid-template-columns: 1.45fr 1fr 1fr; gap: 14px; margin-top: 14px; }
.feed { max-height: 400px; overflow-y: auto; }
.feed .e { padding: 8px 2px; border-bottom: 1px solid #f0f3f7; font-size: 13.5px; display: flex; gap: 8px; }
.feed .e .t { color: var(--ink-3); font-size: 12px; width: 44px; flex: none; padding-top: 1px; }
.feed .e.new { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: #fff7d6; } to { background: transparent; } }
.scroll { max-height: 360px; overflow-y: auto; }
.presenter { position: fixed; right: 18px; bottom: 18px; z-index: 30; background: var(--ink); color: #fff; border-radius: 14px; padding: 12px; width: 300px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-size: 13px; }
.presenter select { width: 100%; border-radius: 8px; padding: 6px; margin: 6px 0; }
.presenter .btn { width: 100%; justify-content: center; margin-top: 6px; padding: 7px; font-size: 13px; }
.presenter.min .body { display: none; }
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hq-grid, .hq-grid3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hq-wrap { padding: 12px; } .presenter { position: static; width: auto; margin: 12px; } }
@media print { .hq-top, .presenter, .noprint { display: none !important; } body { background: #fff; } }
