:root {
  color-scheme: dark;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: #081122;
  color: #ecf4ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.24), transparent 30%),
    radial-gradient(circle at top right, rgba(217, 70, 239, 0.22), transparent 34%),
    radial-gradient(circle at bottom center, rgba(59, 130, 246, 0.18), transparent 30%),
    linear-gradient(135deg, #0b1325 0%, #111c3c 45%, #0e1223 100%);
  color: #ecf4ff;
}

button,
input {
  font: inherit;
}

.hidden { display: none !important; }

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(110px);
  opacity: 0.38;
  pointer-events: none;
}

.ambient-one {
  width: 22rem;
  height: 22rem;
  left: -5rem;
  top: 4rem;
  background: #7c3aed;
}

.ambient-two {
  width: 26rem;
  height: 26rem;
  right: -6rem;
  top: 10rem;
  background: #2563eb;
}

.ambient-three {
  width: 20rem;
  height: 20rem;
  left: 35%;
  bottom: -4rem;
  background: #db2777;
}

.login-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 460px);
  align-items: center;
  gap: 3rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem;
}

.login-brand {
  max-width: 520px;
}

.brand-mark {
  width: 4.75rem;
  height: 4.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 48%, #d946ef 100%);
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 22px 48px rgba(79, 70, 229, 0.4);
}

.login-brand h1 {
  margin: 1.5rem 0 0.8rem;
  font-size: clamp(3rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.login-brand p {
  max-width: 34rem;
  margin: 0;
  color: rgba(226, 232, 255, 0.78);
  font-size: 1.05rem;
  line-height: 1.8;
}

.login-panel {
  position: relative;
  padding: 2rem;
  border-radius: 1.75rem;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 70px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(26px);
}

.login-panel-header h2 {
  margin: 0.2rem 0 0.7rem;
  font-size: 1.9rem;
  letter-spacing: -0.04em;
}

.login-panel-header p {
  margin: 0 0 1.75rem;
  color: rgba(226, 232, 255, 0.72);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.25rem;
  color: #9fb2ff;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

label {
  display: block;
  margin-bottom: 0.55rem;
  color: #dbeafe;
  font-size: 0.92rem;
  font-weight: 700;
}

input {
  width: 100%;
  padding: 1rem 1.05rem;
  margin-bottom: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fbff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

input::placeholder {
  color: rgba(191, 219, 254, 0.48);
}

input:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.8);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.login-actions {
  margin-top: 0.5rem;
}

button {
  border: none;
  border-radius: 1rem;
  padding: 0.95rem 1.25rem;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 48%, #d946ef 100%);
  color: #ffffff;
}

.secondary {
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
}

.login-button {
  width: 100%;
  justify-content: center;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.trust-pill {
  padding: 0.9rem 0.8rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.trust-pill strong {
  display: block;
  font-size: 1.05rem;
}

.trust-pill span {
  color: rgba(226, 232, 255, 0.64);
  font-size: 0.8rem;
}

.dashboard {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem;
}

.hero-card,
.panel,
.metric-card,
.summary-card,
.placeholder-card,
.mini-card {
  background: rgba(11, 18, 36, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.28);
  backdrop-filter: blur(22px);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.8rem 1.9rem;
  border-radius: 1.8rem;
  margin-bottom: 1.2rem;
}

.hero-badge {
  display: inline-flex;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.16);
  color: #b8c2ff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card h1 {
  margin: 0.7rem 0 0.7rem;
  font-size: clamp(2rem, 3vw, 2.85rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-card p {
  max-width: 44rem;
  margin: 0;
  color: rgba(226, 232, 255, 0.7);
}

.logout-button {
  min-width: 7rem;
}

.notice,
.error {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  font-size: 0.95rem;
}

.notice {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #dbeafe;
}

.error {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fee2e2;
}

.tab-row {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.tab-button {
  padding-inline: 1.3rem;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.tab-button.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(168, 85, 247, 0.94));
  color: #ffffff;
  border-color: transparent;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.2rem 1.15rem;
  border-radius: 1.35rem;
}

.metric-card-wide {
  grid-column: 1 / -1;
}

.metric-wide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.metric-wide-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.metric-card-primary {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.16), rgba(11, 18, 36, 0.72)),
    rgba(11, 18, 36, 0.7);
}

.metric-card-highlight {
  background:
    linear-gradient(180deg, rgba(168, 85, 247, 0.16), rgba(11, 18, 36, 0.72)),
    rgba(11, 18, 36, 0.7);
}

.metric-label,
.summary-label,
.mini-label {
  font-size: 0.82rem;
  color: #8ea2c9;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.metric-value {
  font-size: 1.45rem;
  color: #f8fbff;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.metric-help,
.summary-help,
.mini-card p,
.footer {
  color: rgba(226, 232, 255, 0.66);
  line-height: 1.6;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.48rem 0.82rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status-running {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.status-paused {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
}

.status-aborted {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.status-unknown {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.status-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 1rem;
}

.panel {
  padding: 1.35rem;
  border-radius: 1.5rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.panel-header h2,
.placeholder-card h3,
.new-bot-shell h2 {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.panel-header p {
  max-width: 28rem;
  margin: 0;
  color: rgba(226, 232, 255, 0.66);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.terminal-block {
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  background: rgba(15, 23, 42, 0.82);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.terminal-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
}

.terminal-red { background: #fb7185; }
.terminal-yellow { background: #fbbf24; }
.terminal-green { background: #34d399; }

.terminal-title {
  margin-left: 0.35rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status {
  min-height: 17rem;
  margin: 0;
  padding: 1.15rem;
  background: rgba(7, 12, 23, 0.9);
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  color: #dbeafe;
  overflow-x: auto;
}

.summary-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary-card,
.mini-card,
.placeholder-card {
  padding: 1.2rem;
  border-radius: 1.3rem;
}

.summary-value {
  margin-top: 0.3rem;
  font-size: 2.35rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.05em;
}

.summary-help {
  margin-top: 0.45rem;
  font-size: 0.9rem;
}

.mini-card p {
  margin: 0.7rem 0 0;
  font-size: 0.94rem;
}

.footer {
  margin-top: 1rem;
  font-size: 0.94rem;
}

.new-bot-shell {
  padding: 1.5rem;
  border-radius: 1.5rem;
  background: rgba(11, 18, 36, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.24);
}

.new-bot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.placeholder-card-hero {
  grid-column: 1 / -1;
  min-height: 11rem;
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(217, 70, 239, 0.14)),
    rgba(11, 18, 36, 0.7);
}

.placeholder-card h3 {
  margin-bottom: 0.65rem;
}

.placeholder-card p {
  margin: 0;
  color: rgba(226, 232, 255, 0.7);
}

@media (max-width: 980px) {
  .login-screen {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.25rem;
  }

  .dashboard {
    padding: 1.25rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-wide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-layout,
  .new-bot-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 720px) {
  .hero-card,
  .panel-header,
  .top-row {
    flex-direction: column;
  }

  .metrics-grid,
  .action-grid,
  .trust-row {
    grid-template-columns: 1fr;
  }

  .metric-wide-grid {
    grid-template-columns: 1fr;
  }

  .tab-row {
    flex-wrap: wrap;
  }

  .dashboard,
  .login-screen {
    padding: 1rem;
  }

  .hero-card,
  .panel,
  .new-bot-shell,
  .login-panel {
    padding: 1.1rem;
  }
}
