:root {
  --bg: #060b18;
  --text: #e9eefc;
  --muted: #97a4c6;
  --accent: #4ce0d2;
  --accent-2: #7aa2ff;
  --danger: #ff8080;
  --ok: #7ff0c0;
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-bg-strong: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 18px 50px rgba(3, 8, 22, 0.55);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 8% -10%, rgba(76, 224, 210, 0.18), transparent 60%),
    radial-gradient(1000px 600px at 100% 0%, rgba(122, 162, 255, 0.2), transparent 55%),
    var(--bg);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}

.blob-1 {
  width: 46vw;
  height: 46vw;
  left: -8vw;
  top: -10vw;
  background: rgba(76, 224, 210, 0.5);
}

.blob-2 {
  width: 40vw;
  height: 40vw;
  right: -6vw;
  top: 6vw;
  background: rgba(122, 162, 255, 0.45);
}

.blob-3 {
  width: 38vw;
  height: 38vw;
  left: 28vw;
  bottom: -16vw;
  background: rgba(180, 120, 255, 0.32);
}

.glass {
  background: linear-gradient(160deg, var(--glass-bg-strong), var(--glass-bg));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: #131c31;
  }
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(400px, 100%);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-card h1,
.brand {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-card h1 span,
.brand span,
.accent {
  color: var(--accent);
}

.login-card label,
.modal-card label {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(8, 14, 30, 0.55);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

textarea {
  min-height: 220px;
  resize: vertical;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid rgba(76, 224, 210, 0.6);
  outline-offset: 1px;
}

.btn {
  border-radius: 12px;
  padding: 10px 16px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-primary {
  margin-top: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #05201f;
}

.toolbar .btn-primary,
.modal-actions .btn-primary {
  margin-top: 0;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--glass-border);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.13);
}

.btn-danger {
  background: rgba(255, 128, 128, 0.14);
  border-color: rgba(255, 128, 128, 0.4);
  color: var(--danger);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.app-view {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  padding: 20px 24px;
}

.topbar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  font-size: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(76, 224, 210, 0.12);
  border: 1px solid rgba(76, 224, 210, 0.28);
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

.intro {
  margin: 14px 0 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.error {
  color: var(--danger);
  font-size: 13px;
  margin: 10px 0 0;
}

.status {
  min-height: 1.4em;
  margin: 8px 0 0;
}

.status.ok {
  color: var(--ok);
}

.toolbar {
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  min-width: 140px;
}

.field-grow {
  flex: 1 1 220px;
}

.toolbar-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.list-panel {
  padding: 18px 20px;
  min-width: 0;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.table-scroll {
  overflow: auto;
  border-radius: 12px;
}

table.sites {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.sites th {
  text-align: left;
  padding: 9px 10px;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--glass-border);
}

table.sites td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.site-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.site-link:hover {
  text-decoration: underline;
}

.cell-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.cell-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  width: auto;
  accent-color: var(--accent);
}

.switch-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.switch-label.on {
  color: var(--ok);
}

.switch-label.off {
  color: var(--muted);
}

.empty {
  padding: 18px 4px;
  font-size: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 20, 0.62);
}

.modal-card {
  position: relative;
  width: min(480px, 100%);
  padding: 24px;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.modal-wide {
  width: min(720px, 100%);
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 11px 18px;
  border-radius: 12px;
  background: rgba(14, 22, 44, 0.92);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  font-size: 14px;
  z-index: 30;
}

code {
  font-family: "JetBrains Mono", "Consolas", monospace;
  color: var(--accent);
}

@media (max-width: 720px) {
  .cell-actions {
    flex-direction: column;
  }
}
