/*
 * theme.css — WRITTEN BY THE PLATFORM. Do not edit.
 *
 * Palette: Your colours (custom)
 * Source colours: #0a091b #232136 #f7f7fb #4643c4 #5b5bd6 #ffffff
 *
 * Every value below is either one of those five or derived from them, and each
 * one is contrast-corrected against this palette's own background. Consume
 * them with var(--token); never write a colour value in app code.
 */

:root {
  --canvas: #f7f7fb;
  --surface: #fbfbfd;
  --surface-2: #ebebf0;
  --border: #d6d6dc;
  --border-strong: #b0b0b8;
  --ink: #232136;
  --muted: #6e6d7a;
  --accent: #4643c4;
  --accent-hover: #3c39a7;
  --accent-ink: #ffffff;
  --accent-text: #5b5bd6;
  --accent-strong: #4643c4;
  --accent-soft: #dedef3;
  --accent-border: #a7a6e2;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #dce9e4;
  --success-strong: #137638;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #efe3de;
  --warning-strong: #a64c08;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #f0dde0;
  --danger-strong: #b91c1c;}

/**
 * app.css — Waypoint's own styles. Loads after design.css and theme.css, so
 * everything here wins. Retunes the shared component tokens toward a
 * crisp, minimal feel, then adds the handful of pieces the system doesn't
 * have: the task row, tag chips and the hue picker used to colour them.
 *
 * No colour literals anywhere below — every colour is a token, or a
 * `hue-rotate()` shift applied to one.
 */

/* ---------------------------------------------------------------------
   1. Retune the system — crisp, tight, quick. A handful of variables
   change the character of every component at once.
   --------------------------------------------------------------------- */
:root {
  --radius-sm: 5px;
  --radius: 9px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --radius-2xl: 18px;

  --dur-1: 110ms;
  --dur-2: 170ms;
  --dur-3: 260ms;
}

/* ---------------------------------------------------------------------
   2. Sidebar "Manage tags" trigger — a <button> wearing .nav-item, which
   design.css only ever expected on an <a>. Strip the button chrome back
   to the same shape as every other nav row.
   --------------------------------------------------------------------- */
.nav-item-btn {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: var(--fw-medium);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.nav-item-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-item-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.nav-item-btn .icon { flex: 0 0 auto; opacity: 0.85; }

/* The sidebar's "Tags" heading sits between two <nav class="nav"> blocks,
   so the `.nav + .nav` adjacent-sibling gap in design.css never matches —
   give the label its own top margin instead. */
.sidebar .nav-label { margin-top: var(--s-5); }

/* ---------------------------------------------------------------------
   3. The task list. A .card holds a .task-list of .task-row — deliberately
   not a table: due dates, tags and notes don't line up into columns.
   --------------------------------------------------------------------- */
.task-list { display: flex; flex-direction: column; }

.task-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-2);
  border-bottom: 1px solid var(--border);
  transition: background var(--dur-1) var(--ease);
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--surface-2); }

.task-check { padding-top: 2px; min-height: 0; }

.task-main { flex: 1 1 auto; min-width: 0; }

.task-title-row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.task-title { font-weight: var(--fw-medium); color: var(--ink); }
.task-title.is-done { color: var(--muted); text-decoration: line-through; }

.task-notes { margin-top: 2px; color: var(--muted); font-size: var(--t-sm); max-width: 60ch; }

.task-meta {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-top: var(--s-2);
}

.task-row .row-actions {
  flex: 0 0 auto;
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease);
}
.task-row:hover .row-actions,
.task-row:focus-within .row-actions {
  opacity: 1;
}
@media (hover: none) {
  .task-row .row-actions { opacity: 1; }
}

/* ---------------------------------------------------------------------
   4. Quick-add form, pinned above every list.
   --------------------------------------------------------------------- */
.add-task-form { padding: var(--s-5); }

.add-task-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.add-task-row .input.grow { flex: 1 1 220px; min-width: 0; }
.add-task-date { flex: 0 0 160px; }
.add-task-priority { flex: 0 0 160px; }

@media (max-width: 640px) {
  .add-task-row { flex-direction: column; align-items: stretch; }
  .add-task-date,
  .add-task-priority,
  .add-task-row .btn { flex: 0 0 auto; width: 100%; }
}

/* ---------------------------------------------------------------------
   5. Tags — every colour is the one accent, shifted with hue-rotate() so
   each tag reads distinctly without a single colour literal anywhere.
   The shift amount comes from the tag's stored hue, set as --tag-hue on
   the element itself.
   --------------------------------------------------------------------- */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px var(--s-3);
  border-radius: var(--radius-pill);
  font-size: var(--t-xs);
  font-weight: var(--fw-medium);
  background: var(--accent-soft);
  color: var(--accent-strong);
  filter: hue-rotate(var(--tag-hue, 0deg));
  white-space: nowrap;
}

.tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  filter: hue-rotate(var(--tag-hue, 0deg));
  flex: 0 0 auto;
}

/* A .chip used to pick tags on the add/edit forms — the real checkbox is
   sr-only; the label is the visible control, and :has() paints it once
   the input inside is checked. */
.tag-pick { cursor: pointer; }
.tag-pick .tag-dot { margin-right: 2px; }
.tag-pick:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-strong);
  filter: hue-rotate(var(--tag-hue, 0deg));
}

/* The hue picker in "Manage tags" — eight swatches, each the same accent
   rotated by a fixed amount, so a new tag's colour is chosen, not typed. */
.hue-swatch { display: inline-flex; position: relative; cursor: pointer; }
.hue-swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hue-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  filter: hue-rotate(var(--tag-hue, 0deg));
  border: 2px solid transparent;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.hue-swatch input:checked + .hue-dot { border-color: var(--ink); transform: scale(1.1); }
.hue-swatch input:focus-visible + .hue-dot { outline: 2px solid var(--accent); outline-offset: 2px; }

.tag-manager-row { padding: var(--s-2) 0; }
