/* Attic Task Tracker. The first part is the approved design (attic-task-tracker.html, owner 2026-11-16), copied as is.
   Additions for the live app (login, account, calendar, users, summary) are at the end. */
:root {
  /* Layout: companies and departments in a menu on the left, tasks on the right
     in groups by urgency (Overdue, Follow up now, Coming up). On a phone the menu
     sits above the tasks. Light colours only, as the owner asked. */
  --ground: #F8F4F6;
  --surface: #FFFFFF;
  --ink: #1B2430;
  --ink-soft: #4B5563;
  --line: #D5DAE1;
  --hair: #E6E9EE;
  --edge: #7C8798;
  --ring: #6B7585;
  --accent: #7A2E63;
  --on-accent: #FFFFFF;
  --band: #F3ECF0;
  --chip: #EAEDF1;
  --chip-ink: #3D4654;
  --late: #B4281F;
  --late-wash: #FBE2DF;
  --late-band: #FDF1EF;
  --soon: #855000;
  --soon-wash: #FBEAC4;
  --soon-band: #FDF6E3;
  --ok: #246B41;
  --ok-wash: #DBEFE1;
  --info: #1F4E79;
  --info-wash: #E3ECF5;
  --scrim: rgba(9, 28, 26, 0.55);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.45 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app { display: flex; flex-wrap: wrap; align-items: stretch; min-height: 100vh; }

/* Menu on the left */
.side { flex: 1 1 288px; min-width: 0; display: flex; flex-direction: column; gap: 18px; padding-block: 24px 28px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.brand { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.brand h1 { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.2; }
.brand p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }
.navlist { display: flex; flex-direction: column; gap: 2px; }
.navbtn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 46px; padding: 6px 12px; border: 0; border-radius: 10px; background: none; font-size: 16px; font-weight: 600; line-height: 1.25; text-align: left; }
.navbtn .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.navbtn .n { font-size: 14px; font-weight: 500; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.navbtn .lead-ic { flex: none; width: 16px; height: 16px; color: var(--ink-soft); }
.navbtn.open { background: var(--band); }
.navbtn[aria-current="page"] { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.navbtn[aria-current="page"] .n, .navbtn[aria-current="page"] .lead-ic { color: var(--on-accent); }
.navbtn.dept { min-height: 44px; padding-left: 36px; border-radius: 8px; font-size: 15px; font-weight: 500; }
.navbtn.add { border: 1px dashed var(--edge); color: var(--ink-soft); font-size: 15px; }
.navbtn.dept.add { border: 0; }
.navbtn.add .icon { width: 16px; height: 16px; }

/* Tasks on the right */
main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 18px; padding-block: 26px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 900px) {
  main { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}
.flash { margin: 0; padding: 9px 12px; border-radius: 8px; background: var(--late-wash); color: var(--late); font-size: 15px; font-weight: 600; }
.flash.info { background: var(--ok-wash); color: var(--ok); }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.head-title { min-width: 0; }
.head h2 { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere; }
.count { margin: 2px 0 0; font-size: 15.5px; color: var(--ink-soft); }
.count b { font-weight: 700; color: var(--late); }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tools input, .tools select { min-height: 46px; padding: 0 12px; border: 1px solid var(--edge); border-radius: 10px; background: var(--surface); font-size: 16px; }
.tools input { width: 230px; max-width: 100%; }
.tools select { max-width: 190px; }
.pic-filter { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.pic-filter select { color: var(--ink); font-weight: 400; }
.links { display: flex; flex-wrap: wrap; gap: 0 18px; margin: -12px 0 -8px; }
.link-btn { min-height: 44px; padding: 8px 2px; border: 0; background: none; font-size: 14.5px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger { color: var(--late); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; font-size: 16px; font-weight: 600; white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: var(--surface); border-color: var(--edge); }
.btn.danger { background: transparent; border-color: var(--late); color: var(--late); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14.5px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.icon { flex: none; width: 18px; height: 18px; }

/* Notices */
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-radius: 10px; background: var(--info-wash); font-size: 15px; }
.notice p { flex: 1 1 200px; margin: 0; }
.notice.warn { background: var(--soon-wash); color: var(--soon); }
.notice .btn { background: var(--surface); border-color: var(--edge); }

/* The four counters */
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; }
.tab b { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tab .t { font-size: 15px; font-weight: 600; }
.tab .h { font-size: 13.5px; color: var(--ink-soft); }
.tab.alert b { color: var(--late); }
.tab[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.tab[aria-pressed="true"] b, .tab[aria-pressed="true"] .h { color: var(--on-accent); }
@media (max-width: 560px) {
  .tabs { gap: 6px; }
  .tab { padding: 9px 9px 10px; }
  .tab b { font-size: 25px; }
  .tab .t { font-size: 13.5px; line-height: 1.2; }
  .tab .h { display: none; }
}

/* Task list */
.list { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.group { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: var(--band); color: var(--ink-soft); font-size: 14px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.group + .task, .task + .group, .task + .task { border-top: 1px solid var(--hair); }
.group.late { background: var(--late-band); color: var(--late); }
.group.soon { background: var(--soon-band); color: var(--soon); }
.group.done { background: var(--ok-wash); color: var(--ok); }
.task { display: flex; align-items: stretch; }
.task-check { flex: none; display: grid; place-items: center; width: 54px; min-height: 64px; padding: 0; border: 0; background: none; }
.task-check[disabled] { cursor: default; opacity: 0.5; }
.ring { display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--ring); border-radius: 50%; color: transparent; }
.ring svg { width: 13px; height: 13px; }
.task.is-done .ring { border-color: var(--ok); background: var(--ok); color: var(--surface); }
.task-open { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 9px 18px 9px 0; border: 0; background: none; text-align: left; }
.task-wa { flex: none; display: grid; justify-items: center; align-content: center; gap: 2px; width: 78px; min-height: 64px; border-left: 1px solid var(--hair); color: var(--accent); font-size: 12px; font-weight: 700; text-decoration: none; }
.task-wa svg { width: 20px; height: 20px; }
.c-body { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.task-title { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.task.is-done .task-title { color: var(--ink-soft); text-decoration: line-through; }
.task-pills { display: flex; flex-wrap: wrap; gap: 5px 6px; }
.task-notes { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
.c-place { flex: 0 0 160px; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.c-place span { font-size: 14px; font-weight: 400; color: var(--ink-soft); }
.c-pic { flex: 0 0 96px; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.c-pic i { font-style: normal; font-size: 12.5px; letter-spacing: 0.05em; color: var(--ink-soft); }
.c-pic .none { font-weight: 400; color: var(--ink-soft); }
.c-due { flex: 0 0 140px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-weight: 700; font-variant-numeric: tabular-nums; }
.c-due.late { color: var(--late); }
.c-due .nodate { font-weight: 400; color: var(--ink-soft); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border: 1px solid transparent; border-radius: 999px; background: var(--chip); color: var(--chip-ink); font-size: 13px; font-weight: 600; line-height: 1.35; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill.late { background: var(--late-wash); color: var(--late); }
.pill.soon { background: var(--soon-wash); color: var(--soon); }
.pill.ok { background: var(--ok-wash); color: var(--ok); }
.pill.doing { background: var(--info-wash); color: var(--info); }
.navbtn .pill.late { font-size: 12.5px; font-weight: 700; padding: 2px 8px; }
.empty { margin: 0; padding: 18px 16px; border: 1px dashed var(--edge); border-radius: 12px; font-size: 15px; color: var(--ink-soft); }
.lead { margin: 0; font-size: 15px; color: var(--ink-soft); }

/* Dialogs */
dialog { width: min(560px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 14px; background: var(--surface); color: var(--ink); overflow: hidden; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: var(--scrim); }
dialog.small { width: min(420px, calc(100% - 24px)); }
dialog form { display: flex; flex: 1; flex-direction: column; min-height: 0; margin: 0; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.icon-btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: none; }
.dlg-body { flex: 1; min-height: 0; padding: 18px; overflow-y: auto; }
.dlg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.grow { flex: 1; }
.plain { min-width: 0; margin: 0; padding: 0; border: 0; }
.fields { display: grid; gap: 15px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label, .seg legend { font-size: 14.5px; font-weight: 600; }
.field label span { font-weight: 400; color: var(--ink-soft); }
.field input, .field select, .field textarea { display: block; width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); font-size: 16px; }
.field textarea { resize: vertical; line-height: 1.4; }
.field input[type="date"] { -webkit-appearance: none; appearance: none; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 480px) { .pair.stack { grid-template-columns: minmax(0, 1fr); gap: 15px; } }
.remind-tools { display: grid; gap: 7px; margin-top: -6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 0 12px; border: 1px solid var(--edge); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.hint { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.hint.warn { font-weight: 600; color: var(--late); }
.seg legend { margin-bottom: 5px; padding: 0; }
.seg-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.seg label { position: relative; display: block; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg label span { display: grid; place-items: center; min-height: 46px; padding: 0 6px; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); font-size: 15px; font-weight: 600; color: var(--ink-soft); text-align: center; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.form-error { margin: 14px 0 0; font-size: 15px; font-weight: 600; color: var(--late); }
.form-error:empty { display: none; }
.dlg-text { margin: 0 0 14px; }
.dlg-text:empty { display: none; }
@media (max-width: 600px) {
  #task-dlg { width: 100%; height: 100%; max-height: 100%; margin: 0; border-radius: 0; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
  dialog.small { margin-top: 12vh; }
}

/* ---------- Additions for the live app ---------- */

/* Log in and first-time password pages */
.auth { display: grid; place-items: center; width: 100%; min-height: 100vh; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 15px; padding: 26px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.auth-card h1 { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.2; }
.auth-card .lead b { color: var(--ink); }
.auth-card .btn { width: 100%; }
.auth-card .form-error { margin: 0; }
.boot { width: 100%; padding: 40px 16px; text-align: center; color: var(--ink-soft); }

/* Who is logged in, at the bottom of the menu */
.account { display: flex; flex-direction: column; gap: 2px; padding: 14px 8px 0; border-top: 1px solid var(--line); }
.account .who { margin: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.account .who span { margin-left: 6px; font-size: 13.5px; font-weight: 400; color: var(--ink-soft); }
.account .links { margin: 0; }

/* Date fields: a button that opens a calendar whose week starts on Monday */
.date-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); font-size: 16px; text-align: left; }
.date-btn.none { color: var(--ink-soft); }
.date-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.date-btn svg { flex: none; width: 18px; height: 18px; color: var(--ink-soft); }
.cal { margin-top: -6px; padding: 10px; border: 1px solid var(--edge); border-radius: 10px; background: var(--surface); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cal-head b { font-size: 15.5px; }
.cal-head small { display: block; font-size: 13px; font-weight: 400; color: var(--ink-soft); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-grid .wd { padding: 4px 0; font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-align: center; text-transform: uppercase; color: var(--ink-soft); }
.cal-day { min-height: 40px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: none; font-size: 15px; font-variant-numeric: tabular-nums; }
.cal-day:hover { background: var(--band); }
.cal-day.today { border-color: var(--ring); font-weight: 700; }
.cal-day.past { color: var(--ink-soft); }
.cal-day[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 700; }
.cal-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Lists inside the small windows: users, today's summary */
.rows { display: grid; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; list-style: none; }
.rows > li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 12px; }
.rows > li + li { border-top: 1px solid var(--hair); }
.rows .grow { min-width: 120px; font-weight: 600; overflow-wrap: anywhere; }
.rows .sub { display: block; font-size: 14px; font-weight: 400; color: var(--ink-soft); }
.rows button.row-open { flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; font-weight: 600; overflow-wrap: anywhere; }
.sum-group { margin: 16px 0 6px; font-size: 14px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.sum-group.late { color: var(--late); }
.sum-group.soon { color: var(--soon); }
.sum-line { margin: 0; font-size: 17px; font-weight: 700; }
.inline-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.inline-add input { flex: 1 1 180px; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); font-size: 16px; }
.link-box { display: grid; gap: 8px; margin-top: 14px; padding: 12px; border-radius: 10px; background: var(--info-wash); font-size: 15px; }
.link-box p { margin: 0; }
.link-box input { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); font-size: 14px; }
.link-box .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.link-box .btn { background: var(--surface); border-color: var(--edge); text-decoration: none; color: var(--ink); }
a.btn { text-decoration: none; }
a.btn.primary { color: var(--on-accent); }
.cal-head .lead-ic { width: 18px; height: 18px; }
.account .link-btn { min-height: 38px; padding: 6px 2px; }
