:root {
  --bg: #090b12;
  --panel: #111520;
  --panel-2: #171c29;
  --line: #252c3d;
  --text: #f4f6fb;
  --muted: #99a3b8;
  --accent: #7467ff;
  --accent-2: #9b90ff;
  --green: #38d39f;
  --yellow: #ffbe55;
  --red: #ff667d;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 70% -20%, #292059 0, transparent 34%), var(--bg); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #9d94ff88; outline-offset: 2px; }
[hidden] { display: none !important; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; border-right: 1px solid var(--line); background: #0c0f17e8; backdrop-filter: blur(18px); display: flex; flex-direction: column; z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-weight: 750; padding: 0 9px 24px; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(145deg, var(--accent), #ad5cff); box-shadow: 0 10px 35px #755fff45; font-weight: 900; letter-spacing: -.06em; }
.brand-mark.small { width: 35px; height: 35px; border-radius: 10px; font-size: 13px; }
nav { display: grid; gap: 5px; }
nav a { padding: 11px 13px; border-radius: 11px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 650; }
nav a:hover { color: var(--text); background: var(--panel); }
nav a.active { color: white; background: linear-gradient(90deg, #7467ff2b, #7467ff0c); box-shadow: inset 3px 0 var(--accent); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 12px; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px #99a3b815; }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 4px #38d39f20; }
.status-dot.warning { background: var(--yellow); }
main { min-width: 0; }
.topbar { height: 92px; padding: 20px clamp(20px,4vw,52px); display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: #090b1295; backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 4; }
.topbar h1 { font-size: 23px; margin: 1px 0 0; }
.topbar .ghost { margin-left: auto; }
.eyebrow { margin: 0; color: var(--accent-2); font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.content { max-width: 1500px; padding: 32px clamp(20px,4vw,52px) 70px; }
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: linear-gradient(145deg, #141925f2, #10141df2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 16px 60px #0003; }
.card h2, .card h3 { margin-top: 0; }
.card h2 { font-size: 20px; }
.card h3 { font-size: 16px; }
.stat { font-size: clamp(26px, 4vw, 38px); font-weight: 800; margin: 8px 0 0; letter-spacing: -.04em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 7px 0 16px; }
.section-head h2 { margin: 0; font-size: 19px; }
.section-head p { margin: 5px 0 0; }
.badge { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 99px; padding: 5px 9px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.badge.running { color: var(--green); border-color: #38d39f44; background: #38d39f12; }
.badge.paused { color: var(--yellow); border-color: #ffbe5544; }
.badge.finished { color: #b5b9c6; }
.poll-title { font-size: clamp(21px, 3vw, 31px); line-height: 1.2; margin: 10px 0 22px; max-width: 900px; }
.result-row { margin: 14px 0; }
.result-meta { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 10px; align-items: center; margin-bottom: 7px; }
.answer-number { display: grid; place-items: center; width: 27px; height: 27px; background: #7467ff24; color: var(--accent-2); border-radius: 8px; font-weight: 800; }
.result-bar { height: 9px; border-radius: 99px; background: #252b3a; overflow: hidden; }
.result-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #a45dff); transition: width .35s ease; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
button, .button { color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 14px; font-weight: 700; font-size: 13px; }
button:hover, .button:hover { filter: brightness(1.12); }
button.primary, .button.primary { background: linear-gradient(135deg, var(--accent), #8e5cff); border-color: transparent; box-shadow: 0 8px 25px #7467ff2d; }
button.danger { color: #ff9cab; border-color: #ff667d42; background: #ff667d12; }
button.ghost { background: transparent; }
button.wide { width: 100%; padding: 13px; }
.icon-button { display: none; background: transparent; font-size: 22px; padding: 5px; }
label { display: grid; gap: 7px; font-size: 13px; color: #cbd1df; font-weight: 650; }
input, textarea, select { width: 100%; color: var(--text); background: #0d111a; border: 1px solid #2b3345; border-radius: 10px; padding: 11px 12px; }
textarea { min-height: 105px; resize: vertical; line-height: 1.5; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
input[type="color"] { padding: 3px; height: 42px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.check { display: flex; grid-column: 1/-1; align-items: center; gap: 9px; }
.answer-list { display: grid; gap: 9px; margin: 12px 0; }
.answer-input { display: grid; grid-template-columns: 34px 1fr auto auto auto; gap: 7px; align-items: center; }
.answer-input button { padding: 8px 10px; }
.list { display: grid; gap: 11px; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #0e121b; }
.list-item h3, .list-item p { margin: 0; }
.list-item p { margin-top: 5px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.filters { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(130px, 180px)); gap: 10px; margin-bottom: 16px; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.preview-frame { width: 100%; aspect-ratio: 16/9; background: repeating-conic-gradient(#262a33 0 25%, #1b1e26 0 50%) 0/24px 24px; border: 1px solid var(--line); border-radius: 14px; }
.color-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 30; max-width: 390px; padding: 13px 17px; border-radius: 12px; background: #1c2432; border: 1px solid #39445a; box-shadow: 0 18px 50px #0008; transform: translateY(120px); opacity: 0; transition: .25s; }
.toast.show { transform: none; opacity: 1; }
.toast.error { border-color: #ff667d77; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); padding: 34px; border-radius: 22px; background: #121722ed; border: 1px solid var(--line); box-shadow: 0 30px 100px #0008; display: grid; gap: 17px; }
.login-card .brand-mark { margin-bottom: 4px; }
.login-card h1 { margin: -8px 0 0; font-size: 31px; }
.login-card p { margin: 0; line-height: 1.5; }
.form-error { color: #ff91a1; font-size: 13px; }
dialog { border: 0; padding: 0; color: var(--text); background: transparent; }
dialog::backdrop { background: #05070bbd; backdrop-filter: blur(4px); }
.dialog-card { width: min(540px, calc(100vw - 30px)); background: #151a26; border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.dialog-card h2 { margin-top: 0; }
.dialog-card .actions { justify-content: flex-end; }
.winner { color: var(--green); font-weight: 750; }
.test-notice { border-color: #ffbe5555; background: #ffbe550c; }
@media (max-width: 980px) {
  .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .color-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; transform: translateX(-105%); transition: .22s; width: 260px; box-shadow: 20px 0 80px #000c; }
  .sidebar.open { transform: none; }
  .icon-button { display: block; }
  .topbar { height: 78px; padding: 15px 18px; }
  .content { padding: 22px 15px 55px; }
  .field-grid, .filters { grid-template-columns: 1fr; }
  .answer-input { grid-template-columns: 32px 1fr auto; }
  .answer-input .move { display: none; }
  .result-meta { grid-template-columns: 28px 1fr auto; }
  .result-meta .votes { display: none; }
  .list-item { align-items: flex-start; flex-direction: column; }
}
