:root {
  color-scheme: dark;
  --bg: #070a12;
  --bg-2: #101827;
  --panel: rgba(12, 18, 32, 0.82);
  --panel-strong: rgba(18, 26, 44, 0.94);
  --line: rgba(125, 211, 252, 0.18);
  --line-strong: rgba(34, 211, 238, 0.42);
  --text: #eef7ff;
  --muted: #95a8bd;
  --cyan: #22d3ee;
  --green: #6ee7b7;
  --red: #ff3b58;
  --amber: #fbbf24;
  --white: #ffffff;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(125, 211, 252, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 16% 8%, rgba(34, 211, 238, 0.2), transparent 28rem),
    radial-gradient(circle at 84% 16%, rgba(255, 59, 88, 0.15), transparent 24rem),
    linear-gradient(145deg, var(--bg) 0%, #0d1220 44%, #111827 100%);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 28%);
  mask-image: linear-gradient(to bottom, black, transparent);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.nav-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 10, 20, 0.68);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.nav-strip a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-strip a:hover,
.nav-strip a:focus-visible,
.nav-strip a.is-active {
  color: var(--text);
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(255, 59, 88, 0.1));
  outline: none;
  transform: translateY(-1px);
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 24px;
  align-items: end;
  min-height: 280px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(125deg, rgba(9, 15, 28, 0.96), rgba(16, 24, 39, 0.74)),
    repeating-linear-gradient(90deg, rgba(34, 211, 238, 0.08) 0 1px, transparent 1px 26px);
  box-shadow: var(--shadow);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.42), transparent 34%, rgba(255, 59, 88, 0.28)),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.05));
  opacity: 0.42;
}

.topbar::after {
  content: "";
  position: absolute;
  right: -92px;
  top: -90px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(34, 211, 238, 0.26);
  border-radius: 50%;
  box-shadow: inset 0 0 60px rgba(34, 211, 238, 0.08), 0 0 80px rgba(255, 59, 88, 0.11);
}

.hero-copy,
.stats-grid {
  position: relative;
  z-index: 1;
}

.eyebrow,
h1,
h2,
p {
  margin-top: 0;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 700px;
  margin-bottom: 16px;
  font-size: clamp(40px, 5vw, 70px);
  line-height: 0.95;
}

.hero-text {
  max-width: 620px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.signal-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(110, 231, 183, 0.22);
  border-radius: 6px;
  color: var(--green);
  background: rgba(6, 95, 70, 0.18);
  font-size: 12px;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 12px;
}

.stat-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(8, 13, 24, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  color: var(--cyan);
  font-size: 34px;
  line-height: 1;
  text-shadow: 0 0 24px rgba(34, 211, 238, 0.35);
}

.panel {
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-header,
.toolbar,
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.panel-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.panel-header h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.primary-button,
.ghost-button,
.icon-button,
.pagination button,
.edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-button {
  padding: 0 16px;
  color: #06111d;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 16px 34px rgba(34, 211, 238, 0.25);
}

.ghost-button {
  padding: 0 16px;
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.primary-button:hover,
.ghost-button:hover,
.edit-button:hover,
.pagination button:not(:disabled):hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(570px, 100%);
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 10, 20, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.search-box span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-box input::placeholder {
  color: #718399;
}

.status-text {
  min-height: 20px;
  margin: 0;
  color: var(--amber);
  font-size: 14px;
  text-align: right;
}

.table-wrap {
  position: relative;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  vertical-align: middle;
}

th {
  color: var(--cyan);
  background: rgba(7, 13, 26, 0.92);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr {
  background: rgba(15, 23, 42, 0.42);
  transition: background 140ms ease;
}

tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.62);
}

tbody tr:hover {
  background: rgba(34, 211, 238, 0.09);
}

td {
  color: #dbeafe;
}

td:first-child {
  color: var(--green);
  font-weight: 900;
}

.edit-button {
  min-width: 82px;
  min-height: 36px;
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.1);
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 180px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
  font-size: 18px;
}

.pagination button {
  width: 44px;
  color: var(--cyan);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 24px;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

#pageInfo {
  color: var(--muted);
  font-weight: 900;
}

dialog {
  width: min(540px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.58);
}

dialog::backdrop {
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(8, 13, 24, 0.98));
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  margin-bottom: 0;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  color: var(--red);
  border-color: rgba(255, 59, 88, 0.28);
  background: rgba(255, 59, 88, 0.08);
  font-size: 24px;
}

.modal-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.modal-card input {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: rgba(5, 10, 20, 0.72);
  outline: none;
}

.modal-card input:focus,
.search-box:focus-within {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .panel-header,
  .toolbar,
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: stretch;
  }

  .actions > * {
    flex: 1 1 140px;
  }

  .status-text {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1220px);
    padding: 14px 0 24px;
  }

  .nav-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .nav-strip a {
    padding: 0 10px;
  }

  .topbar {
    min-height: 0;
    padding: 22px;
  }

  h1 {
    font-size: 40px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .signal-row span {
    flex: 1 1 auto;
    justify-content: center;
  }
}
