:root {
  --bg: #0f0f10;
  --panel: #18181b;
  --panel-2: #202024;
  --line: #2a2a30;
  --text: #f2f2f2;
  --muted: #9a9aa3;
  --gold: #c9a24b;
  --gold-2: #e2c16f;
  --green: #3fb950;
  --red: #f0605d;
  --amber: #f0b429;
  --blue: #58a6ff;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.4;
  -webkit-font-smoothing: antialiased; padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--gold-2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.container { max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }
header.top {
  position: sticky; top: 0; z-index: 20; background: rgba(15,15,16,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; gap: 12px;
}
header.top .brand { font-weight: 700; letter-spacing: .04em; color: var(--gold); text-transform: uppercase; font-size: 13px; }
header.top .brand small { display: block; color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 12px; }
header.top nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
header.top nav a, header.top nav button {
  background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 13px;
}
header.top nav a.active { border-color: var(--gold); color: var(--gold-2); }
h1 { font-size: 22px; margin: 18px 0 8px; }
h2 { font-size: 16px; margin: 20px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 12px 0; }
.card.gold { border-color: rgba(201,162,75,.45); background: linear-gradient(180deg, rgba(201,162,75,.10), rgba(201,162,75,.02)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; padding: 10px 14px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 14px; min-height: 40px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.btn.good { background: rgba(63,185,80,.15); border-color: rgba(63,185,80,.5); color: #7ee787; }
.btn.bad { background: rgba(240,96,93,.12); border-color: rgba(240,96,93,.5); color: #ff8a86; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.big { min-height: 64px; font-size: 18px; border-radius: 16px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; background: #101013; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); min-height: 42px;
}
textarea { min-height: 80px; resize: vertical; }
label.field { display: block; margin: 8px 0; }
label.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--panel-2); }
.chip.pending { color: var(--amber); border-color: rgba(240,180,41,.4); }
.chip.approved { color: var(--green); border-color: rgba(63,185,80,.4); }
.chip.scheduled { color: var(--blue); border-color: rgba(88,166,255,.4); }
.chip.posted { color: var(--gold-2); border-color: rgba(201,162,75,.5); }
.chip.rejected { color: var(--red); border-color: rgba(240,96,93,.45); }
.chip.uploading { color: var(--muted); }
.chip.warn { color: var(--amber); border-color: rgba(240,180,41,.5); }
.chip.top20 { color: #1a1405; background: var(--gold); border-color: var(--gold); }
.progress { height: 8px; background: #101013; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; background: var(--gold); width: 0%; transition: width .2s; }
.progress.green > div { background: var(--green); }
.counter { display: flex; align-items: baseline; gap: 8px; }
.counter .big { font-size: 44px; font-weight: 800; color: var(--gold-2); line-height: 1; }
.counter .of { font-size: 18px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.stat { background: var(--panel-2); border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); }
.week { display: flex; gap: 6px; align-items: flex-end; height: 56px; margin-top: 10px; }
.week .d { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); height: 100%; justify-content: flex-end; }
.week .bar { width: 100%; background: var(--line); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.week .bar > i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--gold); border-radius: 4px 4px 0 0; }
.dropzone { border: 2px dashed rgba(201,162,75,.5); border-radius: 16px; padding: 22px 14px; text-align: center; background: rgba(201,162,75,.04); }
.dropzone.over { background: rgba(201,162,75,.12); }
.dropzone input { display: none; }
.uplist .item { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.thumb { width: 64px; height: 96px; border-radius: 8px; background: #101013 center/cover no-repeat; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.thumb.wide { width: 96px; height: 96px; }
.list .item { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.list .item .title { font-weight: 600; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; margin: 0 -16px; padding-left: 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); padding: 8px 14px; font-size: 14px; color: var(--muted); }
.tabs button.active { border-color: var(--gold); color: var(--gold-2); background: rgba(201,162,75,.08); }
.tabs button b { color: var(--text); margin-left: 4px; }
.review { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .review { grid-template-columns: 300px 1fr; } }
.player { background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 9/16; max-height: 70vh; display: flex; align-items: center; justify-content: center; }
.player video { width: 100%; height: 100%; object-fit: contain; }
.player .poster { width: 100%; height: 100%; background: center/cover no-repeat; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.player .poster span { background: rgba(0,0,0,.55); border-radius: 999px; padding: 12px 18px; font-weight: 700; }
.meta dl { display: grid; grid-template-columns: 90px 1fr; gap: 4px 8px; margin: 0; font-size: 14px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.product { display: flex; gap: 10px; align-items: center; background: var(--panel-2); border-radius: 10px; padding: 8px; }
.product img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #000; }
.slots .slot { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); align-items: center; }
.slots .slot .t { font-family: ui-monospace, Menlo, monospace; color: var(--muted); }
.slots .slot.empty .t { color: #55555c; }
.slots .slot .cell { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 34px; }
.slots .slot.empty .cell { color: #55555c; font-size: 13px; }
.slots .slot.posted .cell { opacity: .6; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #26262c; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 50; font-size: 14px; max-width: 92vw; }
.toast.bad { background: #5a1e1c; }
.toast.good { background: #1e4a2a; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 720px) { .modal-bg { align-items: center; } }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 16px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; }
@media (min-width: 720px) { .modal { border-radius: 16px; } }
.scanner video { width: 100%; border-radius: 12px; background: #000; max-height: 60vh; object-fit: cover; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.kpi b { font-size: 26px; display: block; }
.kpi span { color: var(--muted); font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; }
.logo { font-size: 26px; font-weight: 800; color: var(--gold); letter-spacing: .02em; }
.logo small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.hint { font-size: 13px; color: var(--muted); }
.warnbox { border: 1px solid rgba(240,180,41,.5); background: rgba(240,180,41,.08); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }
.sr { position: absolute; left: -9999px; }
