:root {
  --bg: #f2f5fb;
  --glass: rgba(249, 251, 255, 0.56);
  --glass-hover: rgba(252, 253, 255, 0.74);
  --glass-strong: rgba(250, 252, 255, 0.78);
  --border-frost: rgba(255, 255, 255, 0.88);
  --border-cobalt: rgba(13, 39, 128, 0.11);
  --border-cobalt-strong: rgba(13, 39, 128, 0.22);
  --cobalt: #0d2780;
  --cobalt-bright: #1d4ed8;
  --cobalt-muted: #3b5188;
  --cobalt-dim: #5d709c;
  --emerald: #059669;
  --danger: #dc2626;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Space Grotesk', 'Inter', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--cobalt);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle slow-moving ambient cobalt & ice-blue aura behind frosted glass */
.ambient-stage {
  position: fixed;
  inset: -18%;
  z-index: 0;
  pointer-events: none;
  filter: blur(84px);
}

.aura-blob {
  position: absolute;
  border-radius: 999px;
  will-change: transform;
}

.aura-1 {
  width: 52vw;
  height: 52vw;
  min-width: 420px;
  min-height: 420px;
  left: 4%;
  top: 8%;
  background: radial-gradient(circle, rgba(16, 52, 172, 0.23) 0%, rgba(29, 78, 216, 0.08) 58%, transparent 76%);
  animation: dndDriftOne 26s ease-in-out infinite alternate;
}

.aura-2 {
  width: 56vw;
  height: 54vw;
  min-width: 440px;
  min-height: 440px;
  right: 2%;
  bottom: 4%;
  background: radial-gradient(circle, rgba(24, 68, 196, 0.20) 0%, rgba(59, 130, 246, 0.08) 56%, transparent 76%);
  animation: dndDriftTwo 31s ease-in-out infinite alternate;
}

.aura-3 {
  width: 44vw;
  height: 44vw;
  min-width: 340px;
  min-height: 340px;
  left: 34%;
  top: 24%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.21) 0%, rgba(191, 219, 254, 0.08) 60%, transparent 78%);
  animation: dndDriftThree 22s ease-in-out infinite alternate;
}

@keyframes dndDriftOne {
  0%   { transform: translate3d(-4%, -3%, 0) scale(1); }
  50%  { transform: translate3d(18%, 11%, 0) scale(1.08); }
  100% { transform: translate3d(32%, -4%, 0) scale(0.96); }
}

@keyframes dndDriftTwo {
  0%   { transform: translate3d(4%, 4%, 0) scale(1.04); }
  50%  { transform: translate3d(-18%, -10%, 0) scale(0.95); }
  100% { transform: translate3d(-30%, 6%, 0) scale(1.07); }
}

@keyframes dndDriftThree {
  0%   { transform: translate3d(-12%, 10%, 0) scale(0.94); }
  50%  { transform: translate3d(12%, -12%, 0) scale(1.08); }
  100% { transform: translate3d(-4%, 6%, 0) scale(1); }
}

.noise-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: overlay;
}

/* Minimal Centered Top Bar */
.minimal-topbar {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 28px 24px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.minimal-wordmark {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--cobalt);
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.minimal-wordmark:hover {
  opacity: 1;
}

/* Spaced Frosted Bento Homepage */
.bento-viewport {
  position: relative;
  z-index: 5;
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 32px 52px;
}

.bento-grid {
  width: 100%;
  max-width: 1060px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 920px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 680px;
  }
}

@media (max-width: 600px) {
  .bento-viewport {
    padding: 16px 20px 40px;
  }
  .bento-grid {
    grid-template-columns: 1fr;
    max-width: 380px;
  }
}

.bento-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--glass);
  backdrop-filter: blur(28px) saturate(142%);
  -webkit-backdrop-filter: blur(28px) saturate(142%);
  border: 1px solid var(--border-frost);
  border-radius: 24px;
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.95),
    0 18px 42px -18px rgba(12, 34, 112, 0.16),
    0 0 0 1px rgba(13, 39, 128, 0.04);
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), background 0.28s ease, box-shadow 0.28s ease;
}

.bento-cell:hover {
  transform: translateY(-4px);
  background: var(--glass-hover);
  box-shadow:
    inset 0 1px 2px #ffffff,
    0 26px 50px -16px rgba(12, 34, 112, 0.22),
    0 0 0 1px rgba(13, 39, 128, 0.07);
}

.panel-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  mix-blend-mode: overlay;
  z-index: 1;
}

.cell-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cell-title {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cobalt);
}

.cell-sub {
  font-size: 11.5px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--cobalt-muted);
  margin-top: 2px;
}

.cell-code {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: var(--cobalt);
  opacity: 0.62;
  white-space: nowrap;
}

.icon-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

/* 25% larger custom frosted-gradient icon scale (85% of square cell) */
.icon-canvas {
  width: 85%;
  height: 85%;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-cell:hover .icon-canvas {
  transform: scale(1.06);
}

.cell-bottom {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--cobalt-dim);
}

.brand-stamp {
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--cobalt);
  opacity: 0.8;
}

/* Shared Dashboard & PIN UI Components (Light Frosted Cobalt System) */
.shell {
  position: relative;
  z-index: 5;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 28px;
}

.topbar {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border-cobalt);
  background: rgba(244, 247, 253, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--cobalt);
  font-weight: 600;
  letter-spacing: 0.1em;
  font-size: 14px;
}

.domain-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.10);
  color: var(--cobalt-bright);
  border: 1px solid rgba(29, 78, 216, 0.22);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid var(--border-frost);
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 14px -4px rgba(13, 39, 128, 0.12), 0 0 0 1px var(--border-cobalt);
  color: var(--cobalt);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.btn:hover {
  background: #ffffff;
  box-shadow: 0 8px 20px -6px rgba(13, 39, 128, 0.18), 0 0 0 1px var(--border-cobalt-strong);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-solar {
  background: var(--cobalt);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 20px -6px rgba(13, 39, 128, 0.38);
}

.btn-solar:hover {
  background: var(--cobalt-bright);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--cobalt-muted);
}

.btn-ghost:hover {
  background: rgba(13, 39, 128, 0.06);
  box-shadow: none;
  color: var(--cobalt);
}

.btn-danger {
  color: var(--danger);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cobalt-bright);
}

.dash-header {
  padding: 34px 0 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border-cobalt);
  flex-wrap: wrap;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.stat-tile {
  background: var(--glass);
  backdrop-filter: blur(22px);
  border: 1px solid var(--border-frost);
  box-shadow: 0 10px 26px -14px rgba(13, 39, 128, 0.14), 0 0 0 1px rgba(13, 39, 128, 0.05);
  border-radius: 16px;
  padding: 16px 18px;
}

.stat-tile span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cobalt-dim);
}

.stat-tile strong {
  display: block;
  font-size: 22px;
  margin-top: 6px;
  color: var(--cobalt);
}

.admin-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 72px;
}

.admin-ext-card {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-frost);
  box-shadow: 0 14px 36px -18px rgba(13, 39, 128, 0.16), 0 0 0 1px rgba(13, 39, 128, 0.06);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.slug-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(13, 39, 128, 0.07);
  color: var(--cobalt);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(13, 39, 128, 0.06);
  color: var(--cobalt-muted);
}

.status-badge.running {
  background: rgba(5, 150, 105, 0.12);
  color: var(--emerald);
}

.status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.meta-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border-cobalt);
  color: var(--cobalt-muted);
}

.url-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.url-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--border-cobalt);
}

.url-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--cobalt-dim);
}

.url-slot-path {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--cobalt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-slot-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.room-scoper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cobalt-muted);
}

.room-scoper input {
  width: 120px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-cobalt-strong);
  background: rgba(255, 255, 255, 0.8);
  color: var(--cobalt);
  font-family: var(--font-mono);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(13, 28, 78, 0.28);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  background: rgba(248, 250, 255, 0.92);
  backdrop-filter: blur(28px);
  border: 1px solid #ffffff;
  box-shadow: 0 28px 60px -16px rgba(12, 32, 104, 0.28);
  border-radius: 22px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card.wide {
  max-width: 760px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cobalt-muted);
}

.field input[type="text"],
.field input[type="password"],
.field input[type="url"],
.field textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-cobalt-strong);
  background: #ffffff;
  color: var(--cobalt);
  font-family: var(--font-sans);
  font-size: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--cobalt);
  cursor: pointer;
}

.log-pre {
  background: #0b163b;
  border-radius: 12px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: #e2e8f0;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
}
