:root {
  --bg: #0b1220;
  --panel: #121a2b;
  --panel-2: #17233b;
  --text: #e8edf7;
  --muted: #93a0b8;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #5bbcff;
  --danger: #ff6b6b;
  --success: #2dd4bf;
}

/* Reset */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* Base */
body {
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #08101d, #0d1627 35%, #0a1020);
  color: var(--text);
}
body.modal-open {
  overflow: hidden;
}

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

/* Layout */
.wrap {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}
.page {
  padding: 32px 0 48px;
}
.stack {
  display: grid;
  gap: 14px;
}
.button-row,
.inline-form {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 18, 32, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}
.brand {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Shared surfaces */
.hero-card,
.panel,
.stat-card,
.modal__dialog {
  background: rgba(18, 26, 43, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.hero-card,
.panel {
  padding: 24px;
  margin-bottom: 20px;
}

/* Buttons */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #5bbcff, #4f7cff);
  color: #fff;
  font-weight: 700;
}
.btn--ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

/* Forms */
label span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: var(--muted);
}
input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}

/* Alerts */
.alert {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.alert--success {
  background: rgba(45, 212, 191, 0.12);
  color: #aaf1e5;
}
.alert--error {
  background: rgba(255, 107, 107, 0.12);
  color: #ffc0c0;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  padding: 24px;
  display: grid;
  gap: 8px;
}
.stat-card strong { font-size: 2rem; }
.stat-card span { color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-weight: 600;
}

/* Details */
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
dt {
  color: var(--muted);
  margin-bottom: 6px;
}
dd {
  margin: 0;
  font-weight: 600;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 8, 18, 0.72);
}

.modal:not([hidden]) {
  display: flex;
}

.modal__dialog {
  width: min(520px, 100%);
  padding: 24px;
  position: relative;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

/* Responsive */
@media (max-width: 800px) {
  .stats-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }
}