:root {
  --bg: #05070b;
  --bg-2: #0b1220;
  --panel: rgba(14, 22, 38, 0.78);
  --panel-strong: rgba(16, 25, 42, 0.95);
  --ink: #e9f2ff;
  --muted: #8fa2bb;
  --line: rgba(180, 202, 230, 0.18);
  --aqua: #1dd6bf;
  --blue: #59a9ff;
  --amber: #ffb347;
  --mint: #41e2a3;
  --orange: #ff934f;
  --indigo: #8fa0ff;
  --danger: #ff7e79;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at -10% -10%, #193563 0%, transparent 58%),
    radial-gradient(920px 520px at 110% 120%, #153434 0%, transparent 57%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

p {
  margin: 0;
}

.aurora {
  position: fixed;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.24;
  pointer-events: none;
  z-index: 0;
}

.aurora-a {
  background: #1492ff;
  top: -170px;
  left: -120px;
  animation: driftA 12s ease-in-out infinite;
}

.aurora-b {
  background: #14d8a6;
  right: -120px;
  bottom: -170px;
  animation: driftB 15s ease-in-out infinite;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(160deg, var(--panel), rgba(8, 13, 22, 0.9));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(9px);
}

.login-card {
  max-width: 470px;
  margin: 10vh auto 0;
  padding: 30px;
  animation: rise 0.55s ease;
}

.eyebrow {
  color: var(--aqua);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 700;
  font-size: 0.74rem;
}

.subtitle {
  margin-top: 10px;
  line-height: 1.5;
  color: var(--muted);
}

.subtitle-inline {
  margin-top: 8px;
  color: var(--muted);
}

form {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

label {
  color: var(--muted);
  font-size: 0.92rem;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 11, 18, 0.8);
  color: var(--ink);
  padding: 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(89, 169, 255, 0.2);
}

button {
  border: none;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 700;
  color: #041019;
  background: linear-gradient(145deg, var(--aqua), #8bf4e0);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(29, 214, 191, 0.28);
}

button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.secondary {
  background: linear-gradient(145deg, #58abff, #b7dbff);
}

.danger {
  background: linear-gradient(145deg, #ff7e79, #ffc4c1);
}

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.error {
  min-height: 1.3em;
  margin-top: 10px;
  color: var(--danger);
}

.hidden {
  display: none;
}

#dashboardView {
  display: grid;
  gap: 16px;
  animation: rise 0.5s ease;
}

#dashboardView.hidden {
  display: none;
}

.topbar {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

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

.hero {
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(29, 214, 191, 0.14), rgba(89, 169, 255, 0.11)),
    linear-gradient(160deg, var(--panel), rgba(8, 13, 22, 0.9));
}

.hero-copy {
  max-width: 760px;
}

.hero-copy h3 {
  margin-top: 8px;
  font-size: clamp(1.35rem, 2.6vw, 2.1rem);
}

.hero-copy p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1.02rem;
}

.apps-area {
  padding: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section-head p {
  color: var(--muted);
}

.section-head.tight {
  margin-bottom: 10px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 13px;
}

.app-btn {
  min-height: 138px;
  border-radius: 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  padding: 16px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  position: relative;
  overflow: hidden;
}

.app-btn strong {
  display: block;
  font-size: 1.04rem;
  margin-bottom: 8px;
}

.app-btn span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.app-btn em {
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-style: normal;
  font-size: 0.83rem;
  color: #c9dcff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-btn::before {
  content: "";
  position: absolute;
  inset: auto -25% -65% auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  opacity: 0.25;
  filter: blur(22px);
}

.accent-aqua::before { background: var(--aqua); }
.accent-blue::before { background: var(--blue); }
.accent-amber::before { background: var(--amber); }
.accent-mint::before { background: var(--mint); }
.accent-orange::before { background: var(--orange); }
.accent-indigo::before { background: var(--indigo); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(4, 7, 11, 0.67);
  backdrop-filter: blur(4px);
  padding: 24px;
  overflow: auto;
}

.modal-content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
}

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

.settings-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 14px;
}

.settings-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  padding: 14px;
}

.user-form {
  margin-top: 4px;
  margin-bottom: 10px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 11px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-running {
  color: var(--mint);
  background: rgba(65, 226, 163, 0.18);
}

.status-restarting,
.status-paused {
  color: var(--amber);
  background: rgba(255, 179, 71, 0.18);
}

.status-stopped,
.status-not-found,
.status-dead {
  color: #9fb0c5;
  background: rgba(143, 162, 187, 0.2);
}

.action-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.action-row button {
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 0.79rem;
}

.action-row .start {
  background: linear-gradient(145deg, #29cfb3, #97f4e5);
}

.action-row .stop {
  background: linear-gradient(145deg, #ff9f6f, #ffd8b9);
}

.action-row .restart {
  background: linear-gradient(145deg, #62b2ff, #c1e1ff);
}

@keyframes driftA {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(26px, -22px); }
}

@keyframes driftB {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-26px, 18px); }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 760px) {
  .login-card {
    margin-top: 8vh;
    padding: 22px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions button {
    flex: 1;
  }

  .modal {
    padding: 8px;
  }
}
