/* Kodiak Bio — shared styles (rep app + admin portal) */
:root {
  --bg: #0c0d0f;
  --bg2: #141519;
  --card: #1a1c21;
  --card2: #22242b;
  --line: #2e3138;
  --text: #f2f0ea;
  --muted: #9a9da6;
  --bone: #e8e4da;
  --ok: #4cc38a;
  --ok-dim: #17352a;
  --warn: #e5b567;
  --bad: #e5726b;
  --bad-dim: #3a1f1e;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, #23252b 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 110%, #1b1d22 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { font-weight: 800; letter-spacing: 0.02em; margin: 0 0 .5em; }
a { color: var(--bone); }
button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #4a4f5c; border-color: transparent; }
input[type=number] { -moz-appearance: textfield; }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img, .brand svg { width: 34px; height: 34px; }
.brand .word { font-size: 20px; font-weight: 900; letter-spacing: .04em; line-height: 1; }
.brand .word small { display: block; font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .28em; text-transform: uppercase; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bone); color: #111; border: none;
  border-radius: 12px; padding: 13px 20px; font-weight: 800; font-size: 16px;
  transition: transform .05s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ok { background: var(--ok); color: #06120c; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid #4a2c2a; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

/* ---------- cards & layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.muted { color: var(--muted); }
.money { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row .grow { flex: 1; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mt { margin-top: 16px; }
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .03em;
  background: var(--card2); color: var(--muted); border: 1px solid var(--line);
}
.chip.ok { background: var(--ok-dim); color: var(--ok); border-color: transparent; }
.chip.bad { background: var(--bad-dim); color: var(--bad); border-color: transparent; }
.chip.warn { background: #33290f; color: var(--warn); border-color: transparent; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--bone); }

/* ---------- rep app shell ---------- */
.app { max-width: 560px; margin: 0 auto; padding: 14px 14px 96px; }
.app-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px 16px; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: rgba(16,17,20,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; background: none; border: none; color: var(--muted);
  padding: 12px 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-transform: uppercase;
}
.tabbar button .ico { font-size: 21px; line-height: 1; }
.tabbar button.on { color: var(--bone); }

.stock-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.stock-item + .stock-item { border-top: 1px solid var(--line); }
.stock-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.count-badge {
  min-width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--card2); font-size: 19px; font-weight: 900;
}
.count-badge.zero { color: var(--muted); opacity: .5; }
.stock-item .name { font-weight: 700; }
.stock-item .sub { font-size: 13px; color: var(--muted); }

.prod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prod-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: left; color: var(--text); position: relative;
}
.prod-tile:active { background: var(--card2); }
.prod-tile .nm { font-weight: 700; font-size: 14px; line-height: 1.25; min-height: 2.5em; }
.prod-tile .pr { color: var(--muted); font-size: 13px; margin-top: 6px; }
.prod-tile .ct {
  position: absolute; top: 10px; right: 10px;
  background: var(--ok-dim); color: var(--ok); font-size: 12px; font-weight: 800;
  border-radius: 999px; padding: 2px 9px;
}
.prod-tile.none { opacity: .38; }

.qty-row { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 8px 0; }
.qty-row button {
  width: 52px; height: 52px; border-radius: 14px; font-size: 26px; font-weight: 800;
  background: var(--card2); color: var(--text); border: 1px solid var(--line);
}
.qty-row .qty { font-size: 34px; font-weight: 900; min-width: 58px; text-align: center; }

.sale-row { padding: 13px 16px; display: flex; align-items: center; gap: 12px; }
.sale-row + .sale-row { border-top: 1px solid var(--line); }
.day-head { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 20px 4px 8px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: var(--bone); color: #111; font-weight: 700; font-size: 14px;
  padding: 12px 20px; border-radius: 12px; z-index: 100;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: 90vw; text-align: center;
  animation: toastin .2s ease;
}
.toast.err { background: var(--bad); color: #fff; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- login ---------- */
.login-wrap { max-width: 380px; margin: 0 auto; padding: 12vh 20px 40px; }
.login-wrap .brand { justify-content: center; margin-bottom: 28px; }
.login-wrap .brand img, .login-wrap .brand svg { width: 56px; height: 56px; }
.pin-note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 16px; }

/* ---------- admin ---------- */
.admin { display: flex; min-height: 100vh; }
.side {
  width: 210px; flex-shrink: 0; border-right: 1px solid var(--line);
  padding: 18px 12px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; background: rgba(12,13,15,.6);
}
.side .brand { padding: 0 8px 18px; }
.side button {
  background: none; border: none; color: var(--muted); text-align: left;
  padding: 11px 12px; border-radius: 10px; font-weight: 600; font-size: 14px;
  display: flex; gap: 10px; align-items: center;
}
.side button.on { background: var(--card); color: var(--text); }
.side .foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 8px; }
.main { flex: 1; padding: 26px 30px 80px; max-width: 1080px; min-width: 0; }

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .v { font-size: 26px; font-weight: 900; margin-top: 2px; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.grid td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: none; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablecard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters > div { min-width: 130px; }
.filters label { margin-top: 0; }

.kitpick { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; }
.kitpick label {
  display: flex; gap: 10px; align-items: center; margin: 0; padding: 10px 12px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); cursor: pointer;
}
.kitpick input[type=checkbox] { width: auto; }

.checkin-result { background: var(--ok-dim); border: 1px solid #1e4634; border-radius: var(--radius); padding: 16px; }

@media (max-width: 760px) {
  .admin { flex-direction: column; }
  .side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); }
  .side .brand { padding: 4px 8px; width: 100%; }
  .side .foot { display: none; }
  .main { padding: 18px 14px 60px; }
}
