:root {
  --bg: #0e1420;
  --bg-soft: #162033;
  --panel: #f4efe4;
  --ink: #152033;
  --muted: #66758d;
  --line: #d4c8ad;
  --accent: #c46d1a;
  --accent-strong: #9d4c00;
  --danger: #a32020;
  --warn: #7e5a00;
  --ok: #1b7d4a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(circle at top, #1d2d45, var(--bg) 55%);
  color: var(--ink);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  color: #f8f0dd;
}

.topbar h1 {
  margin: 0;
  font-size: 1.6rem;
}

.topbar p {
  margin: 0.25rem 0 0;
  color: #d9d2c2;
}

.topbar-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.layout,
.console-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 0 1.5rem 1.5rem;
}

.console-layout,
.full,
.wide {
  grid-column: 1 / -1;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.section-title h2 {
  margin: 0;
  font-size: 1.1rem;
}

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

.status-grid span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.status-grid strong {
  display: block;
  margin-top: 0.2rem;
  word-break: break-word;
}

.button-row,
.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.preset-grid button,
.button-row button,
.ghost,
.primary,
.warn,
.danger {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

.small {
  padding: 0.45rem 0.8rem;
}

.primary {
  background: var(--accent);
  color: white;
}

.warn {
  background: #f0ca64;
  color: #3d2d00;
}

.danger {
  background: #e46b6b;
  color: white;
}

.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff7e6;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.console-log,
.command-result {
  margin: 0;
  padding: 1rem;
  background: #111827;
  color: #d3f7c9;
  border-radius: 14px;
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, monospace;
}

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

.command-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.command-form input,
.login-card input {
  width: 100%;
  border: 1px solid #b8b1a5;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font-size: 1rem;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, calc(100vw - 2rem));
  background: var(--panel);
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
  margin-top: 0;
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.alert {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: #f9d7d7;
  color: #7d1d1d;
  margin-bottom: 1rem;
}

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

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

  .command-form {
    flex-direction: column;
  }
}
