/* Motion Fitness brand palette — sampled directly from the real logo
   (motion-fitness-logo-168w.png): a navy-to-azure blue paired with a
   forest-to-lime green. Not guessed. */
:root {
  --bg: #f4f7f9;
  --surface: #ffffff;
  --ink: #14212e;
  --ink-soft: #4f6072;
  --line: #dde4ea;

  --brand-navy: #0d3b66;
  --brand-blue: #0078b8;
  --brand-green: #1f7a4d;
  --brand-lime: #8dc63f;

  --accent: var(--brand-navy);
  --accent-ink: #ffffff;
  --good: var(--brand-green);
  --warn: #c0603a;
  --amber: #b7791f;
  --misc-accent: #6d5b9e;

  --shadow: 0 1px 2px rgba(13,59,102,.06), 0 6px 20px rgba(13,59,102,.06);
  --sans: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: "Consolas", "SF Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top bar — white, not a blue gradient: the logo's own blue/green washed out
   against a blue header (confirmed visually, not just in theory), and a clean
   white bar with a colored active-pill reads as more modern anyway. */
.topbar {
  display: flex; align-items: center; gap: 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 24px; position: sticky; top: 0; z-index: 5;
  box-shadow: 0 1px 0 rgba(13,59,102,.03), 0 4px 16px rgba(13,59,102,.04);
}
.brand { display: flex; align-items: center; padding: 10px 0; }
.brand img { height: 38px; width: auto; display: block; }
.topbar nav { display: flex; gap: 2px; flex: 1 1 auto; }
.topbar nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; margin: 12px 0; border-radius: 999px;
  color: var(--ink-soft); font-weight: 600; font-size: 14px;
}
.topbar nav a:hover { color: var(--brand-navy); background: var(--bg); text-decoration: none; }
.topbar nav a.on { color: var(--brand-navy); background: #e7f0f7; }
.nav-icon { width: 17px; height: 17px; flex: 0 0 auto; }

.topbar-user { display: flex; align-items: center; gap: 14px; }
.topbar-user .who { color: var(--ink); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.role-badge { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }
.role-badge.role-supervisor { background: #eaf6ec; color: var(--brand-green); border-color: #cdead2; }
.logout-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); font-weight: 600; font-size: 13px; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.logout-btn:hover { background: #fbeae5; color: var(--warn); border-color: #f0c6b8; }
.logout-btn .nav-icon { width: 15px; height: 15px; }

main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px; }
h1 { font-size: 26px; margin: 0 0 20px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0; }

.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.flash-icon { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -4px; margin-right: 5px; }
.flash { padding: 12px 16px; border-radius: 9px; margin-bottom: 18px; font-size: 14px; font-weight: 600; }
.flash.ok { background: #e3f4ec; color: var(--good); border: 1px solid #b9e3cf; }
.flash.error { background: #fbeae5; color: var(--warn); border: 1px solid #f0c6b8; }

/* page head */
.page-head { margin-bottom: 24px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-blue); margin-bottom: 6px; }
.eyebrow .icon { width: 15px; height: 15px; }
.page-head h1 { margin: 0; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 30px; }
.stat {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  box-shadow: var(--shadow); transition: transform 120ms ease, box-shadow 120ms ease;
}
.stat:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(13,59,102,.08), 0 10px 24px rgba(13,59,102,.1); }
.stat-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto; }
.stat-icon .icon { width: 20px; height: 20px; }
.stat-icon-calls { background: #e7f0f7; color: var(--brand-blue); }
.stat-icon-leads { background: #eaf6ec; color: var(--brand-green); }
.stat-icon-warn { background: #fbeae5; color: var(--warn); }
.stat-icon-tasks { background: #efecf8; color: #4a3aa7; }
.stat .n { font-size: 28px; font-weight: 700; font-family: var(--sans); font-variant-numeric: proportional-nums; letter-spacing: -.01em; color: var(--brand-navy); line-height: 1.1; }
.stat .k { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; font-weight: 700; }
.stat.warn .n { color: var(--warn); }

@media (max-width: 1000px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stats.stats-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1000px) { .stats.stats-6 { grid-template-columns: repeat(3, 1fr); } }
.stats.stats-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1000px) { .stats.stats-5 { grid-template-columns: repeat(3, 1fr); } }
.sequence-pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* two columns */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.sec-head h2 { display: flex; align-items: center; gap: 8px; }
.sec-icon { color: var(--brand-blue); }
.sec-head a { font-size: 13px; }
.add-doc-link { font-size: 13px; font-weight: 700; color: var(--brand-blue); }

/* tables */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); font-size: 14px; }
thead th { text-align: left; background: #eef3f7; color: var(--ink-soft); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; }
tbody td { padding: 11px 14px; border-top: 1px solid var(--line); }
tbody tr[data-href] { cursor: pointer; }
tbody tr[data-href]:hover { background: #f0f6fa; }
td.reason { max-width: 320px; }
.inline-form { display: inline; margin-left: 10px; }

/* pills */
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eceff0; color: var(--ink-soft); }
.pill.answered { background: #e3f4ec; color: var(--good); }
.pill.transferred { background: #e5eefb; color: var(--brand-blue); }
.pill.message { background: #fbf0dc; color: var(--amber); }
.pill.abandoned, .pill.error { background: #f7e4de; color: var(--warn); }
.pill.live { background: #fbeae5; color: var(--warn); display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; margin-left: 8px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* "live now" banner on the Dashboard when a call is in progress */
.live-banner { display: flex; align-items: center; gap: 10px; background: #fbeae5; border: 1px solid #f0c6b8; color: var(--warn); font-weight: 700; font-size: 14px; padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; }
.live-banner a { color: var(--warn); text-decoration: underline; margin-left: auto; }

.empty { color: var(--ink-soft); background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; }

/* call detail */
.back { margin: 0 0 6px; font-size: 13px; }
.meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 20px; }
.meta-grid .k { display: block; font-size: 11.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-bottom: 3px; }
.rec { margin: -6px 0 18px; }

/* transcript — color-coded by speaker */
.transcript { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.turn { margin: 0; padding: 9px 14px; border-radius: 10px 10px 10px 3px; font-family: var(--mono); font-size: 13px; line-height: 1.6; max-width: 88%; align-self: flex-start; background: #eceff0; color: var(--ink); }
.turn .who { display: block; font-family: var(--sans); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; opacity: .75; }
.turn.assistant { background: #e3f4ec; color: #0c4a3f; }
.turn.assistant .who { color: var(--good); opacity: 1; }
.turn.user { background: #e5eefb; color: #0d3b66; border-radius: 10px 10px 3px 10px; align-self: flex-end; }
.turn.user .who { color: var(--brand-blue); opacity: 1; }

/* knowledge */
.note { color: var(--ink-soft); font-size: 14px; margin: -8px 0 20px; max-width: 70ch; }
.doc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.doc { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.doc:hover { border-color: var(--brand-blue); text-decoration: none; }
.doc-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.doc-desc { font-size: 13px; color: var(--ink-soft); margin: 6px 0; }
.doc-meta { font-size: 12px; color: #97a29d; }

/* editor */
.editor { display: flex; flex-direction: column; gap: 18px; max-width: 820px; }
.editor label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.editor .hint { font-weight: 400; color: var(--ink-soft); }
.editor input, .editor textarea, .editor select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); }
.editor textarea.body { font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.editor input:focus, .editor textarea:focus, .editor select:focus { outline: 2px solid var(--brand-blue); outline-offset: 1px; border-color: var(--brand-blue); }
.editor input[readonly], .editor textarea[readonly] { background: var(--bg); color: var(--ink-soft); }
.actions { display: flex; align-items: center; gap: 16px; }
.actions button { background: var(--brand-navy); color: var(--accent-ink); border: 0; font-weight: 700; font-size: 14px; padding: 11px 22px; border-radius: 9px; cursor: pointer; }
.actions button:hover { filter: brightness(1.15); }
.actions .cancel { color: var(--ink-soft); }
.actions .slug { margin-left: auto; font-family: var(--mono); font-size: 12px; color: #97a29d; }

/* filter bar (e.g. Prospects page: location/status/sequence filters) */
.filter-bar { max-width: none; flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; margin-bottom: 16px; }
.filter-bar label { min-width: 160px; }
.filter-bar .actions { margin-left: auto; }

/* sortable table column headers (e.g. Prospects page: Added/Visited/Trial ends) */
th.sortable a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
th.sortable a:hover { color: var(--brand-blue); }
th.sortable .arrow { font-size: 10px; }

/* task summary (overview page) — validated categorical palette (4-slot subset of the
   dataviz skill's default 8-hue set: blue/yellow/green/violet), not the brand colors,
   because 4 cards sitting side by side need to be tell-apart-able at a glance —
   checked with scripts/validate_palette.js --pairs all, not eyeballed. */
.task-summary { margin-top: 30px; }
.task-cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.task-cat-card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; box-shadow: var(--shadow); border-left: 5px solid var(--task-cat-accent, var(--brand-navy));
  color: inherit; transition: transform 120ms ease, box-shadow 120ms ease;
}
.task-cat-card:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(13,59,102,.08), 0 10px 24px rgba(13,59,102,.1); }
.task-cat-count { font-size: 30px; font-weight: 700; font-family: var(--sans); font-variant-numeric: proportional-nums; letter-spacing: -.01em; color: var(--task-cat-accent, var(--brand-navy)); }
.task-cat-name { font-size: 14px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.task-cat-label { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.task-cat-daily-checklist { --task-cat-accent: #2a78d6; }
.task-cat-member-follow-ups { --task-cat-accent: #008300; }
.task-cat-maintenance { --task-cat-accent: #eda100; }
.task-cat-misc { --task-cat-accent: #4a3aa7; }

/* staff accounts — stacked, not side-by-side: the account table has six columns
   including two free-text/select inline-edit fields (email, role), which clipped
   badly squeezed into a ~1.4fr column (caught visually, not just in markup review) */
.staff-grid { display: flex; flex-direction: column; gap: 20px; }
.staff-list-card, .staff-add-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.staff-list-card { overflow-x: auto; }
.staff-add-card { padding: 20px; max-width: 480px; }
.staff-add-card h2 { margin-bottom: 14px; }
.link-btn { background: none; border: none; color: var(--brand-blue); font-weight: 700; font-size: 13px; cursor: pointer; padding: 0; }
.link-btn:disabled { color: var(--ink-soft); cursor: not-allowed; }
.hint { font-weight: 400; font-size: 12px; color: var(--ink-soft); }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--warn); }

/* inline-editable table cells (staff email/display-name/role) */
.cell-input { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); width: 100%; min-width: 130px; }
.cell-input:hover { border-color: var(--line); background: var(--bg); }
.cell-input:focus { outline: 2px solid var(--brand-blue); outline-offset: 0; border-color: var(--brand-blue); background: var(--surface); }
select.cell-input { cursor: pointer; min-width: 110px; }
.staff-list-card table { min-width: 760px; }

/* row action groups (e.g. missed calls: "Transcript" link + mark-called-back form side by side) */
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row-actions form { display: contents; }

.reset-pw { position: relative; }
.reset-pw summary { list-style: none; }
.reset-pw summary::-webkit-details-marker { display: none; }
.reset-pw-form { position: absolute; z-index: 10; top: 100%; right: 0; margin-top: 6px; display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px; box-shadow: var(--shadow); white-space: nowrap; }
.reset-pw-form input { font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; width: 170px; }
.reset-pw-form button { background: var(--brand-navy); color: #fff; border: 0; font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 7px; cursor: pointer; }

/* login / forgot-password / reset-password */
.login-wrap { display: flex; justify-content: center; padding: 8vh 20px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 36px 32px; width: 100%; max-width: 380px; }
.login-brand-img { display: block; height: 64px; width: auto; margin: 0 auto; }
.login-sub { text-align: center; color: var(--ink-soft); font-size: 14px; margin: 4px 0 22px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.login-form input { font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; }
.login-form input:focus { outline: 2px solid var(--brand-blue); outline-offset: 1px; border-color: var(--brand-blue); }
.login-form button { margin-top: 6px; background: var(--brand-navy); color: #fff; border: 0; font-weight: 700; font-size: 15px; padding: 12px; border-radius: 9px; cursor: pointer; }
.login-form button:hover { filter: brightness(1.15); }
.login-form .hint { font-weight: 400; font-size: 12.5px; color: var(--ink-soft); margin: -6px 0 0; }
.auth-link { text-align: center; font-size: 13px; margin: 18px 0 0; }

/* my account */
.account-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 20px; max-width: 480px; margin-bottom: 20px; }
.account-card h2 { margin-bottom: 12px; }
.account-card .editor { gap: 14px; }

/* ================= Task board (merged from the standalone TaskDashboard) ================= */

.task-header { text-align: center; margin-bottom: 8px; }
.task-header h1 { margin-bottom: 0; }
.board-date { margin: 4px 0 0; color: var(--ink-soft); font-size: 1rem; font-weight: 500; }

.sub-nav { display: flex; justify-content: center; gap: 8px; margin: 16px 0 22px; }
.sub-nav .nav-btn {
  min-height: 44px; padding: 8px 20px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); font-family: inherit; font-size: 1rem; font-weight: 600; border-radius: 10px;
  cursor: pointer; transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.sub-nav .nav-btn:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.sub-nav .nav-btn.active { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }

.view { display: none; }
.view.active { display: block; }

/* employee tiles */
.employee-tiles { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 0 20px; }
.employee-tile {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 16px 6px 6px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 999px; cursor: pointer;
  font-weight: 600; color: var(--ink); transition: border-color 150ms ease, background-color 150ms ease;
}
.employee-tile:hover { border-color: var(--brand-blue); }
.employee-tile.active { border-color: var(--brand-blue); background: #eaf4fb; color: var(--brand-blue); }
.employee-avatar {
  display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink-soft); color: #fff; font-size: .85rem; font-weight: 700; flex: 0 0 auto;
}
.employee-tile.active .employee-avatar { background: var(--brand-blue); }
.employee-tile-count { font-size: .85rem; color: var(--ink-soft); font-weight: 500; }

/* board grid */
.board-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 860px) { .board-grid { grid-template-columns: 1fr; } }

.category-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow);
  border-top: 6px solid var(--cat-accent, var(--brand-navy));
}
.category-daily-checklist { --cat-accent: var(--brand-navy); }
.category-member-follow-ups { --cat-accent: var(--brand-green); }
.category-maintenance { --cat-accent: var(--amber); }
.category-misc { --cat-accent: var(--misc-accent); }

.category-header { display: flex; align-items: center; justify-content: space-between; }
.category-header h2 { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--cat-accent); }
.task-count {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-soft); font-weight: 600;
  font-size: .9rem; padding: 2px 10px; border-radius: 999px; min-width: 28px; text-align: center;
}

.add-task-form { display: flex; flex-wrap: wrap; gap: 8px; }
.add-title-input, .add-note-input, .add-employee-select {
  flex: 1 1 120px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 1rem; font-family: inherit; color: var(--ink); background: var(--bg);
}
.add-employee-select { flex: 0 1 140px; cursor: pointer; }
.add-title-input:focus, .add-note-input:focus, .add-employee-select:focus {
  outline: 2px solid var(--cat-accent, var(--brand-blue)); outline-offset: 1px; background: var(--surface);
}
.add-btn {
  flex: 0 0 auto; min-height: 44px; min-width: 72px; padding: 8px 18px; border: none; border-radius: 10px;
  background: var(--cat-accent, var(--brand-navy)); color: #fff; font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: filter 150ms ease;
}
.add-btn:hover { filter: brightness(1.12); }
.add-btn:active { filter: brightness(0.92); }

.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-height: 44px; }
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 8px 8px 8px 4px; border-radius: 10px; transition: opacity 200ms ease, transform 200ms ease, background-color 150ms ease; }
.task-row:hover { background: var(--bg); }
.task-row.removing { opacity: 0; transform: translateX(12px); }
.task-row.hidden-by-filter { display: none; }

.task-checkbox {
  appearance: none; flex: 0 0 auto; width: 30px; height: 30px; margin: 5px 2px; border: 2px solid var(--line);
  border-radius: 8px; cursor: pointer; position: relative; background: var(--surface);
  transition: background-color 150ms ease, border-color 150ms ease;
}
.task-checkbox:hover { border-color: var(--cat-accent, var(--brand-blue)); }
.task-checkbox:checked { background: var(--good); border-color: var(--good); }
.task-checkbox:checked::after {
  content: ""; position: absolute; left: 9px; top: 4px; width: 7px; height: 14px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}

.task-body { flex: 1 1 auto; min-width: 0; padding-top: 4px; cursor: pointer; }
.task-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.task-title { font-weight: 600; word-break: break-word; }
.task-note { color: var(--ink-soft); font-size: .92rem; margin-top: 2px; word-break: break-word; }
.employee-badge { display: inline-block; background: var(--bg); border: 1px solid var(--line); color: var(--ink-soft); font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.task-completed-time { color: var(--good); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.task-row.completed .task-title { text-decoration: line-through; color: var(--ink-soft); }
.task-row.completed .task-note { text-decoration: line-through; opacity: .7; }

.delete-btn { flex: 0 0 auto; width: 40px; height: 40px; border: none; background: transparent; color: var(--ink-soft); font-size: 1.1rem; font-weight: 700; border-radius: 8px; cursor: pointer; transition: background-color 150ms ease, color 150ms ease; }
.delete-btn:hover { background: #fbeae5; color: var(--warn); }
.empty-state { color: var(--ink-soft); font-size: .95rem; padding: 6px 4px; font-style: italic; }

/* calendar */
.calendar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 20px 0 8px; }
.calendar-controls select { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; font-family: inherit; background: var(--surface); color: var(--ink); cursor: pointer; }
.calendar-month-nav { display: flex; align-items: center; gap: 10px; margin-left: auto; font-weight: 700; font-size: 1.1rem; }
.calendar-month-nav button { min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-size: 1.3rem; cursor: pointer; color: var(--ink); }
.calendar-month-nav button:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.calendar-hint { color: var(--ink-soft); font-size: .92rem; margin: 0 0 10px; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; text-align: center; color: var(--ink-soft); font-weight: 700; font-size: .85rem; margin-bottom: 6px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.calendar-day { min-height: 112px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 8px; display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.calendar-day.empty { border: none; background: transparent; }
.calendar-day-number { font-weight: 700; font-size: .9rem; color: var(--ink-soft); flex: 0 0 auto; }
.calendar-day-tasks { display: flex; flex-direction: column; gap: 3px; overflow: hidden; min-height: 0; }
.calendar-day-task { font-size: .72rem; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,.7); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 0 auto; }
.calendar-day-more { font-size: .7rem; color: var(--ink-soft); font-weight: 700; padding: 0 4px; flex: 0 0 auto; }
.calendar-day.level-1 { background: #eef6ea; }
.calendar-day.level-2 { background: #d7ecd0; }
.calendar-day.level-3 { background: #b9dfae; }
.calendar-day.today { border-color: var(--brand-blue); border-width: 2px; }

.calendar-day-progress { float: right; font-weight: 700; color: var(--ink-soft); font-size: .78rem; }
.calendar-day.checklist-day.all-done { background: #eef6ea; }
.checklist-item.pending { background: rgba(255,255,255,.7); color: var(--ink); }
.checklist-item.done { background: var(--good); color: #fff; text-decoration: line-through; opacity: .85; }

@media (max-width: 700px) {
  .calendar-weekdays span:nth-child(n) { font-size: .7rem; }
  .calendar-day { min-height: 74px; padding: 5px; }
  .calendar-day-task { font-size: .62rem; padding: 1px 5px; }
}

/* sticky notes */
.add-note-fab { position: fixed; top: 78px; right: 20px; z-index: 600; min-height: 44px; padding: 8px 20px; border: none; border-radius: 10px; background: var(--ink); color: #fff; font-family: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; box-shadow: 0 2px 8px rgba(13,59,102,.25); transition: filter 150ms ease; }
.add-note-fab:hover { filter: brightness(1.2); }
.sticky-notes-layer { position: fixed; inset: 0; pointer-events: none; z-index: 500; }
.sticky-note { position: absolute; pointer-events: auto; display: flex; flex-direction: column; min-width: 160px; min-height: 140px; border-radius: 8px; box-shadow: 0 6px 16px rgba(13,59,102,.25), 0 2px 4px rgba(13,59,102,.15); overflow: hidden; resize: both; }
.sticky-note-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; cursor: grab; background: rgba(0,0,0,.08); flex: 0 0 auto; }
.sticky-note-header:active { cursor: grabbing; }
.sticky-note-colors { display: flex; gap: 5px; }
.sticky-note-color-dot { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); cursor: pointer; padding: 0; }
.sticky-note-delete { border: none; background: transparent; font-weight: 700; font-size: 1.1rem; line-height: 1; cursor: pointer; color: rgba(20,33,46,.6); width: 26px; height: 26px; border-radius: 6px; }
.sticky-note-delete:hover { background: rgba(0,0,0,.12); color: var(--warn); }
.sticky-note-body { flex: 1 1 auto; width: 100%; border: none; background: transparent; resize: none; padding: 10px; font-family: inherit; font-size: .95rem; color: var(--ink); outline: none; }

@media (max-width: 700px) {
  .add-note-fab { top: auto; bottom: 16px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .task-row { transition: none; }
}

@media (max-width: 760px) {
  .stats, .cols, .doc-list, .meta-grid { grid-template-columns: 1fr; }
  .task-cat-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; gap: 12px; padding: 12px 14px; }
  main { padding: 20px 14px 48px; }
}
