/* ===== BillBoard admin — tema scuro ===== */
:root {
  --bg: #0a0f1e; --bg-2: #0e1428; --surface: #131a2e; --surface-2: #182036; --surface-3: #1f2942;
  --line: #232d47; --line-2: #2e3a5a; --text: #eef2ff; --text-2: #b6c0da; --muted: #7c88a8;
  --accent: #6d7cff; --accent-2: #a06bff; --accent-soft: rgba(109,124,255,.14); --accent-ring: rgba(109,124,255,.45);
  --ok: #34d399; --ok-soft: rgba(52,211,153,.14); --warn: #fbbf24; --warn-soft: rgba(251,191,36,.12);
  --danger: #f87171; --danger-soft: rgba(248,113,113,.14); --off: #5b6785;
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --sh: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.35);
  --sh-lg: 0 24px 60px rgba(0,0,0,.5);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font);
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --t: 160ms cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 500px at 15% -10%, rgba(109,124,255,.16), transparent 60%),
              radial-gradient(700px 400px at 100% 0%, rgba(160,107,255,.10), transparent 60%); }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: 1.7rem; line-height: 1.2; } h3 { font-size: 1.05rem; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: .82rem; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.error { color: var(--danger); min-height: 1.2em; font-size: .88rem; }
.hidden { display: none !important; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ----- form controls ----- */
label { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; color: var(--text-2); font-weight: 500; }
input, select, textarea { font: inherit; color: var(--text); padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--bg-2); min-width: 0; width: 100%; transition: border-color var(--t), box-shadow var(--t), background var(--t); }
input::placeholder, textarea::placeholder { color: #5f6b8c; }
input:hover, select:hover, textarea:hover { border-color: #3a4870; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237c88a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
input[type="color"] { padding: 3px; height: 38px; width: 46px; cursor: pointer; }
input[type="range"] { padding: 0; border: 0; accent-color: var(--accent); background: none; height: 28px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
input[type="number"] { font-family: var(--font-mono); font-size: .85rem; }
textarea { resize: vertical; min-height: 64px; }
.code-input { font-family: var(--font-mono); letter-spacing: .22em; text-transform: uppercase; font-size: 1.25rem; text-align: center; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----- buttons ----- */
.btn { font: inherit; font-weight: 600; font-size: .88rem; padding: 9px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; transition: background var(--t), border-color var(--t), transform var(--t), box-shadow var(--t), opacity var(--t); }
.btn:hover { background: var(--surface-3); border-color: #3a4870; }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(109,124,255,.3); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 8px 22px rgba(109,124,255,.4); }
.btn.soft { background: var(--accent-soft); color: #aab4ff; border-color: transparent; }
.btn.soft:hover { background: rgba(109,124,255,.22); }
.btn.danger { color: var(--danger); border-color: rgba(248,113,113,.3); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.block { width: 100%; justify-content: center; }
.btn.lg { min-height: 44px; font-size: .95rem; }
.btn.sm { padding: 5px 10px; font-size: .8rem; min-height: 30px; }
.btn.icon { padding: 0; width: 36px; height: 36px; min-height: 0; justify-content: center; }
.btn.icon.sm { width: 30px; height: 30px; }
.btn:disabled { opacity: .35; cursor: default; transform: none; }

/* ----- brand ----- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px rgba(109,124,255,.45); }
.brand-mark .ic { width: 18px; height: 18px; }

/* ----- login ----- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; }
.login-glow { position: absolute; width: 700px; height: 700px; border-radius: 50%; filter: blur(120px); opacity: .35; pointer-events: none;
  background: conic-gradient(from 90deg, var(--accent), var(--accent-2), #22d3ee, var(--accent)); animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-card { position: relative; background: rgba(19,26,46,.9); backdrop-filter: blur(12px); border: 1px solid var(--line-2); padding: 36px 32px; border-radius: 20px;
  box-shadow: var(--sh-lg); width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { margin-top: 12px; }

/* ----- layout ----- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: rgba(10,15,30,.7); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh; backdrop-filter: blur(10px); }
.sidebar .brand { padding: 0 8px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.server-info { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: .78rem; color: var(--muted); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { font: inherit; font-weight: 500; font-size: .92rem; text-align: left; background: none; border: 0; color: var(--text-2); padding: 11px 12px; border-radius: 10px;
  cursor: pointer; display: flex; align-items: center; gap: 12px; transition: background var(--t), color var(--t); position: relative; }
.nav .ic { width: 19px; height: 19px; }
.nav:hover { background: var(--surface-2); color: var(--text); }
.nav.active { background: var(--accent-soft); color: #fff; }
.nav.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2)); }
.nav.subtle { color: var(--muted); }
.pill { margin-left: auto; background: var(--surface-3); color: var(--text-2); font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; font-family: var(--font-mono); }
.pill:empty { display: none; }
.content { padding: 36px 40px 90px; max-width: 1480px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-title { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-2); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row input, .row select { flex: 1 1 140px; width: auto; }
.row.inline { background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 10px; margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.empty { text-align: center; padding: 56px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty.small { padding: 30px; }
.empty-art { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); margin-bottom: 8px; }
.empty-art .ic { width: 28px; height: 28px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); display: inline-block; }
.dot.live { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(109,124,255,.6); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(109,124,255,0); } 100% { box-shadow: 0 0 0 0 rgba(109,124,255,0); } }

/* ----- stats ----- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.stat-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-value.ok { color: var(--ok); } .stat-value.accent { color: #aab4ff; }

/* ----- schermi ----- */
.pending-panel { margin-bottom: 20px; border-color: rgba(109,124,255,.35); background: linear-gradient(135deg, var(--surface), rgba(109,124,255,.06)); }
.pending { display: flex; gap: 10px; flex-wrap: wrap; }
.pending .chip { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px 10px 16px; display: flex; align-items: center; gap: 16px; }
.pending .chip code { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 700; letter-spacing: .18em; color: #fff; }
.pending .chip .meta { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.pending .none { color: var(--muted); font-size: .88rem; }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dev-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); padding: 18px; display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden; transition: border-color var(--t), transform var(--t); }
.dev-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--off); }
.dev-card.online::before { background: linear-gradient(90deg, var(--ok), #22d3ee); }
.dev-card:hover { border-color: var(--line-2); }
.dev-top { display: flex; justify-content: space-between; align-items: center; }
.status { font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--off); }
.status.on { background: var(--ok-soft); color: var(--ok); } .status.on::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dev-card .dev-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; background: transparent; border-color: transparent; padding: 6px 8px; margin: 0 -8px; }
.dev-card .dev-name:hover { border-color: var(--line-2); background: var(--bg-2); }
.dev-meta { font-size: .78rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.dev-meta span { display: inline-flex; align-items: center; gap: 5px; }
.dev-meta .ic { width: 14px; height: 14px; }
.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(251,191,36,.3); border-radius: var(--r-sm); padding: 8px 10px; font-size: .8rem; display: flex; gap: 8px; align-items: flex-start; }
.warn .ic { width: 16px; height: 16px; margin-top: 1px; }

/* ----- playlist ----- */
.split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.pl-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 24px; }
.pl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pl-list li { border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: background var(--t); border: 1px solid transparent; }
.pl-list li:hover { background: var(--surface-2); }
.pl-list li.active { background: var(--accent-soft); border-color: rgba(109,124,255,.35); }
.pl-list li .ic { width: 16px; height: 16px; color: var(--muted); }
.pl-list li.active .ic { color: #aab4ff; }
.pl-list li .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-list li .count { color: var(--muted); font-size: .74rem; white-space: nowrap; font-family: var(--font-mono); }
.pl-list li.none { color: var(--muted); cursor: default; }
.editor { min-height: 420px; }
.editor.placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.editor-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.title-input { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; flex: 1; min-width: 200px; background: transparent; border-color: transparent; padding: 6px 8px; margin-left: -8px; width: auto; }
.title-input:hover { border-color: var(--line-2); background: var(--bg-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.add-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 18px 0 12px; }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); overflow: hidden; transition: border-color var(--t); }
.item:hover { border-color: var(--line-2); }
.item-main { display: grid; grid-template-columns: 28px 80px 1fr auto auto; gap: 14px; align-items: center; padding: 10px 12px; }
.item-num { color: var(--muted); font-weight: 700; font-size: .78rem; text-align: center; font-family: var(--font-mono); }
.thumb { width: 80px; height: 50px; border-radius: 8px; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); border: 1px solid var(--line); }
.thumb .ic { width: 20px; height: 20px; }
.thumb.t-video { color: #f9a8d4; } .thumb.t-url { color: #67e8f9; } .thumb.t-text { color: #fcd34d; }
.item-label { overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.item-label .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.item-label .type { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.item-label .badge { background: var(--accent-soft); color: #aab4ff; font-size: .7rem; padding: 1px 8px; border-radius: 999px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.dur { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.dur input { width: 68px; padding: 6px 8px; text-align: center; }
.ctrl { display: flex; gap: 4px; align-items: center; }
.ctrl .btn.on { background: var(--accent-soft); color: #aab4ff; border-color: rgba(109,124,255,.35); }
.item-opts { border-top: 1px solid var(--line); background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 22px; }
.preview-wrap { display: flex; flex-direction: column; align-items: center; }
.preview { position: relative; width: 100%; max-width: 720px; aspect-ratio: 16/9; background: #000; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.5); border: 1px solid var(--line-2); }
.preview.portrait { aspect-ratio: 9/16; max-width: 300px; }
.preview-cap { font-size: .74rem; color: var(--muted); text-align: center; margin-top: 8px; }
.opts-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; align-content: start; }
.opts-form .full { grid-column: 1 / -1; }
.opts-form .wide { grid-column: span 2; }
.opts-form .check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 500; min-height: 38px; align-self: end; }
.overlay-block .opts-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts-form .range { display: grid; grid-template-columns: 1fr 52px; gap: 8px; align-items: center; }
.opts-form output { font-size: .78rem; color: var(--text-2); text-align: right; font-family: var(--font-mono); }
.opts-form .colors { display: flex; gap: 10px; align-items: center; }
.opts-form .colors span { font-size: .78rem; color: var(--muted); }
.opts-section { grid-column: 1 / -1; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-2); font-weight: 700; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.opts-section .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.seg { display: flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; background: var(--bg-2); }
.seg button { flex: 1 1 auto; font: inherit; font-size: .82rem; font-weight: 500; background: transparent; border: 0; padding: 8px 10px; cursor: pointer; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: background var(--t), color var(--t); }
.seg button .ic { width: 15px; height: 15px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent-soft); color: #fff; }
.box-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.overlay-block { border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px; background: var(--bg-2); }
.overlay-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.overlay-head .opts-section { border: 0; margin: 0; padding: 0; }

/* Editor interattivo nell'anteprima */
.preview .bb-edit { cursor: move; outline: 1px dashed rgba(255,255,255,.55); outline-offset: -1px; touch-action: none; }
.preview .bb-edit:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.preview .bb-handle { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; background: var(--accent); border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; z-index: 3; }
.preview .bb-text { z-index: 2; }

/* ----- media ----- */
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: 28px; text-align: center; color: var(--muted); margin-bottom: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; transition: border-color var(--t), background var(--t), color var(--t); }
.dropzone .ic { width: 26px; height: 26px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: #aab4ff; }
.progress { display: flex; align-items: center; gap: 10px; color: var(--text-2); margin-bottom: 14px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: border-color var(--t), transform var(--t), box-shadow var(--t); position: relative; }
.tile.clickable { cursor: pointer; }
.tile.clickable:hover, .tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.tile .pv { aspect-ratio: 16/10; background: #05070f; display: grid; place-items: center; overflow: hidden; position: relative; }
.tile .pv img, .tile .pv video { width: 100%; height: 100%; object-fit: cover; }
.tile .pv .kind { position: absolute; top: 8px; left: 8px; background: rgba(5,7,15,.7); backdrop-filter: blur(4px); color: #fff; font-size: .66rem; font-weight: 700; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; display: inline-flex; gap: 5px; align-items: center; }
.tile .pv .kind .ic { width: 12px; height: 12px; }
.tile .info { padding: 9px 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile .info .name { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.tile .info .size { font-size: .72rem; color: var(--muted); white-space: nowrap; font-family: var(--font-mono); }
.tile .del { opacity: 0; transition: opacity var(--t); }
.tile:hover .del { opacity: 1; }

/* ----- modali e toast ----- */
.modal { position: fixed; inset: 0; background: rgba(3,6,16,.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; z-index: 40; animation: fade 160ms ease-out; }
.modal-box { background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; width: 100%; max-width: 900px; max-height: 85vh; overflow: auto; padding: 22px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: var(--sh-lg); animation: rise 200ms cubic-bezier(.2,.7,.2,1); }
.modal-box.narrow { max-width: 420px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--surface-3); color: #fff; border: 1px solid var(--line-2); padding: 11px 18px; border-radius: 10px; z-index: 50;
  box-shadow: var(--sh-lg); font-weight: 500; animation: rise 200ms cubic-bezier(.2,.7,.2,1); }
.toast.err { background: #3b1a1a; border-color: rgba(248,113,113,.4); }

/* ----- responsive ----- */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 12px 16px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { flex-direction: row; } .nav.active::before { display: none; } .sidebar-foot { border: 0; padding: 0; flex-direction: row; } .server-info { display: none; }
  .nav span:not(.pill) { display: none; } .nav { padding: 10px; }
  .content { padding: 20px 16px 60px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; } .pl-side { position: static; }
  .opts-form, .overlay-block .opts-form { grid-template-columns: 1fr 1fr; } .opts-form .wide { grid-column: 1 / -1; } .box-grid { grid-template-columns: repeat(2, 1fr); }
  .item-main { grid-template-columns: 24px 64px 1fr; } .item-main .dur, .item-main .ctrl { grid-column: 2 / -1; }
}
.img-pick { display: flex; align-items: center; gap: 10px; }
.img-pick img { width: 64px; height: 40px; object-fit: contain; border-radius: 6px; background: repeating-conic-gradient(#2a3350 0 25%, #1c2440 0 50%) 0 0 / 12px 12px; border: 1px solid var(--line-2); }
.img-empty { width: 64px; height: 40px; border-radius: 6px; border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); }
.add-widgets { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.info { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.info .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.info .v { font-weight: 600; margin-top: 2px; word-break: break-all; font-variant-numeric: tabular-nums; }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.cmd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cmd-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: .85rem; }
.cmd-list .st { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.cmd-list .st.done { background: var(--ok-soft); color: var(--ok); } .cmd-list .st.failed { background: var(--danger-soft); color: var(--danger); } .cmd-list .st.sent { background: var(--warn-soft); color: var(--warn); }
.cmd-list .out { color: var(--muted); font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.manage-section { margin-top: 18px; }
.manage-section h4 { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); }
.dev-actions { display: flex; gap: 6px; }
.manage-section .row { align-items: center; }
.manage-section .row input[type="checkbox"] { flex: none; width: 18px; }
.manage-section .row .check { flex: 0 0 auto; margin: 0; }
