:root {
  color-scheme: dark;
  --bg: #090d12;
  --panel: rgba(18, 25, 34, 0.86);
  --panel-strong: #121a24;
  --text: #eef4f8;
  --muted: #94a3b3;
  --line: rgba(255,255,255,0.12);
  --accent: #39d0b1;
  --accent-2: #62a7ff;
  --danger: #ff6b72;
  --ok: #3fe08f;
  --shadow: 0 24px 80px rgba(0,0,0,0.36);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 20%, rgba(57, 208, 177, 0.18), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(98, 167, 255, 0.20), transparent 30%),
    linear-gradient(135deg, #090d12 0%, #111827 52%, #071015 100%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.portal-body { overflow-x: hidden; }
.portal { min-height: 100vh; }
.hero { width: min(1180px, calc(100% - 40px)); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.portal-nav { display: flex; justify-content: space-between; align-items: center; padding: 28px 0; }
.brand { font-weight: 800; letter-spacing: 0; font-size: 22px; }
.nav-actions { display: flex; gap: 10px; }
.nav-actions a, .ghost-button, .mini-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.hero-grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr); gap: 54px; align-items: center; padding-bottom: 8vh; }
.eyebrow { color: var(--accent); text-transform: uppercase; font-weight: 800; font-size: 12px; letter-spacing: 0; margin: 0 0 14px; }
h1 { font-size: clamp(44px, 8vw, 86px); line-height: 0.95; margin: 0; max-width: 820px; letter-spacing: 0; }
.lead { color: var(--muted); font-size: 20px; line-height: 1.55; max-width: 680px; margin: 28px 0 0; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }
.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}
.primary-button { background: var(--accent); color: #06100d; }
.secondary-button { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--line); }

.status-board, .login-card, .panel, .table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  backdrop-filter: blur(16px);
}
.status-board { padding: 18px; }
.status-row { display: flex; justify-content: space-between; align-items: center; min-height: 74px; border-bottom: 1px solid var(--line); gap: 16px; }
.status-row:last-child { border-bottom: 0; }
.status-row span { color: var(--muted); }
.status-row strong { font-size: 18px; text-align: right; }

.admin-body { min-height: 100vh; }
.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 60px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.login-card { max-width: 420px; margin: 10vh auto; padding: 26px; }
.login-card h1, .panel h2, .table-panel h2 { font-size: 28px; line-height: 1.1; margin: 0 0 10px; }
.login-card p { color: var(--muted); margin: 0 0 22px; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.07);
  color: var(--text);
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
}
.email-input { display: flex; align-items: center; border: 1px solid var(--line); background: rgba(255,255,255,0.07); border-radius: 8px; overflow: hidden; }
.email-input input { border: 0; background: transparent; border-radius: 0; }
.email-input span { color: var(--muted); padding-right: 12px; white-space: nowrap; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel, .table-panel { padding: 20px; }
.table-panel { margin-top: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 13px; font-weight: 700; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.small-input { width: 100px; min-height: 36px; }
.password-input { width: 170px; min-height: 36px; }
.mini-button { min-height: 36px; padding: 7px 10px; }
.mini-button.danger { color: var(--danger); }
.status { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 8px; font-weight: 800; font-size: 12px; }
.status.on { color: #06100d; background: var(--ok); }
.status.off { color: var(--text); background: rgba(255,255,255,0.12); }
.alert { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--line); }
.alert.ok { background: rgba(63, 224, 143, 0.13); color: #baf9d5; }
.alert.error { background: rgba(255, 107, 114, 0.13); color: #ffd1d4; }

@media (max-width: 760px) {
  .hero { width: min(100% - 24px, 1180px); }
  .portal-nav { align-items: flex-start; gap: 16px; }
  .hero-grid, .admin-grid { grid-template-columns: 1fr; gap: 24px; }
  h1 { font-size: clamp(40px, 13vw, 64px); }
  .lead { font-size: 17px; }
  .hero-actions { flex-direction: column; }
}
