/*
 * Deliberately one stylesheet with no build step and no framework. The CSP this
 * server sends has no 'unsafe-inline', so there are no style attributes here
 * either — anything dynamic is a class toggle.
 */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #14161a;
  --muted: #6b7280;
  --line: #e3e6ea;
  --accent: #f26a21;
  --accent-ink: #ffffff;
  --danger: #b42318;
  --ok: #067647;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --panel: #171a20;
    --ink: #e8eaed;
    --muted: #9aa3af;
    --line: #262b33;
    --accent: #f26a21;
    --accent-ink: #16181d;
    --danger: #f97066;
    --ok: #47cd89;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

h1 { font-size: 15px; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 20px; font-weight: 650; margin: 0 0 4px; letter-spacing: -0.02em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; }
.error { color: var(--danger); font-size: 14px; margin: 4px 0 0; }
.status { font-size: 14px; color: var(--ok); }

.brand { display: flex; align-items: center; gap: 8px; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); flex: none;
}

/* ---------- sign in ---------- */

.signin {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 24px 16px;
}

.card {
  width: 100%; max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex; flex-direction: column; gap: 6px;
}

.card .muted { margin-bottom: 12px; }
.card label { font-size: 13px; font-weight: 550; margin-top: 10px; }

.footnote { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- layout ---------- */

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 20px;
}

.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav button {
  width: 100%; text-align: left;
  background: none; border: 0; color: var(--ink);
  padding: 8px 10px; border-radius: 8px;
  font: inherit; font-size: 14px; cursor: pointer;
}
.nav button:hover { background: var(--bg); }
.nav button[aria-current="true"] { background: var(--bg); font-weight: 600; }

.sidebar-footer { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.who { display: flex; flex-direction: column; min-width: 0; }
.who-name { font-size: 14px; font-weight: 550; }
.who-email { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { padding: 32px; }
.app { max-width: 560px; display: flex; flex-direction: column; gap: 20px; }
.app-header { display: flex; flex-direction: column; gap: 4px; }

.current {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- form controls ---------- */

.field { position: relative; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 550; }

input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

button {
  padding: 9px 14px;
  border: 0; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 600; cursor: pointer;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

button.ghost {
  background: none; color: var(--muted);
  border: 1px solid var(--line); font-weight: 500;
}
button.ghost:hover { color: var(--ink); }

.actions { display: flex; align-items: center; gap: 12px; }

/* ---------- combobox results ---------- */

.results {
  list-style: none; margin: 0; padding: 4px;
  position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
  max-height: 280px; overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.results li { padding: 0; }
.results button {
  width: 100%; text-align: left;
  background: none; color: var(--ink); font-weight: 400;
  padding: 8px 10px; border-radius: 6px;
  display: flex; flex-direction: column; gap: 1px;
}
.results button:hover,
.results button[aria-selected="true"] { background: var(--bg); }
.results .parent { font-size: 12px; color: var(--muted); }
.results .empty { padding: 10px; color: var(--muted); font-size: 14px; }

@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .content { padding: 20px 16px; }
}
