:root {
  --green-900: #1f3d2b;
  --green-700: #2f5d3a;
  --green-500: #4a8a57;
  --green-100: #e6f0e4;
  --bark: #6b4f3a;
  --bg: #f6f5f0;
  --surface: #ffffff;
  --border: #e2e0d8;
  --text: #22261f;
  --muted: #6a6f66;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--green-900);
  color: #fff;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; padding: 0 6px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; border-radius: 6px; }
.brand-name { font-weight: 700; line-height: 1.15; }
.brand-sub { font-size: 12px; opacity: .7; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  color: #dfe9dc; text-decoration: none;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 4px;
}
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a.active { background: var(--green-500); color: #fff; }

/* Main */
main { flex: 1; padding: 28px 32px; min-width: 0; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header h1 { margin: 0; font-size: 24px; }
.page-header p { margin: 4px 0 0; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
}
.card h2 { margin: 0 0 14px; font-size: 16px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 28px; font-weight: 700; margin-top: 6px; color: var(--green-700); }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
/* Let wide tables scroll inside their card instead of stretching the grid past the screen on phones. */
.grid-2 > * { min-width: 0; }
.grid-split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; align-items: start; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr.clickable { cursor: pointer; }
tr.clickable:hover, tr.selected { background: var(--green-100); }
.num { text-align: right; }
.empty { color: var(--muted); padding: 16px 0; text-align: center; }

/* Badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-requested { background: #eef1f6; color: #4a5568; }
.badge-scheduled { background: #e3eefc; color: #1f5fae; }
.badge-in-progress { background: #fff3d6; color: #9a6400; }
.badge-completed { background: #dff3e3; color: #22703a; }
.badge-invoiced { background: #efe6f8; color: #6a3d9a; }
.badge-draft { background: #eef1f6; color: #4a5568; }
.badge-sent { background: #e3eefc; color: #1f5fae; }
.badge-paid { background: #dff3e3; color: #22703a; }
.badge-overdue { background: #fde3e1; color: #b3261e; }
.badge-inactive { background: #eee; color: #888; }

/* Forms & buttons */
.btn {
  border: 1px solid var(--green-700); background: var(--green-700); color: #fff;
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px;
}
.btn:hover { background: var(--green-900); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--green-700); }
.btn-ghost:hover { background: var(--green-100); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
input, select, textarea {
  font: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form-grid .full { grid-column: 1 / -1; }
.checkbox-row { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text); }
.checkbox-row label { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
.hidden { display: none !important; }
/* Admin-only buttons, links and cards; common.js adds .is-admin to <body> once it knows the user is an admin. */
body:not(.is-admin) .admin-only { display: none !important; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.list li:last-child { border-bottom: none; }
.muted { color: var(--muted); font-size: 13px; }

/* Dashboard Weather Tracker */
.weather-intro { margin: -8px 0 4px; }
/* Every upcoming job is listed; the list scrolls inside a fixed height (about 5 jobs) so the card keeps its size. */
.weather-list { max-height: 400px; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; border-bottom: 1px solid var(--border); }
.weather-list li { display: flex; flex-direction: column; gap: 3px; padding: 14px 0; }
.weather-job { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.weather-job a { color: inherit; text-decoration: none; }
.weather-job a:hover { text-decoration: underline; }
.weather-forecast { font-size: 13px; }
.weather-forecast a { color: var(--green-700); }
.weather-alert .weather-forecast { color: #9a6400; font-weight: 600; }
.weather-alert .weather-forecast .muted { font-weight: normal; }
.badge-weather { background: #fff3d6; color: #9a6400; }
.weather-credit { margin: 10px 0 0; font-size: 12px; }

.detail dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0 0 16px; font-size: 14px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }

/* Schedule grid */
.schedule { display: grid; grid-template-columns: 160px repeat(7, minmax(110px, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.schedule > div { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px; min-height: 70px; font-size: 13px; }
.schedule .head { background: var(--green-100); font-weight: 600; min-height: auto; }
.schedule .head.today { background: var(--green-500); color: #fff; }
.schedule .crew-cell { font-weight: 600; background: #fafaf7; }
.schedule .crew-cell .muted { font-weight: 400; }
.chip { display: block; background: var(--green-100); border-left: 3px solid var(--green-500); border-radius: 4px; padding: 4px 6px; margin-bottom: 4px; }

.totals { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.totals .kpi { flex: 1; min-width: 150px; }

@media (max-width: 900px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; padding: 12px 16px; }
  .brand { margin-bottom: 10px; }
  .nav { display: flex; overflow-x: auto; gap: 4px; }
  .nav a { white-space: nowrap; margin: 0; }
  main { padding: 20px 16px; }
  .grid-2, .grid-split { grid-template-columns: 1fr; }
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-danger { background: transparent; border-color: #b3261e; color: #b3261e; }
.btn-danger:hover { background: #fde3e1; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn + .btn { margin-left: 4px; }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.detail-header h2 { margin: 0; }
.detail-header div { display: flex; gap: 6px; flex-shrink: 0; }
.badge-archived { background: #eee; color: #666; vertical-align: middle; }
.schedule .crew-cell .expertise { font-weight: 400; font-size: 11px; color: var(--green-700); margin-top: 4px; line-height: 1.3; }
.badge-active { background: #dff3e3; color: #22703a; }
.badge-admin { background: #efe6f8; color: #6a3d9a; }
.badge-staff { background: #eef1f6; color: #4a5568; }
.tag { display: inline-block; background: var(--green-100); color: var(--green-900); border-radius: 999px; padding: 2px 9px; font-size: 12px; margin: 0 4px 4px 0; }

/* Crew picker on the New Job form */
/* Jobs form: "+ New client…" sub-form */
.new-client-panel { background: var(--green-100); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.new-client-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.new-client-panel input { background: #fff; }
.new-client-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.new-client-actions .error { color: #b3261e; }
/* Jobs form: "Recurring" section */
.recurring-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.recurring-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.recurring-panel { display: flex; flex-direction: column; gap: 12px; background: var(--green-100); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.recurring-panel input[type="date"] { background: #fff; }
.recurring-panel .checkbox-row { align-items: center; }
.recurring-panel .checkbox-row > span { min-width: 56px; color: var(--muted); }
.recurring-monthly { display: flex; flex-direction: column; gap: 6px; }
.form-grid .recurring-monthly label { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: 14px; }
.recurring-end { max-width: 220px; }
.recurring-panel p { margin: 0; }
.recurring-panel p.error { color: #b3261e; }
.crew-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.crew-field-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crew-picker { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; max-height: 340px; overflow-y: auto; background: #fff; }
.crew-picker li { border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.crew-picker li:last-child { border-bottom: none; }
.crew-picker li.recommended { border-left-color: var(--green-500); background: #f4f9f3; }
.crew-picker label { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; cursor: pointer; color: var(--text); }
.crew-picker label:hover { background: var(--green-100); }
.crew-picker li:has(input:checked) label { background: var(--green-100); }
.crew-picker input[type="checkbox"] { margin-top: 3px; }
.crew-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; }
.crew-name { font-weight: 600; }
.crew-skills, .crew-reason { flex-basis: 100%; }
.crew-skills .tag { margin-bottom: 0; }
.crew-reason { font-size: 13px; color: var(--green-700); font-style: italic; }
.crew-busy { font-size: 12px; color: #b3261e; }
.crew-picker li.busy label { background: #faf7f5; }
.crew-picker li.busy .crew-name { color: var(--muted); }
.badge-recommended { background: var(--green-500); color: #fff; }

/* Logged-in user + log out, pinned to the bottom of the sidebar */
.sidebar { display: flex; flex-direction: column; }
.sidebar-user { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid rgba(255,255,255,.12); display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: #dfe9dc; }
.sidebar-logout { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 6px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.sidebar-logout:hover { background: rgba(255,255,255,.1); }

/* Login page */
.login-page { align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; margin: 0; padding: 28px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: var(--green-900); }
.login-brand .brand-name { color: var(--green-900); }
.login-btn { width: 100%; padding: 10px; }
.login-error { margin: 0; color: #b3261e; font-size: 14px; }

@media (max-width: 900px) {
  .sidebar-user { margin-top: 10px; padding-top: 10px; }
}

/* Settings link: pushed to the bottom of the sidebar, separated from the main pages */
.nav-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-user { margin-top: 8px; }
@media (max-width: 900px) {
  .nav-bottom { margin-top: 6px; padding-top: 6px; }
}

/* Calendar page: month grid, Sunday first. Job colours match the status badges. */
.calendar-filters { align-items: center; flex-wrap: wrap; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(100px, 1fr)); min-width: 720px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-head { background: var(--green-100); font-weight: 600; font-size: 13px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-day { min-height: 110px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 12px; }
.cal-head:nth-child(7n), .cal-day:nth-child(7n) { border-right: none; }
.cal-day.other-month { background: #fafaf7; }
.cal-day.other-month .cal-date { color: #b5b8b0; }
.cal-date { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.cal-day.today .cal-date { display: inline-block; background: var(--green-500); color: #fff; border-radius: 999px; padding: 1px 8px; }
.cal-job { display: block; text-decoration: none; color: var(--text); border-left: 3px solid; border-radius: 4px; padding: 3px 6px; margin-bottom: 4px; line-height: 1.3; }
.cal-job span { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-job:hover { filter: brightness(.95); }
.cal-job.status-requested { background: #eef1f6; border-color: #4a5568; }
.cal-job.status-scheduled { background: #e3eefc; border-color: #1f5fae; }
.cal-job.status-in-progress { background: #fff3d6; border-color: #9a6400; }
.cal-job.status-completed { background: #dff3e3; border-color: #22703a; }
.cal-job.status-invoiced { background: #efe6f8; border-color: #6a3d9a; }
.nowrap { white-space: nowrap; }
.cal-job em { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
/* Events (not jobs) are coloured by calendar, with a dashed edge so they don't look like a job status. */
.event-card { margin-bottom: 14px; }
.cal-event { position: relative; border-left-style: dashed; padding-right: 18px; }
.cal-event.cal-warren { background: #e0f4f4; border-color: #137a7a; }
.cal-event.cal-adam { background: #fde8e0; border-color: #b5481c; }
.cal-event-delete { position: absolute; top: 1px; right: 2px; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 2px; }
.cal-event-delete:hover { color: #b3261e; }
.legend-event { display: inline-block; border-left: 3px dashed; border-radius: 4px; padding: 1px 8px; font-size: 12px; }
.legend-event.cal-warren { background: #e0f4f4; border-color: #137a7a; }
.legend-event.cal-adam { background: #fde8e0; border-color: #b5481c; }

/* Email Drafter: clickable list of templates */
.template-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.template-list button { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid transparent; border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.template-list button:hover { background: var(--green-100); }
.template-list button.active { border-left-color: var(--green-500); background: var(--green-100); }
.placeholder-buttons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.placeholder-buttons .tag { border: none; font: inherit; font-size: 12px; cursor: pointer; margin: 0; }
.placeholder-buttons .tag:hover { background: var(--green-500); color: #fff; }

/* Estimates & Invoices: create card and cost breakdown rows */
.create-card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.create-card-header h2 { margin: 0; }
.create-card-hint { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
#invoice-form { margin-top: 16px; }
.line-items-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.line-item-row { display: grid; grid-template-columns: 1fr 140px 32px; gap: 8px; margin-bottom: 8px; }
.line-item-row .li-remove { padding: 0; font-size: 18px; }
.invisible { visibility: hidden; }
.line-items-total { text-align: right; font-size: 13px; color: var(--muted); margin-top: 4px; }
.line-items-total strong { color: var(--text); font-size: 15px; margin-left: 6px; }
@media (max-width: 900px) {
  .line-item-row { grid-template-columns: 1fr 110px 32px; }
}
/* Discount/tax rows: [Discount ▾] [description] [10] [% ▾] –$100.00 [×]; on phones the description gets its own line. */
.adjustment-row {
  display: grid; gap: 8px; margin-bottom: 8px; align-items: center;
  grid-template-columns: 110px 1fr 80px 60px 96px 32px;
  grid-template-areas: "kind desc value mode amount remove";
}
.adj-kind { grid-area: kind; }
.adj-desc { grid-area: desc; }
.adj-value { grid-area: value; }
.adj-mode { grid-area: mode; }
.adj-amount { grid-area: amount; text-align: right; font-size: 13px; color: var(--muted); }
.adjustment-row .adj-remove { grid-area: remove; padding: 0; font-size: 18px; }
#add-adjustment { margin-top: 4px; }
@media (max-width: 600px) {
  .adjustment-row {
    grid-template-columns: 1fr 70px 56px 32px;
    grid-template-areas: "kind value mode remove" "desc desc amount amount";
  }
}
.row-actions a.btn { display: inline-block; text-decoration: none; }
.icon-btn, .row-actions a.icon-btn { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.form-actions { display: flex; align-items: center; gap: 8px; }
.form-actions-end { display: flex; gap: 8px; margin-left: auto; } /* Delete PDF + Delete: far right, away from Save */

/* Jobs, Estimates & Invoices and Users tables: the status/access badge is a dropdown. The arrow is drawn in the badge's own colour. */
select.status-select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 999px; padding: 3px 22px 3px 9px; font-size: 12px; font-weight: 600;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 11px center, right 7px center;
  background-size: 4px 4px; background-repeat: no-repeat;
}
select.status-select:hover { border-color: currentColor; }
select.status-select:disabled { opacity: 0.6; cursor: wait; }
select.status-select option { background: #fff; color: var(--text); font-weight: 400; }

/* Filter dropdowns: the browser's own arrow sat on the very edge and clipped past the rounded corner, so draw one inset instead. */
.filters select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 15px center, right 10px center;
  background-size: 5px 5px; background-repeat: no-repeat;
}

/* Estimates & Invoices: Upload PDF + New buttons side by side, and the upload status line under them. */
.create-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.upload-status { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.upload-status-ok { color: var(--green-700); font-weight: 600; }

/* Task Manager: "Tasks" bookmark tab on every page that slides the panel out from the bottom right */
.task-drawer {
  position: fixed; right: 0; bottom: 24px; z-index: 50;
  width: min(280px, calc(100vw - 48px));
  transform: translateX(100%); transition: transform .25s ease;
}
.task-drawer.open { transform: none; }
.task-tab {
  position: absolute; right: 100%; bottom: 16px;
  writing-mode: vertical-rl; transform: rotate(180deg);
  background: var(--green-700); color: #fff; border: none; border-radius: 0 8px 8px 0;
  padding: 14px 8px; font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .03em;
  cursor: pointer; box-shadow: 2px 0 8px rgba(0, 0, 0, .15);
}
.task-tab:hover { background: var(--green-900); }
/* Count of tasks from other people, on the tab's outer top corner. The tab is rotated 180°, so bottom/right here
   is top/left on screen, and the badge is turned back upright. */
.task-tab-badge {
  position: absolute; bottom: -7px; right: -7px;
  writing-mode: horizontal-tb; transform: rotate(180deg);
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; border: 2px solid #fff;
  background: #c2410c; color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; letter-spacing: 0;
}
.task-tab-badge:empty { display: none; }
.task-panel {
  display: flex; flex-direction: column; gap: 12px;
  height: min(80vh, 640px); padding: 18px 16px 16px;
  background: var(--surface); border: 1px solid var(--border); border-right: none;
  box-shadow: -8px 12px 40px rgba(31, 61, 43, .16), -2px 2px 8px rgba(0, 0, 0, .06);
}
.task-drawer:not(.open) .task-panel { box-shadow: none; }
.task-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-panel h2 { margin: 0; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.task-count {
  min-width: 22px; padding: 2px 7px; border-radius: 999px; text-align: center;
  background: var(--green-100); color: var(--green-700); font-size: 12px; font-weight: 600;
}
.task-count:empty { display: none; }

/* One pill-shaped field with the round "+" (Create task) button inside it */
.task-form {
  display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 14px;
  background: #f4f4f0; border: 1px solid transparent; border-radius: 999px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.task-form:focus-within { background: #fff; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(74, 138, 87, .15); }
.task-form input { flex: 1; min-width: 0; padding: 6px 0; border: none; background: transparent; outline: none; }
/* "Assign to" picker: Me, or someone else to send the task to */
.task-assign {
  flex-shrink: 0; max-width: 52px; padding: 2px 4px; border: none; border-radius: 999px;
  background: var(--green-100); color: var(--green-700); font: inherit; font-size: 10px; font-weight: 600; cursor: pointer; text-overflow: ellipsis;
}
.task-assign:hover, .task-assign:focus-visible { background: #d4e6d1; }
.task-assign[hidden] { display: none; }
.task-add {
  display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; padding: 0;
  border: none; border-radius: 50%; background: var(--green-700); color: #fff; cursor: pointer; transition: background .15s;
}
.task-add:hover { background: var(--green-900); }

.task-error { margin: 0; color: #b3261e; font-size: 13px; }
.task-error:empty { display: none; }
.task-sent { margin: 0; color: var(--green-700); font-size: 13px; font-weight: 600; }
.task-sent:empty { display: none; }
.task-list { list-style: none; margin: 0 -6px; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.task-list label {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 10px;
  font-size: 14px; line-height: 20px; color: var(--text); cursor: pointer; overflow-wrap: anywhere; transition: background .15s;
}
.task-list label:hover { background: #f4f4f0; }
.task-list li.done span { text-decoration: line-through; color: #a3a69f; }
.task-list li.notice span { color: var(--green-700); font-weight: 600; }
.task-from { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }

/* Round checkbox that fills green with a white tick */
.task-list input[type="checkbox"] {
  appearance: none; flex-shrink: 0; width: 20px; height: 20px; margin: 0; padding: 0;
  border: 2px solid #c9c8bf; border-radius: 50%; background: #fff;
  display: grid; place-content: center; cursor: pointer; transition: background .15s, border-color .15s;
}
.task-list input[type="checkbox"]:hover { border-color: var(--green-500); }
.task-list input[type="checkbox"]::after {
  content: ""; width: 5px; height: 9px; margin-top: -2px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0); transition: transform .15s ease;
}
.task-list input[type="checkbox"]:checked { background: var(--green-500); border-color: var(--green-500); }
.task-list input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }
.task-list input[type="checkbox"]:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
.task-empty { padding: 9px 10px; }
@media (prefers-reduced-motion: reduce) { .task-drawer, .task-list input[type="checkbox"]::after { transition: none; } }
