:root {
  color-scheme: dark;
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #22d3ee;
  --danger: #f87171;
  --ok: #34d399;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Tahoma, sans-serif;
  background: radial-gradient(circle at top, #1f2937, var(--bg));
  color: var(--text);
}

.container {
  width: min(1100px, 94vw);
  margin: 24px auto;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: rgba(17, 24, 39, 0.86);
  border: 1px solid #374151;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

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

h1,
h2 {
  margin: 0 0 12px;
}

p {
  color: var(--muted);
}

form {
  display: grid;
  gap: 8px;
}

.grid {
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.grid button {
  grid-column: 1 / -1;
}

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

input,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #4b5563;
  padding: 10px 12px;
  background: #0b1220;
  color: var(--text);
}

a.button-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 10px 12px;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  color: var(--text);
  font-weight: 700;
}

a.button-link.ghost {
  background: transparent;
  border-color: #4b5563;
}

button {
  cursor: pointer;
  border-color: transparent;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  font-weight: 700;
}

button.danger {
  background: linear-gradient(90deg, #dc2626, #b91c1c);
}

.flash {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.flash.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--ok);
}

.flash.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #374151;
  text-align: right;
  padding: 10px 8px;
  vertical-align: top;
  font-size: 0.92rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.actions-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.actions form {
  width: auto;
}

.actions button {
  width: auto;
  min-width: 70px;
  padding: 8px 10px;
}

code {
  font-size: 0.82rem;
}

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

.stat-box {
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.85);
}

.stat-title {
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px 16px;
}

.kv-grid div {
  border-bottom: 1px dashed #374151;
  padding: 8px 0;
}

.kv-grid strong {
  color: #cbd5e1;
}

.kv-grid span {
  color: #e5e7eb;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.info-card {
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.72);
}

.info-card h3 {
  margin: 0 0 10px;
  font-size: 0.98rem;
  color: #cbd5e1;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #334155;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row span {
  color: #94a3b8;
}

.info-row strong {
  color: #f8fafc;
  text-align: left;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.wrap {
  word-break: break-all;
}

.cli-list {
  display: grid;
  gap: 10px;
}

.cli-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #374151;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 10px;
  padding: 10px;
}

.cli-row code {
  word-break: break-all;
}

.cli-row button {
  width: auto;
  min-width: 90px;
}

.terminal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ghost-btn {
  background: transparent;
  border: 1px solid #4b5563;
}

.term-status {
  margin-inline-start: auto;
  color: #93c5fd;
  font-weight: 700;
}

.terminal-box {
  width: 100%;
  height: 480px;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
  background: #050b1a;
}

.novnc-box {
  position: relative;
}

.novnc-box canvas {
  width: 100% !important;
  height: 100% !important;
}

.novnc-note {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  font-size: 12px;
  color: #7dd3fc;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 8px;
}
