:root {
  --bg: #03090b;
  --panel: rgba(8, 22, 27, 0.82);
  --panel-strong: rgba(11, 31, 38, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eefbff;
  --muted: #8aa3ad;
  --accent: #00d4ff;
  --accent-deep: #001419;
  --danger: #ff5570;
  --ok: #55f0a3;
  --warn: #ffc85c;
  --radius: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 260px),
    linear-gradient(135deg, rgba(0, 20, 25, 0.96), rgba(0, 212, 255, 0.14)),
    radial-gradient(circle at 80% 0%, rgba(0, 212, 255, 0.18), transparent 34%),
    var(--bg);
}

button, input, textarea, select {
  font: inherit;
}

button, .upload-label {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 14px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

button:hover, .upload-label:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 212, 255, 0.55);
  background: rgba(0, 212, 255, 0.1);
}

button:disabled, input:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

button:disabled:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

small code {
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 6px;
  color: #dffbff;
  background: rgba(0, 0, 0, 0.28);
  padding: 3px 7px;
  font: 12px/1.4 "Cascadia Code", "Fira Code", Consolas, monospace;
}

button.primary {
  border: 0;
  color: #001419;
  background: linear-gradient(135deg, #00d4ff, #9ff1ff);
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(0, 212, 255, 0.2);
}

button.danger {
  border-color: rgba(255, 85, 112, 0.55);
  color: #ffd9df;
}

button.ghost {
  background: transparent;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  padding: 11px 12px;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(0, 212, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
h1, h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 0; font-size: clamp(24px, 4vw, 34px); }
h3 { margin-bottom: 16px; font-size: 18px; }
small { color: var(--muted); }

.hidden { display: none !important; }

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

.login-shell {
  width: min(430px, 100%);
  animation: rise 420ms ease both;
}

.brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #001419;
  background: linear-gradient(135deg, #00d4ff, #ffffff);
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 24px 60px rgba(0, 212, 255, 0.2);
}

.brand-mark.small {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.login-shell h1 {
  margin: 20px 0 8px;
  font-size: 42px;
}

.login-shell p {
  color: var(--muted);
  line-height: 1.6;
}

.login-card, .surface, .metric, .hero-band {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.login-card {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  padding: 22px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  background:
    linear-gradient(180deg, rgba(0, 212, 255, 0.09), transparent 220px),
    rgba(0, 10, 12, 0.78);
  backdrop-filter: blur(22px);
}

.panel-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-brand strong { display: block; }

nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

nav button {
  justify-content: start;
  text-align: left;
  border-color: transparent;
  background: transparent;
  color: #cbe9ef;
}

nav button.active {
  color: #001419;
  background: linear-gradient(135deg, #00d4ff, #d8faff);
  font-weight: 800;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.env-chip, .badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 999px;
  color: #bff4ff;
  background: rgba(0, 212, 255, 0.08);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge {
  min-height: 26px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.top-actions, .control-row, .toolbar, .command-row, .section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-head h3 { margin-bottom: 0; }

.status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 800;
}

.status.online {
  color: #001419;
  background: var(--ok);
}

.status.offline {
  color: #ffe9ee;
  background: rgba(255, 85, 112, 0.18);
  border-color: rgba(255, 85, 112, 0.45);
}

.page {
  display: none;
  animation: fade 180ms ease both;
}

.page.active { display: block; }

.hero-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 214px;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(0, 212, 255, 0.11), transparent 42%),
    linear-gradient(135deg, rgba(0, 20, 25, 0.92), rgba(0, 212, 255, 0.22)),
    var(--panel-strong);
  position: relative;
  overflow: hidden;
}

.hero-band::after {
  content: "";
  position: absolute;
  inset: auto 22px 18px auto;
  width: min(340px, 45%);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent));
  opacity: 0.75;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-band h3 {
  margin-bottom: 6px;
  font-size: clamp(24px, 4vw, 38px);
}

.hero-band p {
  margin-bottom: 0;
  color: var(--muted);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #dff9ff;
  background: rgba(255, 255, 255, 0.055);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.control-row {
  position: relative;
  z-index: 1;
  justify-content: flex-end;
}

.control-row button {
  min-width: 88px;
}

.insight-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(220px, 0.8fr) minmax(220px, 0.7fr);
  gap: 14px;
  margin: 16px 0;
}

.command-card code {
  display: block;
  overflow-x: auto;
  border: 1px solid rgba(0, 212, 255, 0.16);
  border-radius: var(--radius);
  color: #dffbff;
  background: rgba(0, 0, 0, 0.28);
  padding: 12px;
  font: 13px/1.5 "Cascadia Code", "Fira Code", Consolas, monospace;
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 9px 10px;
}

.check-item span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.check-item.ok span {
  background: var(--ok);
  box-shadow: 0 0 18px rgba(85, 240, 163, 0.45);
}

.check-item.warn span {
  background: var(--warn);
  box-shadow: 0 0 18px rgba(255, 200, 92, 0.35);
}

.check-item strong {
  font-size: 13px;
}

.check-item small {
  justify-self: end;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-grid button {
  min-height: 44px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.metric {
  min-height: 174px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  opacity: 0.8;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin: 6px 0 10px;
  font-size: 30px;
}

.metric canvas {
  width: 100%;
  height: 72px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.surface {
  min-width: 0;
  padding: 18px;
  transition: border-color 160ms ease, transform 160ms ease;
}

.surface:hover, .metric:hover {
  border-color: rgba(0, 212, 255, 0.23);
}

.surface.tall {
  min-height: 70vh;
}

.console {
  width: 100%;
  min-height: 420px;
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(0, 212, 255, 0.13);
  border-radius: var(--radius);
  color: #d9fbff;
  background: rgba(0, 0, 0, 0.44);
  padding: 14px;
  font: 13px/1.55 "Cascadia Code", "Fira Code", Consolas, monospace;
  white-space: pre-wrap;
}

.console.mini {
  min-height: 220px;
  max-height: 360px;
}

.command-row {
  margin-top: 12px;
  flex-wrap: nowrap;
}

.command-row input { flex: 1; }

.table {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--panel-soft);
  transition: border-color 160ms ease, background 160ms ease;
}

.row:hover {
  border-color: rgba(0, 212, 255, 0.22);
  background: rgba(0, 212, 255, 0.055);
}

.row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row .meta {
  color: var(--muted);
  font-size: 12px;
}

.row .actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.row .actions button {
  min-height: 32px;
  padding: 0 10px;
}

.drop-zone {
  display: none;
  margin-bottom: 12px;
  border: 1px dashed rgba(0, 212, 255, 0.65);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 28px;
  text-align: center;
  background: rgba(0, 212, 255, 0.08);
}

.drop-zone.visible { display: block; }

.upload-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.upload-label input { display: none; }

.editor {
  margin-top: 16px;
}

textarea {
  min-height: 58vh;
  resize: vertical;
  font: 13px/1.55 "Cascadia Code", "Fira Code", Consolas, monospace;
}

.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 10px;
}

.kv div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel-soft);
}

.kv span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.form-grid, .settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.settings-grid label:nth-child(4) {
  grid-column: 1 / -1;
}

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

.check input {
  width: auto;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Pro interface pass */
:root {
  --nav: rgba(2, 8, 12, 0.9);
  --surface: rgba(7, 18, 25, 0.78);
  --surface-raised: rgba(12, 27, 36, 0.92);
  --cyan-soft: rgba(0, 212, 255, 0.12);
  --green-soft: rgba(85, 240, 163, 0.12);
  --gold-soft: rgba(255, 200, 92, 0.12);
  --violet: #8b7cff;
  --violet-soft: rgba(139, 124, 255, 0.14);
}

body {
  background:
    linear-gradient(180deg, rgba(0, 212, 255, 0.1), transparent 240px),
    radial-gradient(circle at 14% 0%, rgba(139, 124, 255, 0.13), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(0, 212, 255, 0.16), transparent 30%),
    linear-gradient(145deg, #020607 0%, #051016 42%, #071c23 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, black, transparent 70%);
}

button, .upload-label {
  letter-spacing: 0;
}

button.primary {
  background: linear-gradient(135deg, #64e6ff, #5ee7b7);
}

button.danger {
  background: linear-gradient(135deg, rgba(255, 85, 112, 0.2), rgba(255, 255, 255, 0.04));
}

.app {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  padding: 20px 16px;
  background:
    linear-gradient(180deg, rgba(0, 212, 255, 0.1), transparent 190px),
    linear-gradient(135deg, rgba(139, 124, 255, 0.08), transparent 42%),
    var(--nav);
}

.panel-brand {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.side-status {
  display: grid;
  grid-template-columns: 12px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0, 212, 255, 0.14);
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(255, 255, 255, 0.035));
}

.side-status > span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 18px rgba(255, 85, 112, 0.45);
}

.side-status > span.online {
  background: var(--ok);
  box-shadow: 0 0 18px rgba(85, 240, 163, 0.45);
}

.side-status strong {
  display: block;
  font-size: 13px;
}

.side-status small {
  font-size: 11px;
}

nav {
  gap: 7px;
}

nav button {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
}

nav button::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  vertical-align: 1px;
}

nav button.active {
  color: #001419;
  box-shadow: 0 14px 36px rgba(0, 212, 255, 0.18);
}

nav button.active::before {
  background: #001419;
}

.workspace {
  padding: 20px clamp(18px, 3vw, 34px) 34px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  margin: -20px calc(clamp(18px, 3vw, 34px) * -1) 20px;
  padding: 18px clamp(18px, 3vw, 34px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(3, 9, 12, 0.76);
  backdrop-filter: blur(18px);
}

.topbar h2 {
  font-size: clamp(25px, 3vw, 38px);
}

.top-actions button {
  min-height: 34px;
}

.login-card, .surface, .metric, .hero-band {
  background: linear-gradient(145deg, rgba(12, 28, 36, 0.88), rgba(5, 14, 20, 0.76));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.hero-band {
  min-height: 238px;
  border-color: rgba(0, 212, 255, 0.22);
  background:
    linear-gradient(120deg, rgba(0, 212, 255, 0.18), transparent 46%),
    radial-gradient(circle at 88% 20%, rgba(94, 231, 183, 0.12), transparent 32%),
    linear-gradient(145deg, rgba(5, 18, 24, 0.95), rgba(7, 36, 46, 0.86));
}

.hero-band h3 {
  max-width: 820px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

.hero-band p {
  max-width: 620px;
}

.control-row {
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  align-content: end;
  min-width: min(360px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.control-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.control-row button {
  min-height: 46px;
}

.insight-grid {
  grid-template-columns: minmax(280px, 1.25fr) minmax(270px, 0.95fr) minmax(230px, 0.7fr);
}

.surface {
  border-color: rgba(255, 255, 255, 0.09);
}

.metric {
  min-height: 188px;
}

.metric strong {
  font-size: 34px;
}

.metric.cpu::before { background: linear-gradient(90deg, #00d4ff, #64e6ff); }
.metric.ram::before { background: linear-gradient(90deg, #5ee7b7, #55f0a3); }
.metric.disk::before { background: linear-gradient(90deg, #ffc85c, #ff9f6e); }
.metric.net::before { background: linear-gradient(90deg, #8b7cff, #00d4ff); }

.metric canvas {
  height: 84px;
}

.kv {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.row {
  min-height: 58px;
  padding: 12px 14px;
}

#console.page.active {
  display: block;
}

.console-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  height: calc(100vh - 116px);
  min-height: 560px;
  padding: 16px;
}

.console-head {
  margin-bottom: 0;
}

.console-quick {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.console-quick button {
  min-height: 34px;
  white-space: nowrap;
}

.console-shell .console {
  min-height: 0;
  height: 100%;
  border-color: rgba(0, 212, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(0, 212, 255, 0.035), transparent 180px),
    rgba(0, 0, 0, 0.58);
}

.console-dock {
  position: sticky;
  bottom: 0;
  flex-wrap: nowrap;
  margin-top: 0;
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 12px;
  padding: 10px;
  background: rgba(4, 13, 18, 0.95);
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.28);
}

.prompt-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 38px;
  border-radius: 8px;
  color: #001419;
  background: linear-gradient(135deg, #64e6ff, #5ee7b7);
  font-weight: 900;
}

.console-dock input {
  height: 38px;
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
}

.console::-webkit-scrollbar,
.console-quick::-webkit-scrollbar {
  width: 10px;
  height: 8px;
}

.console::-webkit-scrollbar-track,
.console-quick::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.console::-webkit-scrollbar-thumb,
.console-quick::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.36);
}

.form-grid, .settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

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

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

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

  .sidebar {
    position: static;
    height: auto;
  }

  nav {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .split, .form-grid, .settings-grid, .insight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 16px;
  }

  .topbar, .hero-band {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-band::after {
    width: 62%;
  }

  nav {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .row {
    grid-template-columns: 1fr;
  }

  .row .actions {
    justify-content: flex-start;
  }

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