@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #09090f;
  --bg2: #0e0e16;
  --surface: #13131d;
  --surface2: #191926;
  --surface3: #212132;
  --line: rgba(255, 255, 255, 0.07);
  --line2: rgba(255, 255, 255, 0.12);
  --text: #ececf4;
  --muted: #8f8fa8;
  --dim: #5f5f78;
  --accent: #7c5cff;
  --accent2: #ff4d8d;
  --grad: linear-gradient(135deg, #7c5cff 0%, #b84dff 50%, #ff4d8d 100%);
  --live: #ff3b5c;
  --ok: #2ee6a6;
  --warn: #ffb547;
  --info: #4db8ff;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(124, 92, 255, 0.4); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #262638; border-radius: 10px; border: 2px solid var(--bg); }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  background: var(--bg2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; box-shadow: 0 8px 24px -8px rgba(124, 92, 255, 0.8);
}
.logo-mark svg { width: 22px; height: 22px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500; transition: 0.15s;
}
.nav a svg { width: 18px; height: 18px; opacity: 0.85; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav a.active { color: var(--text); background: var(--surface2); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.active svg { color: #a48dff; opacity: 1; }
.nav .sep { height: 1px; background: var(--line); margin: 12px 10px; }
.nav .count { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 20px; background: rgba(255, 59, 92, 0.15); color: var(--live); font-weight: 600; }
.side-foot { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.side-foot .row { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface3); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 18px 32px; background: rgba(9, 9, 15, 0.8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.page { padding: 28px 32px 60px; max-width: 1440px; }
.menu-btn { display: none; }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card.pad { padding: 20px; }
.card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 650; }
.card .hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 14px; }
.section-title h2 { font-size: 15px; margin: 0; font-weight: 650; }
.section-title .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--surface2); cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: 0.15s;
}
.btn:hover { background: var(--surface3); border-color: rgba(255, 255, 255, 0.18); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 8px 24px -10px rgba(160, 80, 255, 0.9); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.live { background: var(--live); border: 0; color: #fff; box-shadow: 0 8px 24px -10px rgba(255, 59, 92, 0.9); }
.btn.go { background: var(--ok); color: #04261a; border: 0; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.btn.danger { color: #ff7d93; }
.btn.danger:hover { background: rgba(255, 59, 92, 0.12); border-color: rgba(255, 59, 92, 0.3); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 30px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: #c4c4d6; }
.field .help { font-size: 12px; color: var(--dim); }
.input, select.input, textarea.input {
  height: 40px; width: 100%; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--bg2); outline: none; transition: 0.15s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238f8fa8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input[type='color'].input { padding: 4px; width: 56px; }
input[type='range'] { accent-color: var(--accent); width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.small { font-size: 12.5px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* segmented / chips */
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--bg2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.seg button.on { background: var(--surface3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; border-radius: 30px; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.chip.on { border-color: transparent; background: rgba(124, 92, 255, 0.18); color: #c9bbff; box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.5); }
.tag { display: inline-flex; padding: 2px 8px; border-radius: 6px; background: var(--surface3); color: var(--muted); font-size: 11.5px; font-weight: 600; }

/* switch */
.switch { display: inline-block; vertical-align: middle; position: relative; width: 38px; height: 22px; flex-shrink: 0; cursor: pointer; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: var(--surface3); transition: 0.2s; box-shadow: inset 0 0 0 1px var(--line2); }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #9a9ab3; transition: 0.2s; }
.switch input:checked + span { background: var(--accent); box-shadow: none; }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .t { font-weight: 600; }
.toggle-row .d { font-size: 12.5px; color: var(--muted); }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 30px; font-size: 12px; font-weight: 650; text-transform: capitalize; background: var(--surface3); color: var(--muted); }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live { background: rgba(255, 59, 92, 0.14); color: #ff6b84; }
.pill.live::before { animation: pulse 1.4s infinite; }
.pill.starting, .pill.connecting, .pill.reconnecting, .pill.degraded { background: rgba(255, 181, 71, 0.13); color: var(--warn); }
.pill.scheduled { background: rgba(77, 184, 255, 0.13); color: var(--info); }
.pill.failed, .pill.error { background: rgba(255, 59, 92, 0.14); color: #ff6b84; }
.pill.healthy, .pill.ready, .pill.ok { background: rgba(46, 230, 166, 0.12); color: var(--ok); }
.pill.processing, .pill.uploading, .pill.importing { background: rgba(124, 92, 255, 0.15); color: #b6a4ff; }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 59, 92, 0.6); } 50% { opacity: 0.6; box-shadow: 0 0 0 5px rgba(255, 59, 92, 0); } }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .k { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .v { font-size: 28px; font-weight: 750; letter-spacing: -0.03em; margin-top: 6px; }
.kpi .s { font-size: 12px; color: var(--dim); margin-top: 2px; }
.kpi .glow { position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; filter: blur(40px); opacity: 0.25; }
.bar { height: 6px; border-radius: 6px; background: var(--surface3); overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: 6px; transition: width 0.4s; }

/* stream cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.scard { overflow: hidden; cursor: pointer; transition: 0.2s; }
.scard:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: var(--shadow); }
.scard .thumb { aspect-ratio: 16/9; background: var(--bg2) center/cover; position: relative; }
.scard .thumb .pill { position: absolute; top: 12px; left: 12px; backdrop-filter: blur(10px); background: rgba(0, 0, 0, 0.55); }
.scard .thumb .pill.live { background: rgba(255, 59, 92, 0.9); color: #fff; }
.scard .thumb .meta { position: absolute; bottom: 10px; right: 10px; }
.scard .body { padding: 14px 16px 16px; }
.scard .name { font-weight: 650; font-size: 15px; }
.scard .np { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); font-weight: 650; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: rgba(255, 255, 255, 0.02); }

/* library */
.dropzone {
  border: 1.5px dashed rgba(124, 92, 255, 0.4); border-radius: var(--r); padding: 30px; text-align: center;
  background: radial-gradient(ellipse at top, rgba(124, 92, 255, 0.08), transparent 70%); transition: 0.2s; cursor: pointer;
}
.dropzone.over { border-color: var(--accent); background: rgba(124, 92, 255, 0.12); }
.dropzone .big { font-weight: 650; font-size: 15px; margin-top: 10px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.vcard { overflow: hidden; position: relative; }
.vcard .thumb { aspect-ratio: 16/9; background: var(--bg2) center/cover no-repeat; position: relative; display: grid; place-items: center; color: var(--dim); }
.vcard .thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, 0.75); padding: 1px 7px; border-radius: 6px; font: 600 11.5px var(--mono); color: #fff; }
.vcard .thumb .kind { position: absolute; left: 8px; top: 8px; }
.vcard .thumb .kind .pill { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(6px); }
.vcard .body { padding: 10px 12px 12px; }
.vcard .name { font-weight: 600; font-size: 13px; }
.vcard .acts { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: 0.15s; }
.vcard:hover .acts { opacity: 1; }
.vcard .acts .btn { background: rgba(0, 0, 0, 0.7); border-color: transparent; backdrop-filter: blur(6px); }
.vcard.sel { box-shadow: 0 0 0 2px var(--accent); }
.vcard .check { position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; border-radius: 7px; background: rgba(0, 0, 0, 0.6); border: 1.5px solid rgba(255, 255, 255, 0.5); display: grid; place-items: center; }
.vcard.sel .check { background: var(--accent); border-color: var(--accent); }

/* upload queue */
.uq { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.uq .u { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface2); }

/* playlist */
.plist { display: flex; flex-direction: column; gap: 6px; }
.pitem {
  display: grid; grid-template-columns: 20px 24px 88px 1fr auto; gap: 12px; align-items: center;
  padding: 8px 10px; border-radius: 12px; background: var(--surface2); border: 1px solid transparent; transition: 0.15s;
}
.pitem:hover { border-color: var(--line2); }
.pitem.playing { border-color: rgba(255, 59, 92, 0.5); background: linear-gradient(90deg, rgba(255, 59, 92, 0.1), var(--surface2) 60%); }
.pitem.off { opacity: 0.45; }
.pitem.dragging { opacity: 0.4; }
.pitem.over { box-shadow: 0 -2px 0 var(--accent); }
.pitem .grip { cursor: grab; color: var(--dim); display: grid; place-items: center; }
.pitem .idx { font: 600 12px var(--mono); color: var(--dim); text-align: center; }
.pitem .th { width: 88px; aspect-ratio: 16/9; border-radius: 8px; background: var(--bg2) center/cover; }
.pitem .opts { display: flex; gap: 6px; align-items: center; }
.pitem .mini { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pitem .mini input { width: 70px; height: 26px; font-size: 12px; padding: 0 8px; border-radius: 7px; }

/* editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.monitor { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; }
.player { aspect-ratio: 16/9; background: #000; border-radius: var(--r); overflow: hidden; position: relative; border: 1px solid var(--line); }
.player video { width: 100%; height: 100%; object-fit: contain; display: block; }
.player .ph { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--dim); font-size: 13px; background: radial-gradient(circle at 50% 40%, #16162a, #050508); }
.player .badge { position: absolute; top: 12px; left: 12px; }
.np-card { padding: 14px 16px; }
.progress { height: 4px; border-radius: 4px; background: var(--surface3); overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--live); transition: width 1s linear; }
.dest-health { display: flex; flex-direction: column; }
.dest-health .d { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
.logbox { max-height: 260px; overflow: auto; padding: 8px 0; font: 12px/1.55 var(--mono); }
.logbox .l { padding: 3px 16px; display: flex; gap: 10px; }
.logbox .l .t { color: var(--dim); flex-shrink: 0; }
.logbox .l.warn { color: var(--warn); }
.logbox .l.error { color: #ff7d93; }

/* destinations */
.plat { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; flex-shrink: 0; }
.dcard { padding: 16px 18px; display: flex; align-items: center; gap: 14px; }

/* modal */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(3, 3, 8, 0.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade 0.15s; }
.modal { width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--line2); border-radius: 18px; box-shadow: var(--shadow); animation: pop 0.18s ease-out; }
.modal.wide { max-width: 980px; }
.modal .mh { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal .mh h3 { margin: 0; font-size: 16px; }
.modal .mb { padding: 22px; }
.modal .mf { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* toast */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--surface3); border: 1px solid var(--line2); box-shadow: var(--shadow); max-width: 380px; animation: pop 0.2s; font-weight: 500; }
.toast.err { border-color: rgba(255, 59, 92, 0.5); }
.toast.ok { border-color: rgba(46, 230, 166, 0.4); }

/* empty */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .ico { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface2); border: 1px solid var(--line); color: #a48dff; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 16px; }

/* chart */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.chart .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .c i { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--grad); min-height: 2px; transition: height 0.5s; position: relative; }
.chart .c i:hover::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -6px); background: var(--surface3); padding: 2px 8px; border-radius: 6px; font-size: 11.5px; white-space: nowrap; }
.chart .c span { font-size: 10.5px; color: var(--dim); }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .art { position: relative; overflow: hidden; background: #07070d; display: flex; flex-direction: column; justify-content: space-between; padding: 44px; }
.auth .art::before { content: ''; position: absolute; width: 700px; height: 700px; border-radius: 50%; background: radial-gradient(circle, rgba(124, 92, 255, 0.45), transparent 60%); top: -200px; left: -150px; filter: blur(20px); }
.auth .art::after { content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 77, 141, 0.3), transparent 60%); bottom: -250px; right: -150px; filter: blur(20px); }
.auth .art > * { position: relative; z-index: 1; }
.auth .art h2 { font-size: 44px; line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 16px; max-width: 520px; }
.auth .art p { color: #b3b3c9; max-width: 440px; font-size: 15px; }
.auth .form { display: grid; place-items: center; padding: 40px; }
.auth .form > div { width: 100%; max-width: 380px; }
.auth h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 6px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.live-mock { border-radius: 16px; border: 1px solid var(--line2); background: rgba(19, 19, 29, 0.7); backdrop-filter: blur(10px); padding: 16px; max-width: 420px; }

.codeblock { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font: 12.5px/1.6 var(--mono); overflow: auto; white-space: pre; color: #c9c9e0; }
.keybox { background: rgba(46, 230, 166, 0.08); border: 1px solid rgba(46, 230, 166, 0.3); padding: 12px; border-radius: 10px; font: 13px var(--mono); word-break: break-all; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1200px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .monitor { position: static; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; width: 260px; transform: translateX(-100%); transition: 0.25s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: inline-flex; }
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth .art { display: none; }
  .pitem { grid-template-columns: 18px 64px 1fr; }
  .pitem .idx { display: none; }
  .pitem .th { width: 64px; }
  .pitem .opts { grid-column: 1 / -1; justify-content: flex-end; }
  .topbar .actions .btn span.lbl-hide { display: none; }
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar .actions { margin-left: auto; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi .v { font-size: 22px; }
}
