@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400..800;1,400..800&display=swap");

:root {
  --canvas: #f3f6f7;
  --surface: #ffffff;
  --ink: #102a2f;
  --ink-2: #3b5459;
  --muted: #6b8085;
  --line: #dfe7e8;
  --line-2: #edf2f3;
  --teal: #0f766e;
  --teal-ink: #0b5953;
  --teal-soft: #e3f4f1;
  --mint: #5eead4;
  --sky: #0ea5e9;
  --green: #16a34a;
  --green-soft: #e4f6ea;
  --amber: #d97706;
  --amber-ink: #92400e;
  --amber-soft: #fef3e2;
  --red: #dc2626;
  --red-ink: #a61b1b;
  --red-soft: #fdeaea;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 20px;
  --shadow: 0 1px 2px rgba(16, 42, 47, .05), 0 8px 24px -12px rgba(16, 42, 47, .18);
  --pop: 0 24px 60px -20px rgba(16, 42, 47, .45);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
h1, h2, h3 { letter-spacing: -0.02em; margin: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #d7e6e7; }
.top-in { display: flex; align-items: center; gap: 28px; padding: 0 32px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--teal); display: grid; place-items: center; position: relative; overflow: hidden; }
.brand-mark::after { content: ""; position: absolute; left: 4px; right: 4px; top: 15px; height: 2px; background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.tabs { display: flex; gap: 4px; height: 100%; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 0 14px; color: #a9c1c3; text-decoration: none; font-weight: 600; font-size: 14.5px; border-bottom: 3px solid transparent; }
.tabs a:hover { color: #fff; }
.tabs a.on { color: #fff; border-bottom-color: var(--mint); }
.tabs svg { width: 18px; height: 18px; }
.top .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.who b { color: #fff; font-weight: 600; }
.who button { background: rgba(255,255,255,.08); border: 0; color: #d7e6e7; padding: 6px 11px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.who button:hover { background: rgba(255,255,255,.16); }

.page { max-width: 1320px; margin: 0 auto; padding: 32px 32px 90px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 30px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.page-head .spacer { flex: 1; }

/* ------------------------------------------------ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: #c4d3d5; background: #fafcfc; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: 0 8px 20px -10px rgba(15, 118, 110, .8); }
.btn.primary:hover { background: var(--teal-ink); }
.btn.big { padding: 13px 22px; font-size: 15.5px; border-radius: 12px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--red-ink); }
.btn.danger:hover { background: var(--red-soft); border-color: #f5c2c2; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; background: var(--surface); min-width: 0; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13.5px; font-weight: 650; color: var(--ink-2); }
.hint { font-size: 13px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); }
.notice { border-radius: 10px; padding: 11px 14px; font-size: 14px; margin: 10px 0; }
.notice.ok { background: var(--green-soft); color: #166534; }
.notice.err { background: var(--red-soft); color: var(--red-ink); }
.notice.warn { background: var(--amber-soft); color: var(--amber-ink); }

/* ------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-art { background: var(--ink); color: #cfe0e1; padding: 52px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h2 { font-size: 46px; line-height: 1.05; font-weight: 800; color: #fff; max-width: 520px; letter-spacing: -0.035em; }
.login-art p { max-width: 440px; color: #9fb8ba; font-size: 16px; margin: 18px 0 0; }
.receipt { position: absolute; right: 64px; bottom: 70px; width: 300px; background: #f8fbfb; border-radius: 6px; padding: 26px 24px 40px; transform: rotate(-6deg); box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); color: #1b3236; font-size: 13px; }
.receipt .ln { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #cdd9da; }
.receipt .ln b { font-weight: 700; }
.receipt .scan { position: absolute; left: -10px; right: -10px; height: 3px; background: var(--mint); box-shadow: 0 0 18px 4px rgba(94, 234, 212, .8); top: 30%; animation: scan 3.2s ease-in-out infinite alternate; }
@keyframes scan { from { top: 12%; } to { top: 88%; } }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-form form { width: 100%; max-width: 370px; }
.login-form h1 { font-size: 30px; font-weight: 800; }
.login-form > form > p { color: var(--muted); margin: 6px 0 26px; }

/* ------------------------------------------------ scan page */
.drop { border: 2px dashed #b6cbcd; border-radius: var(--r-l); background: var(--surface); padding: 46px 24px; text-align: center; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--teal); background: var(--teal-soft); }
.drop-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; margin: 0 auto 16px; }
.drop-icon svg { width: 32px; height: 32px; }
.drop h2 { font-size: 22px; font-weight: 800; }
.drop p { color: var(--muted); margin: 6px auto 20px; max-width: 520px; }
.drop .btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tips { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-top: 22px; color: var(--muted); font-size: 13.5px; }
.tips span { display: inline-flex; align-items: center; gap: 6px; }
.tips svg { width: 16px; height: 16px; color: var(--teal); }

.picked { margin-top: 22px; }
.picked-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.picked-head h2 { font-size: 19px; font-weight: 750; }
.picked-head .spacer { flex: 1; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.thumb { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; position: relative; }
.thumb .img { height: 150px; background: #eef3f3 center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.thumb .meta { padding: 9px 11px; font-size: 12.5px; }
.thumb .meta b { display: block; font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb .meta span { color: var(--muted); }
.thumb .warn { margin-top: 6px; color: var(--amber-ink); background: var(--amber-soft); border-radius: 6px; padding: 3px 7px; font-size: 12px; }
.thumb .bad { color: var(--red-ink); background: var(--red-soft); }
.thumb .x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(16, 42, 47, .65); color: #fff; cursor: pointer; display: grid; place-items: center; }
.thumb .x svg { width: 14px; height: 14px; }

.history { margin-top: 34px; }
.history h2 { font-size: 18px; font-weight: 750; margin-bottom: 10px; }
.hist-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.hist-list a { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 13px 18px; text-decoration: none; color: var(--ink); align-items: center; }
.hist-list a + a { border-top: 1px solid var(--line-2); }
.hist-list a:hover { background: #f8fbfb; }
.hist-list .sub { color: var(--muted); font-size: 13.5px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip.g { background: var(--green-soft); color: #166534; }
.chip.a { background: var(--amber-soft); color: var(--amber-ink); }
.chip.r { background: var(--red-soft); color: var(--red-ink); }
.chip.t { background: var(--teal-soft); color: var(--teal-ink); }

/* ------------------------------------------------ progress */
.run { padding: 30px 32px; }
.run-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.run-head h2 { font-size: 24px; font-weight: 800; }
.run-head .sub { color: var(--muted); }
.run-head .pct { margin-left: auto; font-size: 34px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.bar { height: 16px; border-radius: 999px; background: var(--line-2); overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .5s ease, background .4s;
  background: linear-gradient(90deg, var(--teal), var(--sky)); position: relative; overflow: hidden; }
.bar i::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.28) 0 12px, transparent 12px 24px); animation: stripes 1s linear infinite; }
@keyframes stripes { from { background-position: 0 0; } to { background-position: 52px 0; } }
.bar.done i { background: var(--green); }
.bar.done i::after { display: none; }
.stage { margin-top: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.files { margin-top: 22px; border-top: 1px solid var(--line-2); }
.frow { display: grid; grid-template-columns: 34px minmax(0, 1fr) 190px; gap: 14px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--line-2); }
.frow .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--muted); }
.frow .ic svg { width: 16px; height: 16px; }
.frow .ic.g { background: var(--green); color: #fff; }
.frow .ic.a { background: var(--amber); color: #fff; }
.frow .ic.r { background: var(--red); color: #fff; }
.frow .ic.busy { background: var(--teal-soft); color: var(--teal); }
.frow .nm b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .nm span { color: var(--muted); font-size: 13px; }
.frow .st { text-align: right; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.mini { height: 5px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: 6px; }
.mini i { display: block; height: 100%; background: var(--teal); transition: width .4s; }
.spin { width: 16px; height: 16px; border: 2.5px solid var(--teal-soft); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.done-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.done-check { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); box-shadow: 0 10px 30px -8px rgba(22, 163, 74, .7); flex: none; }
.done-check svg { width: 34px; height: 34px; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.done-hero h2 { font-size: 26px; font-weight: 800; color: #166534; }
.box { border-radius: var(--r-m); padding: 14px 16px; margin-top: 14px; }
.box h3 { font-size: 15px; font-weight: 750; margin-bottom: 6px; }
.box ul { margin: 0; padding-left: 20px; }
.box li { margin: 3px 0; }
.box.r { background: var(--red-soft); color: var(--red-ink); border: 1px solid #f6c7c7; }
.box.a { background: var(--amber-soft); color: var(--amber-ink); border: 1px solid #f6dcb1; }
.run-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ------------------------------------------------ sheet */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 15px 18px; }
.stat b { display: block; font-size: 25px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13.5px; }
.stat.money b small { font-size: 14px; color: var(--muted); font-weight: 700; margin-left: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search { flex: 0 1 340px; }
.toolbar .spacer { flex: 1; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { width: 17px; height: 17px; accent-color: var(--amber); }
.sheet-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: auto; max-height: calc(100vh - 290px); box-shadow: var(--shadow); }
table.sheet { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; font-size: 14px; }
.sheet th { position: sticky; top: 0; z-index: 2; background: #f6f9f9; text-align: left; font-weight: 750; font-size: 13px; color: var(--ink-2); padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sheet th.n, .sheet td.n { text-align: right; }
.sheet td { border-bottom: 1px solid var(--line-2); padding: 0; height: 42px; position: relative; }
.sheet td + td, .sheet th + th { border-left: 1px solid var(--line-2); }
.sheet .rn { width: 48px; text-align: center; color: var(--muted); font-size: 12.5px; background: #fafcfc; font-variant-numeric: tabular-nums; }
.sheet .cell { padding: 0 12px; height: 42px; display: flex; align-items: center; cursor: text; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sheet td.n .cell { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.sheet .cell.na { color: #a5b5b7; }
.sheet .cell.locked { cursor: default; color: var(--ink-2); }
.sheet .cell:hover { background: #f4fafa; }
.sheet td.edited::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 9px 9px 0; border-color: transparent var(--teal) transparent transparent; }
.sheet td.saving .cell { background: var(--teal-soft); }
.sheet td.errcell .cell { background: var(--red-soft); }
.sheet input.ed { width: 100%; height: 42px; border: 0; outline: 2px solid var(--teal); outline-offset: -2px; padding: 0 12px; background: #fff; font-variant-numeric: tabular-nums; }
.sheet td.n input.ed { text-align: right; }
.sheet tr.has-notes .rn { box-shadow: inset 3px 0 0 var(--amber); }
.sheet tr:hover td { background-color: #fbfdfd; }
.sheet .info { width: 46px; text-align: center; }
.info-btn { width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; display: inline-grid; place-items: center; color: var(--muted); position: relative; }
.info-btn:hover { background: var(--line-2); color: var(--ink); }
.info-btn svg { width: 17px; height: 17px; }
.info-btn.flag { color: var(--amber); }
.info-btn.flag::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.sheet tfoot td { position: sticky; bottom: 0; background: #f6f9f9; font-weight: 800; border-top: 1px solid var(--line); padding: 0 12px; height: 44px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 19px; margin-bottom: 6px; }
.legend { display: flex; gap: 18px; color: var(--muted); font-size: 13px; margin-top: 10px; flex-wrap: wrap; }
.legend span { display: inline-flex; gap: 7px; align-items: center; }
.legend .tri { width: 0; height: 0; border-style: solid; border-width: 0 9px 9px 0; border-color: transparent var(--teal) transparent transparent; }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }

/* ------------------------------------------------ side panel */
.scrim { position: fixed; inset: 0; background: rgba(16, 42, 47, .35); z-index: 40; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 94vw); background: var(--surface); z-index: 41; box-shadow: var(--pop); display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.panel-head h2 { font-size: 19px; font-weight: 800; }
.panel-head .sub { color: var(--muted); font-size: 13.5px; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 18px 22px 30px; overflow-y: auto; flex: 1; }
.panel-body h3 { font-size: 14px; font-weight: 750; margin: 20px 0 8px; }
.panel-body h3:first-child { margin-top: 0; }
.note-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.note-list li { background: var(--amber-soft); color: var(--amber-ink); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.edits { font-size: 13.5px; color: var(--ink-2); }
.edits div { padding: 6px 0; border-bottom: 1px solid var(--line-2); }

/* ------------------------------------------------ settings */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.set { padding: 24px 26px; margin-bottom: 20px; }
.set h2 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.set > p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 14px; }
table.users td { padding: 10px 4px; border-bottom: 1px solid var(--line-2); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 60; font-size: 14px; box-shadow: var(--pop); max-width: 520px; }
.toast.err { background: var(--red-ink); }
.modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; background: rgba(16, 42, 47, .4); }
.modal .card { width: min(420px, 92vw); padding: 24px; }

@media (prefers-reduced-motion: reduce) {
  .bar i::after, .receipt .scan, .spin, .done-check, .panel { animation: none; }
}
@media (max-width: 900px) {
  .top-in { padding: 0 14px; gap: 12px; }
  .who b { display: none; }
  .page { padding: 22px 16px 80px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .frow { grid-template-columns: 34px 1fr; }
  .frow .st { grid-column: 2; text-align: left; }
  .tabs a span { display: none; }
}

/* ------------------------------------------------ waiting for your OK */
.box.i { background: var(--line-2); color: var(--ink-2); border: 1px solid var(--line); }
.box.holds { padding: 16px; }
.holds-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.holds-head h3 { font-size: 16px; }
.holds-head p { margin: 2px 0 0; font-size: 13.5px; }
.holds-head > div { flex: 1; }
.hold { background: var(--surface); color: var(--ink); border: 1px solid #f1d6a8; border-radius: var(--r-m); padding: 12px 14px; margin-top: 10px; }
.hold-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hold-head .spacer { flex: 1; }
.hold-head b { font-weight: 750; }
.hold-notes { margin: 8px 0 10px; padding-left: 18px; color: var(--amber-ink); font-size: 13.5px; }
.hold-notes li { margin: 2px 0; }
.hold-rows { overflow-x: auto; }
.hold-rows table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hold-rows th { text-align: left; color: var(--muted); font-weight: 650; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.hold-rows td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.hold-rows .n { text-align: right; font-variant-numeric: tabular-nums; }
