:root {
  --bg: #07090d;
  --panel: rgba(16, 20, 28, 0.88);
  --panel-strong: #10151e;
  --line: rgba(148, 163, 184, 0.16);
  --line-bright: rgba(94, 234, 212, 0.28);
  --text: #e6edf7;
  --muted: #8793a8;
  --accent: #5eead4;
  --accent-strong: #2dd4bf;
  --danger: #fb7185;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: radial-gradient(circle at 76% 6%, rgba(45, 212, 191, 0.11), transparent 30rem), radial-gradient(circle at 10% 100%, rgba(59, 130, 246, 0.08), transparent 34rem), var(--bg); }
button, input { font: inherit; }
button { color: inherit; }

.background-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.shell { position: relative; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 72px; }
.eyebrow { color: var(--accent); font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.15em; }
h1 { margin: 7px 0 0; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 0.98; letter-spacing: -0.055em; }
h2 { margin: 5px 0 0; font-size: 1.25rem; letter-spacing: -0.025em; }

.login-card { width: min(440px, 100%); margin: 10vh auto 0; padding: 38px; border: 1px solid var(--line-bright); border-radius: 18px; background: linear-gradient(145deg, rgba(19, 26, 36, 0.98), rgba(10, 13, 19, 0.96)); box-shadow: var(--shadow); }
.login-card p { margin: 18px 0 30px; color: var(--muted); line-height: 1.6; }
.login-card form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; }
label span { color: #b7c1d1; font-size: 0.78rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
input { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--text); background: rgba(3, 6, 11, 0.8); transition: border-color 140ms ease, box-shadow 140ms ease; }
.login-card input { padding: 13px 14px; }
input:focus { border-color: rgba(94, 234, 212, 0.7); box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1); }
.primary { margin-top: 4px; padding: 13px 18px; border: 0; border-radius: 9px; color: #04100f; background: var(--accent); font-weight: 800; cursor: pointer; }
.primary:hover { background: #99f6e4; }
.form-error { min-height: 1.2em; color: var(--danger); font-size: 0.85rem; }

.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 28px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.connection { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(8, 11, 16, 0.72); font-size: 0.78rem; font-weight: 700; }
.connection span { width: 7px; height: 7px; border-radius: 50%; background: #64748b; }
.connection.online { color: #a7f3d0; border-color: rgba(52, 211, 153, 0.25); }
.connection.online span { background: #34d399; box-shadow: 0 0 12px rgba(52, 211, 153, 0.75); }
.connection.error { color: #fda4af; border-color: rgba(251, 113, 133, 0.3); }
.connection.error span { background: var(--danger); }
.ghost, .terminal-action { border: 1px solid var(--line); border-radius: 8px; color: #a9b4c6; background: rgba(9, 12, 18, 0.72); cursor: pointer; }
.ghost { padding: 8px 12px; }
.ghost:hover, .terminal-action:hover { color: var(--text); border-color: rgba(148, 163, 184, 0.34); }

.server-strip { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: 0 20px 60px rgba(0,0,0,0.22); }
.server-strip div { display: grid; gap: 6px; padding: 18px 20px; border-right: 1px solid var(--line); }
.server-strip div:last-child { border-right: 0; }
.server-strip span { color: #64748b; font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.65rem; letter-spacing: 0.14em; }
.server-strip strong { font-size: 0.87rem; letter-spacing: -0.01em; }

.quick-panel { margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.hint { color: #64748b; font-size: 0.76rem; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-command { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; text-align: left; background: linear-gradient(150deg, rgba(23, 29, 40, 0.9), rgba(12, 16, 23, 0.9)); cursor: pointer; transition: transform 140ms ease, border-color 140ms ease; }
.quick-command:hover { transform: translateY(-2px); border-color: var(--line-bright); }
.quick-command strong { color: #dce7f5; font-size: 0.88rem; }
.quick-command span { color: var(--muted); font-size: 0.72rem; line-height: 1.4; }

.terminal-card { overflow: hidden; margin-top: 24px; border: 1px solid rgba(94, 234, 212, 0.2); border-radius: 14px; background: rgba(5, 8, 13, 0.96); box-shadow: var(--shadow); }
.terminal-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-bottom: 1px solid var(--line); background: #111720; }
.terminal-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; }
.red { background: #fb7185; } .amber { background: #fbbf24; } .green { background: #34d399; }
.terminal-title { margin-left: 8px; color: #7d899b; font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.72rem; }
.terminal-action { margin-left: 6px; padding: 6px 9px; font-size: 0.7rem; }
.terminal-output { height: min(48vh, 500px); min-height: 310px; overflow: auto; padding: 20px; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.78rem; line-height: 1.55; scrollbar-color: #253142 transparent; }
.welcome-line { color: #64748b; }
.command-record { padding: 0 0 20px; }
.command-record + .command-record { padding-top: 18px; border-top: 1px dashed rgba(148, 163, 184, 0.12); }
.command-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: #5f6c7f; font-size: 0.68rem; }
.command-text { color: var(--accent); white-space: pre-wrap; word-break: break-word; }
.command-text::before { content: '> '; color: #64748b; }
.response-text { margin: 9px 0 0; color: #cad5e4; white-space: pre-wrap; overflow-wrap: anywhere; }
.command-record.failed .response-text { color: #fda4af; }
.command-line { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 13px 15px; border-top: 1px solid var(--line); background: #0d121a; }
.prompt { color: var(--accent); font-family: "SFMono-Regular", Consolas, monospace; font-weight: 800; }
.command-line input { padding: 10px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-family: "SFMono-Regular", Consolas, monospace; }
.run-button { padding: 8px 15px; border: 1px solid rgba(94, 234, 212, 0.35); border-radius: 8px; color: var(--accent); background: rgba(45, 212, 191, 0.08); font-weight: 800; cursor: pointer; }
.run-button:hover { background: rgba(45, 212, 191, 0.15); }
.run-button:disabled, .quick-command:disabled { cursor: wait; opacity: 0.48; }

[hidden] { display: none !important; }

@media (max-width: 820px) {
  .shell { width: min(100% - 24px, 1180px); padding-top: 28px; }
  .topbar { align-items: flex-start; }
  .server-strip, .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .server-strip div:nth-child(2) { border-right: 0; }
  .server-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .login-card { padding: 26px; }
  .topbar { display: grid; }
  .topbar-actions { justify-content: space-between; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .server-strip, .quick-grid { grid-template-columns: 1fr; }
  .server-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .server-strip div:last-child { border-bottom: 0; }
  .terminal-header { align-items: flex-start; gap: 12px; }
  .terminal-title { display: block; margin: 8px 0 0; }
  .terminal-output { min-height: 360px; }
}
