:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --bg-2: #0d0d0d;
  --panel: #141414;
  --panel-2: #1a1a1a;
  --surface: #0f0f0f;
  --line: #232323;
  --line-2: #1f1f1f;
  --line-strong: #2a2a2a;
  --text: #ededed;
  --muted: #8a8a8a;
  --muted-2: #6f6f6f;
  --accent: #d4ff3a;
  --accent-hover: #c0eb1f;
  --accent-soft: rgba(212, 255, 58, 0.12);
  --accent-soft-2: rgba(212, 255, 58, 0.06);
  --accent-ring: rgba(212, 255, 58, 0.28);
  --green: #8be15a;
  --cyan: #7dd3fc;
  --amber: #f5b83d;
  --red: #fb7185;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 12px 32px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  padding: 22px;
  border-right: 1px solid var(--line-2);
  background: #0c0c0c;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0a;
  flex-shrink: 0;
}
.brand-mark svg { display: block; }
.brand-title { font-weight: 800; letter-spacing: -0.01em; font-size: 15px; }
.brand-subtitle, .muted, .subtitle { color: var(--muted); font-size: 13px; }
.nav { display: grid; gap: 4px; }
.nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.nav-item:hover {
  background: var(--panel-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 700;
  border-color: var(--accent);
}
.side-card {
  margin-top: 24px;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}
.side-logout {
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.side-logout:hover {
  background: var(--panel-2);
  border-color: var(--line-strong);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.main { padding: 28px; overflow: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 20px; }
h1 { margin: 0 0 6px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.subhead { margin: 0 0 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}
.btn:hover { border-color: var(--line-strong); background: #1f1f1f; }
.btn.primary {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
  font-weight: 700;
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.4);
  color: #fecdd3;
}
.btn.danger:hover { background: rgba(251, 113, 133, 0.18); border-color: rgba(251, 113, 133, 0.6); }
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn.ghost:hover { background: var(--panel-2); border-color: var(--line-strong); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.status-strip, .grid, .two-col { display: grid; gap: 12px; margin-bottom: 14px; }
.status-strip { grid-template-columns: minmax(180px, 1.4fr) repeat(4, 1fr); }
.cards { grid-template-columns: repeat(4, 1fr); }
.two-col { grid-template-columns: 1.15fr .85fr; }
.two-col.tight { grid-template-columns: 1fr 1fr; margin-bottom: 0; }
.two-col.tight.proxies-grid {
  grid-template-columns: minmax(0, 80%) minmax(0, 20%);
  gap: 10px;
  align-items: start;
}
.two-col.tight.proxies-grid > * { min-width: 0; }

.status-pill, .small-stat, .metric, .panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.status-pill {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--muted);
}
.status-pill.running .dot { background: var(--accent); animation: pulse 1.4s infinite; }
.status-pill.dry .dot { background: var(--amber); animation: pulse-amber 1.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(212, 255, 58, .55); }
  100% { box-shadow: 0 0 0 12px rgba(212, 255, 58, 0); }
}
@keyframes pulse-amber {
  0% { box-shadow: 0 0 0 0 rgba(245, 184, 61, .55); }
  100% { box-shadow: 0 0 0 12px rgba(245, 184, 61, 0); }
}

.small-stat, .metric { padding: 18px; }
.small-stat span, .metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.small-stat strong { font-size: 22px; font-weight: 700; color: var(--text); }
.metric strong {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.panel { padding: 18px; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }

.input {
  width: 240px; max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.input::placeholder { color: var(--muted-2); }

.field { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.field input, .field textarea, .field select, .setting-row input, .setting-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field textarea:focus, .field select:focus, .setting-row input:focus, .setting-row select:focus, .input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field select {
  background-color: var(--surface);
  color-scheme: dark;
}
select option { background: #141414; color: var(--text); }
.checkbox-field { grid-template-columns: 1fr auto; align-items: center; }
.checkbox-field input { width: 18px; height: 18px; }
.field textarea { min-height: 92px; resize: vertical; font-family: inherit; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 12px; }
.check-list {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
}
.check-list.compact { max-height: none; padding: 8px; }
.check-list label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.check-list input { width: 16px; height: 16px; }
input[type="checkbox"] { accent-color: var(--accent); }
.setting-row input[type="checkbox"] { width: 18px; height: 18px; }
.setting-row input:not([type="checkbox"]), .setting-row select { max-width: 220px; text-align: right; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
.accounts-table { min-width: 1180px; }
.accounts-table th,
.accounts-table td {
  padding-left: 8px;
  padding-right: 8px;
}
th, td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}
th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
th[data-sort] {
  cursor: pointer;
  user-select: none;
  transition: color .15s ease;
}
th[data-sort]:hover,
th[data-sort].sort-active {
  color: var(--text);
}
th[data-sort]::after {
  content: attr(data-sort-indicator);
  display: inline-block;
  width: 12px;
  margin-left: 5px;
  color: var(--accent);
  font-size: 11px;
}
tr:hover td { background: var(--accent-soft-2); }
.account-row { cursor: pointer; }
.account-row.expanded td { background: var(--accent-soft); }
.account-details td { background: rgba(255, 255, 255, 0.015); white-space: normal; }
.checkbox-col {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  text-align: center;
}
.checkbox-col input {
  width: 16px;
  height: 16px;
}
.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 12px;
}
.bulk-summary {
  color: var(--muted);
  font-size: 13px;
}
.details-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); gap: 12px; }
.nested-table { min-width: 520px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 600;
}
.badge.SUCCESS, .badge.READY {
  color: var(--green);
  border-color: rgba(139, 225, 90, 0.32);
  background: rgba(139, 225, 90, 0.08);
}
.badge.ACTIVE, .badge.IN_USE {
  color: var(--cyan);
  border-color: rgba(125, 211, 252, 0.32);
  background: rgba(125, 211, 252, 0.08);
}
.badge.WAITING_SLOT, .badge.COOLDOWN {
  color: var(--amber);
  border-color: rgba(245, 184, 61, 0.32);
  background: rgba(245, 184, 61, 0.08);
}
.badge.IP {
  color: var(--amber);
  border-color: rgba(245, 184, 61, 0.5);
  background: rgba(245, 184, 61, 0.12);
}
.badge.BROKEN, .badge.TRANSPORT, .badge.OFF {
  color: var(--red);
  border-color: rgba(251, 113, 133, 0.32);
  background: rgba(251, 113, 133, 0.08);
}

.feed { display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.stack { display: grid; gap: 8px; }
.event {
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: #d6d6d6;
  font-size: 13px;
  line-height: 1.45;
}
.placeholder { color: var(--muted); line-height: 1.5; }
.pool-card, .setting-card {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface);
}
#proxyPools .pool-card { padding: 12px; }
#proxyPools .event { overflow-wrap: anywhere; }
.pool-missing { border-color: rgba(245, 184, 61, 0.45); background: rgba(245, 184, 61, 0.05); }
.pool-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  margin-bottom: 6px;
}
.row-actions { display: inline-flex; gap: 6px; align-items: center; }
.row-actions.vertical { display: grid; gap: 5px; align-items: stretch; }
.v-list { display: grid; gap: 3px; white-space: normal; }
.v-list span { display: block; }
.mini-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.mini-btn:hover { border-color: var(--accent); background: #1f1f1f; }
.mini-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.danger-text {
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.32);
  background: rgba(251, 113, 133, 0.06);
}
.danger-text:hover {
  border-color: rgba(251, 113, 133, 0.6);
  background: rgba(251, 113, 133, 0.12);
}

.expiry-ok { color: var(--green); font-weight: 700; }
.expiry-warning { color: var(--amber); font-weight: 800; }
.expiry-danger { color: var(--red); font-weight: 800; }
.expiry-muted { color: var(--muted); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}
.settings-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}
.collapsible-block {
  min-width: 0;
}
.collapse-head {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 0 0 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.collapse-head span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.collapse-icon {
  color: var(--accent);
  font-weight: 800;
}
.collapse-body.collapsed {
  display: none;
}
.error-legend {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.error-legend div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
}
.error-legend strong {
  color: var(--text);
}
.setting-card h2 { margin-bottom: 12px; }
.scheduler-mode-card { gap: 10px; display: grid; }
.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}
.mode-option {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.mode-option input { display: none; }
.mode-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.capacity-card .setting-row strong {
  font-variant-numeric: tabular-nums;
}
.setting-block {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line-2);
}
.setting-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line-2);
  font-size: 13px;
}
.setting-row span { color: var(--muted); }
.setting-row strong { text-align: right; color: var(--text); font-weight: 600; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}
.modal.hidden { display: none; }
.modal-card {
  width: min(920px, 100%);
  max-height: 88vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.message-card { width: min(560px, 100%); }
.message-body {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: #d6d6d6;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.message-body.success { border-color: rgba(139, 225, 90, 0.32); background: rgba(139, 225, 90, 0.06); }
.message-body.warn { border-color: rgba(245, 184, 61, 0.36); background: rgba(245, 184, 61, 0.06); }
.message-body.error { border-color: rgba(251, 113, 133, 0.42); background: rgba(251, 113, 133, 0.07); color: #fecdd3; }
.message-body ul { margin: 0; padding-left: 18px; }
.message-body code { white-space: normal; }
.modal-actions { justify-content: flex-end; margin-top: 14px; }
.issue-warning { border-color: rgba(245, 184, 61, 0.4); background: rgba(245, 184, 61, 0.05); }
.issue-error, .issue-danger {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.06);
  color: #fecdd3;
}
.hidden { display: none !important; }

/* Скроллбары в фирменном стиле */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1f1f1f; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #2a2a2a; background-clip: padding-box; border: 2px solid transparent; }

/* ============================================
   Дашборд: hero-row, KPI, combo-карточки, slot-bar
   ============================================ */

.hero-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.hero-status {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-status::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212, 255, 58, 0.04), transparent 60%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.hero-status.running::before { opacity: 1; }
.hero-status.dry::before {
  background: linear-gradient(135deg, rgba(245, 184, 61, 0.05), transparent 60%);
  opacity: 1;
}

/* Двойная пульсация — большое и малое кольцо */
.live-pulse {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.live-pulse::before,
.live-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--muted);
}
.live-pulse::before { transform: scale(0.55); }

.hero-status.running .live-pulse::before {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(212, 255, 58, 0.55);
  animation: live-dot 1.6s ease-in-out infinite;
}
.hero-status.running .live-pulse::after {
  background: var(--accent);
  opacity: 0.6;
  animation: live-ring 1.8s ease-out infinite;
}
.hero-status.dry .live-pulse::before {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(245, 184, 61, 0.55);
  animation: live-dot 1.6s ease-in-out infinite;
}
.hero-status.dry .live-pulse::after {
  background: var(--amber);
  opacity: 0.6;
  animation: live-ring 1.8s ease-out infinite;
}

@keyframes live-dot {
  0%, 100% { transform: scale(0.55); opacity: 1; }
  50% { transform: scale(0.7); opacity: 0.85; }
}
@keyframes live-ring {
  0%   { transform: scale(0.6); opacity: 0.55; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

.hero-content { display: grid; gap: 4px; min-width: 0; }
.hero-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.hero-status.running .hero-title { color: var(--accent); }
.hero-status.dry .hero-title { color: var(--amber); }
.hero-sub { color: var(--muted); font-size: 13px; }
.hero-timer {
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* KPI-карточки */
.kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  min-height: 120px;
  transition: border-color .2s ease;
}
.kpi-card:hover { border-color: var(--line-strong); }
.kpi-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kpi-number {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.kpi-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--muted);
}
.kpi-sub span {
  display: block;
  flex-basis: 100%;
}
.kpi-conversion {
  color: var(--accent);
  font-weight: 600;
}

/* Combo-карточки (Подсети / Слоты) */
.combo-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.combo-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.combo-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-2);
}
.combo-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.combo-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.combo-rows {
  display: grid;
  gap: 9px;
}
.combo-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}
.combo-item span:nth-child(2) { color: var(--muted); }
.combo-item strong {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.combo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.combo-dot.ready, .combo-dot.success { background: var(--green); }
.combo-dot.inuse, .combo-dot.active { background: var(--cyan); }
.combo-dot.cooldown, .combo-dot.waiting { background: var(--amber); }
.combo-dot.broken { background: var(--red); }
.combo-dot.accounts { background: var(--accent); }

/* Сегментированная полоса распределения слотов */
.slot-bar-wrap {
  margin-bottom: 14px;
}
.slot-bar {
  display: flex;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.slot-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #0a0a0a;
  transition: width .6s cubic-bezier(.22, 1, .36, 1);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  min-width: 0;
}
.slot-bar-segment.ready { background: var(--green); }
.slot-bar-segment.inuse { background: var(--cyan); }
.slot-bar-segment.cooldown { background: var(--amber); }
.slot-bar-segment.broken { background: var(--red); }
.slot-bar-segment .bar-label {
  padding: 0 10px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
}
.slot-bar-segment[style*="width: 0%"] { display: none; }

.health-panel {
  border: 1px solid rgba(251, 113, 133, 0.34);
  border-radius: 14px;
  background: rgba(251, 113, 133, 0.06);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.health-rule {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.health-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(251, 113, 133, 0.22);
  border-radius: 10px;
  background: rgba(10, 10, 10, 0.4);
}
.health-item div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.health-kind {
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.health-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.health-metric {
  flex-shrink: 0;
  color: #fecdd3;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Лента событий с уровнями */
.event-feed { gap: 6px; }
.event-row {
  display: grid;
  grid-template-columns: 70px auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  color: #d6d6d6;
  animation: event-slide-in .35s cubic-bezier(.22, 1, .36, 1);
}
.event-row .event-time {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.event-row .event-level {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.event-row .event-level.success {
  color: var(--green);
  border-color: rgba(139, 225, 90, 0.32);
  background: rgba(139, 225, 90, 0.08);
}
.event-row .event-level.warn {
  color: var(--amber);
  border-color: rgba(245, 184, 61, 0.32);
  background: rgba(245, 184, 61, 0.08);
}
.event-row .event-level.error {
  color: var(--red);
  border-color: rgba(251, 113, 133, 0.32);
  background: rgba(251, 113, 133, 0.08);
}
.event-row .event-level.info {
  color: var(--cyan);
  border-color: rgba(125, 211, 252, 0.32);
  background: rgba(125, 211, 252, 0.08);
}
.event-row .event-message {
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
}

@keyframes event-slide-in {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .status-strip, .cards, .two-col, .two-col.tight, .two-col.tight.proxies-grid, .settings-grid, .details-grid { grid-template-columns: 1fr 1fr; }
  .hero-row { grid-template-columns: 1fr 1fr; }
  .hero-status { grid-column: 1 / -1; }
  .combo-row { grid-template-columns: 1fr; }
  .health-list { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 620px) {
  .status-strip, .cards, .two-col, .two-col.tight, .two-col.tight.proxies-grid, .settings-grid, .form-grid, .details-grid, .hero-row, .combo-row { grid-template-columns: 1fr; }
  .hero-status { grid-column: auto; }
  .main, .sidebar { padding: 16px; }
  .health-head, .health-item { align-items: flex-start; flex-direction: column; }
  .health-metric { white-space: normal; }
  .event-row { grid-template-columns: 60px auto 1fr; font-size: 12px; }
}

.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 255, 58, 0.08), transparent 34%),
    var(--bg);
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.login-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 28px;
}
.login-brand { margin-bottom: 26px; }
.login-title {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: 0;
}
.login-form {
  display: grid;
  gap: 14px;
}
.login-form .field input {
  height: 44px;
  font-size: 15px;
}
.login-submit {
  width: 100%;
  height: 44px;
  margin-top: 2px;
}
.login-error {
  border: 1px solid rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.1);
  color: #fecdd3;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
