:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-border: #262b35;
  --text: #e6e8eb;
  --muted: #8a92a3;
  --accent: #4f8cff;
  --ok: #3ec97a;
  --warn: #e0b03d;
  --danger: #e0503d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.loading, .center-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 32px;
  width: 360px;
}

.auth-card h1 {
  font-size: 18px;
  margin: 0 0 20px;
}

.field {
  margin-bottom: 14px;
}

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

.password-row input {
  flex: 1;
}

.password-row button {
  white-space: nowrap;
  font-size: 12px;
  padding: 0 10px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

input[type="text"], input[type="password"], select {
  width: 100%;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: #0d0f13;
  color: var(--text);
  font-size: 14px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 14px;
  background: var(--accent);
  color: white;
}

button.secondary {
  background: #2a2f3a;
  color: var(--text);
}

button.danger {
  background: var(--danger);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.5;
}

.qr-wrap {
  display: flex;
  justify-content: center;
  background: white;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
}

.otp-secret {
  background: #0d0f13;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 10px;
  font-family: monospace;
  word-break: break-all;
  font-size: 13px;
  margin: 10px 0;
}

/* dashboard */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--panel-border);
}

.topbar .who { color: var(--muted); font-size: 13px; }
.topbar .who button { margin-left: 10px; }

.section-spaced { margin-top: 20px; }

.tabs {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  border-bottom: 1px solid var(--panel-border);
}

.tabs button {
  background: none;
  color: var(--muted);
  padding: 12px 6px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}

.tabs button.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

main {
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.project-group {
  margin-bottom: 28px;
}

.project-group h2 {
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
}

.container-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.container-card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.container-card .name {
  font-weight: 600;
  font-size: 14px;
}

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

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge.ok { background: rgba(62,201,122,0.15); color: var(--ok); }
.badge.warn { background: rgba(224,176,61,0.15); color: var(--warn); }
.badge.danger { background: rgba(224,80,61,0.15); color: var(--danger); }
.badge.muted { background: rgba(138,146,163,0.15); color: var(--muted); }

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

.actions button {
  font-size: 12px;
  padding: 6px 10px;
}

pre.logs {
  background: #0d0f13;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  max-height: 400px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 20px;
  width: 520px;
  max-width: 92vw;
  max-height: 85vh;
  overflow: auto;
}

.modal h3 {
  margin-top: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--panel-border);
}

th { color: var(--muted); font-weight: 600; }

.checkbox-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  max-width: 360px;
}

.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.success { border-color: var(--ok); color: var(--ok); }
