.admin-layout { flex: 1; overflow-y: auto; padding: 24px; }
.admin-section {
  background: var(--surface);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
  max-width: 900px;
}
.admin-section h2 { margin: 0 0 4px; font-size: 17px; color: var(--text-strong); }
.admin-section p.hint { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.admin-section code {
  background: var(--bg-deep); padding: 1px 5px; border-radius: 4px;
  font-size: 12px; color: #c3c8ff;
}

table.admin { width: 100%; border-collapse: collapse; font-size: 14px; }
table.admin th {
  text-align: left; padding: 8px; color: var(--muted); font-weight: 500;
  border-bottom: 1px solid var(--bg);
}
table.admin td { padding: 8px; border-bottom: 1px solid var(--bg); vertical-align: middle; }
table.admin td.actions { text-align: right; white-space: nowrap; }
table.admin td.actions button { font-size: 13px; padding: 5px 10px; margin-left: 6px; }
table.admin input { padding: 6px 8px; font-size: 13px; }

.inline-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.inline-form input { flex: 1; min-width: 140px; }
.inline-form .checkbox {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; white-space: nowrap;
}
/* Also reset min-width: the rule above gives every input a 140px floor, which
   would stretch the checkbox away from its own label. */
.inline-form .checkbox input { width: auto; min-width: 0; flex: none; }
.role-select { width: auto; min-width: 118px; flex: none; padding: 6px 8px; font-size: 13px; }

/* ---- Balance ---- */
.balance-now {
  display: flex; align-items: baseline; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius); background: var(--bg-deep);
  box-shadow: inset 0 0 0 1px var(--success);
}
.balance-now.owed { box-shadow: inset 0 0 0 1px var(--danger); }
.balance-now .figure { font-size: 28px; font-weight: 600; color: #4ac57e; }
.balance-now.owed .figure { color: #f77b7e; }
.balance-now .caption { font-size: 13px; color: var(--muted); }

.secret {
  margin-top: 14px; padding: 14px; border-radius: var(--radius-sm);
  background: rgba(240, 177, 50, 0.08); box-shadow: inset 0 0 0 1px var(--warning);
}
.secret .code {
  font-family: Consolas, "Courier New", monospace; font-size: 15px;
  background: var(--bg-deep);
  padding: 10px; border-radius: 6px; margin: 8px 0; word-break: break-all; user-select: all;
}
.secret .warning { font-size: 13px; color: var(--warning); }

.storage-bars { display: flex; flex-direction: column; gap: 10px; }
.storage-row { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.storage-row .name { width: 90px; color: var(--muted); }
.storage-row .progress { flex: 1; }
.storage-row .value { width: 110px; text-align: right; color: var(--muted); font-size: 13px; }
.storage-row.total { border-top: 1px solid var(--bg); padding-top: 10px; }

/* Service keys: enough to recognise which key is in place, never the key. */
.key-state { font-size: 11px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.key-state.set { color: #4ac57e; }
.key-state.missing { color: #ffb26b; }
.key-use { font-size: 12px; color: var(--muted); max-width: 260px; }

/* A dot beside the name: green while the site is open, grey otherwise. */
.presence {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 7px; vertical-align: middle;
}
.presence.on { background: var(--success); box-shadow: 0 0 0 2px rgba(35, 165, 90, 0.25); }
.presence.off { background: var(--surface-3); }

@media (max-width: 720px) {
  .admin-layout { padding: 12px; }
  .admin-section { padding: 14px 12px; }
  .admin-section table.admin { display: block; overflow-x: auto; white-space: nowrap; }
}

/* The Google login is a whole JSON line, not a key — so it gets a wide field. */
.gdrive-form { display: flex; gap: 8px; margin-top: 10px; }
.gdrive-form input { flex: 1; font-family: ui-monospace, monospace; font-size: 12px; }
.gdrive-form button { flex: none; }

/* The disk itself, above the breakdown of what Doomchat put on it. */
.disk { margin-bottom: 14px; }
.disk-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; margin-bottom: 5px;
}
.disk-used { color: var(--text-strong); font-weight: 600; }
.disk-free { color: #5fd894; font-weight: 600; }
.disk-free.low { color: #ff9093; }
.disk .progress { height: 8px; }
.disk-note { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
