/* TaskTrack — visual identity adapted from the SAMI-AEC UX training deck:
   dark teal canvas, green primary, orange signature highlight, IBM Plex Sans. */

:root {
  --bg: #0e2e34;
  --bg-2: #123a41;
  --bg-3: #16444c;
  --ink: #ffffff;
  --muted: #a7bfc3;
  --muted-2: #7f999e;

  --green: #72be44;
  --green-600: #63a939;
  --green-soft: rgba(114, 190, 68, 0.14);
  --green-line: rgba(114, 190, 68, 0.35);

  --orange: #c05a1e;
  --orange-bright: #d96a26;
  --orange-soft: rgba(217, 106, 38, 0.15);

  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.16);
  --danger: #e5675f;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);

  --font: 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system,
    'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
/* [hidden] must always win over element display rules (e.g. .task-main{display:flex}) */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
/* ambient backdrop lifted from the deck */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 600px at 88% -12%, rgba(114, 190, 68, 0.08), transparent 60%),
    radial-gradient(1000px 700px at 6% 112%, rgba(22, 68, 76, 0.9), transparent 60%);
}
.app, .auth-wrap { position: relative; z-index: 1; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 25px; }
h2 { font-size: 17px; }

/* signature skewed highlight */
mark {
  background: var(--orange); color: #fff;
  padding: 0.04em 0.32em 0.08em; transform: skewX(-8deg);
  display: inline-block; border-radius: 3px;
}
mark > span { display: inline-block; transform: skewX(8deg); }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0;
  padding: 24px 16px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 4px 10px 20px;
  font-weight: 700; font-size: 20px; letter-spacing: -0.02em;
}
.brand-mark {
  width: 28px; height: 28px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--green); border-radius: 8px;
  color: var(--bg); font-size: 15px; font-weight: 800;
  transform: skewX(-6deg);
}
.brand-mark span { transform: skewX(6deg); }
.brand-name b { color: var(--green); font-weight: 700; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; font-size: 14.5px;
  cursor: pointer; border: none; background: none; width: 100%;
  text-align: left; font-family: inherit;
}
.nav-item:hover { background: var(--bg-3); color: var(--ink); text-decoration: none; }
.nav-item.active {
  background: var(--green-soft); color: var(--ink);
  border: 1px solid var(--green-line); font-weight: 600;
}
.nav-ico { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; opacity: 0.85; }
.nav-ico svg { width: 20px; height: 20px; display: block; }
.nav-item:hover .nav-ico { opacity: 1; }
.nav-item.active .nav-ico { color: var(--green); opacity: 1; }
.nav-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.nav-logout:hover { color: var(--orange-bright); }

.content {
  flex: 1; padding: 32px 38px 72px;
  max-width: 1120px; margin: 0 auto; width: 100%;
}

/* ---------- page head ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--green); font-weight: 600; font-size: 13px;
  letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px;
}
.eyebrow::before { content: ''; width: 22px; height: 2px; background: var(--green); }
.page-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- cards ---------- */
.card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-hint { color: var(--muted); font-size: 12.5px; }
.card-hint.link { color: var(--green); font-weight: 600; }
.count {
  display: inline-block; background: var(--green-soft); color: var(--green);
  border: 1px solid var(--green-line);
  font-size: 12px; font-weight: 700; padding: 0 8px;
  border-radius: 999px; margin-left: 4px; line-height: 20px;
}
.card-today { border-color: var(--green-line); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.cols .card { margin-bottom: 0; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }

/* ---------- quick add ---------- */
.add-card { padding: 16px 18px; }
.add-form { display: flex; flex-direction: column; gap: 12px; }
.add-input {
  border: none; outline: none; background: none;
  font-size: 18px; font-family: inherit; font-weight: 600;
  padding: 4px 2px; color: var(--ink);
}
.add-input::placeholder { color: var(--muted-2); font-weight: 500; }
.add-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  border-top: 1px solid var(--line); padding-top: 12px;
}

/* segmented control */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 6px 12px; border-radius: 7px; cursor: pointer; user-select: none;
}
.seg input:checked + label { background: var(--bg-3); color: var(--ink); }
.seg input:focus-visible + label { outline: 2px solid var(--green); }
.seg-status input:checked + label { background: var(--green); color: var(--bg); }
.date-custom {
  border: none; background: none; font-family: inherit; font-size: 13px;
  color: var(--muted); padding: 5px 8px; border-radius: 7px; cursor: pointer;
  color-scheme: dark;
}
.date-custom:hover { background: var(--bg-3); color: var(--ink); }

.select {
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink);
  border: 1px solid var(--line-2); background: var(--bg); border-radius: var(--radius-sm);
  padding: 8px 12px; cursor: pointer; outline: none; color-scheme: dark;
}
.select:focus { border-color: var(--green); }

/* day picker for the quick-add — single day by default, span is opt-in */
.daypick { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.daypick-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted-2); margin-right: 2px;
}
.quickdays { display: inline-flex; gap: 6px; }
.chip-btn {
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 7px 13px; cursor: pointer;
}
.chip-btn:hover { color: var(--ink); }
.chip-btn.is-on { background: var(--green); color: var(--bg); border-color: var(--green); }
.date-input {
  font-family: inherit; font-size: 13px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 7px 10px;
  color-scheme: dark; outline: none;
}
.date-input:focus { border-color: var(--green); }
.span-sep { color: var(--muted); font-size: 13px; }

.add-foot {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
}
.span-toggle {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none;
  font-size: 13px; color: var(--muted); font-weight: 500;
}
.span-toggle input { width: 15px; height: 15px; accent-color: var(--green); cursor: pointer; }
.span-toggle:hover { color: var(--ink); }
.add-hint { font-size: 12.5px; color: var(--muted-2); }
.add-hint b { color: var(--green); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  font-family: inherit; font-size: 14px; font-weight: 700;
  border-radius: var(--radius-sm); padding: 10px 18px; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: var(--bg); }
.btn-primary:hover { background: var(--green-600); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg-3); text-decoration: none; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-bright); text-decoration: none; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; margin-top: 4px; }
.icon-btn {
  border: none; background: none; cursor: pointer; color: var(--muted);
  font-size: 14px; width: 30px; height: 30px; border-radius: 8px; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  flex-shrink: 0;
}
.icon-btn svg { width: 16px; height: 16px; display: block; }
.icon-btn:hover { background: var(--bg-3); color: var(--ink); text-decoration: none; }
.icon-danger:hover { background: var(--orange-soft); color: var(--orange-bright); }

/* ---------- daily log: week board ---------- */
.standup-help { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.standup-help b { color: var(--ink); font-weight: 600; }
.cols.standup { align-items: start; }

/* vertical weekday agenda (Sun–Thu) — full-width tasks, thin empty days */
.agenda { padding: 6px 20px; }
.aday { display: flex; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.aday:first-child { border-top: none; }
.aday-label { flex: 0 0 66px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding-top: 8px; }
.aday-dow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.aday-num { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1; }
.aday.is-today .aday-dow, .aday.is-today .aday-num { color: var(--green); }
.aday-today {
  margin-top: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--green); background: var(--green-soft); border: 1px solid var(--green-line);
  border-radius: 999px; padding: 1px 7px;
}
.aday-count {
  margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 7px; line-height: 18px;
}
.aday.is-today { background: var(--green-soft); border-radius: 12px; border-top-color: transparent; margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
.aday.is-today + .aday { border-top-color: transparent; }
.aday-body { flex: 1; min-width: 0; }
.aday .dayadd { margin-bottom: 0; }
.aday .task-list { margin-top: 8px; }
.agenda-list .task-date { display: none; } /* the row already names the day */

.dayadd {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 5px 6px 5px 14px;
}
.dayadd:focus-within { border-color: var(--green); }
.dayadd-input {
  flex: 1; min-width: 0; border: none; background: none; outline: none;
  font-family: inherit; font-size: 15px; color: var(--ink); padding: 7px 0;
}
.dayadd-input::placeholder { color: var(--muted-2); }
.dayadd-proj {
  flex-shrink: 0; max-width: 128px; font-size: 12.5px; font-weight: 600;
  padding: 6px 8px; border-color: var(--line); background: var(--bg-2);
}
.dayadd-go {
  flex-shrink: 0; width: 30px; height: 30px; border: none; border-radius: 8px;
  background: var(--green); color: var(--bg); font-size: 20px; font-weight: 700; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-family: inherit;
}
.dayadd-go:hover { background: var(--green-600); }

.another { margin-bottom: 18px; }
.another > summary {
  cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 600;
  padding: 11px 15px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm);
  list-style: none; user-select: none;
}
.another > summary::-webkit-details-marker { display: none; }
.another > summary::before { content: '＋ '; color: var(--green); font-weight: 700; }
.another[open] > summary::before { content: '－ '; }
.another > summary:hover { color: var(--ink); border-color: var(--green-line); }
.another-form { margin-top: 10px; flex-wrap: wrap; }

/* ---------- task lists ---------- */
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.task {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 6px; border-bottom: 1px solid var(--line);
}
.task:last-child { border-bottom: none; }
.task-list.compact .task { padding: 8px 4px; }
.task-main { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.task-body { min-width: 0; }
.task-desc { font-weight: 500; font-size: 15px; color: var(--ink); word-break: break-word; }
.task-edit { flex-basis: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 2px; }
.edit-desc {
  flex: 1; min-width: 180px; font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--green); border-radius: 8px; padding: 8px 11px; outline: none;
}
.edit-proj { flex-shrink: 0; }
.task-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.task-date { color: var(--muted-2); font-size: 11.5px; }
.chip {
  font-size: 11.5px; font-weight: 700; color: var(--green);
  background: var(--green-soft); border: 1px solid var(--green-line);
  padding: 0 9px; border-radius: 999px; line-height: 18px;
}
.check {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid var(--muted-2); background: transparent; cursor: pointer;
  color: transparent; font-size: 12px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.check:hover { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.check svg { width: 17px; height: 17px; display: block; }
.check-done { border-color: var(--green); background: var(--green); color: var(--bg); cursor: default; }
/* un-complete: make done checkmark interactive */
.check-undoable { cursor: pointer; }
.check-undoable:hover { background: var(--green-600); border-color: var(--green-600); color: var(--bg); }
.task-static .check-done svg { width: 11px; height: 11px; }
.task-check { display: inline-flex; }
/* drag-to-reorder grip */
.task-grip {
  border: none; background: none; color: var(--muted-2); cursor: grab;
  width: 22px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0; opacity: 0.3; transition: opacity 0.12s ease;
}
.task:hover .task-grip { opacity: 0.7; }
.task-grip:hover { opacity: 1 !important; color: var(--ink); }
.task-grip:active { cursor: grabbing; }
.task-grip svg { width: 18px; height: 18px; display: block; }
/* prevent the draggable <li> from showing a grab cursor everywhere */
.task[draggable="true"] { cursor: default; }
.task.dragging { opacity: 0.5; background: var(--bg-3); outline: 1px dashed var(--green-line); border-radius: 8px; }
/* sort button per day column */
.btn-sort-day {
  border: none; background: none; color: var(--muted-2); cursor: pointer;
  font-size: 13px; padding: 2px 5px; border-radius: 5px; margin-top: 2px;
  line-height: 1;
}
.btn-sort-day:hover { background: var(--bg-3); color: var(--ink); }
.task-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; opacity: 0.6; transition: opacity 0.15s ease; }
.task:hover .task-actions { opacity: 1; }
.js-inline { display: inline; margin: 0; }
.empty { color: var(--muted); font-size: 14px; margin: 6px 2px 2px; }

/* week / grouped view */
.week { display: flex; flex-direction: column; gap: 16px; }
.week-day-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); margin-bottom: 4px;
}
.week-day.is-today .week-day-label { color: var(--green); }
.task-list.plain .task { border: none; padding: 5px 2px; }
.task.task-static { justify-content: flex-start; gap: 10px; }
.task-static .check-done { width: 22px; height: 22px; font-size: 10px; }
.task-static .task-desc { font-weight: 400; color: var(--muted); }

/* ---------- Thursday banner ---------- */
.sendbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--orange-soft); border: 1px solid rgba(217, 106, 38, 0.4);
  border-radius: var(--radius); padding: 13px 18px; margin-bottom: 18px;
  font-size: 14px; color: #f3d9c9;
}
.sendbar b { color: #fff; }
.sendbar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange-bright); flex-shrink: 0; }

/* ---------- report / email ---------- */
.week-nav { display: flex; gap: 8px; }
.email-meta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.email-row { display: flex; gap: 12px; font-size: 14px; }
.email-k { width: 64px; color: var(--muted); flex-shrink: 0; font-weight: 600; }
.email-v.strong { font-weight: 700; }
.email-v.muted, .muted { color: var(--muted); }
/* the email body is a light "paper" surface — echoes the deck's white UI demos */
.email-body {
  background: #f7faf9; border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm); padding: 20px; color: #22343a;
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  margin: 0 0 16px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.email-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.copied-note { color: var(--green); font-weight: 700; font-size: 13px; }

/* editable email (weekly report) */
.email-head-right { display: flex; align-items: center; gap: 8px; }
.edited-badge {
  background: var(--orange-soft); color: var(--orange-bright);
  border: 1px solid rgba(217, 106, 38, 0.4); font-size: 11px; font-weight: 700;
  padding: 1px 9px; border-radius: 999px;
}
.email-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.email-field .email-k { width: auto; }
.email-subject-input {
  width: 100%; font-family: inherit; font-size: 15px; font-weight: 700; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; outline: none;
}
.email-subject-input:focus { border-color: var(--green); }
.email-body-edit {
  width: 100%; background: #f7faf9; border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm); padding: 18px; color: #22343a;
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.7; resize: vertical; outline: none; margin: 0 0 12px;
}
.email-body-edit:focus { border-color: var(--green); box-shadow: 0 0 0 2px rgba(114, 190, 68, 0.25); }
.email-hint { font-size: 12.5px; color: var(--muted-2); margin: 0 0 14px; }
.email-hint b { color: var(--muted); font-weight: 600; }
.reset-form { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.btn-link-danger {
  background: none; border: none; color: var(--muted); font-family: inherit; font-size: 13px;
  cursor: pointer; padding: 4px 0; font-weight: 600;
}
.btn-link-danger:hover { color: var(--orange-bright); }

/* ---------- quick email ---------- */
.qrows { display: flex; flex-direction: column; gap: 8px; }
.qrow { display: flex; align-items: center; gap: 8px; border-radius: var(--radius-sm); }
.qrow.dragging { opacity: 0.55; background: var(--bg-3); outline: 1px dashed var(--green-line); }
.qgrip {
  border: none; background: none; color: var(--muted-2); cursor: grab;
  width: 22px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
}
.qgrip:hover { color: var(--ink); }
.qgrip:active { cursor: grabbing; }
.qgrip svg { width: 16px; height: 16px; display: block; }
.grip-hint { color: var(--muted); letter-spacing: -2px; }
.qbullet { color: var(--green); font-size: 18px; width: 10px; text-align: center; flex-shrink: 0; }
.qinput {
  flex: 1; min-width: 0; font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 13px; outline: none;
}
.qinput:focus { border-color: var(--green); }
.qproject { flex-shrink: 0; max-width: 160px; padding: 9px 10px; }
.qrow .qdel { flex-shrink: 0; opacity: 0.6; }
.qrow .qdel:hover { opacity: 1; }

.qbatch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.qbatch {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.qbatch:last-child { border-bottom: none; }
.qbatch-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; text-decoration: none; }
.qbatch-main:hover { text-decoration: none; }
.qbatch-main:hover .qbatch-title { color: var(--green); }
.qbatch-title { font-weight: 600; color: var(--ink); }
.qbatch-meta { font-size: 12.5px; color: var(--muted); }
.form-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- browse / calendar ---------- */
.browse { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .browse { grid-template-columns: 1fr; } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-weight: 700; font-size: 16px; }
.cal-nav { display: flex; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow {
  text-align: center; font-size: 11px; font-weight: 700; color: var(--muted-2);
  padding: 4px 0; text-transform: uppercase;
}
.cal-cell {
  position: relative; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 13.5px; font-weight: 600;
  color: var(--ink); border: 1px solid transparent; cursor: pointer;
  text-decoration: none;
}
.cal-cell:hover { background: var(--bg-3); text-decoration: none; }
.cal-cell.out { color: var(--muted-2); opacity: 0.45; }
.cal-cell.today { border-color: var(--line-2); }
.cal-cell.selected { background: var(--green); color: var(--bg); }
.cal-cell .cdot {
  position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--green);
}
.cal-cell.selected .cdot { background: var(--bg); }
.cal-cell .cdot.planned { background: var(--orange-bright); }
.cal-legend { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.cal-legend i.g { background: var(--green); }
.cal-legend i.o { background: var(--orange-bright); }

.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input[type='search'] {
  flex: 1; font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 11px 14px; outline: none;
}
.search-bar input[type='search']:focus { border-color: var(--green); }
.results-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* ---------- forms / settings ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field textarea, .field select {
  font-family: inherit; font-size: 15px; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 13px;
  background: var(--bg); outline: none; width: 100%; color-scheme: dark;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green); }
.field textarea { resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.field-check { justify-content: space-between; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: background 0.15s ease; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform 0.15s ease; }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }

/* projects manager */
.proj-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.proj-row { display: flex; align-items: center; gap: 8px; }
.proj-row.is-archived { opacity: 0.6; }
.proj-form { display: flex; align-items: center; gap: 8px; flex: 1; margin: 0; }
.proj-name {
  font-family: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink);
  border: 1px solid transparent; border-radius: 9px; padding: 8px 10px; flex: 1; background: var(--bg); outline: none;
}
.proj-name:focus { border-color: var(--green); }
.proj-name-static { display: inline-block; }
.proj-add { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }

/* colour swatch dropdown (unique colours per project) */
.colorpick { position: relative; flex-shrink: 0; }
.color-swatch {
  width: 30px; height: 30px; border-radius: 8px; padding: 0; display: block; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.color-swatch:hover { border-color: #fff; }
.color-swatch.is-static { cursor: default; }
.color-menu {
  position: absolute; top: 38px; left: 0; z-index: 30; width: max-content;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px; box-shadow: var(--shadow);
}
.color-menu[hidden] { display: none; } /* beat the author display:grid so hidden works */
.color-opt {
  width: 28px; height: 28px; border-radius: 7px; padding: 0; cursor: pointer; position: relative;
  border: 2px solid transparent; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.color-opt:hover { border-color: rgba(255, 255, 255, 0.7); }
.color-check { width: 15px; height: 15px; opacity: 0; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.color-opt.is-current { border-color: #fff; }
.color-opt.is-current .color-check { opacity: 1; }
.color-opt.is-used { cursor: not-allowed; opacity: 0.32; border-color: transparent; }
.color-opt.is-used:hover { border-color: transparent; }
.color-opt.is-used .color-check { opacity: 1; }

/* ---------- alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; margin-bottom: 18px; }
.alert-ok { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-line); }
.alert-error { background: var(--orange-soft); color: var(--orange-bright); border: 1px solid rgba(217, 106, 38, 0.4); }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 390px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px;
}
.auth-brand { font-size: 23px; font-weight: 700; display: flex; align-items: center; gap: 11px; }
.auth-sub { color: var(--muted); margin: 8px 0 22px; font-size: 14px; }
.err-title { margin: 16px 0 10px; font-size: 20px; }
.err-msg { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 12px; white-space: pre-wrap; overflow: auto; color: var(--muted); }
