:root {
  --bg: #f5f6f8; --surface: #fff; --surface-2: #f0f2f5; --text: #1b1f27; --muted: #667085;
  --border: #e3e6ec; --accent: #3355ff; --accent-text: #fff; --accent-soft: #e8ecff;
  --green: #12805c; --green-bg: #dcf5ea; --amber: #a15c00; --amber-bg: #fff0cf;
  --grey: #5b6472; --grey-bg: #e9ecf1; --red: #c0262d; --red-bg: #fde6e7; --blue: #1d5fd1; --blue-bg: #e2edff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .06); --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218; --surface: #181c24; --surface-2: #1f2430; --text: #e8eaf0; --muted: #98a1b2;
    --border: #2a303c; --accent: #6f8bff; --accent-text: #0b0e16; --accent-soft: #232b4a;
    --green: #5fd3a3; --green-bg: #123a2c; --amber: #f5b94a; --amber-bg: #3d2d0c;
    --grey: #a4adbb; --grey-bg: #2a303c; --red: #ff8a90; --red-bg: #43191c; --blue: #8db4ff; --blue-bg: #1b2c4d;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; } h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
code, .code, .code-s { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .r { text-align: right; } .nowrap { white-space: nowrap; } .grow { flex: 1; }

.nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); } .brand:hover { text-decoration: none; }
.brand.big { font-size: 1.6rem; justify-content: center; margin-bottom: 20px; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-text); font-weight: 800; }
.nav nav { display: flex; gap: 4px; flex: 1; }
.nav nav a { color: var(--muted); padding: 7px 12px; border-radius: 8px; font-weight: 500; }
.nav nav a:hover { background: var(--surface-2); text-decoration: none; } .nav nav a.on { color: var(--text); background: var(--surface-2); }
.who { display: flex; align-items: center; gap: 10px; margin: 0; }

main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; } main.narrow { max-width: 420px; padding-top: 12vh; }
.crumb { margin: 0 0 8px; } .head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 1rem; } .head h1 { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow-x: auto; } .card-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px 6px; } .card-head h2 { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; } .cards .card { margin: 0; }
.stat .n { font-size: 2rem; font-weight: 700; line-height: 1.1; } .stat.warn { border-color: var(--amber); } .stat.warn .n { color: var(--amber); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; } .two .card { margin-bottom: 18px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.attention { border-color: var(--amber); background: linear-gradient(var(--amber-bg), var(--amber-bg)) top / 100% 4px no-repeat, var(--surface); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: top; } tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); } tr.click { cursor: pointer; } tr.dim { opacity: .6; }
.w-chk { width: 36px; } .w-prog { width: 30%; } .notes { max-width: 340px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--grey-bg); color: var(--grey); }
.badge.pending, .badge.requested { background: var(--amber-bg); color: var(--amber); }
.badge.approved, .badge.done { background: var(--green-bg); color: var(--green); }
.badge.uploading, .badge.rec { background: var(--blue-bg); color: var(--blue); } .badge.rec { background: var(--red-bg); color: var(--red); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--grey); margin-right: 7px; opacity: .5; }
.dot.on { background: #22c55e; opacity: 1; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.code { display: inline-block; font-weight: 700; letter-spacing: .12em; background: var(--surface-2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 8px; }
.code-s { letter-spacing: .08em; }

.btn { font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: inline-block; }
.btn:hover { background: var(--surface-2); text-decoration: none; } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); } .btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--red); } .btn.ghost { border-color: transparent; background: none; color: var(--muted); } .btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 10px; font-size: .85rem; }
form.inline { display: inline; } .row { display: flex; gap: 8px; flex-wrap: wrap; } .row.sep { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .88rem; }
input:not([type=checkbox]):not([type=radio]), textarea { font: inherit; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; width: 100%; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
fieldset.targets { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; } fieldset.targets legend { font-weight: 600; font-size: .88rem; padding: 0 6px; }
fieldset.targets > label { margin-right: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .chip { background: var(--surface-2); border-radius: 999px; padding: 3px 12px; font-size: .88rem; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 9px 12px; margin: 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 5px 0 3px; border: 1px solid var(--border); }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.pend-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); } .pend-row input { width: 200px; }
.empty { text-align: center; color: var(--muted); padding: 44px 20px; } .empty.slim { padding: 18px; } .empty strong { color: var(--text); }
.flash { padding: 11px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; background: var(--green-bg); color: var(--green); }
.flash.error { background: var(--red-bg); color: var(--red); }
.login .card { padding: 24px; } .login h1 { margin: 0; font-size: 1.3rem; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); } .two, .grid3 { grid-template-columns: 1fr; }
  .nav-inner { gap: 12px; padding: 0 12px; } main { padding: 18px 12px 50px; } .pend-row input { width: 100%; }
}
