/* The account website in the app's look: Fluent colours (sampled from the
   app's Slint UI), the system light or dark theme, cards on a plain page. */

:root {
  color-scheme: light dark;
  --page: #f3f3f3;
  --sidebar: #ebebeb;
  --nav-selected: #e0e0e0;
  --card: #fbfbfb;
  --card-border: #e5e5e5;
  --control: #ffffff;
  --control-hover: #f6f6f6;
  --control-border: #d1d1d1;
  --text: #1a1a1a;
  --text-secondary: #5d5d5d;
  --text-tertiary: #8a8a8a;
  --accent: #005fb8;
  --accent-hover: #1a6fc0;
  --on-accent: #ffffff;
  --online: #0f7b0f;
  --error: #c42b1c;
  --error-card: #fde7e9;
  --success-card: #dff6dd;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-code: "Cascadia Mono", Consolas, ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #1c1c1c;
    --sidebar: #2c2c2c;
    --nav-selected: #383838;
    --card: #292929;
    --card-border: #3a3a3a;
    --control: #363636;
    --control-hover: #3d3d3d;
    --control-border: #3e3e3e;
    --text: #ffffff;
    --text-secondary: #c5c5c5;
    --text-tertiary: #919191;
    --accent: #60cdff;
    --accent-hover: #6cc4ff;
    --on-accent: #000000;
    --online: #6ccb5f;
    --error: #ff99a4;
    --error-card: #442726;
    --success-card: #393d1b;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--text);
  font: 14px/20px var(--font);
}

a { color: var(--accent); }

.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 20px;
  font: 600 18px/24px var(--font-display);
}

.brand svg { flex: none; }

.nav {
  display: block;
  position: relative;
  padding: 8px 14px 8px 46px;
  border-radius: 5px;
  color: var(--text);
  text-decoration: none;
}

.nav:hover { background: var(--nav-selected); }

.nav.selected { background: var(--nav-selected); }

.nav.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.sidebar .spacer { flex: 1; }

.sidebar form { padding: 0 10px; }

main {
  padding: 24px;
  max-width: 820px;
}

main.narrow {
  max-width: 460px;
  margin: 10vh auto 0;
}

main.wide { max-width: none; }

h1 {
  margin: 8px 0 2px;
  font: 600 28px/36px var(--font-display);
}

h2 {
  margin: 0 0 4px;
  font: 600 16px/22px var(--font);
}

h3 {
  margin: 24px 0 8px;
  font: 600 14px/20px var(--font);
}

.sub {
  margin: 0 0 20px;
  color: var(--text-tertiary);
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 7px;
  padding: 16px;
  margin: 0 0 12px;
}

.card p { margin: 0 0 12px; color: var(--text-secondary); font-size: 12px; line-height: 16px; }

.card p:last-child { margin-bottom: 0; }

.note { display: flex; gap: 12px; align-items: baseline; }

.note.error { background: var(--error-card); }

.note.success { background: var(--success-card); }

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row .grow { flex: 1; min-width: 0; }

.code {
  font: 28px/36px var(--font-code);
  letter-spacing: 1px;
}

input[type=text], input[type=email] {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--control-border);
  border-bottom-color: var(--text-tertiary);
  border-radius: 4px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  min-width: 0;
}

input:focus-visible { outline: none; border-bottom: 2px solid var(--accent); }

button {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--control-border);
  border-radius: 4px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

button:hover { background: var(--control-hover); }

button.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

button.accent:hover { background: var(--accent-hover); }

button.link {
  border: none;
  background: none;
  padding: 0;
  min-height: 0;
  color: var(--accent);
}

form.inline { display: inline; margin: 0; }

.person {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--card-border);
}

.card.list { padding: 0; }

.card.list .person:first-child { border-top: none; }

.person .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.person .detail { color: var(--text-tertiary); font-size: 12px; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--text-tertiary);
  flex: none;
}

.dot.online { background: var(--online); }

.empty { padding: 12px 16px; color: var(--text-tertiary); }

.error-text { color: var(--error); }

/* Admin console: tables, facts and badges. */
.card.table { padding: 0; overflow-x: auto; }

table { border-collapse: collapse; width: 100%; font-size: 12px; line-height: 16px; }

th, td {
  padding: 8px 12px;
  border-top: 1px solid var(--card-border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th { border-top: none; color: var(--text-secondary); font-weight: 600; }

th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }

.wrap { white-space: normal; min-width: 160px; }

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 16px;
  margin: 0;
  font-size: 12px;
}

.facts dt { color: var(--text-secondary); }

.facts dd { margin: 0; overflow-wrap: anywhere; }

.badge {
  display: inline-block;
  padding: 0 6px;
  margin: 0 4px 2px 0;
  border-radius: 4px;
  background: var(--nav-selected);
  font-size: 11px;
  line-height: 18px;
}

.flag { color: var(--error); }

.muted { color: var(--text-tertiary); }

[hidden] { display: none !important; }

@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .brand { padding: 0 8px 0 4px; }
  .nav { padding: 6px 10px; }
  .nav.selected::before { display: none; }
  .sidebar .spacer { display: none; }
  main { padding: 16px; }
}
