/* Control-plane page chrome — built on the shared tokens in base.css. */

/* Auth pages (login / register / password) */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 2rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;

  & .brand-logo { width: 2rem; height: 2rem; }
  & h1 { font-size: 1.25rem; font-weight: 600; }
  & .theme-toggle { margin-left: auto; }
}

.auth-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.auth .form { max-width: none; }

.form-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.auth .btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: 0.25rem;
}

.auth-links {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: grid;
  gap: 0.4rem;

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

/* Flash messages */
.flash-region {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 2rem 0;
}

.flash {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.875rem;
  color: var(--color-text);
}

.flash-notice { border-color: var(--color-primary); }
.flash-alert,
.flash-error {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: var(--color-error);
}

/* Workspaces list */
.workspaces-user {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.workspace-list {
  display: grid;
  gap: 0.75rem;
}

.workspace-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.workspace-card-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.workspace-card-name { font-weight: 600; }

/* A sleeping workspace shows its badge next to the button rather than instead
   of it — it opens exactly like a running one, it just takes a few seconds. */
.workspace-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.workspace-card-host {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.badge {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-header);
  white-space: nowrap;
}

.badge-pending { color: var(--color-primary); }

.badge-error {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background: var(--color-error);
}


/* Admin dashboard. Deliberately plain: it is an operator tool, read far more
   often than it is looked at. */
.admin-section { margin-top: 2rem; }
.admin-section h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.admin-lede { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }

.admin-meter {
  height: 0.4rem;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
  max-width: 24rem;
}
.admin-meter-fill { height: 100%; background: var(--color-primary); }
.admin-meter-fill.is-full { background: var(--color-danger); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-table th,
.admin-table td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--color-border-light); }
.admin-table thead th { background: var(--color-header); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .muted { color: var(--color-text-muted); }
.admin-table tfoot th { padding: 0.5rem 0.75rem; border-top: 1px solid var(--color-border); }

.admin-note { font-size: 0.8125rem; color: var(--color-text-muted); margin-top: 0.5rem; line-height: 1.5; max-width: 44rem; }

/* Admin dashboard. Deliberately plain — an operator tool, scanned rather than
   admired. */
.admin-section { margin-top: 2rem; }
.admin-section h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.admin-lede { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }

.admin-meter {
  height: 0.4rem;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
  max-width: 24rem;
}
.admin-meter-fill { height: 100%; background: var(--color-primary); }
.admin-meter-fill.is-full { background: var(--color-danger); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-table th,
.admin-table td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--color-border-light); }
.admin-table thead th {
  background: var(--color-header);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .muted { color: var(--color-text-muted); }
.admin-table tfoot th { padding: 0.5rem 0.75rem; border-top: 1px solid var(--color-border); }

.admin-note {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
  max-width: 44rem;
}
