:root {
  --bg: #080c11;
  --bg-2: #0c131a;
  --panel: #111a23;
  --panel-2: #16212c;
  --panel-3: #1b2836;
  --line: #22313f;
  --line-soft: #1a2632;
  --text: #e6edf3;
  --muted: #8fa1b3;
  --dim: #5d7285;
  --green: #3ddc97;
  --green-2: #2fbf85;
  --green-soft: rgba(61, 220, 151, 0.12);
  --amber: #d9b26a;
  --red: #e65959;
  --violet: #9b7cf6;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --radius: 10px;
  --font: 'Segoe UI', 'Inter', system-ui, -apple-system, Roboto, sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  scrollbar-color: #2a3a49 transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #263644; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #35495b; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; }

button, input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }

button { cursor: pointer; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--panel-3); border-color: #2c3f51; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, #43e3a0, #2fbf85);
  border-color: #2aa877;
  color: #06251a;
  font-weight: 700;
}
.btn-primary:hover { background: linear-gradient(180deg, #53ecab, #37cb90); border-color: #33c08a; }

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--panel-2); }

.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 7px; }
.btn-danger { color: #ff9a9a; border-color: #4a2626; background: #2a1618; }
.btn-danger:hover { background: #351b1d; border-color: #6a3030; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--dim); }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  background: #0b1219;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.12);
}
.textarea { resize: vertical; min-height: 90px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 6, 9, 0.72);
  backdrop-filter: blur(6px);
}
.modal.open { display: flex; }

.modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 26px;
}
.modal-card.wide { width: min(760px, 100%); }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
}
.modal-close:hover { background: var(--panel-2); color: var(--text); }

.tabs { display: flex; gap: 4px; background: #0b1219; border: 1px solid var(--line); padding: 4px; border-radius: 9px; }
.tabs button { flex: 1; padding: 8px; border: none; background: transparent; color: var(--muted); border-radius: 6px; font-weight: 500; }
.tabs button.active { background: var(--panel-3); color: var(--text); }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.kicker {
  display: inline-block;
  color: var(--green);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.grow { flex: 1; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.03em;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(61, 220, 151, 0.22);
}
.badge.gray { background: #182430; color: var(--muted); border-color: var(--line); }
.badge.red { background: rgba(230, 89, 89, 0.12); color: #ff9a9a; border-color: rgba(230, 89, 89, 0.28); }
.badge.violet { background: rgba(155, 124, 246, 0.12); color: #c3b0ff; border-color: rgba(155, 124, 246, 0.3); }

.toast-stack {
  position: fixed;
  z-index: 500;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 9px;
  background: #17222d;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  animation: toast-in 0.2s ease-out;
}
.toast.error { border-color: #5a2b2b; background: #2a1719; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.6;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; }

.avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(160deg, #2fbf85, #186b50);
  color: #05241a;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}
