/* ============================================================================
   tasks.css — Task manager (2026-10-27): the Tasks tab (#tab-tasks), the task
   icon in the tab row, the editor, reminder cards and the order form's task
   list. Same palette and card language as the dashboard (dashboard.css):
   white cards on soft grey, no blur, no gradients, SVG icons only.

   SCOPE: every selector starts with .tsk (or #taskNavBtn). Paired with
   public/js/tasks.js. Removing this file + its <link> removes the styling.
   ============================================================================ */

.tsk, .tsk-layer {
  --tsk-page: #f2f4f6;
  --tsk-card: #ffffff;
  --tsk-ink: #191c1e;
  --tsk-ink-dim: #5c5d67;
  --tsk-ink-faint: #8b8d96;
  --tsk-line: #e1e3e5;
  --tsk-line-soft: #edeef0;
  --tsk-hover: #f7f8fa;
  --tsk-blue: #0062ff;
  --tsk-blue-dark: #0052d6;
  --tsk-blue-wash: #e6efff;
  --tsk-red: #d64b40;
  --tsk-red-wash: #fdecea;
  --tsk-green: #1a9d5f;
  --tsk-green-wash: #e6f5ed;
  --tsk-amber: #c47d12;
  --tsk-r-card: 20px;
  --tsk-r-tile: 16px;
  --tsk-shadow: 0 4px 20px -2px rgba(17, 18, 22, .05);
  --tsk-shadow-pop: 0 24px 60px -16px rgba(17, 18, 22, .28);
  --tsk-ease: cubic-bezier(.22, 1, .36, 1);
  font-family: inherit;
  color: var(--tsk-ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.tsk *, .tsk *::before, .tsk *::after,
.tsk-layer *, .tsk-layer *::before, .tsk-layer *::after { box-sizing: border-box; }
/* crm-theme.css forces a font and a 34px min-height on every button/input. */
.tsk button, .tsk input, .tsk select, .tsk textarea,
.tsk-layer button, .tsk-layer input, .tsk-layer select, .tsk-layer textarea { font-family: inherit !important; }
/* :where() keeps these resets at zero specificity, so every component class
   below (.tsk-stat, .tsk-btn, …) wins over them. */
:where(.tsk, .tsk-layer) :where(button) { min-height: 0; font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
:where(.tsk, .tsk-layer) :where(h1, h2, h3, p) { margin: 0; }
.tsk [hidden], .tsk-layer [hidden] { display: none !important; }
/* …but these two must beat crm-theme's global `button { min-height: 34px }` and
   heading margins, which are element selectors (0,0,1). */
.tsk button, .tsk-layer button { min-height: 0; }
.tsk h1, .tsk h2, .tsk h3, .tsk p, .tsk-layer h2, .tsk-layer p { margin: 0; }
.tsk :focus-visible, .tsk-layer :focus-visible { outline: 2px solid var(--tsk-blue); outline-offset: 2px; border-radius: 8px; }
.tsk svg, .tsk-layer svg { flex: none; }

/* ── The task icon in the tab row ─────────────────────────────────────────── */
/* A plain black icon, no box: a clipboard holding a short to-do list (one item
   ticked, one still open). Open on the Tasks page, the board fills in black and
   the list turns white, so it reads as "selected" without a background. */
#taskNavBtn {
  position: absolute; left: 24px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; min-height: 0 !important; padding: 0 !important;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0 !important; border-radius: 10px; box-shadow: none !important;
  background: transparent !important; color: #111316 !important; cursor: pointer;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1), opacity .2s ease;
}
#taskNavBtn:hover { transform: translateY(-50%) translateY(-1px); }
#taskNavBtn:hover .tn-ico { transform: rotate(-6deg); }
#taskNavBtn:focus-visible { outline: 2px solid #111316; outline-offset: 2px; }
#taskNavBtn .tn-ico { width: 28px; height: 28px; overflow: visible; transition: transform .3s cubic-bezier(.22, 1, .36, 1); transform-origin: 50% 20%; }
#taskNavBtn .tn-board, #taskNavBtn .tn-clip { fill: #fff; transition: fill .2s ease; }
#taskNavBtn .tn-clip { fill: currentColor; }
#taskNavBtn .tn-ink { transition: stroke .2s ease; }
#taskNavBtn.is-active .tn-board { fill: currentColor; }
#taskNavBtn.is-active .tn-clip { stroke: #fff; stroke-width: 1.4; }
#taskNavBtn.is-active .tn-ink { stroke: #fff; }
#taskNavBtn .tsk-navbadge {
  position: absolute; top: -1px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #d64b40; color: #fff; border: 2px solid #fff;
  font-size: 10px; font-weight: 700; line-height: 14px; text-align: center; font-variant-numeric: tabular-nums;
}
#taskNavBtn .tsk-navbadge[hidden] { display: none; }
/* Locked with the other tabs while company setup is unfinished. */
body:has(.tabs.admin-nav .tab-btn.tab-locked) #taskNavBtn { opacity: .4; pointer-events: none; }
body:has(#adminLoginOverlay[style*="flex"]) #taskNavBtn { display: none; }
.tabs.admin-nav { position: relative; }
@media (max-width: 1180px) {
  /* The tab row scrolls on narrow screens: the icon becomes its first item. */
  #taskNavBtn { position: relative; left: auto; top: auto; transform: none; flex: none; margin-right: 6px; width: 38px; height: 38px; }
  #taskNavBtn:hover { transform: none; }
}

/* ── Page shell ───────────────────────────────────────────────────────────── */
.tsk-shell { max-width: 1460px; margin: 0 auto; background: var(--tsk-page); border-radius: 26px; padding: 18px 18px 22px; }
.tsk-titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.tsk-titlebar h1 { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.tsk-crumb { font-size: 12.5px; color: var(--tsk-ink-dim); margin-top: 3px; }
.tsk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tsk-seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--tsk-card); border-radius: 999px; box-shadow: 0 1px 3px rgba(17,18,22,.05); }
.tsk-seg button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--tsk-ink-dim); transition: background .2s ease, color .2s ease; }
.tsk-seg button svg { width: 15px; height: 15px; }
.tsk-seg button:hover { color: var(--tsk-ink); }
.tsk-seg button.is-on { background: var(--tsk-ink); color: #fff; }

.tsk-select.tsk-pill { width: auto; min-width: 170px; height: 38px; padding: 0 12px 0 14px; border: 0; border-radius: 999px; background: var(--tsk-card); box-shadow: 0 1px 3px rgba(17,18,22,.05); font-size: 13px; }
.tsk-select.tsk-pill:hover { box-shadow: 0 1px 3px rgba(17,18,22,.05), inset 0 0 0 1px var(--tsk-line); }

.tsk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; transition: transform .3s var(--tsk-ease), box-shadow .3s var(--tsk-ease), background .2s ease; }
.tsk-btn svg { width: 16px; height: 16px; }
.tsk-btn-primary { background: var(--tsk-blue); color: #fff !important; }
.tsk-btn-primary:hover { background: var(--tsk-blue-dark); transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(0, 98, 255, .6); }
.tsk-btn-ghost { background: var(--tsk-card); color: var(--tsk-ink); box-shadow: inset 0 0 0 1px var(--tsk-line); }
.tsk-btn-ghost:hover { background: var(--tsk-hover); }
.tsk-btn-danger { color: var(--tsk-red) !important; padding: 0 10px; }
.tsk-btn-danger:hover { background: var(--tsk-red-wash); }
.tsk-btn[disabled] { opacity: .55; pointer-events: none; }

/* ── Summary tiles (they are also the list filters) ──────────────────────── */
.tsk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 13px; }
.tsk-stat { text-align: left; background: var(--tsk-card); border-radius: var(--tsk-r-tile); padding: 15px 16px 14px; box-shadow: var(--tsk-shadow); display: flex; flex-direction: column; gap: 8px; transition: transform .35s var(--tsk-ease), box-shadow .35s var(--tsk-ease); }
.tsk-stat:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -12px rgba(17,18,22,.16); }
.tsk-stat.is-on { box-shadow: inset 0 0 0 2px var(--tsk-ink), var(--tsk-shadow); }
.tsk-stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tsk-stat-label { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--tsk-ink-faint); }
.tsk-stat-label i { width: 8px; height: 8px; border-radius: 3px; background: var(--c, var(--tsk-ink-faint)); }
.tsk-stat-num { font-size: 28px; font-weight: 800; letter-spacing: -1px; line-height: 1; font-variant-numeric: tabular-nums; }
.tsk-stat-sub { font-size: 12px; color: var(--tsk-ink-dim); }
.tsk-stat.is-alert .tsk-stat-num { color: var(--tsk-red); }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.tsk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 13px; align-items: start; }
.tsk-grid.is-single { grid-template-columns: minmax(0, 1fr); }
.tsk-card { background: var(--tsk-card); border-radius: var(--tsk-r-card); box-shadow: var(--tsk-shadow); min-width: 0; }
.tsk-cardhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; flex-wrap: wrap; }
.tsk-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--tsk-ink-faint); }
.tsk-cardhead h2 { font-size: 16px; font-weight: 700; letter-spacing: -.2px; margin-top: 2px; }
.tsk-search { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 12px; background: var(--tsk-hover); box-shadow: inset 0 0 0 1px var(--tsk-line-soft); min-width: 230px; }
.tsk-search svg { width: 15px; height: 15px; color: var(--tsk-ink-faint); }
.tsk-search input { border: 0 !important; outline: none; background: transparent !important; font-size: 13px; width: 100%; padding: 0 !important; margin: 0 !important; box-shadow: none !important; color: var(--tsk-ink); height: 36px; }

/* ── Task rows ────────────────────────────────────────────────────────────── */
.tsk-list { padding: 0 8px 8px; }
.tsk-group { padding: 12px 10px 4px; display: flex; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 700; color: var(--tsk-ink); }
.tsk-group small { font-size: 11.5px; font-weight: 600; color: var(--tsk-ink-faint); }
.tsk-group.is-late small { color: var(--tsk-red); }
.tsk-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 14px; cursor: pointer; transition: background .15s ease; }
.tsk-row + .tsk-row { box-shadow: 0 -1px 0 var(--tsk-line-soft); }
.tsk-row:hover { background: var(--tsk-hover); box-shadow: none; }
.tsk-row:hover + .tsk-row { box-shadow: none; }

.tsk-check { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 2px #c9ccd3; display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: background .2s ease, box-shadow .2s ease, color .2s ease; }
.tsk-check svg { width: 14px; height: 14px; }
.tsk-check:hover { box-shadow: inset 0 0 0 2px var(--tsk-green); color: var(--tsk-green); }
.is-done .tsk-check { background: var(--tsk-green); box-shadow: none; color: #fff; }

/* Black and white, round (user feedback 2026-10-27). Type colours stay on the
   calendar chips and legend, where they tell the types apart at a glance. */
.tsk-type { width: 36px; height: 36px; border-radius: 50%; background: #f1f2f4; color: #111316; display: inline-flex; align-items: center; justify-content: center; }
.tsk-type svg { width: 17px; height: 17px; }
.tsk-body { min-width: 0; }
.tsk-title { font-size: 14px; font-weight: 600; color: var(--tsk-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-done .tsk-title { color: var(--tsk-ink-faint); text-decoration: line-through; text-decoration-color: #b8bbc2; }
.tsk-note { font-size: 12.5px; color: var(--tsk-ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.tsk-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 5px; font-size: 12px; color: var(--tsk-ink-dim); }
.tsk-meta > span, .tsk-meta > a { display: inline-flex; align-items: center; gap: 5px; }
.tsk-meta svg { width: 13px; height: 13px; color: var(--tsk-ink-faint); }
.tsk-when.is-late { color: var(--tsk-red); font-weight: 600; }
/* Phones show the assignee inside the meta line instead of its own column. */
.tsk-meta-who { display: none !important; }
.tsk-when.is-late svg { color: var(--tsk-red); }
.tsk-order { padding: 2px 8px; border-radius: 999px; background: var(--tsk-hover); box-shadow: inset 0 0 0 1px var(--tsk-line-soft); color: var(--tsk-ink) !important; text-decoration: none; font-weight: 600; font-size: 11.5px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsk-order:hover { background: var(--tsk-blue-wash); box-shadow: inset 0 0 0 1px #cfe0ff; }

.tsk-who { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tsk-ink-dim); white-space: nowrap; }
.tsk-av { width: 28px; height: 28px; border-radius: 50%; background: #111316; color: #fff; font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; letter-spacing: .3px; overflow: hidden; flex: none; }
.tsk-av.has-pic { background: #f1f2f4; box-shadow: 0 0 0 1px var(--tsk-line); }
.tsk-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tsk-rowact { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .15s ease; }
.tsk-row:hover .tsk-rowact, .tsk-row:focus-within .tsk-rowact { opacity: 1; }
.tsk-icon { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--tsk-ink-dim); }
.tsk-icon svg { width: 16px; height: 16px; }
.tsk-icon:hover { background: #eceef1; color: var(--tsk-ink); }
.tsk-icon.is-danger:hover { background: var(--tsk-red-wash); color: var(--tsk-red); }

.tsk-more { display: flex; justify-content: center; padding: 6px 0 14px; }
.tsk-empty { padding: 46px 20px 52px; text-align: center; color: var(--tsk-ink-dim); }
.tsk-empty-mark { width: 56px; height: 56px; border-radius: 18px; background: var(--tsk-green-wash); color: var(--tsk-green); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.tsk-empty-mark svg { width: 26px; height: 26px; }
.tsk-empty h3 { font-size: 15px; font-weight: 700; color: var(--tsk-ink); margin-bottom: 4px; }
.tsk-empty p { font-size: 13px; margin-bottom: 16px; }
.tsk-skel { height: 58px; margin: 6px 10px; border-radius: 14px; background: linear-gradient(90deg, #f3f4f6 0%, #eceef1 50%, #f3f4f6 100%); background-size: 200% 100%; animation: tskShimmer 1.2s linear infinite; }
@keyframes tskShimmer { to { background-position: -200% 0; } }
.tsk-error { margin: 10px 18px 18px; padding: 12px 14px; border-radius: 12px; background: var(--tsk-red-wash); color: #9b2c22; font-size: 13px; }

/* ── Side panel: the selected day ────────────────────────────────────────── */
.tsk-side .tsk-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.tsk-side .tsk-type, .tsk-side .tsk-who { display: none; }
.tsk-side-foot { padding: 6px 18px 18px; }
.tsk-side-foot .tsk-btn { width: 100%; }

/* ── Calendar ─────────────────────────────────────────────────────────────── */
.tsk-calhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; flex-wrap: wrap; }
.tsk-calnav { display: inline-flex; align-items: center; gap: 6px; }
.tsk-calnav h2 { font-size: 17px; font-weight: 800; letter-spacing: -.3px; min-width: 160px; }
.tsk-round { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px var(--tsk-line); color: var(--tsk-ink-dim); }
.tsk-round:hover { background: var(--tsk-hover); color: var(--tsk-ink); }
.tsk-round svg { width: 16px; height: 16px; }
.tsk-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.tsk-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; color: var(--tsk-ink-dim); }
.tsk-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }

.tsk-cal { padding: 0 12px 14px; }
.tsk-dow, .tsk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tsk-dow span { padding: 6px 8px 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--tsk-ink-faint); }
.tsk-days { border-radius: 16px; box-shadow: inset 0 0 0 1px var(--tsk-line-soft); overflow: hidden; }
.tsk-day { position: relative; min-height: 112px; padding: 7px 7px 6px; text-align: left; display: flex; flex-direction: column; gap: 3px; box-shadow: inset -1px -1px 0 var(--tsk-line-soft); background: var(--tsk-card); transition: background .15s ease; }
.tsk-day:hover { background: var(--tsk-hover); }
.tsk-day.is-out { background: #fafbfc; }
.tsk-day.is-out .tsk-daynum { color: #b6b9c0; }
.tsk-day.is-sel { box-shadow: inset 0 0 0 2px var(--tsk-ink); z-index: 1; }
.tsk-daynum { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--tsk-ink); font-variant-numeric: tabular-nums; align-self: flex-start; padding: 0 6px; }
.tsk-day.is-today .tsk-daynum { background: var(--tsk-blue); color: #fff; }
.tsk-dayadd { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--tsk-ink-dim); opacity: 0; transition: opacity .15s ease; }
.tsk-dayadd svg { width: 14px; height: 14px; }
.tsk-day:hover .tsk-dayadd { opacity: 1; }
.tsk-dayadd:hover { background: var(--tsk-blue-wash); color: var(--tsk-blue); }
.tsk-chip { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; padding: 3px 6px; border-radius: 7px; background: var(--w); font-size: 11.5px; font-weight: 600; color: var(--tsk-ink); line-height: 1.3; }
.tsk-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); flex: none; }
.tsk-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsk-chip b { font-weight: 700; color: var(--tsk-ink-dim); flex: none; font-variant-numeric: tabular-nums; }
.tsk-chip.is-done { background: #f3f4f6; color: var(--tsk-ink-faint); text-decoration: line-through; }
.tsk-chip.is-done i { background: #c3c6cc; }
.tsk-chip.is-late { box-shadow: inset 0 0 0 1px #f2c6c1; }
.tsk-daymore { font-size: 11px; font-weight: 700; color: var(--tsk-ink-dim); padding: 1px 6px; }
.tsk-dots { display: none; gap: 3px; flex-wrap: wrap; }
.tsk-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

/* ── Editor (dialog) ──────────────────────────────────────────────────────── */
.tsk-overlay { position: fixed; inset: 0; z-index: 10050; background: rgba(17, 18, 22, .42); display: flex; align-items: center; justify-content: center; padding: 20px; }
.tsk-overlay[hidden] { display: none; }
.tsk-dialog { width: 100%; max-width: 760px; max-height: calc(100vh - 32px); overflow: auto; background: var(--tsk-card); border-radius: 14px; box-shadow: var(--tsk-shadow-pop); }
.tsk-dhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px 4px; }
.tsk-dhead h2 { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.tsk-dbody { padding: 8px 24px 2px; display: flex; flex-direction: column; gap: 14px; }
.tsk-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tsk-field > label, .tsk-label { font-size: 12px; font-weight: 600; color: var(--tsk-ink-dim); }
.tsk-field > label em { font-style: normal; font-weight: 400; color: var(--tsk-ink-faint); }
.tsk-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tsk-row2:has(> [hidden]) { grid-template-columns: 1fr; }
.tsk-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tsk-input, .tsk-field select, .tsk-field textarea {
  width: 100%; height: 42px; padding: 0 12px !important; margin: 0 !important; border-radius: 10px !important;
  border: 1px solid var(--tsk-line) !important; background: #fff !important; font-size: 14px !important; color: var(--tsk-ink) !important;
  box-shadow: none !important; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.tsk-field textarea { height: auto; min-height: 76px; padding: 10px 12px !important; resize: vertical; line-height: 1.45; }
.tsk-input:focus, .tsk-field select:focus, .tsk-field textarea:focus { border-color: var(--tsk-blue) !important; box-shadow: 0 0 0 3px rgba(0, 98, 255, .14) !important; }
.tsk-input.is-big { height: 48px; font-size: 15px !important; font-weight: 500; }
.tsk-input::placeholder, .tsk-field textarea::placeholder { font-weight: 400; color: #9a9ca4; opacity: 1; }
.tsk-input.is-bad { border-color: var(--tsk-red) !important; }
.tsk-types { display: flex; flex-wrap: wrap; gap: 6px; }
.tsk-types button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 400; color: var(--tsk-ink-dim); box-shadow: inset 0 0 0 1px var(--tsk-line); transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.tsk-types button svg { width: 15px; height: 15px; color: var(--c); }
.tsk-types button:hover { background: var(--tsk-hover); color: var(--tsk-ink); }
.tsk-types button.is-on { background: var(--w); color: var(--tsk-ink); box-shadow: inset 0 0 0 1.5px var(--c); }
.tsk-hint { font-size: 12px; color: var(--tsk-ink-faint); }
.tsk-hint.is-warn { color: var(--tsk-amber); }
.tsk-msg { font-size: 12.5px; color: var(--tsk-red); min-height: 0; }
.tsk-dfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 24px 20px; }
.tsk-dfoot > div { display: flex; gap: 8px; margin-left: auto; }

.tsk-linked { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 42px; padding: 0 6px 0 12px; border-radius: 10px; background: var(--tsk-hover); box-shadow: inset 0 0 0 1px var(--tsk-line-soft); font-size: 13.5px; font-weight: 600; }
.tsk-linked span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsk-linked svg { width: 15px; height: 15px; color: var(--tsk-ink-faint); }
.tsk-picker { position: relative; }
.tsk-picker > svg { position: absolute; left: 13px; top: 13px; width: 16px; height: 16px; color: var(--tsk-ink-faint); pointer-events: none; }
.tsk-picker .tsk-input { padding-left: 38px !important; }
.tsk-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 2; background: #fff; border-radius: 10px; box-shadow: 0 16px 36px -12px rgba(17,18,22,.25), 0 0 0 1px var(--tsk-line-soft); padding: 6px; max-height: 240px; overflow: auto; }
.tsk-results[hidden] { display: none; }
.tsk-results button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; }
.tsk-results button:hover, .tsk-results button.is-hl { background: var(--tsk-hover); }
.tsk-results b { font-size: 13px; font-weight: 500; }
.tsk-results small { font-size: 12px; color: var(--tsk-ink-dim); }
.tsk-results .tsk-hint { padding: 8px 10px; }

/* ── Reminder cards (bottom right) ───────────────────────────────────────── */
.tsk-remstack { position: fixed; right: 20px; bottom: 20px; z-index: 10040; display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: calc(100vw - 32px); }
.tsk-rem { background: #fff; border-radius: 18px; box-shadow: var(--tsk-shadow-pop), 0 0 0 1px rgba(17,18,22,.04); padding: 14px 14px 12px; animation: tskIn .45s var(--tsk-ease); }
@keyframes tskIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.tsk-remtop { display: flex; align-items: flex-start; gap: 11px; }
.tsk-remtop .tsk-type { width: 38px; height: 38px; }
.tsk-remtxt { flex: 1; min-width: 0; }
.tsk-remtxt small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--tsk-blue); }
.tsk-remtxt strong { display: block; font-size: 14.5px; font-weight: 700; margin-top: 2px; }
.tsk-remtxt p { font-size: 12.5px; color: var(--tsk-ink-dim); margin-top: 3px; }
.tsk-remtxt .tsk-order { display: inline-flex; margin-top: 7px; }
.tsk-remacts { display: flex; gap: 6px; margin-top: 12px; }
.tsk-remacts .tsk-btn { height: 34px; flex: 1; padding: 0 10px; font-size: 12.5px; }

/* ── Order form: compact task list ───────────────────────────────────────── */
.tsk-mini { display: flex; flex-direction: column; gap: 2px; }
.tsk-mini .tsk-row { grid-template-columns: auto minmax(0, 1fr) auto; padding: 9px 6px; gap: 10px; }
.tsk-mini .tsk-type, .tsk-mini .tsk-who { display: none; }
.tsk-mini .tsk-rowact { opacity: 1; }
.tsk-mini-empty { font-size: 13px; color: var(--tsk-ink-faint); padding: 8px 4px 10px; }
.tsk-mini-add { margin-top: 6px; }

/* ── Small screens ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .tsk-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .tsk-shell { padding: 12px 10px 16px; border-radius: 20px; }
  .tsk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tsk-stat-num { font-size: 24px; }
  .tsk-actions { width: 100%; }
  .tsk-actions .tsk-btn-primary { margin-left: auto; }
  .tsk-search { min-width: 0; width: 100%; }
  .tsk-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; }
  .tsk-row .tsk-type, .tsk-row .tsk-who { display: none; }
  .tsk-meta-who { display: inline-flex !important; }
  .tsk-rowact { opacity: 1; }
  .tsk-title, .tsk-note { white-space: normal; }
  .tsk-day { min-height: 58px; padding: 5px 3px; align-items: center; }
  .tsk-day .tsk-chip, .tsk-day .tsk-daymore, .tsk-dayadd { display: none; }
  .tsk-dots { display: flex; justify-content: center; }
  .tsk-daynum { align-self: center; font-size: 12px; min-width: 24px; height: 24px; }
  .tsk-row2 { grid-template-columns: 1fr; }
  .tsk-overlay { align-items: flex-end; padding: 0; }
  .tsk-dialog { border-radius: 14px 14px 0 0; max-height: 92vh; }
  .tsk-row3 { grid-template-columns: 1fr 1fr; }
  .tsk-row3 > :last-child { grid-column: 1 / -1; }
  .tsk-dhead, .tsk-dbody, .tsk-dfoot { padding-left: 18px; padding-right: 18px; }
  .tsk-remstack { right: 12px; left: 12px; bottom: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .tsk *, .tsk-layer * { animation: none !important; transition: none !important; }
}
/* The day panel is narrow: let titles wrap instead of cutting them off. */
.tsk-side .tsk-title { white-space: normal; }
/* The order pill outside a row's meta line (reminder card) sizes its own icon. */
.tsk-order { display: inline-flex; align-items: center; gap: 5px; }
.tsk-order svg { width: 13px; height: 13px; color: var(--tsk-ink-faint); }

/* ── Our own dropdowns (tasks.js dropdown / datePicker / timePicker) ─────── */
.tsk-select {
  width: 100%; height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 9px;
  border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--tsk-line);
  font-size: 14px; font-weight: 400; color: var(--tsk-ink); text-align: left;
  transition: box-shadow .15s ease, background .15s ease;
}
.tsk-select > svg { width: 16px; height: 16px; color: var(--tsk-ink-faint); }
.tsk-select-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsk-select.is-empty .tsk-select-text { color: #9a9ca4; }
.tsk-select-chev { display: inline-flex; color: var(--tsk-ink-faint); transition: transform .2s ease; }
.tsk-select-chev svg { width: 15px; height: 15px; }
.tsk-select:hover { box-shadow: inset 0 0 0 1px #c9ccd3; }
.tsk-select.is-open { box-shadow: inset 0 0 0 1px var(--tsk-blue), 0 0 0 3px rgba(0, 98, 255, .14); }
.tsk-select.is-open .tsk-select-chev { transform: rotate(180deg); }
.tsk .tsk-select:focus-visible, .tsk-layer .tsk-select:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--tsk-blue), 0 0 0 3px rgba(0, 98, 255, .14); border-radius: 10px; }
.tsk-select.tsk-pill { border-radius: 999px; }
.tsk-select.tsk-pill.is-open { box-shadow: 0 0 0 1px var(--tsk-blue), 0 0 0 4px rgba(0, 98, 255, .12); }
.tsk-select.tsk-pill .tsk-select-text { font-weight: 500; }

.tsk-pop {
  position: fixed; z-index: 10070; background: #fff; border-radius: 12px; padding: 6px;
  box-shadow: 0 18px 40px -14px rgba(17, 18, 22, .28), 0 0 0 1px rgba(17, 18, 22, .07);
  max-width: calc(100vw - 16px); overflow: auto; overscroll-behavior: contain;
  animation: tskPop .16s ease-out;
}
.tsk-pop[hidden] { display: none; }
@keyframes tskPop { from { opacity: 0; transform: translateY(-4px); } }
.tsk-optlist { display: flex; flex-direction: column; gap: 1px; }
.tsk-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 36px !important; padding: 0 10px; border-radius: 8px; font-size: 13.5px; font-weight: 400; color: var(--tsk-ink); text-align: left; white-space: nowrap; }
.tsk-opt svg { width: 15px; height: 15px; color: var(--tsk-blue); }
.tsk-opt:hover, .tsk-opt.is-hl { background: var(--tsk-hover); }
.tsk-opt.is-sel { color: var(--tsk-blue); font-weight: 500; }
.tsk-opt.is-quiet { color: var(--tsk-ink-dim); }
.tsk-pop-time { width: 180px; max-height: 264px; }

.tsk-pop-date { width: 292px; padding: 12px; }
.tsk-dp-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 8px 6px; }
.tsk-dp-head strong { font-size: 14px; font-weight: 600; }
.tsk-dp-head span { display: inline-flex; gap: 2px; }
.tsk-dp-nav { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--tsk-ink-dim); }
.tsk-dp-nav:hover { background: var(--tsk-hover); color: var(--tsk-ink); }
.tsk-dp-nav svg { width: 15px; height: 15px; }
.tsk-dp-dow, .tsk-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.tsk-dp-dow span { text-align: center; font-size: 11px; font-weight: 500; color: var(--tsk-ink-faint); padding: 4px 0; }
.tsk-dp-day { height: 36px; border-radius: 8px; font-size: 13px; font-weight: 400; color: var(--tsk-ink); font-variant-numeric: tabular-nums; }
.tsk-dp-day:hover, .tsk-dp-day.is-hl { background: var(--tsk-hover); }
.tsk-dp-day.is-out { color: #b6b9c0; }
.tsk-dp-day.is-today { color: var(--tsk-blue); font-weight: 600; box-shadow: inset 0 0 0 1px #cfe0ff; }
.tsk-dp-day.is-sel { background: var(--tsk-ink); color: #fff; box-shadow: none; font-weight: 500; }
.tsk-dp-foot { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; box-shadow: 0 -1px 0 var(--tsk-line-soft); }
.tsk-dp-foot button { height: 30px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--tsk-ink); box-shadow: inset 0 0 0 1px var(--tsk-line); }
.tsk-dp-foot button:hover { background: var(--tsk-hover); }
.tsk-dp-foot .is-quiet { margin-left: auto; color: var(--tsk-ink-dim); box-shadow: none; }

/* ── The "?" next to the title and its guide card ────────────────────────── */
.tsk-titlebar h1 { display: inline-flex; align-items: center; gap: 8px; }
.tsk-help { width: 20px; height: 20px; display: inline-flex; color: #111316; border-radius: 50%; transition: transform .25s var(--tsk-ease), opacity .2s ease; }
.tsk-help svg { width: 20px; height: 20px; }
.tsk-help:hover { transform: translateY(-1px) rotate(-8deg); }
.tsk-help.is-open { opacity: .75; }
.tsk .tsk-help:focus-visible { border-radius: 50%; outline-offset: 2px; }
.tsk-pop-help { width: 680px; padding: 12px 14px 10px; }
.tsk-help-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 6px 4px; }
.tsk-help-head strong { font-size: 15px; font-weight: 600; }
.tsk-help-head .tsk-icon { width: 28px; height: 28px; }
.tsk-help-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.tsk-help-list li { display: flex; gap: 11px; padding: 6px 4px; }
.tsk-help-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--tsk-hover); box-shadow: inset 0 0 0 1px var(--tsk-line-soft); color: var(--tsk-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tsk-help-ic svg { width: 15px; height: 15px; }
.tsk-help-list b { display: block; font-size: 13px; font-weight: 600; color: var(--tsk-ink); }
.tsk-help-list p { margin: 1px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--tsk-ink-dim); white-space: normal; }
.tsk-help-list p b { display: inline; font-size: inherit; font-weight: 500; }
.tsk-help-foot { margin: 6px 0 0; padding: 10px 4px 0; box-shadow: 0 -1px 0 var(--tsk-line-soft); font-size: 12px; line-height: 1.45; color: var(--tsk-ink-faint); white-space: normal; }
@media (max-width: 640px) {
  .tsk-help-list { grid-template-columns: 1fr; }
  .tsk-help-list li + li { box-shadow: 0 -1px 0 var(--tsk-line-soft); }
}

/* ── Missed tasks, rule lines, overdue by person (2026-10-27) ────────────── */
.tsk-row.is-missed .tsk-title { color: var(--tsk-ink-dim); }
.tsk-missed { padding: 1px 8px; border-radius: 999px; background: var(--tsk-red-wash); color: #9b2c22; font-size: 11.5px; font-weight: 500; }
.tsk-chip.is-missed { background: #f6f6f7; color: var(--tsk-ink-faint); box-shadow: inset 0 0 0 1px #f2c6c1; }
.tsk-chip.is-missed i { background: #e2a39c; }
.tsk-rule { display: flex; align-items: center; gap: 6px; margin-top: 4px !important; font-size: 12px; color: var(--tsk-ink-faint); }
.tsk-rule svg { width: 13px; height: 13px; }
.tsk-byperson { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 0 18px 10px; }
.tsk-byperson-label { font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--tsk-ink-faint); margin-right: 4px; }
.tsk-personchip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 3px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--tsk-line); font-size: 12.5px; font-weight: 400; color: var(--tsk-ink); transition: background .15s ease, box-shadow .15s ease; }
.tsk-personchip .tsk-av { width: 26px; height: 26px; font-size: 10px; }
.tsk-personchip b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--tsk-red-wash); color: #9b2c22; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.tsk-personchip:hover { background: var(--tsk-hover); box-shadow: inset 0 0 0 1px #c9ccd3; }
.tsk-personchip[disabled] { opacity: .6; cursor: default; }
.tsk-help-rules { margin-top: 4px; padding: 8px 4px 0; box-shadow: 0 -1px 0 var(--tsk-line-soft); }
.tsk-help-rules strong { display: block; font-size: 12px; font-weight: 600; color: var(--tsk-ink); margin-bottom: 4px; }
.tsk-help-rules ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 2px; }
.tsk-help-rules li { font-size: 12px; line-height: 1.45; color: var(--tsk-ink-dim); white-space: normal; }
.tsk-help-rules b { font-weight: 500; color: var(--tsk-ink); }
