/* ==========================================================================
   L&D Task Tracker — design system
   Ink sidebar, cool canvas, one green for "action", status colours carry
   meaning everywhere (stripe, pill, board column, calendar chip).
   ========================================================================== */

:root {
  --ink: #18222d;
  --ink-2: #243241;
  --ink-soft: #3a4856;
  --canvas: #f2f4f3;
  --surface: #ffffff;
  --sunken: #f7f8f7;
  --line: #dce2df;
  --line-strong: #c6cfcb;
  --text: #18222d;
  --muted: #5e6b73;
  --faint: #8a969c;

  --primary: #126b5b;
  --primary-ink: #0c4f43;
  --primary-soft: #e3f1ed;

  --todo: #5b6b78;      --todo-bg: #eceff1;
  --progress: #2c5fc4;  --progress-bg: #e7eefb;
  --review: #6a4bb3;    --review-bg: #efeafa;
  --done: #127a52;      --done-bg: #e2f3ea;
  --closed: #6f7a80;    --closed-bg: #eef0f1;
  --rejected: #8c4a3b;  --rejected-bg: #f6ebe7;
  --overdue: #b93a26;   --overdue-bg: #fbe9e5;
  --amber: #b9700b;     --amber-bg: #fdf1dc;

  --font-ui: "Instrument Sans", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Hind Siliguri", "Instrument Sans", system-ui, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --sidebar-w: 248px;

  /* Bootstrap bridge */
  --bs-body-font-family: var(--font-ui);
  --bs-body-color: var(--text);
  --bs-body-bg: var(--canvas);
  --bs-border-color: var(--line);
  --bs-primary: var(--primary);
  --bs-primary-rgb: 18, 107, 91;
  --bs-link-color: var(--primary);
  --bs-link-color-rgb: 18, 107, 91;
  --bs-link-hover-color: var(--primary-ink);
  --bs-link-hover-color-rgb: 12, 79, 67;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--canvas);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-ink); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4, .page-title {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
  color: var(--ink);
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */
.shell {
  display: flex;
  min-height: 100vh;
  /* keeps the ink column full height however long the page is */
  background: linear-gradient(to right, var(--ink) var(--sidebar-w), transparent var(--sidebar-w));
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 14px 14px;
  background: var(--ink);
  color: #d9e1e6;
  overflow-y: auto;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 16px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}
.brand:hover { color: #fff; }

.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  background: var(--primary);
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  width: 7px;
  height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.new-task-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 4px 14px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.new-task-btn:hover { background: #158270; color: #fff; }
.new-task-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: #c3ced5;
  font-weight: 500;
}
.side-link:hover { background: var(--ink-2); color: #fff; }
.side-link.is-active { background: #2c3d4e; color: #fff; }
.side-link.is-active .side-ico svg { stroke: #7fd3bf; }

.side-ico { display: inline-flex; width: 18px; height: 18px; }
.side-ico svg, .mobile-bell svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.side-text { flex: 1; min-width: 0; }

.side-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  background: #34465a;
  color: #fff;
}
.side-count.tone-alert { background: var(--overdue); }
.side-count.tone-warn { background: #d08a1c; color: #1d1405; }

.side-group-title {
  margin: 18px 10px 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #7f8f9b;
}

.side-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #2a3846;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.me-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-md);
  color: #fff;
}
.me-chip:hover, .me-chip.is-active { background: var(--ink-2); color: #fff; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: #cfe7e0;
  color: var(--primary-ink);
  font-size: 12px;
  font-weight: 700;
}
.avatar.sm { width: 24px; height: 24px; flex-basis: 24px; font-size: 10px; }

.me-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { font-size: 12px; color: #93a3ae; }

.signout {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: #93a3ae;
}
.signout:hover { color: #fff; background: var(--ink-2); }

.main {
  flex: 1;
  min-width: 0;
  padding: 30px 36px 24px;
  display: flex;
  flex-direction: column;
}
.main > :not(.app-foot) { width: 100%; max-width: 1280px; }

.app-foot {
  margin-top: auto;
  padding-top: 32px;
  font-size: 12.5px;
  color: var(--faint);
}

.mobile-bar, .scrim { display: none; }

@media (max-width: 991.98px) {
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    background: var(--ink);
    color: #fff;
  }
  .menu-btn {
    display: inline-flex;
    padding: 6px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: #fff;
  }
  .menu-btn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; color: #fff; font-family: var(--font-display); font-weight: 650; flex: 1; }
  .mobile-brand .brand-mark { width: 24px; height: 24px; flex-basis: 24px; }
  .mobile-brand .brand-mark::after { left: 7px; top: 4px; }
  .mobile-bell { position: relative; color: #fff; padding: 6px; }
  .mobile-bell svg { width: 22px; height: 22px; }
  .mobile-bell .dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: #ff6b53; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    transform: translateX(-100%);
    transition: transform .2s ease;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
  }
  .menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 22, 30, .45); z-index: 35; }

  .main { padding: 20px 16px 20px; }
  .shell { background: none; }
}

/* --------------------------------------------------------------------------
   Guest (sign in, register, password reset)
   -------------------------------------------------------------------------- */
.guest-main {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) 1.1fr;
}

.guest-brand {
  display: flex;
  flex-direction: column;
  padding: 40px 48px;
  background: var(--ink);
  color: #dfe7ec;
}
.guest-pitch { margin: auto 0; max-width: 26rem; }
.guest-pitch h1 {
  color: #fff;
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  line-height: 1.05;
  font-weight: 750;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.guest-pitch p { color: #a9b7c0; font-size: 1.05rem; max-width: 30ch; }

.guest-flow {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
}
.guest-flow li { display: flex; align-items: center; gap: 8px; }
.guest-flow li + li::before {
  content: "";
  width: 14px;
  height: 1px;
  background: #4a5b6b;
}

.guest-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card { width: 100%; max-width: 420px; }
.auth-card.wide { max-width: 620px; }
.auth-card h2 { font-size: 1.7rem; font-weight: 650; margin-bottom: 4px; }
.auth-card .lead-sm { color: var(--muted); margin-bottom: 24px; }
.auth-alt { margin-top: 20px; color: var(--muted); font-size: 14px; }

@media (max-width: 860px) {
  .guest-main { grid-template-columns: 1fr; }
  .guest-brand { padding: 24px 20px; }
  .guest-pitch { margin: 28px 0 18px; }
  .guest-pitch h1 { font-size: 1.8rem; }
  .guest-panel { align-items: flex-start; padding: 28px 18px 40px; }
}

/* --------------------------------------------------------------------------
   Page header
   -------------------------------------------------------------------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-bottom: 22px;
}
.page-title { font-size: 1.85rem; font-weight: 650; margin: 0; line-height: 1.15; }
.page-sub { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.crumb { display: inline-flex; gap: 6px; margin-bottom: 8px; font-size: 13.5px; color: var(--muted); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--primary); }

/* --------------------------------------------------------------------------
   Buttons + forms (Bootstrap overrides)
   -------------------------------------------------------------------------- */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: var(--r-md);
  --bs-btn-padding-y: .5rem;
  --bs-btn-padding-x: 1rem;
  --bs-btn-font-size: .94rem;
}
.btn-sm { --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .65rem; --bs-btn-font-size: .85rem; --bs-btn-border-radius: 8px; }

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-ink);
  --bs-btn-hover-border-color: var(--primary-ink);
  --bs-btn-active-bg: var(--primary-ink);
  --bs-btn-active-border-color: var(--primary-ink);
  --bs-btn-disabled-bg: var(--primary);
  --bs-btn-disabled-border-color: var(--primary);
}

.btn-ghost, .btn-light, .btn-outline-secondary, .btn-secondary {
  --bs-btn-color: var(--ink);
  --bs-btn-bg: var(--surface);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-bg: var(--sunken);
  --bs-btn-hover-border-color: #aeb9b4;
  --bs-btn-active-bg: #eef1ef;
  --bs-btn-active-color: var(--ink);
  --bs-btn-active-border-color: #aeb9b4;
}

.btn-danger, .btn-outline-danger {
  --bs-btn-color: var(--overdue);
  --bs-btn-bg: var(--surface);
  --bs-btn-border-color: #e3b4aa;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--overdue);
  --bs-btn-hover-border-color: var(--overdue);
  --bs-btn-active-bg: #9c2f1e;
  --bs-btn-active-border-color: #9c2f1e;
}

.btn-success { --bs-btn-bg: var(--done); --bs-btn-border-color: var(--done); --bs-btn-hover-bg: #0d6142; --bs-btn-hover-border-color: #0d6142; }
.btn-warning { --bs-btn-color: #5a3a06; --bs-btn-bg: var(--amber-bg); --bs-btn-border-color: #ecc98a; --bs-btn-hover-bg: #f9e3b8; --bs-btn-hover-border-color: #e0b665; }
.btn-info, .btn-dark { --bs-btn-color: #fff; --bs-btn-bg: var(--ink-soft); --bs-btn-border-color: var(--ink-soft); --bs-btn-hover-bg: var(--ink); --bs-btn-hover-border-color: var(--ink); --bs-btn-hover-color: #fff; }

.form-label { font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.form-text, .hint { font-size: 13px; color: var(--muted); }

.form-control, .form-select {
  border-color: var(--line-strong);
  border-radius: var(--r-md);
  padding: .55rem .8rem;
  font-size: .95rem;
  color: var(--text);
  background-color: var(--surface);
}
.form-select { padding-right: 2.25rem; background-position: right .7rem center; }
.form-control-sm, .form-select-sm { padding: .3rem .6rem; font-size: .87rem; border-radius: 8px; }
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 107, 91, .16);
}
textarea.form-control { min-height: 110px; }

.form-range::-webkit-slider-thumb { background: var(--primary); }
.form-range::-moz-range-thumb { background: var(--primary); }

.alert { border-radius: var(--r-md); border-width: 1px; padding: .75rem 1rem; }
.alert-success { background: var(--done-bg); border-color: #b7dfc9; color: #0c4f35; }
.alert-danger { background: var(--overdue-bg); border-color: #efc0b6; color: #7a2516; }
.alert-info { background: var(--progress-bg); border-color: #c4d4f3; color: #1d3f82; }
.alert-warning { background: var(--amber-bg); border-color: #efd29c; color: #5a3a06; }
.alert ul { padding-left: 1.1rem; }

/* --------------------------------------------------------------------------
   Panels, tables
   -------------------------------------------------------------------------- */
.panel, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.card { --bs-card-border-color: var(--line); --bs-card-border-radius: var(--r-lg); box-shadow: none !important; }
.panel-pad { padding: 20px; }
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
}
.panel-head h2 { font-size: 1.12rem; font-weight: 650; margin: 0; }
.panel-head a { font-size: 14px; font-weight: 600; }

.table { --bs-table-bg: transparent; margin: 0; font-size: 14.5px; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-color: var(--line); }
.table thead th, .table thead.table-dark th {
  background: var(--sunken) !important;
  color: var(--muted) !important;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--line) !important;
  white-space: nowrap;
}
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: transparent; }
.table-bordered > :not(caption) > * > * { border-width: 0 0 1px 0; }
.table-bordered > :not(caption) > * { border-width: 0; }
.table-responsive { border-radius: var(--r-lg); }

.empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
}
.empty strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 4px; }

/* --------------------------------------------------------------------------
   Pills (status / priority / due)
   -------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 8px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pill.no-dot::before { display: none; }

.tone-todo     { color: var(--todo);     background: var(--todo-bg); }
.tone-progress { color: var(--progress); background: var(--progress-bg); }
.tone-review   { color: var(--review);   background: var(--review-bg); }
.tone-done     { color: var(--done);     background: var(--done-bg); }
.tone-closed   { color: var(--closed);   background: var(--closed-bg); }
.tone-rejected { color: var(--rejected); background: var(--rejected-bg); }
.tone-overdue  { color: var(--overdue);  background: var(--overdue-bg); }

.prio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.prio-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.prio-bars i { display: block; width: 3px; border-radius: 1px; background: #cdd5d9; }
.prio-bars i:nth-child(1) { height: 5px; }
.prio-bars i:nth-child(2) { height: 8px; }
.prio-bars i:nth-child(3) { height: 11px; }
.prio-low      { color: var(--faint); }
.prio-low .prio-bars i:nth-child(1) { background: currentColor; }
.prio-medium   { color: var(--todo); }
.prio-medium .prio-bars i:nth-child(-n+2) { background: currentColor; }
.prio-high     { color: var(--amber); }
.prio-high .prio-bars i { background: currentColor; }
.prio-critical { color: var(--overdue); }
.prio-critical .prio-bars i { background: currentColor; }

.due { font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.due-overdue { color: var(--overdue); }
.due-today { color: var(--amber); }
.due-soon { color: var(--ink-soft); }
.due-none { color: var(--faint); font-weight: 500; }

.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--muted); }

/* Status stripe on the left edge of any task item */
.stripe { position: relative; }
.stripe::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--stripe, var(--todo));
}
.s-todo { --stripe: var(--todo); }
.s-progress { --stripe: var(--progress); }
.s-review { --stripe: var(--review); }
.s-done { --stripe: var(--done); }
.s-closed { --stripe: var(--closed); }
.s-rejected { --stripe: var(--rejected); }
.s-overdue { --stripe: var(--overdue); }

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.hello { margin-bottom: 22px; }
.hello h1 { font-size: 2rem; font-weight: 650; margin: 0; }
.hello p { margin: 4px 0 0; color: var(--muted); }

.numbers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  margin-bottom: 20px;
}
.numbers a {
  display: block;
  padding: 14px 18px;
  color: var(--ink);
  border-left: 1px solid var(--line);
}
.numbers a:first-child { border-left: 0; }
.numbers a:hover { background: var(--sunken); }
.numbers b { display: block; font-family: var(--font-display); font-size: 1.8rem; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.numbers span { font-size: 13.5px; color: var(--muted); }
.numbers .is-bad b { color: var(--overdue); }

@media (max-width: 860px) {
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .numbers a { border-left: 0; border-top: 1px solid var(--line); }
  .numbers a:nth-child(-n+2) { border-top: 0; }
  .numbers a:nth-child(even) { border-left: 1px solid var(--line); }
  .numbers a:last-child:nth-child(odd) { grid-column: span 2; }
}

/* The two-week strip — the one bold element of the dashboard */
.strip-wrap { padding: 4px 20px 20px; overflow-x: auto; }
.strip {
  display: grid;
  grid-template-columns: 92px repeat(14, minmax(46px, 1fr));
  gap: 4px;
  min-width: 760px;
  align-items: end;
}
.strip-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  color: var(--ink);
}
.strip-col:hover { color: var(--ink); }
.strip-stack {
  height: 112px;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  padding: 4px;
  border-radius: var(--r-sm);
  background: var(--sunken);
}
.strip-col:hover .strip-stack { background: #eceeed; }
.strip-col.is-today .strip-stack { background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--primary); }
.strip-col.is-weekend .strip-stack { background: repeating-linear-gradient(135deg, var(--sunken) 0 6px, #eef0ef 6px 12px); }
.strip-col.is-late .strip-stack { background: var(--overdue-bg); }
.strip-unit { height: 7px; border-radius: 2px; flex: 0 0 7px; }
.strip-unit.p-critical { background: var(--overdue); }
.strip-unit.p-high { background: #d58b17; }
.strip-unit.p-medium { background: #7e8f9b; }
.strip-unit.p-low { background: #bfc9ce; }
.strip-more { font-size: 11px; font-weight: 700; text-align: center; color: var(--ink-soft); }
.strip-day { text-align: center; line-height: 1.15; }
.strip-day b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.strip-day span { font-size: 11.5px; color: var(--muted); }
.strip-col.is-today .strip-day b, .strip-col.is-today .strip-day span { color: var(--primary); }
.strip-col.is-late .strip-day b, .strip-col.is-late .strip-day span { color: var(--overdue); }
.strip-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 0 20px 16px; font-size: 12.5px; color: var(--muted); }
.strip-legend i { display: inline-block; width: 10px; height: 7px; border-radius: 2px; margin-right: 5px; }

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

.task-rows { list-style: none; margin: 0; padding: 0; }
.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  align-items: center;
  padding: 12px 20px 12px 22px;
  border-top: 1px solid var(--line);
  color: var(--text);
}
.task-row:hover { background: var(--sunken); color: var(--text); }
.task-row .t-title { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.task-row .t-side { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }

.load-list { list-style: none; margin: 0; padding: 0 20px 16px; }
.load-item { padding: 10px 0; border-top: 1px solid var(--line); }
.load-item:first-child { border-top: 0; }
.load-top { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.load-top a { font-weight: 600; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.load-top span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.load-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--sunken); }
.load-bar i { display: block; height: 100%; }
.load-bar .b-overdue { background: var(--overdue); }
.load-bar .b-progress { background: var(--progress); }
.load-bar .b-review { background: var(--review); }
.load-bar .b-todo { background: #a7b3ba; }

.feed { list-style: none; margin: 0; padding: 0 20px 14px; }
.feed li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.feed li:first-child { border-top: 0; }
.feed .what { color: var(--text); overflow-wrap: anywhere; }
.feed .what a { font-weight: 600; color: var(--ink); }
.feed .when { font-size: 12.5px; color: var(--faint); }

/* --------------------------------------------------------------------------
   Task list
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
}
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .n { font-size: 12px; padding: 0 7px; border-radius: 999px; background: var(--todo-bg); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tabs a.tab-overdue .n { background: var(--overdue-bg); color: var(--overdue); }

.view-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.view-switch a { padding: .45rem .8rem; font-weight: 600; font-size: 14px; color: var(--muted); border-left: 1px solid var(--line); }
.view-switch a:first-child { border-left: 0; }
.view-switch a.is-active { background: var(--ink); color: #fff; }

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.filters .actions { display: flex; gap: 8px; }

.task-table td { vertical-align: middle; }
.task-table .t-title { font-weight: 600; color: var(--ink); }
.task-table .t-title:hover { color: var(--primary); }
.task-table td.stripe { padding-left: 1.1rem; }
.task-table td.stripe::before { top: 12px; bottom: 12px; }
.task-table tbody tr:hover { background: var(--sunken); }
.task-table .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.assignee { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }

.mini-progress { width: 64px; height: 5px; border-radius: 3px; background: var(--todo-bg); overflow: hidden; }
.mini-progress i { display: block; height: 100%; background: var(--primary); }

@media (max-width: 760px) {
  .task-table thead { display: none; }
  .task-table, .task-table tbody, .task-table tr, .task-table td { display: block; width: 100%; }
  .task-table tr { position: relative; padding: 10px 14px 10px 16px; border-bottom: 1px solid var(--line); }
  .task-table td.stripe { position: static; }
  .task-table td.stripe::before { top: 10px; bottom: 10px; }
  .task-table td { border: 0 !important; padding: 2px 0 !important; }
  .task-table td.hide-sm { display: none; }
  .task-table td.cell-inline { display: inline-block; width: auto; margin-right: 12px; }
}

/* --------------------------------------------------------------------------
   Board
   -------------------------------------------------------------------------- */
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  align-items: start;
}
.col {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  border-radius: var(--r-lg);
  background: #e9edeb;
  border-top: 3px solid var(--stripe, var(--todo));
}
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  font-weight: 650;
  font-family: var(--font-display);
}
.col-head .n { font-family: var(--font-ui); font-size: 12.5px; font-weight: 700; color: var(--muted); }
.col-hint { margin: -4px 12px 8px; font-size: 12px; color: var(--muted); }
.col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 8px 10px;
  min-height: 120px;
  flex: 1;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  transition: background .12s ease;
}
.col-body.is-over { background: rgba(18, 107, 91, .10); outline: 2px dashed var(--primary); outline-offset: -4px; }
.col-body.is-blocked { cursor: not-allowed; }

.kcard {
  display: block;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  cursor: grab;
}
.kcard:hover { border-color: var(--line-strong); color: var(--text); }
.kcard.is-dragging { opacity: .45; }
.kcard.is-saving { opacity: .6; pointer-events: none; }
.kcard .k-title { display: block; font-weight: 600; color: var(--ink); margin-bottom: 8px; overflow-wrap: anywhere; line-height: 1.35; }
.kcard .k-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kcard .k-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kcard .k-move { margin-top: 8px; }

.toast-note {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.toast-note.is-error { background: var(--overdue); }

/* --------------------------------------------------------------------------
   Calendar
   -------------------------------------------------------------------------- */
.cal { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--sunken); border-bottom: 1px solid var(--line); }
.cal-head div.wk { color: var(--faint); }
.cal-cell {
  min-height: 118px;
  padding: 6px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cal-grid .cal-cell:nth-child(7n+1) { border-left: 0; }
.cal-grid .cal-cell:nth-child(-n+7) { border-top: 0; }
.cal-cell.is-out { background: #fafbfa; }
.cal-cell.is-out .cal-date { color: #b5bec2; }
.cal-cell.is-weekend { background: #fbfbfa; }
.cal-date { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink-soft); padding: 0 2px 2px; }
.cal-cell.is-today .cal-date b { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; }
.cal-add { opacity: 0; font-size: 16px; line-height: 1; color: var(--muted); padding: 0 4px; border-radius: 4px; }
.cal-cell:hover .cal-add, .cal-add:focus { opacity: 1; }
.cal-add:hover { background: var(--primary-soft); color: var(--primary); }
.chip {
  display: block;
  padding: 2px 6px 2px 8px;
  border-radius: 5px;
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-left: 3px solid var(--stripe, var(--todo));
  background: var(--sunken);
  color: var(--ink);
}
.chip:hover { background: #e8ecea; color: var(--ink); }
.chip.is-finished { color: var(--faint); text-decoration: line-through; }
.cal-more { font-size: 12px; color: var(--muted); padding-left: 4px; }

@media (max-width: 760px) {
  .cal-head { display: none; }
  .cal-grid { grid-template-columns: 1fr; }
  .cal-cell { min-height: 0; border-left: 0 !important; border-top: 1px solid var(--line) !important; }
  .cal-cell.is-out, .cal-cell.is-empty { display: none; }
  .cal-date::after { content: attr(data-dow); font-weight: 500; color: var(--muted); margin-left: 8px; margin-right: auto; }
}

/* --------------------------------------------------------------------------
   Task detail
   -------------------------------------------------------------------------- */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1000px) { .detail { grid-template-columns: 1fr; } }

.detail-title { font-size: 1.9rem; font-weight: 650; line-height: 1.15; margin: 0 0 10px; overflow-wrap: anywhere; }
.detail-desc { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; max-width: 72ch; }
.detail-desc.is-empty { color: var(--faint); font-style: italic; }

.facts { margin: 0; }
.facts > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { font-weight: 500; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.bigprogress { height: 8px; border-radius: 4px; background: var(--todo-bg); overflow: hidden; margin-top: 6px; }
.bigprogress i { display: block; height: 100%; background: var(--primary); }

.status-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.status-pick input { position: absolute; opacity: 0; pointer-events: none; }
.status-pick label {
  cursor: pointer;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface);
}
.status-pick label:hover { border-color: #9faca6; }
.status-pick input:checked + label { border-color: transparent; }
.status-pick input:checked + label.tone-todo     { background: var(--todo);     color: #fff; }
.status-pick input:checked + label.tone-progress { background: var(--progress); color: #fff; }
.status-pick input:checked + label.tone-review   { background: var(--review);   color: #fff; }
.status-pick input:checked + label.tone-done     { background: var(--done);     color: #fff; }
.status-pick input:checked + label.tone-closed   { background: var(--closed);   color: #fff; }
.status-pick input:checked + label.tone-rejected { background: var(--rejected); color: #fff; }
.status-pick input:checked + label.tone-overdue  { background: var(--overdue);  color: #fff; }
.status-pick input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 2px; }
.status-pick label.tone-todo, .status-pick label.tone-progress, .status-pick label.tone-review,
.status-pick label.tone-done, .status-pick label.tone-closed, .status-pick label.tone-rejected,
.status-pick label.tone-overdue { background: var(--surface); color: var(--ink-soft); }

.timeline { list-style: none; margin: 0; padding: 0 20px 10px; }
.timeline li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .who { font-weight: 600; font-size: 14px; }
.timeline .when { font-size: 12.5px; color: var(--faint); margin-left: 6px; }
.timeline .note { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline li.is-system .note { color: var(--muted); font-size: 14px; }
.timeline li.is-system .avatar { background: var(--sunken); color: var(--faint); }

/* --------------------------------------------------------------------------
   Forms (task form, admin forms)
   -------------------------------------------------------------------------- */
.form-wrap { max-width: 860px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.form-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--sunken);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.title-input { font-family: var(--font-display); font-size: 1.25rem !important; font-weight: 600; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  background: var(--surface);
}
.seg input:checked + label { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.seg input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 2px; }

.quick-dates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick-dates button {
  border: 1px solid var(--line);
  background: var(--sunken);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.quick-dates button:hover { border-color: var(--line-strong); background: #eef1ef; }

/* --------------------------------------------------------------------------
   Admin tables (people, approvals)
   -------------------------------------------------------------------------- */
.people-table .inline-form { display: flex; gap: 6px; align-items: center; }
.people-table .inline-form .form-select { min-width: 140px; }
.badge-soft { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.badge-active { background: var(--done-bg); color: var(--done); }
.badge-pending { background: var(--amber-bg); color: var(--amber); }
.badge-inactive { background: var(--closed-bg); color: var(--closed); }
.badge-rejected { background: var(--overdue-bg); color: var(--overdue); }

details.manage summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--primary); list-style: none; }
details.manage summary::-webkit-details-marker { display: none; }
details.manage[open] summary { margin-bottom: 8px; }
details.manage .manage-body { display: grid; gap: 8px; min-width: 240px; }

/* --------------------------------------------------------------------------
   Error page
   -------------------------------------------------------------------------- */
.error-page { max-width: 560px; padding: 40px 0; }
.error-code { font-family: var(--font-display); font-size: 4.5rem; font-weight: 750; line-height: 1; color: var(--line-strong); margin-bottom: 10px; }
.guest-panel .error-page { padding: 0; }

/* Bulk actions on the task list */
.task-table .sel-col { width: 38px; padding-right: 0 !important; }
.task-table td.sel-col { vertical-align: middle; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.bulk-bar {
  position: sticky;
  bottom: 14px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 30px rgba(15, 22, 30, .25);
}
.bulk-bar .form-select, .bulk-bar .form-control { width: auto; min-width: 160px; }
.bulk-bar .btn-ghost { --bs-btn-bg: transparent; --bs-btn-color: #fff; --bs-btn-border-color: #4a5b6b; --bs-btn-hover-bg: var(--ink-2); --bs-btn-hover-color: #fff; }
.bulk-bar [hidden] { display: none !important; }
@media (max-width: 760px) { .task-table td.sel-col { display: inline-block; width: auto; margin-right: 8px; } }


.form-check-input:indeterminate { background-color: var(--primary); border-color: var(--primary); }

/* Joint assignment picker */
.co-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; max-height: 236px; overflow-y: auto; padding: 8px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--sunken); }
.co-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; font-size: 14px; font-weight: 500; margin: 0; }
.co-item:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.co-item[hidden] { display: none; }
.co-item .form-check-input { margin: 0; flex: 0 0 auto; }

/* People stack on list rows */
.stack { display: inline-flex; align-items: center; }
.stack .avatar { border: 2px solid var(--surface); margin-left: -7px; }
.stack .avatar:first-child { margin-left: 0; }
.stack .more { margin-left: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* Files */
.files { list-style: none; margin: 0; padding: 0 20px 10px; }
.files li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.files li:first-child { border-top: 0; }
.ftype { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--sunken); border: 1px solid var(--line); font-size: 10px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; }
.ftype.t-pdf { background: #fbe9e5; color: #a5321f; border-color: #f0cbc2; }
.ftype.t-doc, .ftype.t-docx { background: #e7eefb; color: #2c5fc4; border-color: #c9d7f3; }
.ftype.t-xls, .ftype.t-xlsx, .ftype.t-csv { background: #e2f3ea; color: #127a52; border-color: #bfe2cf; }
.ftype.t-ppt, .ftype.t-pptx { background: #fdf1dc; color: #a45f05; border-color: #f0d6a6; }
.fname { font-weight: 600; overflow-wrap: anywhere; }
.fmeta { font-size: 12.5px; color: var(--faint); }
.factions { display: flex; gap: 4px; align-items: center; }
.drop { margin: 0 20px 16px; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); background: var(--sunken); }
.drop.is-over { border-color: var(--primary); background: var(--primary-soft); }

/* ==========================================================================
   Refinements — calmer, more polished surfaces
   ========================================================================== */
:root {
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-2: 0 4px 16px rgba(16, 24, 40, .07);
}
body { font-size: 14.5px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.panel, .card, .numbers, .kpi-row, .cal { box-shadow: var(--shadow-1); }
.page-title { font-size: 1.7rem; letter-spacing: -0.02em; }
.page-head { padding-bottom: 4px; }

.side-link { position: relative; font-size: 14.5px; }
.side-link.is-active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: #7fd3bf;
}
.btn { --bs-btn-border-radius: 9px; letter-spacing: -0.005em; }
.btn-primary { box-shadow: 0 1px 2px rgba(12, 79, 67, .25); }
.table thead th { font-size: 12.5px; letter-spacing: .01em; }
.task-row, .table > tbody > tr { transition: background-color .12s ease; }
.form-control, .form-select { transition: border-color .12s ease, box-shadow .12s ease; }

/* ==========================================================================
   Notifications
   ========================================================================== */
.nt-wrap { max-width: 880px; }
.nt-toolbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; margin-bottom: 12px;
  background: rgba(242, 244, 243, .92); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--r-lg);
}
.nt-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.nt-check .form-check-input { margin: 0; }
.nt-count { margin-left: auto; font-size: 13px; color: var(--faint); }
.nt-toolbar [hidden] { display: none !important; }

.nt-group { margin-bottom: 18px; }
.nt-day { font-family: var(--font-ui); font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 0 8px 4px; letter-spacing: .02em; }
.nt-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.nt-item { position: relative; display: flex; align-items: center; border-top: 1px solid var(--line); }
.nt-item:first-child { border-top: 0; }
.nt-item:hover { background: var(--sunken); }
.nt-item.is-unread { background: #f3faf7; }
.nt-item.is-unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }

.nt-sel {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%); margin: 0 !important;
  opacity: 0; transition: opacity .12s ease; z-index: 2;
}
.nt-item:hover .nt-sel, .nt-sel:checked, .nt-sel:focus-visible, .is-selecting .nt-sel { opacity: 1; }
.nt-item:hover .nt-ico, .is-selecting .nt-ico { opacity: 0; }
.nt-item:has(.nt-sel:checked) { background: var(--primary-soft); }

.nt-body {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: start;
  padding: 14px 8px 14px 14px; color: var(--text);
}
.nt-body:hover { color: var(--text); }
.nt-ico {
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity .12s ease;
}
.nt-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.k-assign   { background: var(--progress-bg); color: var(--progress); }
.k-handover { background: var(--review-bg); color: var(--review); }
.k-away     { background: var(--closed-bg); color: var(--closed); }
.k-update   { background: var(--todo-bg); color: var(--ink-soft); }
.k-file     { background: var(--amber-bg); color: var(--amber); }
.k-done     { background: var(--done-bg); color: var(--done); }

.nt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nt-title { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.is-unread .nt-title { font-weight: 700; }
.nt-new { font-size: 11px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 0 7px; border-radius: 999px; line-height: 1.7; }
.nt-msg { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.nt-task { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; color: var(--ink-soft); font-weight: 500; min-width: 0; }
.nt-task .pill { font-size: 11.5px; padding: 0 8px 0 7px; }
.nt-time { font-size: 12.5px; color: var(--faint); white-space: nowrap; padding-top: 2px; }

.nt-x {
  flex: 0 0 auto; margin-right: 10px;
  width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--faint);
  display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s ease;
}
.nt-item:hover .nt-x, .nt-x:focus-visible { opacity: 1; }
.nt-x:hover { background: var(--overdue-bg); color: var(--overdue); }
.nt-x svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
@media (hover: none) { .nt-x, .nt-sel { opacity: 1; } .nt-ico { display: none; } .nt-body { grid-template-columns: minmax(0, 1fr) auto; padding-left: 42px; } }

.nt-empty { padding: 48px 24px; text-align: center; }
.nt-empty-ico { display: inline-flex; width: 52px; height: 52px; border-radius: 16px; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 12px; }
.nt-empty-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nt-empty strong { display: block; font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); }
.nt-empty p { color: var(--muted); margin: 4px auto 0; max-width: 40ch; }
.nt-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; font-size: 13.5px; }

/* ==========================================================================
   Reports
   ========================================================================== */
.report-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; padding: 4px; background: #e8ecea; border-radius: 12px; width: fit-content; max-width: 100%; }
.report-tabs a { padding: 7px 13px; border-radius: 9px; color: var(--ink-soft); font-weight: 600; font-size: 13.5px; }
.report-tabs a:hover { color: var(--ink); background: rgba(255,255,255,.6); }
.report-tabs a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.report-filters { margin-bottom: 18px; }
.report-filters > summary {
  display: flex; align-items: baseline; gap: 12px; padding: 12px 18px; cursor: pointer; list-style: none;
  font-weight: 650; font-family: var(--font-display);
}
.report-filters > summary::-webkit-details-marker { display: none; }
.report-filters > summary::after { content: "▾"; margin-left: auto; color: var(--faint); font-size: 12px; }
.report-filters:not([open]) > summary::after { content: "▸"; }
.rf-desc { font-family: var(--font-ui); font-weight: 500; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rf-presets { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.rf-presets a { padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid transparent; }
.rf-presets a:hover { background: var(--sunken); color: var(--ink); }
.rf-presets a.is-active { background: var(--primary-soft); color: var(--primary-ink); border-color: #bfe0d6; }
.rf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px 12px; align-items: end; }
.rf-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0; }
.rf-actions { display: flex; gap: 6px; }

.report-doc {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-2); padding: 28px 30px 22px;
}
.rd-head { padding-bottom: 18px; margin-bottom: 20px; border-bottom: 2px solid var(--ink); }
.rd-brand { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.rd-brand .brand-mark { width: 18px; height: 18px; flex-basis: 18px; border-radius: 5px; }
.rd-brand .brand-mark::after { left: 5.5px; top: 3px; width: 5px; height: 9px; border-width: 0 2px 2px 0; }
.rd-brand span { color: var(--faint); font-weight: 600; }
.rd-title { font-size: 1.9rem; font-weight: 700; margin: 0; letter-spacing: -0.025em; }
.rd-about { color: var(--muted); margin: 4px 0 14px; }
.rd-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 20px; margin: 0; }
.rd-meta dt { font-size: 11.5px; font-weight: 700; color: var(--faint); letter-spacing: .03em; }
.rd-meta dd { margin: 0; font-weight: 600; font-size: 14px; }
.rd-filters { margin: 12px 0 0; font-size: 13px; color: var(--ink-soft); background: var(--sunken); border-radius: 8px; padding: 6px 10px; display: inline-block; }

.kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; margin-bottom: 16px;
}
.report-doc .kpi-row { box-shadow: none; margin-bottom: 24px; background: var(--sunken); }
.kpi { padding: 14px 16px; border-left: 1px solid var(--line); margin-left: -1px; }
.kpi span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi b { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 1.6rem; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi.is-bad b { color: var(--overdue); }
.kpi.is-good b { color: var(--done); }

.rd-sec { margin-bottom: 26px; }
.rd-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rd-sec-head h3 { font-size: 1.05rem; font-weight: 650; margin: 0; display: flex; align-items: center; gap: 10px; }
.rd-num {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px;
  background: var(--ink); color: #fff; font-family: var(--font-ui); font-size: 12px; font-weight: 700;
}
.rd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 0 22px; }
.rd-table-wrap { border: 1px solid var(--line); border-radius: 12px; max-height: 640px; overflow: auto; }
.report-table { font-size: 13.5px; margin: 0; }
.report-table thead th { position: sticky; top: 0; z-index: 1; background: #f4f6f5 !important; }
.report-table > tbody > tr:nth-child(even) > td { background: #fafbfa; }
.report-table > tbody > tr:hover > td { background: var(--primary-soft); }
.report-table td, .report-table th { white-space: nowrap; }
.report-table td.t-strong { white-space: normal; min-width: 220px; font-weight: 600; color: var(--ink); }
.report-table.is-wide { font-size: 13px; }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table tfoot td { position: sticky; bottom: 0; background: #eef2f0; font-weight: 700; color: var(--ink); border-top: 2px solid var(--line-strong); }
.cell-bar { position: relative; display: inline-flex; justify-content: flex-end; align-items: center; min-width: 120px; height: 22px; }
.cell-bar i { position: absolute; left: 0; top: 5px; bottom: 5px; border-radius: 4px; background: linear-gradient(90deg, #cfe9e1, #a8d8ca); max-width: 100%; }
.cell-bar em { position: relative; font-style: normal; padding-left: 6px; font-weight: 600; }
.legend { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.chart { width: 100%; height: auto; display: block; }
.rd-foot { border-top: 1px solid var(--line); padding-top: 12px; font-size: 12.5px; color: var(--faint); }
.rd-foot p { margin: 0 0 4px; }

@media (max-width: 760px) { .report-doc { padding: 18px 16px; border-radius: 12px; } .rd-title { font-size: 1.5rem; } }

@media print {
  @page { size: A4 landscape; margin: 11mm 10mm; }
  body { background: #fff !important; font-size: 10.5px; }
  .sidebar, .mobile-bar, .scrim, .no-print, .app-foot, .page-head, .report-tabs, .report-filters { display: none !important; }
  .shell { display: block; background: none !important; }
  .main { padding: 0 !important; }
  .main > :not(.app-foot) { max-width: none !important; }
  .report-doc { border: 0; box-shadow: none; padding: 0; }
  .rd-table-wrap { max-height: none; overflow: visible; border-color: #bbb; }
  .report-table thead th { position: static; }
  .report-table tfoot td { position: static; }
  .report-table thead { display: table-header-group; }
  .report-table tr { break-inside: avoid; }
  .rd-sec { break-inside: auto; }
  .rd-sec-head { break-after: avoid; }
  .kpi-row { break-inside: avoid; }
  .rd-num { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cell-bar i, .report-table tfoot td, .kpi-row { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
.rd-grid .cell-bar { min-width: 84px; }
.rd-grid .report-table td:first-child { white-space: normal; min-width: 110px; }

/* ==========================================================================
   App (PWA): install, bottom navigation, push prompts
   ========================================================================== */
.install-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 1px dashed #3b4d5f; border-radius: 8px; background: transparent;
  color: #c3ced5; font-weight: 600; font-size: 14px; text-align: left;
}
.install-btn:hover { background: var(--ink-2); color: #fff; border-color: #56697b; }
.install-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.install-btn[hidden], [data-install][hidden] { display: none !important; }

.app-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.app-step { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--sunken); }
.app-step > b { display: block; margin-bottom: 8px; font-family: var(--font-display); font-weight: 650; }
[data-push-ui] [hidden] { display: none !important; }

.push-cta { margin-bottom: 14px; }
.push-cta-in {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid #c9d7f3; background: linear-gradient(90deg, #eef3fc, #f6f9fe); border-radius: 12px; font-size: 14px;
}
.push-cta-in > span:nth-child(2) { flex: 1; min-width: 0; }
.push-cta-in .nt-ico { flex: 0 0 34px; }

.bottom-nav { display: none; }
@media (max-width: 991.98px) {
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(16, 24, 40, .06);
  }
  .bottom-nav a {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 4px 0; color: var(--muted); font-size: 11px; font-weight: 600;
  }
  .bottom-nav a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav a.is-active { color: var(--primary); }
  .bottom-nav .bn-new {
    width: 48px; height: 48px; margin: -18px auto 0; border-radius: 16px; justify-content: center;
    background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(18, 107, 91, .35);
  }
  .bottom-nav .bn-new svg { width: 24px; height: 24px; stroke-width: 2.2; }
  .bn-badge {
    position: absolute; top: 0; left: 50%; margin-left: 5px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; background: var(--overdue); color: #fff; font-size: 10px; line-height: 17px; text-align: center;
  }
  .main { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .bulk-bar { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .toast-note { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .mobile-bell { display: none; }
  .app-foot { display: none; }
}
/* Installed app: feels native */
.is-app body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
.is-app .mobile-bar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
@media (display-mode: standalone) { .install-btn { display: none !important; } }

/* Push diagnostics */
.push-report { list-style: none; margin: 10px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.push-report li { display: grid; grid-template-columns: 22px 210px minmax(0, 1fr); gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.push-report li:first-child { border-top: 0; }
.push-report li::before { content: "•"; font-weight: 700; }
.push-report li.ok::before { content: "✓"; color: var(--done); }
.push-report li.bad::before { content: "✕"; color: var(--overdue); }
.push-report li.warn::before { content: "!"; color: var(--amber); }
.push-report li span { color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 600px) { .push-report li { grid-template-columns: 22px minmax(0, 1fr); } .push-report li span { grid-column: 2; } }
.device-list { list-style: none; margin: 0; padding: 0; }
.device-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 6px 0; font-size: 13.5px; }

/* Live pop-up while the site is open */
.live-pop {
  position: fixed; right: 20px; top: 20px; z-index: 90;
  display: grid; grid-template-columns: 38px minmax(0, 1fr) 24px; gap: 12px; align-items: start;
  width: min(380px, calc(100vw - 32px)); padding: 14px 14px 14px 16px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-left: 4px solid var(--primary);
  border-radius: 14px; box-shadow: 0 18px 40px rgba(16, 24, 40, .18);
  transform: translateY(-12px); opacity: 0; transition: transform .25s ease, opacity .25s ease;
}
.live-pop.is-in { transform: none; opacity: 1; }
.live-pop:hover { color: var(--text); }
.live-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.live-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.live-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.live-text b { color: var(--ink); font-weight: 700; }
.live-text span { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.live-pop button { border: 0; background: transparent; color: var(--faint); font-size: 20px; line-height: 1; padding: 0; }
.live-pop button:hover { color: var(--ink); }
@media (max-width: 991.98px) { .live-pop { top: calc(64px + env(safe-area-inset-top, 0px)); right: 16px; } }
@media (prefers-reduced-motion: reduce) { .live-pop { transition: none; } }

/* Two-step sign-in */
.tfa-badge { display: inline-flex; width: 48px; height: 48px; border-radius: 14px; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 12px; }
.tfa-badge svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tfa-input { font-family: var(--font-display); font-size: 1.35rem !important; letter-spacing: .18em; text-align: center; font-variant-numeric: tabular-nums; }
.tfa-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: 18px; }
.tfa-steps > li > b { display: block; font-family: var(--font-display); font-weight: 650; margin-bottom: 4px; }
.tfa-steps > li > span { color: var(--muted); font-size: 14px; }
.tfa-qr-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 8px; }
.tfa-qr { width: 184px; height: 184px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.tfa-qr svg { width: 100%; height: 100%; display: block; }
.tfa-key { display: inline-block; font-size: 15px; letter-spacing: .08em; background: var(--sunken); border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; color: var(--ink); word-break: break-all; }
.backup-codes { columns: 2; gap: 24px; margin: 0 0 14px; padding-left: 1.4rem; }
.backup-codes code { font-size: 15px; color: var(--ink); letter-spacing: .05em; }

/* Checklist */
.cl-bar { height: 6px; margin: 0 20px 6px; border-radius: 3px; background: var(--todo-bg); overflow: hidden; }
.cl-bar i { display: block; height: 100%; background: var(--primary); transition: width .25s ease; }
.cl-list { list-style: none; margin: 0; padding: 4px 20px 6px; }
.cl-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.cl-list li:first-child { border-top: 0; }
.cl-list label { display: flex; align-items: flex-start; gap: 10px; margin: 0; cursor: pointer; }
.cl-list .form-check-input { margin: 3px 0 0; flex: 0 0 auto; }
.cl-text { overflow-wrap: anywhere; }
.cl-list li.is-done .cl-text { color: var(--faint); text-decoration: line-through; }
.cl-by { font-size: 12px; }
.cl-x { border: 0; background: transparent; color: var(--faint); font-size: 18px; line-height: 1; opacity: 0; }
.cl-list li:hover .cl-x, .cl-x:focus-visible { opacity: 1; }
.cl-x:hover { color: var(--overdue); }
@media (hover: none) { .cl-x { opacity: 1; } }
.cl-add { display: flex; gap: 8px; align-items: flex-start; padding: 6px 20px 14px; }
.cl-add textarea { min-height: 38px !important; resize: vertical; }

/* Mentions */
.mention-wrap { position: relative; }
.mention-list { position: absolute; left: 10px; top: 100%; z-index: 20; min-width: 220px; list-style: none; margin: 2px 0 0; padding: 4px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-2); }
.mention-list li { padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.mention-list li.is-active, .mention-list li:hover { background: var(--primary-soft); color: var(--primary-ink); }
.mention { color: var(--primary-ink); background: var(--primary-soft); border-radius: 5px; padding: 0 3px; font-weight: 600; }
