:root {
  --ink: #0f1b2d;
  --ink-2: #44526a;
  --muted: #7a869c;
  --line: #e3e8f0;
  --bg: #f4f6fa;
  --card: #ffffff;
  --brand: #12355b;
  --brand-2: #1d4f86;
  --accent: #f0a500;
  --green: #138a5b;
  --green-bg: #e3f5ec;
  --amber: #a86400;
  --amber-bg: #fff2d9;
  --blue: #1d5fbf;
  --blue-bg: #e5efff;
  --purple: #6b3fc4;
  --purple-bg: #efe8ff;
  --red: #c0392b;
  --red-bg: #fde8e6;
  --grey-bg: #eef1f5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 4px 16px rgba(15, 27, 45, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 700; margin-top: 1.6rem; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .6em; }
a { color: var(--brand-2); }
code { background: var(--grey-bg); padding: 2px 6px; border-radius: 6px; font-size: .9em; word-break: break-all; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- loading ---------- */
.loading { min-height: 100vh; display: grid; place-content: center; gap: 14px; justify-items: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .92rem;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:disabled { opacity: .55; cursor: wait; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.outline { background: #fff; color: var(--brand); border-color: #c9d3e2; }
.btn.outline:hover { border-color: var(--brand); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--grey-bg); }
.btn.danger { background: #fff; color: var(--red); border-color: #f2c4bf; }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { padding: 6px 11px; font-size: .84rem; border-radius: 8px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--brand-2); font: inherit; font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 14px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.row.end { justify-content: flex-end; margin-top: 14px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  background: var(--brand); color: #fff;
  padding: 0 24px; height: 62px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.logo { background: var(--accent); color: var(--brand); font-weight: 800; border-radius: 8px; padding: 3px 8px; font-size: .9rem; letter-spacing: .03em; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: transparent; border: 0; color: rgba(255,255,255,.75); font: inherit; font-weight: 600; font-size: .92rem;
  padding: 8px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.tab.active { color: #fff; background: rgba(255,255,255,.16); }
.badge { background: var(--accent); color: var(--brand); font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.who { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: .88rem; }
.who .btn.ghost { color: #fff; }
.who .btn.ghost:hover { background: rgba(255,255,255,.12); }

.main { max-width: 1120px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.stack { display: grid; gap: 14px; }
.job { display: flex; flex-direction: column; gap: 10px; }
.job h3 { margin: 0; }
.job-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pay { font-weight: 800; color: var(--green); font-size: 1.05rem; white-space: nowrap; }
.desc { color: var(--ink-2); white-space: pre-wrap; margin: 0; }
.meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .84rem; color: var(--muted); }
.job .grow { flex: 1; }

.chip { display: inline-block; background: var(--grey-bg); color: var(--ink-2); font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.status { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.s-open { background: var(--blue-bg); color: var(--blue); }
.s-progress { background: var(--purple-bg); color: var(--purple); }
.s-revision { background: var(--red-bg); color: var(--red); }
.s-submitted { background: var(--amber-bg); color: var(--amber); }
.s-pending { background: var(--amber-bg); color: var(--amber); }
.s-paid { background: var(--green-bg); color: var(--green); }
.s-cancelled { background: var(--grey-bg); color: var(--muted); }

.callout { background: var(--grey-bg); border-radius: 10px; padding: 10px 13px; font-size: .9rem; white-space: pre-wrap; }
.callout.warn { background: var(--amber-bg); color: #6e4300; }
.callout.good { background: var(--green-bg); color: #0b5a3a; }

.callout.danger { background: var(--red-bg); color: #8a2216; }
.urgent { display: inline-block; background: var(--red); color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.card.job.is-urgent { border-left: 4px solid var(--red); }
.urgent-box { display: grid; gap: 4px; background: #fff7f6; border: 1px solid #f6d3cf; border-radius: 10px; padding: 10px 13px; }
.urgent-box .check { margin-top: 0; color: var(--red); }
.due { font-size: .9rem; background: var(--blue-bg); color: var(--blue); border-radius: 8px; padding: 7px 11px; }
.due.late { background: var(--red-bg); color: var(--red); }
.stack-sm { display: grid; gap: 6px; }
.video { position: relative; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- questions ---------- */
.qa-list { display: grid; gap: 10px; margin-bottom: 14px; }
.qa { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; }
.qa.pending { border-left: 4px solid var(--accent); }
.qa .q { white-space: pre-wrap; }
.qa .a { background: var(--green-bg); color: #0b4a30; border-radius: 8px; padding: 8px 11px; white-space: pre-wrap; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat strong { display: block; font-size: 1.4rem; font-weight: 800; margin-top: 4px; line-height: 1.3; }
.stat.green strong { color: var(--green); }
.stat.amber strong { color: var(--amber); }

/* ---------- lists ---------- */
.list { display: grid; gap: 10px; }
.list-row {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.list-row:hover { border-color: #b9c6da; box-shadow: var(--shadow); }
.list-row .title { font-weight: 700; }
.list-row .sub { font-size: .84rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.list-row .right { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.filter.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.filter .n { opacity: .7; margin-left: 4px; }

.attention { display: grid; gap: 8px; }
.attention button { text-align: left; }
.att { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 14px; font: inherit; cursor: pointer; width: 100%; color: var(--ink); }
.att:hover { border-color: #b9c6da; border-left-color: var(--accent); }

.detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: .86rem; font-weight: 600; }
.dl dd { margin: 0; word-break: break-word; white-space: pre-wrap; }

.req-list { display: grid; gap: 10px; }
.req { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.req .msg { font-style: italic; color: var(--ink-2); margin: 6px 0 4px; }

.share-box { border: 1px dashed #b9c6da; border-radius: 12px; padding: 14px 16px; margin: 12px 0; background: #fafbfd; }
.share-box.done { border-style: solid; border-color: #b6e1cc; background: var(--green-bg); }
.share-box ol { padding-left: 20px; margin: 8px 0 12px; }
.check { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfd; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }

.pay-group { display: grid; gap: 10px; }
.pay-group-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }

.fl-card { display: grid; gap: 10px; }
.fl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fl-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); }
.fl-stats b { color: var(--ink); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-icon { font-size: 2rem; color: #c3cddb; }
.empty h3 { color: var(--ink-2); margin-top: 6px; }

/* ---------- forms ---------- */
form { display: grid; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
label small { font-weight: 500; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--ink);
  border: 1px solid #cfd8e5; border-radius: 10px; padding: 10px 12px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(29, 79, 134, .25); border-color: var(--brand-2); }
textarea { resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side {
  background: radial-gradient(circle at 20% 15%, #1f5a96 0, var(--brand) 55%, #0b2440 100%);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 18px;
}
.auth-side h1 { font-size: 2.3rem; max-width: 460px; }
.auth-side p { color: rgba(255,255,255,.8); max-width: 440px; font-size: 1.02rem; }
.auth-points { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.9); }
.auth-points li::before { content: "✓"; background: var(--accent); color: var(--brand); width: 22px; height: 22px; border-radius: 50%; display: grid; place-content: center; font-weight: 800; font-size: .8rem; flex: none; }
.auth-main { display: grid; place-content: center; padding: 32px 20px; }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-size: 1.5rem; margin: 0 0 4px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.center-wrap { min-height: 100vh; display: grid; place-content: center; padding: 30px 16px; }
.narrow { width: min(560px, calc(100vw - 32px)); }
.gate-icon { font-size: 2.4rem; }

/* ---------- modal ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(15, 27, 45, .5); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal { background: #fff; border-radius: 16px; width: min(600px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; }
.modal-head h3 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 16px 22px 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.icon-btn { background: none; border: 0; font-size: 1.1rem; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: var(--grey-bg); }
@keyframes fade { from { opacity: 0; } }

/* ---------- toast ---------- */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: .9rem; box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; transform: translateY(8px); transition: all .25s; }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--red); }


/* ---------- nav icons (shown on phones) ---------- */
.tab svg { display: none; width: 22px; height: 22px; flex: none; }
.tab-short { display: none; }
.field { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.field-label small { font-weight: 500; color: var(--muted); display: block; }
input, select, textarea { font-size: 16px; } /* 16px stops iPhones zooming in when you tap a field */
body { -webkit-tap-highlight-color: transparent; }
.btn, .tab, .filter, .att, .list-row { touch-action: manipulation; }
@media (hover: none) {
  .list-row:hover, .att:hover { box-shadow: none; border-color: var(--line); }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; min-height: 100dvh; align-content: start; }
  .auth-side { padding: calc(22px + env(safe-area-inset-top)) 20px 22px; gap: 8px; }
  .auth-side h1 { font-size: 1.4rem; margin: 6px 0 0; }
  .auth-side p { font-size: .92rem; margin: 0; }
  .auth-points { display: none; }
  .auth-main { place-content: start center; padding: 24px 16px calc(32px + env(safe-area-inset-bottom)); }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.05rem; margin-top: 1.3rem; }

  /* top bar: brand + sign out only */
  .topbar { height: auto; min-height: 54px; padding: env(safe-area-inset-top) 16px 0; gap: 10px; }
  .brand { flex: 1; font-size: 1rem; }
  .who span { display: none; }

  /* bottom tab bar, like a phone app */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(15, 27, 45, .07);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 2px; overflow: visible; justify-content: space-around;
  }
  .tab { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; padding: 7px 2px 6px; color: var(--muted); font-size: .7rem; font-weight: 700; border-radius: 12px; position: relative; }
  .tab:hover { color: var(--muted); background: transparent; }
  .tab.active, .tab.active:hover { color: var(--brand); background: var(--blue-bg); }
  .tab svg { display: block; }
  .tab-label { display: none; }
  .tab-short { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tab .badge { position: absolute; top: 2px; left: calc(50% + 5px); font-size: .62rem; line-height: 1.5; padding: 0 5px; min-width: 17px; text-align: center; }

  .main { padding: 18px 14px calc(92px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 14px; align-items: center; }
  .page-head > div p { font-size: .9rem; }

  /* touch-friendly controls */
  .btn { min-height: 44px; padding: 10px 16px; }
  .btn.sm { min-height: 38px; padding: 7px 12px; }
  .job .row > .btn.primary, .job .row > a.btn.primary { flex: 1 1 auto; }
  .modal-actions .btn { flex: 1; }

  .card { padding: 16px; border-radius: 14px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat span { font-size: .68rem; }
  .stat strong { font-size: 1.05rem; word-break: break-word; }
  .meta { gap: 4px 12px; font-size: .8rem; }
  .pay { font-size: 1rem; }

  .two { grid-template-columns: 1fr; }
  .two.keep { grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .list-row { grid-template-columns: 1fr; padding: 13px 14px; }
  .list-row .right { justify-content: space-between; }
  .req { flex-direction: column; }
  .req .btn { width: 100%; }

  /* filter chips scroll sideways instead of wrapping */
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 14px; padding: 2px 14px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: none; padding: 8px 14px; }

  /* tables become stacked cards */
  .table-wrap { background: transparent; border: 0; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 0; margin-bottom: 10px; }
  .table-wrap td { border: 0; padding: 5px 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 14px; text-align: right; }
  .table-wrap td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: .76rem; font-weight: 600; text-align: left; }
  .table-wrap td:not([data-label]) { justify-content: flex-start; text-align: left; }
  .table-wrap td:not([data-label])::before { display: none; }
  .table-wrap td:first-child { font-weight: 700; }
  .pay-group .table-wrap tr { box-shadow: none; }

  /* pop-ups slide up from the bottom */
  .backdrop { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; animation: sheet .22s ease-out; }
  .modal-head { position: sticky; top: 0; z-index: 2; background: #fff; padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
  .modal-body { padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); }
  .modal-actions { position: sticky; bottom: 0; z-index: 2; background: #fff; padding: 10px 0 2px; }

  #toast-root { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .center-wrap { padding: calc(20px + env(safe-area-inset-top)) 14px 24px; place-content: start center; }
  .empty { padding: 36px 16px; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
.quick { margin-bottom: 2px; }
.quick .filter { padding: 6px 12px; }

/* ---------- agreement, identity & payout checks ---------- */
.agreement-card { width: min(780px, calc(100vw - 28px)); }
.agreement-text { max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px 18px 14px; background: #fafbfd; margin: 12px 0 16px; font-size: .92rem; -webkit-overflow-scrolling: touch; }
.agreement-text.in-modal { max-height: none; margin: 0 0 12px; }
.agreement-text h2 { font-size: 1.2rem; margin: 14px 0 6px; }
.agreement-text h3 { font-size: 1rem; margin: 18px 0 6px; color: var(--brand); }
.agreement-text h4 { font-size: .93rem; margin: 12px 0 4px; }
.agreement-text ul, .agreement-text ol { padding-left: 22px; margin: 4px 0 8px; }
.agreement-text li { margin: 3px 0; }
form .check { font-weight: 500; color: var(--ink); align-items: flex-start !important; }
form .check input { margin-top: 2px; flex: none; }
.payout-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; display: grid; gap: 12px; margin: 0; min-width: 0; background: #fafbfd; }
.payout-box legend { font-weight: 700; padding: 0 6px; color: var(--brand); }
.id-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.id-slot { border: 2px dashed #c9d3e2; border-radius: 12px; padding: 10px; display: grid !important; gap: 8px; justify-items: center; text-align: center; align-content: start; background: #fafbfd; }
.id-slot img { width: 100%; max-height: 150px; object-fit: contain; border-radius: 8px; }
.id-slot input { font-size: 13px; width: 100%; border: 0; padding: 0; background: transparent; }
.id-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.id-imgs figure { margin: 0; }
.id-imgs img { width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
.id-imgs figcaption { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 4px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .9rem; font-weight: 600; }
.checks .ok { color: var(--green); } .checks .warn { color: var(--amber); } .checks .bad { color: var(--red); }
.att.att-alert { border-left-color: var(--red); }
tr.hl td { background: #fff7e6; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.45; }
.loading-inline { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 20px 0; }
.loading-inline .spinner { width: 20px; height: 20px; }
@media (max-width: 640px) {
  .id-imgs { grid-template-columns: 1fr; }
  .agreement-text { max-height: 50dvh; padding: 4px 14px 12px; }
  .agreement-card { padding: 16px; }
}

/* ---------- authenticator (OTP) ---------- */
.otp { font-size: 1.6rem !important; letter-spacing: .3em; text-align: center; font-weight: 700; padding: 12px; }
.steps { padding-left: 20px; margin: 10px 0 14px; display: grid; gap: 4px; }
.qr-box { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: center; margin: 6px 0 14px; }
.qr { width: 180px; height: 180px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.qr svg { width: 100%; height: 100%; }
.setup-key { display: block; font-size: .95rem; letter-spacing: .05em; padding: 8px 10px; word-break: break-all; }
@media (max-width: 640px) { .qr-box { grid-template-columns: 1fr; justify-items: center; } .qr-box .stack-sm { width: 100%; } }
.nrc-big { font-size: 1.1rem; font-weight: 800; letter-spacing: .04em; }

/* =====================================================================
   SBJ BRAND LAYER — logo colours, Sora + Figtree, sidebar dashboard
   Midnight #050D1F · Teal #009EA3 · Royal #175ED3
   ===================================================================== */
:root {
  --midnight: #050D1F;
  --midnight-2: #0C1A33;
  --teal: #009EA3;
  --teal-soft: #E3F5F5;
  --royal: #175ED3;
  --royal-2: #124CB0;

  --ink: #0E1A2B;
  --ink-2: #3C4A5E;
  --muted: #6A7689;
  --line: #E3E8EF;
  --bg: #F3F6FA;
  --card: #FFFFFF;
  --brand: var(--royal);
  --brand-2: var(--royal-2);
  --accent: var(--teal);
  --blue: #175ED3;
  --blue-bg: #E6EEFC;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(5, 13, 31, .04), 0 6px 20px rgba(5, 13, 31, .05);
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Sora", "Figtree", system-ui, sans-serif;
}

body { font-family: var(--font-body); font-size: 15.5px; color: var(--ink); background: var(--bg); }
h1, h2, h3, .pay, .stat strong, .brand-text b, .auth-card h2 { font-family: var(--font-head); }
h1 { font-weight: 700; letter-spacing: -.02em; font-size: 1.75rem; }
h2 { font-weight: 600; letter-spacing: -.01em; }
h3 { font-weight: 600; letter-spacing: -.005em; }
a { color: var(--royal); }
:focus-visible { outline: 3px solid rgba(0, 158, 163, .45); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(0, 158, 163, .22); border-color: var(--teal); }

/* buttons */
.btn { border-radius: 11px; font-weight: 600; letter-spacing: .005em; }
.btn.primary { background: var(--royal); }
.btn.primary:hover { background: var(--royal-2); }
.btn.outline { color: var(--royal); border-color: #CBD7EA; }
.btn.outline:hover { border-color: var(--royal); background: #F5F8FE; }
.link { color: var(--royal); }

/* brand lockup */
.brand { display: flex; align-items: center; gap: 11px; }
.logo-mark { flex: none; display: block; }
.brand-text { display: grid; line-height: 1.05; }
.brand-text b { color: #fff; font-size: 1.2rem; font-weight: 700; letter-spacing: .02em; }
.brand-text span { color: var(--teal); font-size: .74rem; font-weight: 600; letter-spacing: .01em; margin-top: 2px; }

/* top bar (tablet) */
.topbar { background: var(--midnight); height: 66px; }
.tab { color: rgba(255, 255, 255, .64); border-radius: 10px; }
.tab:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.tab.active { background: rgba(0, 158, 163, .16); color: #fff; }
.badge { background: var(--teal); color: #fff; font-weight: 700; }
.who { color: rgba(255, 255, 255, .8); }

/* desktop: left sidebar dashboard */
@media (min-width: 900px) {
  .topbar {
    position: fixed; inset: 0 auto 0 0; z-index: 20; width: 252px; height: auto;
    flex-direction: column; align-items: stretch; gap: 26px; padding: 26px 16px 18px;
    border-right: 1px solid rgba(255, 255, 255, .06);
  }
  .brand { padding: 0 8px; }
  .tabs { flex-direction: column; flex: 1; gap: 3px; overflow: visible; }
  .tab { position: relative; justify-content: flex-start; gap: 12px; padding: 11px 12px; font-size: .95rem; font-weight: 600; }
  .tab svg { display: block; width: 20px; height: 20px; opacity: .9; }
  .tab.active::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal); }
  .tab .badge { margin-left: auto; }
  .who { flex-direction: column; align-items: stretch; gap: 6px; padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
  .who span { display: block; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .who .btn.ghost { justify-content: flex-start; padding-left: 0; color: rgba(255, 255, 255, .7); }
  .who .btn.ghost:hover { background: transparent; color: #fff; }
  .main { margin: 0 0 0 252px; max-width: 1200px; padding: 38px 48px 64px; }
}

/* cards & lists */
.card { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); }
.list-row { border-radius: 14px; }
.list-row:hover, .att:hover { border-color: #C7D3E3; box-shadow: 0 4px 16px rgba(5, 13, 31, .06); }
.att { border-left-color: var(--teal); border-radius: 12px; }
.att.att-alert { border-left-color: var(--red); }
.chip { background: #EEF2F7; color: var(--ink-2); }
.pay { color: #0E8A63; font-weight: 700; }
.filter.active { background: var(--midnight); border-color: var(--midnight); }

/* stats: one clean strip instead of separate boxes */
.stats {
  gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat { border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 18px 22px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.stat span { text-transform: none; letter-spacing: 0; font-size: .84rem; font-weight: 500; color: var(--muted); }
.stat strong { font-size: clamp(1.15rem, 1.5vw, 1.5rem); font-weight: 700; letter-spacing: -.02em; margin-top: 6px; }

/* tables: sentence-case headers */
th { text-transform: none; letter-spacing: 0; font-size: .82rem; font-weight: 600; color: var(--muted); background: #F8FAFC; }

/* sign-in: midnight panel with the logo ring as the hero */
.auth-side { position: relative; overflow: hidden; background: var(--midnight); }
.auth-side > *:not(.auth-ring) { position: relative; z-index: 1; }
.auth-ring { position: absolute; right: -170px; bottom: -150px; pointer-events: none; }
.auth-side h1 { font-family: var(--font-head); font-weight: 700; letter-spacing: -.025em; line-height: 1.12; }
.auth-side p { color: rgba(255, 255, 255, .72); }
.auth-points li::before { background: var(--teal); color: #fff; }
.auth-card h2 { font-weight: 700; letter-spacing: -.02em; }
.gate-icon { display: flex; justify-content: center; margin-bottom: 4px; }
.card.narrow:not([style]) .gate-icon { justify-content: flex-start; }

/* phone */
@media (max-width: 640px) {
  .topbar { height: auto; min-height: 58px; }
  .brand .logo-mark { width: 32px; height: 32px; }
  .brand-text b { font-size: 1.05rem; }
  .brand-text span { font-size: .68rem; }
  .tabs { background: #fff; }
  .tab, .tab:hover { color: var(--muted); background: transparent; }
  .tab.active, .tab.active:hover { color: var(--royal); background: #EAF1FD; }
  .tab .badge { background: var(--teal); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 14px 16px; }
  .stat strong { font-size: 1.12rem; }
  .auth-ring { right: -230px; bottom: -260px; }
  .auth-ring svg { width: 420px; height: 420px; }
  h1 { font-size: 1.4rem; }
}
@media (min-width: 641px) and (max-width: 899px) {
  .tab svg { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* sign-in: contact details for clients */
.client-contact { margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: center; }
.client-contact p { margin: 0 0 12px; font-size: .92rem; color: var(--ink-2); }
.contact-icons { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; }
.ci { display: grid; justify-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); font-size: .8rem; font-weight: 600; }
.ci-dot { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .15s; }
.ci:hover .ci-dot { transform: translateY(-2px); }
.ci-email .ci-dot { background: var(--teal); }
.ci-whatsapp .ci-dot { background: #25D366; }
.ci-facebook .ci-dot { background: #0866FF; }
.ci-youtube .ci-dot { background: #FF0000; }
.ci-mail { display: inline-block; margin-top: 12px; color: var(--muted); text-decoration: none; }
.ci-mail:hover { color: var(--royal); text-decoration: underline; }

/* ---------- testimonials ---------- */
.stars { color: #F5B301; letter-spacing: 1px; font-size: 1rem; }
.stars span { color: #D5DCE6; }
.tstrip { margin-top: 26px; }
.tstrip h3 { font-size: .95rem; font-weight: 600; margin: 0 0 12px; }
.tviewport { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ttrack { display: flex; gap: 14px; width: max-content; animation: tscroll var(--dur, 40s) linear infinite; }
.tdup { display: flex; gap: 14px; }
.tviewport:hover .ttrack, .tviewport:focus-within .ttrack { animation-play-state: paused; }
@keyframes tscroll { to { transform: translateX(calc(-50% - 7px)); } }
.tcard { width: 290px; flex: none; margin: 0; padding: 16px 18px; border-radius: 14px; display: grid; gap: 8px; align-content: start; }
.tcard blockquote { margin: 0; font-size: .92rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.tcard figcaption { font-weight: 700; font-size: .9rem; display: grid; }
.tcard figcaption span { font-weight: 500; font-size: .78rem; }
/* on the midnight panel */
.tstrip-side { position: relative; z-index: 1; max-width: 560px; }
.tstrip-side h3 { color: rgba(255, 255, 255, .85); }
.tstrip-side .tcard { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: #fff; }
.tstrip-side .tcard figcaption span { color: var(--teal); }
.tstrip-side .stars span { color: rgba(255, 255, 255, .2); }
/* under the sign-in form (phones) */
.tstrip-main { display: none; }
.tstrip-main .tcard { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.tstrip-main .tcard figcaption span { color: var(--teal); }
@media (max-width: 860px) { .tstrip-side { display: none; } .tstrip-main { display: block; } }
@media (prefers-reduced-motion: reduce) {
  .ttrack { animation: none; } .tdup { display: none; }
  .tviewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}

/* star picker (5 → 1 in markup, shown right-to-left) */
.rate { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; position: relative; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate label { font-size: 2rem; line-height: 1; color: #D5DCE6; cursor: pointer; display: inline; }
.rate input:checked ~ label, .rate label:hover, .rate label:hover ~ label { color: #F5B301; }
.rate input:focus-visible + label { outline: 3px solid rgba(0, 158, 163, .45); border-radius: 6px; }
.nudge { background: var(--teal-soft); color: #0B4F52; }

/* ---------- online status ---------- */
.pres { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.pres i { width: 8px; height: 8px; border-radius: 50%; background: #B8C2D0; flex: none; }
.pres.on { color: #0E8A63; }
.pres.on i { background: #19B97A; box-shadow: 0 0 0 3px rgba(25, 185, 122, .18); }
.fl-head { align-items: center; }
.stat.teal strong { color: var(--teal); }
