/* Mirrors session-manager design tokens. Keep these in sync if SM changes. */
:root {
  --bg: #050a14;
  --surface: #000;
  --surface-2: #0d1220;
  --border: #616065;
  --border-dim: #1a2235;
  --text: #d6d9e3;
  --dim: #b0afb8;
  --ok: #22c55e;
  --warn: #fbbf24;
  --err: #ef4444;
  --accent: #3e82b2;
  --accent-hover: #2d658c;
  --ice: #80dfff;
  --row-hover: rgba(62, 130, 178, 0.12);
  --row-selected: rgba(62, 130, 178, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

a { color: var(--ice); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
header h1 {
  font-size: 18px;
  color: var(--ice);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
#user-bar { display: flex; gap: 12px; align-items: center; }
#user-email { color: var(--dim); font-size: 12px; }

main { padding: 20px 24px 96px; max-width: 1400px; }

section { margin-bottom: 28px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 8px;
}
.section-head h2 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #f0f0f5;
}
.section-head .hint { color: var(--dim); font-size: 12px; }
.section-head label { color: var(--dim); font-size: 12px; }
.count { color: var(--dim); font-weight: normal; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 12px 0 12px;
  overflow: hidden;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-dim);
  white-space: nowrap;
}
th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dim);
  position: sticky;
  top: 0;
}
tbody tr:hover { background: var(--row-hover); cursor: pointer; }
tbody tr.selected { background: var(--row-selected); }
tbody tr:last-child td { border-bottom: 0; }
td.muted { color: var(--dim); }
td.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.dirty { color: var(--err); font-weight: 600; margin-left: 4px; }

input[type=text] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 0 8px 0 8px;
  font: inherit;
  font-size: 13px;
  outline: none;
}
input[type=text]:focus { border-color: var(--ice); }
input[type=text]::placeholder { color: #616065; }

input[type=checkbox], input[type=radio] {
  accent-color: var(--accent);
}

button {
  padding: 8px 18px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 0 8px 0 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
button:hover:not(:disabled) {
  border-color: var(--ice);
  color: var(--ice);
}
button:disabled { opacity: 0.4; cursor: not-allowed; }
#deploy-btn, #deploy-confirm {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
#deploy-btn:hover:not(:disabled), #deploy-confirm:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 12px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  align-items: center;
}
#deploy-summary { color: var(--dim); font-size: 12px; }

dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0 12px 0 12px;
  padding: 20px;
  min-width: 480px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog h3 {
  margin: 0 0 12px 0;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ice);
}
dialog p { font-size: 13px; }
dialog code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--ice);
}
dialog label {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--dim);
}
.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
#deploy-result { font-size: 12px; color: var(--dim); margin: 12px 0 0 0; }
#deploy-result.error { color: var(--err); }
#deploy-result.success { color: var(--ok); }
