/* ==========================================================================
   QT OpsHub — styles.css
   ========================================================================== */
:root {
  /* brand — overwritten per business line at runtime */
  --accent: #1B75BC;
  --accent-deep: #0f5a94;
  --accent-hi: #48A9E8;
  --accent-soft: #eaf3fb;
  --accent-ink: #0f5a94;
  --alt: #E8402C;

  --shell: #0C1522;
  --shell-2: #13233a;
  --shell-line: #22334a;
  --shell-ink: #93a6bd;
  --shell-ink-hi: #e6edf5;

  --bg: #f5f8fb;
  --surface: #ffffff;
  --surface-2: #f5f7f9;
  --line: #e4eaf1;
  --line-strong: #cfd8e3;
  --ink: #16222f;
  --ink-2: #4b5560;
  --ink-3: #7b8794;

  --ok: #17855c;
  --warn: #c2740b;
  --bad: #C62828;
  --info: #0f5a94;

  --r-sm: 9px;
  --r: 13px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(22, 34, 47, .05), 0 8px 22px -14px rgba(22, 34, 47, .22);
  --shadow-lg: 0 18px 46px -18px rgba(22, 34, 47, .34);
  --sidebar: 250px;
  --font: Saira, "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --display: Anton, "Saira Condensed", Impact, var(--font);
  --slab: "Roboto Slab", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; }

/* ------------------------------------------------------------------ brand */
.lockup { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.lockup.stack { flex-direction: column; gap: 7px; text-align: center; }
.lockup .lk-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lk-sub { font-size: 8.5px; text-transform: uppercase; letter-spacing: .13em; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm { display: inline-flex; align-items: baseline; line-height: 1; white-space: nowrap; }
.wm b { font-weight: inherit; }
.wm-qt { font-family: var(--display); letter-spacing: .005em; font-weight: 400; }
.wm-dr { font-family: var(--slab); font-weight: 700; letter-spacing: -.015em; }
.lockup.duo { gap: 9px; }
.duo-div { width: 1px; height: 26px; display: block; flex: none; }
.mark { flex: none; }
p { margin: 0 0 8px; }
a { color: var(--accent); text-decoration: none; }
.ic { display: block; flex: none; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.hide { display: none !important; }

/* ------------------------------------------------------------------ shell */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar); flex: none; background: var(--shell); color: var(--shell-ink);
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40;
  transition: background .22s;
}
.sb-brand { padding: 16px 16px 12px; display: flex; gap: 10px; align-items: center; min-width: 0; }
.app-name { font-size: 9px; text-transform: uppercase; letter-spacing: .2em;
  color: var(--shell-ink); opacity: .7; font-weight: 700; padding: 0 18px 12px; }

.biz-switch { padding: 0 12px 12px; }
.biz-switch .seg { display: flex; background: var(--shell-2); border-radius: 10px; padding: 3px; gap: 3px; }
.biz-switch .seg button {
  flex: 1; border: 0; background: transparent; color: var(--shell-ink); font: inherit; font-size: 11.5px;
  font-weight: 600; padding: 7px 4px; border-radius: 8px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 4px; white-space: nowrap; overflow: hidden;
  min-width: 0;
}
.biz-switch .seg button span { overflow: hidden; text-overflow: ellipsis; }
.biz-switch .seg button.on { background: var(--accent); color: #fff; }
.biz-switch .seg button .ic { width: 15px; height: 15px; }

.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.sb-nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px;
  color: var(--shell-ink); font-weight: 550; font-size: 13.5px; margin-bottom: 2px; cursor: pointer;
}
.sb-nav a:hover { background: var(--shell-2); color: var(--shell-ink-hi); }
.sb-nav a.on { background: var(--accent); color: #fff; }
.sb-nav a .dot {
  margin-left: auto; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: rgba(255,255,255,.42);
}
.sb-nav a .dot.hot { background: var(--alt); box-shadow: 0 0 0 3px rgba(232,64,44,.18); }
.sb-nav a.on .dot, .sb-nav a.on .dot.hot { background: #fff; box-shadow: none; }
.sb-sec { font-size: 10px; text-transform: uppercase; letter-spacing: .11em; color: var(--shell-ink);
  opacity: .62; padding: 14px 12px 6px; font-weight: 700; }

.sb-foot { padding: 12px; border-top: 1px solid var(--shell-line); }
.agent-chip {
  display: flex; align-items: center; gap: 9px; background: var(--shell-2); border-radius: 10px;
  padding: 9px 11px; cursor: pointer;
}
.agent-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none;
  box-shadow: 0 0 0 3px rgba(5,150,105,.2); }
.agent-chip.off .dot { background: #64748b; box-shadow: none; }
.agent-chip b { color: var(--shell-ink-hi); font-size: 12.5px; display: block; }
.agent-chip span { font-size: 11px; color: var(--shell-ink); opacity: .8; }

/* -------------------------------------------------------------- main area */
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  padding: 12px 22px; display: flex; align-items: center; gap: 14px;
}
.topbar h1 { font-size: 19px; }
.topbar .sub { font-size: 12.5px; color: var(--ink-3); }
.topbar .spacer { flex: 1; }

.searchbox { position: relative; }
.searchbox .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.searchbox input {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px;
  padding: 8px 12px 8px 33px; font: inherit; width: 230px; outline: none;
}
.searchbox input:focus { border-color: var(--accent); background: #fff; }

.view { padding: 20px 22px 90px; flex: 1; }
.view-narrow { max-width: 1180px; }

/* -------------------------------------------------------------- elements */
.btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent;
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 13px;
  padding: 8px 13px; border-radius: 9px; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-dark { background: #0f172a; color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-soft { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { padding: 5px 9px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 11px 18px; font-size: 14.5px; border-radius: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  border: 0; background: transparent; color: var(--ink-2); padding: 6px; border-radius: 8px;
  cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); }
.card-pad { padding: 16px 18px; }
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
}
.card-head h3 { font-size: 14.5px; }
.card-head .spacer { flex: 1; }

.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650;
  color: #fff; padding: 2.5px 9px; border-radius: 20px; border: 1px solid transparent;
  white-space: nowrap; letter-spacing: .005em;
}
.badge.soft { background: var(--surface-2); }

.kpi { padding: 15px 17px; }
.kpi .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3);
  font-weight: 700; }
.kpi .value { font-size: 25px; font-weight: 700; letter-spacing: -.03em; margin-top: 5px; }
.kpi .foot { font-size: 12px; color: var(--ink-2); margin-top: 3px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.2px; }
table.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); font-weight: 700; padding: 9px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); position: sticky; top: 0; z-index: 1;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tbody tr.clickable:hover { background: var(--surface-2); }
.tbl-wrap { overflow-x: auto; border-radius: var(--r-lg); }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); }
.empty .ic { margin: 0 auto 10px; color: var(--line-strong); width: 34px; height: 34px; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}

.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item .grow { min-width: 0; }
.list-item b { font-size: 13.5px; font-weight: 620; }
.list-item .sub { font-size: 12px; color: var(--ink-2); }

/* ----------------------------------------------------------------- forms */
.input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 11px;
  font: inherit; font-size: 13.5px; background: #fff; color: var(--ink); outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 62px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 620; color: var(--ink-2); }
.field-label.inline { font-weight: 550; color: var(--ink); }
.field-hint { font-size: 11.5px; color: var(--ink-3); }
.field-chk { flex-direction: row; align-items: center; gap: 9px; cursor: pointer; }
.chk { width: 17px; height: 17px; accent-color: var(--accent); flex: none; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.form-divider {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3);
  font-weight: 700; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-top: 6px;
}

/* ---------------------------------------------------------------- modals */
#modals { position: relative; z-index: 100; }
.modal-back {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center;
  justify-content: center; padding: 18px; opacity: 0; transition: opacity .18s; z-index: 100;
  backdrop-filter: blur(2px);
}
.modal-back.in { opacity: 1; }
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%;
  max-width: 640px; max-height: 92vh; display: flex; flex-direction: column;
  transform: translateY(10px) scale(.99); transition: transform .18s;
}
.modal-back.in .modal { transform: none; }
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1120px; }
.modal-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex;
  align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 16px; }
.modal-sub { font-size: 12.5px; color: var(--ink-3); margin: 3px 0 0; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--line); display: flex;
  justify-content: flex-end; gap: 9px; background: var(--surface-2);
  border-radius: 0 0 16px 16px; }

/* ---------------------------------------------------------------- toasts */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #0f172a; color: #fff; padding: 10px 15px; border-radius: 11px; font-size: 13px;
  font-weight: 550; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px;
  animation: pop .2s ease; max-width: 90vw;
}
.toast.out { opacity: 0; transition: opacity .5s; }
.toast-success { background: #065f46; }
.toast-error { background: #991b1b; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

/* -------------------------------------------------------------- schedule */
.sched { display: grid; grid-template-columns: 66px 1fr; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.sched-times { border-right: 1px solid var(--line); background: var(--surface-2); }
.sched-time { height: 56px; font-size: 10.5px; color: var(--ink-3); padding: 3px 7px;
  text-align: right; font-weight: 650; white-space: nowrap; }
.sched-lanes { display: flex; overflow-x: auto; }
.sched-lane { flex: 1; min-width: 150px; border-right: 1px solid var(--line); position: relative; }
.sched-lane:last-child { border-right: 0; }
.sched-lane-head {
  position: sticky; top: 0; background: var(--surface); z-index: 2; padding: 9px 10px;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px;
}
.sched-lane-head b { font-size: 12.5px; }
.sched-grid { position: relative; }
.sched-hour { height: 56px; border-bottom: 1px solid var(--line); }
.sched-hour:nth-child(odd) { background: rgba(248,250,252,.6); }
.sched-job {
  position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 5px 8px; color: #fff;
  font-size: 11.5px; overflow: hidden; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.18);
  border-left: 3px solid rgba(255,255,255,.55);
}
.sched-job b { display: block; font-size: 12px; font-weight: 650; }
.sched-job span { opacity: .88; font-size: 11px; }
.sched-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 3; }
.sched-now::before { content: ''; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--bad); }

.daybar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.daybar button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 12px;
  font: inherit; font-size: 12px; cursor: pointer; min-width: 62px; text-align: center; flex: none;
}
.daybar button b { display: block; font-size: 15px; font-weight: 700; }
.daybar button span { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: .05em; font-weight: 650; }
.daybar button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.daybar button.on span { color: rgba(255,255,255,.8); }
.daybar button .cnt { display: block; font-size: 10px; color: var(--accent); font-weight: 700; }
.daybar button.on .cnt { color: #fff; }

/* ----------------------------------------------------------------- agent */
.agent-rule { display: flex; gap: 13px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.agent-rule:last-child { border-bottom: 0; }
.agent-rule .ricon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.agent-rule b { font-size: 13.5px; }
.agent-rule p { font-size: 12.5px; color: var(--ink-2); margin: 3px 0 0; }

.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--line-strong); border-radius: 20px;
  transition: background .16s; cursor: pointer;
}
.switch .track::before {
  content: ''; position: absolute; width: 17px; height: 17px; border-radius: 50%; background: #fff;
  top: 3px; left: 3px; transition: transform .16s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::before { transform: translateX(17px); }

.feed-item { display: flex; gap: 11px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-dot { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center;
  flex: none; font-size: 13px; }
.feed-item .t { font-size: 13px; }
.feed-item .m { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* ----------------------------------------------------------- line items */
.li-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.li-table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3);
  text-align: left; padding: 6px 6px; font-weight: 700; }
.li-table td { padding: 4px 4px; vertical-align: top; }
.li-table .input { padding: 7px 9px; font-size: 13px; }
.li-table td.n { width: 78px; } .li-table td.p { width: 108px; } .li-table td.a { width: 96px; }
.li-table td.x { width: 34px; }
.totals { margin-left: auto; width: 260px; font-size: 13.5px; }
.totals .r { display: flex; justify-content: space-between; padding: 5px 0; }
.totals .r.big { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 9px;
  font-size: 17px; font-weight: 720; }

/* ---------------------------------------------------------- masked money */
body.money-hidden .kpi .value,
body.money-hidden .hero .stats b,
body.money-hidden .totals .r.big span:last-child { letter-spacing: .06em; }

/* ------------------------------------------------------------------ misc */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.photo-grid figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 9px;
  overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid .del { position: absolute; top: 3px; right: 3px; background: rgba(15,23,42,.7);
  color: #fff; border: 0; border-radius: 6px; width: 21px; height: 21px; cursor: pointer;
  display: grid; place-items: center; }
.photo-add {
  border: 1.5px dashed var(--line-strong); border-radius: 9px; aspect-ratio: 1; display: grid;
  place-items: center; color: var(--ink-3); cursor: pointer; background: var(--surface-2);
}
.photo-add:hover { border-color: var(--accent); color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11.5px; padding: 4px 10px; border-radius: 20px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; font-weight: 600;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
  overflow-x: auto; }
.tabs button {
  border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 620;
  color: var(--ink-3); padding: 9px 14px; cursor: pointer; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

.bars { display: flex; align-items: flex-end; gap: 7px; height: 96px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 5px;
  align-items: center; }
.bars .b i { width: 100%; background: var(--accent-soft); border-radius: 5px 5px 2px 2px;
  min-height: 3px; display: block; }
.bars .b.hi i { background: var(--accent); }
.bars .b em { font-size: 10px; color: var(--ink-3); font-style: normal; font-weight: 650; }
.bars .b s { font-size: 11px; text-decoration: none; font-weight: 700; }

.progress { height: 6px; background: var(--line); border-radius: 20px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 20px; }

.att { display: flex; gap: 10px; padding: 11px 14px; border-radius: 11px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--line); }
.att.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.att.bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.att.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

.hero {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; border-radius: var(--r-lg);
  padding: 20px 22px; position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -50px; top: -70px; width: 230px; height: 230px;
  border-radius: 50%; background: rgba(255,255,255,.07);
}
.hero h2 { font-size: 20px; }
.hero p { opacity: .82; font-size: 13px; margin: 4px 0 0; }
.hero .stats { display: flex; gap: 26px; margin-top: 16px; flex-wrap: wrap; }
.hero .stats div b { display: block; font-size: 21px; font-weight: 720; }
.hero .stats div span { font-size: 11.5px; opacity: .78; text-transform: uppercase;
  letter-spacing: .06em; font-weight: 650; }

/* --------------------------------------------------------------- mobile */
.mobile-bar { display: none; }
.sb-toggle { display: none; }

@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .sidebar {
    transform: translateX(-100%); transition: transform .22s; width: 262px;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: ''; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 35;
  }
  .main { margin-left: 0; }
  .sb-toggle { display: grid; }
  .topbar { padding: 10px 12px; gap: 9px; }
  .topbar h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 40vw; }
  .topbar .sub { display: none; }
  .searchbox input { width: 38px; padding-right: 4px; transition: width .18s; color: transparent; }
  .searchbox input:focus { color: var(--ink); }
  .searchbox input:focus { width: 52vw; }
  #new-btn { padding: 8px 11px; }
  .sched { grid-template-columns: 54px 1fr; }
  .sched-lane { min-width: 128px; }
  .view { padding: 14px 14px 96px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: span 1; }
  .modal { max-height: 94vh; }
  .mobile-bar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px); border-top: 1px solid var(--line); z-index: 45;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-bar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px;
    color: var(--ink-3); font-size: 10px; font-weight: 650; cursor: pointer;
  }
  .mobile-bar a.on { color: var(--accent); }
  .mobile-bar a { position: relative; }
  .mobile-bar a.flag::after {
    content: ''; position: absolute; top: 4px; right: 50%; margin-right: -14px;
    width: 6px; height: 6px; border-radius: 50%; background: var(--alt);
  }
  .totals { width: 100%; }
  .hide-sm { display: none !important; }
  .card-head { flex-wrap: wrap; }
  .list-item { padding: 12px 13px; gap: 9px; }
}

@media print {
  .sidebar, .topbar, .mobile-bar, .modal-foot { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
}

/* ==========================================================================
   Lock screen + field mode — what the crew sees
   ========================================================================== */
#lock {
  position: fixed; inset: 0; z-index: 300; background: var(--shell);
  display: grid; place-items: center; padding: 22px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
}
.lock-box { width: 100%; max-width: 430px; text-align: center; }
.lock-brand { display: flex; justify-content: center; margin-bottom: 26px; }
.lock-title { color: #fff; font-size: 23px; font-weight: 650; letter-spacing: -.02em; }
.lock-sub { color: var(--shell-ink); font-size: 13.5px; margin-top: 5px; }
.lock-people {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); gap: 11px; margin-top: 24px;
}
.lock-person {
  background: var(--shell-2); border: 1px solid var(--shell-line); border-radius: 15px;
  padding: 17px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; font: inherit; color: #fff;
}
.lock-person:active { transform: scale(.97); }
.lock-person b { font-size: 14px; }
.lock-person span { font-size: 10.5px; color: var(--shell-ink); text-transform: uppercase;
  letter-spacing: .1em; font-weight: 700; }
.lock-pin { margin-top: 26px; }
.lock-input {
  width: 100%; max-width: 230px; background: var(--shell-2); border: 1.5px solid var(--shell-line);
  border-radius: 14px; color: #fff; font: inherit; font-size: 30px; letter-spacing: .45em;
  text-align: center; padding: 15px 10px 15px 22px; outline: none;
}
.lock-input:focus { border-color: var(--accent); }
.lock-input.shake { animation: shake .38s; }
@keyframes shake { 10%,90%{transform:translateX(-2px)} 30%,70%{transform:translateX(5px)} 50%{transform:translateX(-7px)} }
.lock-err { color: #ff9b8f; font-size: 12.5px; min-height: 18px; margin-top: 10px; }
.lock-back { background: none; border: 0; color: var(--shell-ink); font: inherit; font-size: 13px;
  margin-top: 8px; cursor: pointer; text-decoration: underline; }

/* ------------------------------------------------------------ field mode */
#field { min-height: 100vh; background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
.fh { background: var(--shell); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 16px 16px; }
.fh-row { display: flex; align-items: center; gap: 12px; }
.fh-row b { display: block; font-size: 17px; letter-spacing: -.015em; }
.fh-row span { font-size: 12.5px; color: var(--shell-ink); }
.fh-out, .fh-back {
  background: rgba(255,255,255,.1); border: 0; color: #fff; width: 38px; height: 38px;
  border-radius: 11px; display: grid; place-items: center; cursor: pointer; flex: none;
}
.fh-back svg { transform: rotate(180deg); }
.fh-stats { display: flex; gap: 26px; margin-top: 15px; }
.fh-stats b { display: block; font-size: 21px; font-weight: 720; }
.fh-stats span { font-size: 10.5px; color: var(--shell-ink); text-transform: uppercase;
  letter-spacing: .09em; font-weight: 700; }
.fh-job { padding-bottom: 18px; }

.fdays { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 4px; background: var(--shell);
  scrollbar-width: none; }
.fdays::-webkit-scrollbar { display: none; }
.fdays button {
  flex: none; min-width: 58px; background: rgba(255,255,255,.07); border: 0; border-radius: 13px;
  padding: 9px 6px 10px; color: #fff; font: inherit; cursor: pointer; text-align: center;
}
.fdays button.on { background: #fff; color: var(--shell); }
.fdays em { display: block; font-style: normal; font-size: 9.5px; letter-spacing: .09em;
  font-weight: 800; opacity: .62; }
.fdays b { display: block; font-size: 19px; font-weight: 700; line-height: 1.25; }
.fdays s { display: block; font-size: 10px; text-decoration: none; opacity: .62; font-weight: 700; }

.fbody { padding: 16px 14px 40px; display: flex; flex-direction: column; gap: 12px; }

.fjob {
  display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 15px 14px; width: 100%; text-align: left; font: inherit;
  cursor: pointer; box-shadow: var(--shadow); color: var(--ink);
}
.fjob:active { transform: scale(.99); }
.fjob.done { opacity: .58; }
.fjob-time { text-align: center; flex: none; width: 56px; }
.fjob-time b { display: block; font-size: 15px; font-weight: 750; letter-spacing: -.02em; }
.fjob-time s { display: block; font-size: 11px; text-decoration: none; color: var(--ink-3); font-weight: 650; }
.fjob-title { font-size: 15.5px; font-weight: 650; line-height: 1.3; }
.fjob-sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.fjob-addr { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.fjob-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.fbadge { font-size: 10.5px; font-weight: 750; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.fbadge.urgent { background: var(--bad); color: #fff; }
.fchev { color: var(--line-strong); }

.fempty { text-align: center; padding: 54px 20px; color: var(--ink-3); }
.fempty .ic { margin: 0 auto 12px; color: var(--line-strong); }
.fempty b { display: block; font-size: 16px; color: var(--ink-2); }
.fempty p { font-size: 13.5px; margin-top: 4px; }

.fcall {
  display: flex; align-items: center; gap: 13px; background: var(--shell); color: #fff;
  border-radius: 15px; padding: 15px 17px; text-decoration: none; margin-top: 6px;
}
.fcall b { display: block; font-size: 14.5px; }
.fcall span { font-size: 12.5px; color: var(--shell-ink); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 9px; }
.fact {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none;
  color: var(--accent); box-shadow: var(--shadow);
}
.fact b { font-size: 12.5px; color: var(--ink); }
.faddr { font-size: 13.5px; color: var(--ink-2); text-align: center; margin-top: -2px; }

.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 15px 16px; box-shadow: var(--shadow); }
.fcard-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3);
  font-weight: 800; margin-bottom: 9px; display: flex; justify-content: space-between; }
.fcount { color: var(--accent); }
.fcard-p { font-size: 14.5px; line-height: 1.55; margin: 0; white-space: pre-wrap; }

.fnote { display: flex; gap: 11px; background: #fff8e6; border: 1px solid #f5dfa8; color: #7a5405;
  border-radius: 14px; padding: 13px 15px; font-size: 13.5px; line-height: 1.5; }

.fbig {
  width: 100%; border: 0; border-radius: 18px; padding: 20px; font: inherit; cursor: pointer;
  background: var(--accent); color: #fff; text-align: center; box-shadow: 0 8px 20px -8px var(--accent);
}
.fbig b { display: block; font-size: 20px; font-weight: 720; letter-spacing: -.02em; }
.fbig span { font-size: 12.5px; opacity: .82; }
.fbig:active { transform: scale(.99); }
.fbig.running { background: var(--ok); box-shadow: 0 8px 20px -8px var(--ok); }

.fdone { display: flex; align-items: center; gap: 12px; background: #e8f6ef; border: 1px solid #b6e2ce;
  color: #116048; border-radius: 16px; padding: 16px 18px; }
.fdone b { display: block; font-size: 15.5px; }
.fdone span { font-size: 12.5px; opacity: .8; }

.ftabs { display: flex; gap: 6px; background: var(--surface-2); border-radius: 13px; padding: 4px; }
.ftabs button {
  flex: 1; border: 0; background: transparent; font: inherit; font-size: 13.5px; font-weight: 650;
  color: var(--ink-2); padding: 10px 6px; border-radius: 10px; cursor: pointer;
}
.ftabs button.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

.fprog { display: flex; align-items: center; gap: 11px; }
.fprog .progress { flex: 1; height: 8px; }
.fprog span { font-size: 12px; color: var(--ink-3); font-weight: 700; }

.fcheck {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; font: inherit;
  background: none; border: 0; border-bottom: 1px solid var(--line); padding: 14px 0;
  font-size: 14.5px; line-height: 1.45; cursor: pointer; color: var(--ink);
}
.fcheck:last-child { border-bottom: 0; }
.fcheck .fbox {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-strong); flex: none;
  display: grid; place-items: center; color: #fff; margin-top: -2px;
}
.fcheck.on .fbox { background: var(--ok); border-color: var(--ok); }
.fcheck.on > span:last-child { color: var(--ink-3); text-decoration: line-through; }

.fhint { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; margin: 0 2px; }
.fphotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; }
.fphotos figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); }
.fphotos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fphotos .del { position: absolute; top: 4px; right: 4px; background: rgba(15,23,42,.72); color: #fff;
  border: 0; border-radius: 8px; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer; }
.fadd {
  aspect-ratio: 1; border: 2px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2);
  color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.finput {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: 13px; padding: 13px;
  font: inherit; font-size: 15px; resize: vertical; outline: none; background: #fff; color: var(--ink);
}
.finput:focus { border-color: var(--accent); }

@media (min-width: 760px) {
  #field { max-width: 620px; margin: 0 auto; box-shadow: 0 0 60px -30px rgba(22,34,47,.4); }
}

.fpreview { background: #fde68a; color: #7a5405; font-size: 12.5px; font-weight: 650; padding: 9px 14px;
  display: flex; align-items: center; gap: 10px; }
.fpreview button { margin-left: auto; background: #7a5405; color: #fff; border: 0; border-radius: 8px;
  padding: 6px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.sb-user { display: flex; align-items: center; gap: 9px; padding: 10px 4px 2px; }
.sb-user b { color: var(--shell-ink-hi); font-size: 12.5px; display: block; }
.sb-user span { font-size: 10.5px; color: var(--shell-ink); text-transform: uppercase; letter-spacing: .09em; font-weight: 700; }
.sb-user button { margin-left: auto; background: transparent; border: 1px solid var(--shell-line); color: var(--shell-ink);
  border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 11.5px; font-weight: 650; cursor: pointer; }
.sb-user button:hover { color: #fff; border-color: var(--shell-ink); }

.fclock { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow); }
.fclock-l { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--ink-3); }
.fclock-t { display: block; font-size: 30px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fclock.live .fclock-l { color: var(--ok); }
.fclock.live .fclock-l::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); margin-right: 6px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.fclock-btn { margin-left: auto; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  border-radius: 11px; padding: 11px 16px; font: inherit; font-weight: 700; cursor: pointer; }

.sigpad { width: 100%; height: 150px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: #fff;
  touch-action: none; display: block; margin-top: 6px; }

/* cloud sign-in + lock footer */
.lock-text { text-align: left; letter-spacing: 0; font-size: 16px; margin-top: 10px; width: 100%; max-width: 100%; padding: 14px 16px; }
.lock-go { width: 100%; margin-top: 14px; }
.lock-foot { margin-top: 30px; color: var(--shell-ink); font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
