/* Reterea Redesk. Same visual language as Reterea Meet: brand teal #008986
   (deep #005e61), Instrument Sans, a teal side bar, soft cards and tables.
   The theme lives in <html data-theme="light|dark"> (theme.js). */

@import url("fonts.css");

:root {
  --font-ui: "Instrument Sans Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
  --brand: #008986;
  --brand-dark: #005e61;
  --side-w: 248px;
  --r-m: 8px;
  --r-l: 12px;
}

/* Light: cool paper with a hint of teal, teal ink instead of black. */
html[data-theme="light"] {
  color-scheme: light;
  --paper: #f2f6f6;
  --surface: #ffffff;
  --surface-2: #f6f9f9;
  --sunken: #e9f0f0;
  --ink: #0e2a2b;
  --ink-2: #3c5657;
  --muted: #5e7576;
  --line: #d9e3e3;
  --line-strong: #c3d2d2;
  --brand-ink: #006f6c;
  --brand-soft: #e1f2f1;
  --side: #00393c;
  --side-ink: #d5ebe9;
  --side-muted: #87b0ae;
  --side-hover: rgba(255, 255, 255, 0.07);
  --side-on: rgba(255, 255, 255, 0.13);
  --side-mark: #5fd4ce;
  --signal: #c93434;
  --signal-soft: #fbe9e9;
  --ok: #1c7445;
  --ok-soft: #e2f3ea;
  --shadow: 0 1px 2px rgba(14, 42, 43, 0.05), 0 1px 1px rgba(14, 42, 43, 0.03);
  --logo-filter: none;
}

/* Dark: the same hues, shifted towards teal. */
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0a1718;
  --surface: #102224;
  --surface-2: #0d1d1e;
  --sunken: #0b191a;
  --ink: #e1eeed;
  --ink-2: #b2c8c7;
  --muted: #86a2a1;
  --line: #1f3839;
  --line-strong: #2c4a4b;
  --brand-ink: #5fd0ca;
  --brand-soft: #113a3a;
  --side: #08292a;
  --side-ink: #cfe3e1;
  --side-muted: #7c9d9b;
  --side-hover: rgba(255, 255, 255, 0.05);
  --side-on: rgba(95, 212, 206, 0.12);
  --side-mark: #5fd4ce;
  --signal: #ff7272;
  --signal-soft: #3a1b1d;
  --ok: #72d79c;
  --ok-soft: #12301f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --logo-filter: brightness(0) invert(1);
}

/* --- base --- */
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); }
h1, h2 { color: var(--ink); line-height: 1.2; }
h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 20px; }
h2 { font-size: 1.0625rem; font-weight: 600; margin: 36px 0 12px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
code { font-family: var(--font-mono); font-size: 0.85em; word-break: break-all; }
.note { color: var(--muted); font-size: 0.875rem; max-width: 80ch; }
.error { color: var(--signal); font-weight: 550; }
svg { width: 18px; height: 18px; flex: none; }

/* --- shell: teal side bar + content --- */
.shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100%;
  /* The column stays teal below the height of the window too. */
  background: linear-gradient(to right, var(--side) var(--side-w), transparent var(--side-w));
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px 14px 16px;
  background: var(--side);
  color: var(--side-ink);
}
.side .brand { padding: 0 10px; }
.side .logo { filter: brightness(0) invert(1); }
.side .brand-name { color: var(--side-ink); border-left-color: rgba(255, 255, 255, 0.22); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-group { margin: 18px 12px 6px; font-size: 0.78rem; font-weight: 500; color: var(--side-muted); }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r-m);
  color: var(--side-ink);
  text-decoration: none;
  font-weight: 500;
}
.nav-item svg { opacity: 0.8; }
.nav-item:hover { background: var(--side-hover); }
.nav-item[aria-current="page"] { background: var(--side-on); color: #fff; }
.nav-item[aria-current="page"] svg { opacity: 1; color: var(--side-mark); }
.nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--side-mark);
}
.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.me { display: flex; align-items: center; gap: 4px; }
.me-id { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 0.9rem; }
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.side .icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--side-muted);
}
.side .icon-btn:hover { background: var(--side-hover); color: #fff; }
.main { min-width: 0; }
.content { max-width: 1200px; padding: 36px 44px 72px; box-sizing: border-box; }

/* --- brand --- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo { height: 30px; width: auto; filter: var(--logo-filter); }
.brand-name {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--brand-ink);
  border-left: 1px solid var(--line-strong);
  padding-left: 10px;
  line-height: 1.2;
}

/* --- theme switch: three icons --- */
.theme-switch {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--sunken);
  border: 1px solid var(--line);
}
.theme-switch button {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}
.theme-switch button svg { width: 16px; height: 16px; }
.theme-switch button:hover { background: transparent; color: var(--ink); }
.theme-switch button[aria-checked="true"] { background: var(--surface); color: var(--brand-ink); box-shadow: var(--shadow); }
.side .theme-switch { background: rgba(0, 0, 0, 0.18); border-color: rgba(255, 255, 255, 0.08); }
.side .theme-switch button { color: var(--side-muted); }
.side .theme-switch button:hover { color: #fff; }
.side .theme-switch button[aria-checked="true"] { background: rgba(255, 255, 255, 0.14); color: #fff; box-shadow: none; }

/* --- buttons and fields --- */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 550;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
button:hover, .btn:hover { background: var(--surface-2); border-color: var(--muted); }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
button.danger { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 35%, var(--line)); }
button.danger:hover { background: var(--signal-soft); border-color: var(--signal); }
td button, td .btn { min-height: 30px; padding: 0 10px; font-size: 0.85rem; }
input, select {
  box-sizing: border-box;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
td input { min-height: 30px; padding: 3px 9px; font-size: 0.85rem; }
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
input[type="checkbox"] { min-height: 0; accent-color: var(--brand); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; font-weight: 550; color: var(--ink-2); }
label.check { flex-direction: row; align-items: center; gap: 8px; min-height: 38px; }
form.inline { display: inline; }
form.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 14px 0; }

/* --- tables, tags, boxes --- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow);
}
th { font-size: 0.8rem; font-weight: 600; color: var(--muted); background: var(--surface-2); }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 310px; }
td.actions form.inline { display: inline-flex; gap: 6px; }
td.actions:has(> :only-child) { min-width: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 550;
  background: var(--sunken);
  color: var(--ink-2);
  white-space: nowrap;
}
.tag.live { margin-left: 0; background: var(--ok-soft); color: var(--ok); }
.tag.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.box {
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: var(--r-l);
  padding: 16px 20px;
  margin: 16px 0;
}
.box p { margin: 6px 0; }
.back { display: inline-block; margin-bottom: 14px; font-size: 0.9rem; text-decoration: none; }

/* --- pages without login: brand on top, card in the middle --- */
.auth { min-height: 100%; display: flex; flex-direction: column; }
.auth-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.auth-main { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 9vh 20px 48px; }
.narrow {
  width: min(400px, 100%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.narrow h1 { margin: 0; font-size: 1.5rem; }
.narrow p { margin: 0; }
.narrow form { display: flex; flex-direction: column; gap: 14px; }
.narrow img { align-self: center; border-radius: var(--r-m); background: #fff; padding: 6px; }

/* --- narrow screens: the side bar becomes a top bar --- */
@media (max-width: 820px) {
  .shell { display: block; background: none; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-group { display: none; }
  .nav-item[aria-current="page"]::before { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; padding: 0; border: 0; }
  .me-name { display: none; }
  .content { padding: 24px 16px 56px; }
  table { display: block; overflow-x: auto; }
}
