/* ============================================================================
   Tasks wireframe — light Asana aesthetic on shared-ui (Meridian/Ocean) tokens.
   theme.css loads first and provides the CSS variables.
   ============================================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
#app { display: flex; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* ---- Sidebar --------------------------------------------------------------- */
:root {
  --sb-bg: var(--surface);
  --sb-border: var(--border-soft);
  --sb-item: var(--text-2);
  --sb-hover: var(--surface-2);
  --sb-active-bg: var(--accent-soft);
  --sb-active-fg: var(--accent-strong);
  --sb-title: var(--text);
  --sb-muted: var(--muted);
}
.sidebar {
  width: 220px; flex: 0 0 220px;
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sb-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 14px;
}
.sb-logo .mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.sb-logo .word { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--sb-title); }
.sb-logo .word span { color: var(--muted); font-weight: 500; }
.sb-nav { padding: 4px 10px; flex: 1; overflow-y: auto; }
.sb-nav a.item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--sb-item); font-weight: 500;
  margin-bottom: 1px;
}
.sb-nav a.item:hover { background: var(--sb-hover); }
.sb-nav a.item.active { background: var(--sb-active-bg); color: var(--sb-active-fg); }
.sb-nav a.item svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .75; }
.sb-nav a.item.active svg { opacity: 1; }
.sb-sub { margin: 2px 0 8px; }
.sb-sub a {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 36px; border-radius: 8px;
  color: var(--muted); font-size: .82rem;
}
.sb-sub a:hover { background: var(--sb-hover); color: var(--sb-item); }
.sb-sub a.active { color: var(--sb-title); font-weight: 600; }
.sb-sub .dot { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; }
.sb-foot { padding: 10px; border-top: 1px solid var(--sb-border); }
.sb-foot a svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .75; }

/* ---- Topbar ----------------------------------------------------------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 40;
}
.tb-title { font-size: var(--fs-title); font-weight: 700; letter-spacing: -.01em; margin-right: auto; white-space: nowrap; }
.tb-search { position: relative; width: 300px; }
.tb-search input {
  width: 100%; height: 32px; border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 0 12px 0 32px; font-size: .82rem; outline: none;
}
.tb-search input:focus { border-color: var(--accent); background: var(--surface); }
.tb-search svg { position: absolute; left: 11px; top: 8px; width: 15px; height: 15px; color: var(--faint); }
.tb-results {
  position: absolute; top: 38px; left: 0; width: 380px; max-height: 420px; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(26,31,54,.14); z-index: 60; padding: 6px;
}
.tb-results .hit { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; cursor: pointer; font-size: .84rem; }
.tb-results .hit:hover { background: var(--surface-2); }
.tb-results .hit .k { color: var(--faint); font-size: .72rem; margin-left: auto; flex: 0 0 auto; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: 8px;
  font-size: .82rem; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.small { height: 26px; padding: 0 10px; font-size: .76rem; border-radius: 7px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-2); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .bubble {
  position: absolute; top: 5px; right: 5px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; border: 2px solid var(--surface);
}

/* ---- Avatars ----------------------------------------------------------------- */
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; color: #fff; flex: 0 0 auto;
  letter-spacing: .02em;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar.lg { width: 34px; height: 34px; font-size: 13px; }
.avatars { display: inline-flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -7px; }
.avatars .avatar:first-child { margin-left: 0; }

/* ---- Chips -------------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 8px; border-radius: 10px;
  font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.chip.outline { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 500; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; }
.fchip { /* frequency */
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 6px; font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.flag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 19px; padding: 0 7px; border-radius: 5px;
  font-size: .7rem; font-weight: 700; letter-spacing: .02em;
}
.flag.rush { background: #FEF3C7; color: #B45309; }
.flag.needs-dr { background: var(--accent-soft); color: var(--accent-strong); }
.flag.call-patient { background: #E6F4F1; color: #0E8578; }
.flag.charge { background: var(--warn-bg); color: var(--warn); }
.flag.blk { background: var(--danger); color: #fff; }
.ap-name { font-size: .72rem; color: var(--faint); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apl-nm { font-size: .76rem; color: var(--faint); font-weight: 500; flex: 0 0 auto; }
.arch {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .68rem; font-weight: 700; color: var(--text-2);
}

/* ---- Content ------------------------------------------------------------------- */
.content { padding: 22px 28px 60px; max-width: 1240px; width: 100%; margin: 0 auto; }
.content.wide { max-width: none; margin: 0; }
.page-h { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.page-h h1 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.page-h .sub { color: var(--muted); font-size: .84rem; }
.page-h .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.eyebrow {
  font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint);
}

/* ---- Segmented control ----------------------------------------------------------- */
.seg {
  display: inline-flex; background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: 9px; padding: 2px; gap: 2px;
}
.seg a, .seg button {
  height: 26px; padding: 0 12px; border-radius: 7px;
  font-size: .8rem; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center;
}
.seg .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---- Filter bar -------------------------------------------------------------------- */
.fbar { display: flex; align-items: center; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.fsel {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 8px;
  border: 1px dashed var(--border); color: var(--muted);
  font-size: .78rem; font-weight: 500; cursor: pointer; background: var(--surface);
}
.fsel:hover { border-color: var(--faint); color: var(--text-2); }
.fsel.on { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.fsel svg { width: 12px; height: 12px; }
.fmenu {
  position: absolute; top: 32px; left: 0; min-width: 200px; z-index: 55;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(26,31,54,.14); padding: 5px;
}
.fmenu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 9px; border-radius: 7px; font-size: .8rem; text-align: left; color: var(--text-2);
}
.fmenu button:hover { background: var(--surface-2); }
.fmenu button.sel { color: var(--accent-strong); font-weight: 600; }
.fclear { color: var(--faint); font-size: .76rem; padding: 0 6px; }
.fclear:hover { color: var(--danger); }

/* ---- Cards + sections --------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
}
.card .card-h {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--border-soft);
}
.card .card-h h2 { font-size: 14px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.card .card-h .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card .pad { padding: 14px 16px; }

/* ---- Task rows ------------------------------------------------------------------------- */
.rows { padding: 4px 0; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px; cursor: pointer; position: relative;
  border-bottom: 1px solid var(--border-soft);
}
.rows .row:last-child { border-bottom: none; }
.row:hover { background: #FAFBFD; }
.ck {
  width: 18px; height: 18px; border-radius: 50%; flex: 0 0 18px;
  border: 1.5px solid var(--border); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; color: transparent;
}
.ck:hover { border-color: var(--good); color: var(--good); }
.row.done .ck, .lrow.done .ck { background: var(--good); border-color: var(--good); color: #fff; }
.ck svg { width: 10px; height: 10px; }
.row .t { font-size: .855rem; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.done .t { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--border); }
.row.wrap { flex-wrap: wrap; row-gap: 3px; }
.row.wrap .t { white-space: normal; line-height: 1.35; flex: 1 1 0; min-width: 0; }
.row.wrap > .due { flex: 0 0 auto; }
.row.wrap .meta { flex: 1 1 100%; margin-left: 28px; justify-content: flex-start; }
.row .meta { margin-left: auto; display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.row .pt {
  font-size: .74rem; font-weight: 700; color: var(--accent-strong);
  background: var(--accent-soft); padding: 1px 7px; border-radius: 6px;
}
.row .pt:hover { text-decoration: underline; }
.pt.pro { background: #E6F4F1; color: #0E8578; }
.due { font-size: .76rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.due.today { color: var(--good); }
.due.over { color: var(--danger); }
.due.soon { color: var(--warn); }
.row .ord {
  width: 20px; flex: 0 0 20px; text-align: right;
  font-size: .72rem; color: var(--faint); font-variant-numeric: tabular-nums;
}
.row .hover-acts { display: inline-flex; align-items: center; gap: 4px; visibility: hidden; }
.row:hover .hover-acts { visibility: visible; }
.prio { font-size: .72rem; font-weight: 700; }
.prio.High { color: var(--danger); }
.prio.Medium { color: var(--warn); }
.prio.Low { color: var(--faint); }
.attempt { display: inline-flex; gap: 2.5px; align-items: center; }
.attempt i { width: 5px; height: 5px; border-radius: 50%; background: var(--border); }
.attempt i.on { background: var(--warn); }
.group-h {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 6px;
}
.group-h .n { font-size: .74rem; color: var(--faint); font-weight: 600; }
.auto-tag { color: var(--faint); display: inline-flex; }
.auto-tag svg { width: 12px; height: 12px; }

/* ---- Progress --------------------------------------------------------------------------- */
.prog { display: inline-flex; align-items: center; gap: 8px; }
.prog .bar { width: 90px; height: 5px; border-radius: 3px; background: var(--border-soft); overflow: hidden; }
.prog .bar i { display: block; height: 100%; border-radius: 3px; background: var(--good); }
.prog .lbl { font-size: .74rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- Dashboard --------------------------------------------------------------------------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.greet h1 { font-size: 24px; margin: 2px 0 2px; letter-spacing: -.02em; }
.greet .date { color: var(--muted); font-size: .84rem; }
.kpis { display: flex; gap: 10px; margin-left: auto; }
.kpi {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 8px 14px; text-align: center; min-width: 86px; box-shadow: var(--shadow-card);
}
.kpi .v { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.kpi .v.bad { color: var(--danger); }
.kpi .v.good { color: var(--good); }
.kpi .l { font-size: .7rem; color: var(--faint); font-weight: 600; }

/* ---- Board (Appliance Tracker) — ClickUp-style wells + tags ------------------- */
.board {
  display: flex; gap: 10px; align-items: flex-start;
  overflow-x: auto; padding: 4px 28px 22px;
}
.col {
  width: 238px; flex: 0 0 238px;
  background: #EEF1F5; border-radius: 12px; padding: 8px;
}
.col-h { display: flex; align-items: center; gap: 8px; padding: 3px 4px 9px; }
.col-h .status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 6px;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.col-h .status .sdot { width: 7px; height: 7px; border-radius: 50%; }
.col-h .n { font-size: .74rem; color: var(--faint); font-weight: 600; }
.col-h .coladd {
  margin-left: auto; width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 15px;
}
.col-h .coladd:hover { background: rgba(26,31,54,.06); color: var(--text-2); }
.col-body { display: flex; flex-direction: column; gap: 7px; min-height: 8px; }
.ap-card {
  background: var(--surface); border-radius: 9px;
  box-shadow: 0 1px 2px rgba(26,31,54,.09);
  padding: 10px 11px; cursor: pointer; position: relative;
  border: 1px solid transparent;
}
.ap-card:hover { box-shadow: 0 3px 10px rgba(26,31,54,.13); border-color: var(--border-soft); }
.ap-card.rush { border-left: 3px solid #D97706; }
.ap-card.blocked { border-left: 3px solid var(--danger); }
.ap-card.blocked:hover { border-color: var(--border); }
.ap-top { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; min-width: 0; }
.ap-top .code { font-size: .9rem; font-weight: 700; letter-spacing: -.01em; }
.ap-items { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ap-tag {
  display: inline-flex; align-items: center;
  border-radius: 5px; padding: 2px 7px;
  font-size: .72rem; font-weight: 600;
}
.ap-tag b { font-weight: 700; opacity: .65; margin-right: 4px; }
.ap-item {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 6px; padding: 2px 7px 2px 4px; font-size: .74rem; font-weight: 600; color: var(--text-2);
}
.ap-item .arch { height: 16px; min-width: 16px; font-size: .62rem; border: none; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.ap-foot { display: flex; align-items: center; gap: 7px; font-size: .73rem; color: var(--muted); min-width: 0; white-space: nowrap; }
.ap-foot .appt { color: var(--faint); overflow: hidden; text-overflow: ellipsis; }
.ap-foot .ic { display: inline-flex; color: var(--faint); }
.ap-foot .ic svg { width: 12px; height: 12px; }
.ap-foot .rt { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-weight: 500; font-size: .7rem; color: var(--faint); white-space: nowrap; }

/* in-place card expansion on hover — anchored over the card, layout never moves */
.expando {
  position: fixed; z-index: 90;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 18px 50px rgba(26,31,54,.28), 0 2px 8px rgba(26,31,54,.12);
  padding: 10px 11px; cursor: pointer;
  animation: xin .13s ease-out;
}
@keyframes xin { from { box-shadow: 0 1px 2px rgba(26,31,54,.09); } }
.x-details {
  border-top: 1px solid var(--border-soft);
  margin-top: 9px; padding-top: 8px;
  display: flex; flex-direction: column; gap: 3px;
}
.x-details .prow { display: flex; gap: 8px; padding: 3px 0; font-size: .78rem; align-items: baseline; }
.x-details .prow .k { width: 76px; flex: 0 0 76px; color: var(--faint); font-weight: 600; }
.x-details .status {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 5px;
  font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.x-details .status .sdot { width: 6px; height: 6px; border-radius: 50%; }
.x-details .note { margin-top: 5px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: .78rem; color: var(--text-2); line-height: 1.45; cursor: pointer; }

/* ---- Calendar ---------------------------------------------------------------------------------- */
.cal { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.cal-head { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--border-soft); }
.cal-head div { padding: 8px 10px; font-size: .72rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.cal-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cal-cell { min-height: 104px; border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); padding: 6px 7px; overflow: hidden; }
.cal-cell:nth-child(5n) { border-right: none; }
.cal-cell .d { font-size: .74rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.cal-cell.out { background: #FAFBFC; } .cal-cell.out .d { color: var(--border); }
.cal-cell.today .d {
  color: #fff; background: var(--accent); width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.cal-task {
  display: flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 500; color: var(--text-2);
  padding: 2px 5px; border-radius: 5px; cursor: pointer;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.cal-task:hover { background: var(--surface-2); }
.cal-task .dot { width: 7px; height: 7px; border-radius: 3px; flex: 0 0 7px; }
.cal-task.overflow { color: var(--faint); font-weight: 600; }

/* ---- Slide-over task panel ------------------------------------------------------------------------ */
.scrim { position: fixed; inset: 0; background: rgba(26,31,54,.18); z-index: 70; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 470px; z-index: 80;
  background: var(--surface); box-shadow: -12px 0 40px rgba(26,31,54,.16);
  display: flex; flex-direction: column;
  animation: slide .18s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }
.panel-h {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-soft);
}
.btn.done-btn.on { background: var(--good-bg); border-color: transparent; color: var(--good); }
.panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.panel-body h2 { font-size: 17px; letter-spacing: -.01em; margin: 0 0 14px; line-height: 1.35; }
.meta-grid { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.mrow { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; min-height: 30px; }
.mrow .k { width: 108px; flex: 0 0 108px; font-size: .78rem; color: var(--faint); font-weight: 600; padding-top: 3px; }
.mrow .v { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .84rem; }
.mrow .v .add {
  width: 22px; height: 22px; border-radius: 50%; border: 1px dashed var(--border);
  color: var(--faint); display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.mrow .v .add:hover { border-color: var(--accent); color: var(--accent); }
.asg { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 14px; padding: 2px 10px 2px 2px; font-size: .8rem; font-weight: 600; }
.note-box { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; font-size: .84rem; color: var(--text-2); line-height: 1.5; }
.divider { border-top: 1px solid var(--border-soft); margin: 16px -20px; }
.cmt { display: flex; gap: 10px; padding: 8px 0; }
.cmt .b { flex: 1; }
.cmt .who { font-size: .8rem; font-weight: 700; }
.cmt .when { color: var(--faint); font-weight: 500; font-size: .74rem; margin-left: 6px; }
.cmt .txt { font-size: .84rem; color: var(--text-2); margin-top: 2px; line-height: 1.45; }
.cmt .txt .mention { color: var(--accent-strong); font-weight: 600; background: var(--accent-soft); padding: 0 4px; border-radius: 4px; }
.cmt-input { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border-soft); }
.cmt-input input {
  flex: 1; height: 34px; border-radius: 17px; border: 1px solid var(--border);
  padding: 0 14px; font-size: .82rem; outline: none; background: var(--surface-2);
}
.cmt-input input:focus { border-color: var(--accent); background: var(--surface); }

/* ---- Dropdown menus (bell, avatar) ------------------------------------------------------------------- */
.drop {
  position: absolute; top: 40px; right: 0; width: 350px; z-index: 65;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(26,31,54,.16); overflow: hidden;
}
.drop .d-h { padding: 11px 14px; font-size: .8rem; font-weight: 700; border-bottom: 1px solid var(--border-soft); display: flex; }
.drop .d-h .right { margin-left: auto; color: var(--accent); font-weight: 600; font-size: .76rem; cursor: pointer; }
.ntf { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.ntf:hover { background: #FAFBFD; }
.ntf:last-child { border-bottom: none; }
.ntf .txt { font-size: .8rem; color: var(--text-2); line-height: 1.4; }
.ntf .txt b { color: var(--text); }
.ntf .when { font-size: .72rem; color: var(--faint); margin-top: 2px; }
.menu { position: absolute; top: 40px; right: 0; width: 230px; z-index: 65;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(26,31,54,.16); padding: 5px; }
.menu button, .menu a { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border-radius: 7px; font-size: .82rem; color: var(--text-2); }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu .sect { padding: 7px 9px 3px; font-size: .68rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }

/* ---- Modal (new task) ------------------------------------------------------------------------------------ */
.modal-wrap { position: fixed; inset: 0; z-index: 85; display: flex; align-items: flex-start; justify-content: center; padding-top: 9vh; }
.modal {
  width: 560px; max-height: 80vh; overflow: auto;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(26,31,54,.28); animation: pop-in .14s ease-out; position: relative; z-index: 86;
}
.modal .m-h { padding: 14px 18px 0; display: flex; align-items: center; }
.modal .m-h h3 { margin: 0; font-size: 15px; }
.modal .m-body { padding: 12px 18px 18px; }
.modal input.title {
  width: 100%; border: none; outline: none; font-size: 17px; font-weight: 600; padding: 6px 0 12px;
}
.modal input.title::placeholder { color: var(--faint); }
.frow, .cond { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; }
.frow .k, .cond .k { width: 96px; flex: 0 0 96px; font-size: .78rem; color: var(--faint); font-weight: 600; padding-top: 5px; }
.frow .v, .cond .v { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cond { border-left: 2px solid var(--accent-soft); padding-left: 10px; margin-left: -12px; animation: pop-in .12s ease-out; }
[hidden] { display: none !important; }
.pick {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 13px; border: 1px solid var(--border); font-size: .78rem; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.pick:hover { border-color: var(--faint); }
.pick.sel { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); }
.m-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border-soft); }

/* appliance type picker — two calm checklists instead of a chip cloud */
.ap-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 22px; width: 100%; align-items: start; }
.ap-col-h {
  font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); padding: 4px 8px 6px;
}
.ap-opt {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 5px 8px; border-radius: 7px; font-size: .81rem; font-weight: 500;
  color: var(--text-2); text-align: left;
}
.ap-opt:hover { background: var(--surface-2); }
.ap-opt .cb {
  width: 15px; height: 15px; flex: 0 0 15px; border-radius: 4.5px;
  border: 1.5px solid var(--border); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; color: transparent;
}
.ap-opt .cb svg { width: 9px; height: 9px; }
.ap-opt.sel { color: var(--accent-strong); font-weight: 600; }
.ap-opt.sel .cb { background: var(--accent); border-color: var(--accent); color: #fff; }
.req-hint { font-size: .74rem; color: var(--faint); margin-right: auto; align-self: center; }
.req-hint.bad { color: var(--danger); }

/* ---- Tables (patients, professionals, manage) --------------------------------------------------------------- */
.tbl { width: 100%; border-collapse: collapse; font-size: .84rem; }
.tbl th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); font-weight: 700; padding: 10px 16px; border-bottom: 1px solid var(--border-soft);
}
.tbl td { padding: 9px 16px; border-bottom: 1px solid var(--border-soft); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #FAFBFD; }

/* ---- Role cards grid --------------------------------------------------------------------------------------------- */
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.role-card { padding: 16px; cursor: pointer; position: relative; overflow: hidden; }
.role-card:hover { border-color: var(--border); box-shadow: 0 4px 14px rgba(26,31,54,.09); }
.role-card > .bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.role-card h3 { margin: 4px 0 10px; font-size: 15px; letter-spacing: -.01em; }
.role-card .nums { display: flex; gap: 16px; margin-top: 12px; }
.role-card .nums .n { font-size: 17px; font-weight: 700; }
.role-card .nums .l { font-size: .7rem; color: var(--faint); font-weight: 600; }

/* ---- Tooltips ([data-tip]) ------------------------------------------------------------------------------------------ */
/* tooltips are JS-portaled to <body> (.jtip) — CSS ::after bubbles clipped inside cells */

/* ---- inline chip editing (flags + items) ------------------------------------- */
.fedit { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; min-height: 19px; min-width: 26px; }
.flag, .ap-item { position: relative; }
.flag .fx, .ap-item .fx {
  position: absolute; right: 0; top: 0; bottom: 0; width: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; color: inherit; background: inherit;
  border-radius: 0 5px 5px 0;
  opacity: 0; transition: opacity .1s; /* overlays the chip's tail — no reflow, no extra width */
}
.flag:hover .fx, .ap-item:hover .fx { opacity: 1; }
.flag .fx:hover, .ap-item .fx:hover { filter: brightness(.92); }
.flag.confirm, .ap-item.confirm { background: var(--bad) !important; color: #fff !important; }
.flag.confirm .fx, .ap-item.confirm .fx { display: inline-flex; }
.ap-item.confirm .arch { background: transparent; color: #fff; box-shadow: none; border: none; }
.fplus {
  display: inline-flex; width: 19px; height: 19px; border-radius: 6px;
  border: 1px dashed var(--border); color: var(--faint); font-size: 13px;
  align-items: center; justify-content: center; flex: 0 0 19px;
  opacity: 0; transition: opacity .1s; /* space always reserved */
}
.ap-card:hover .fplus, .row:hover .fplus, .fedit.always .fplus { opacity: 1; }
.fplus:hover { color: var(--accent); border-color: var(--accent); }
.ap-item .arch { cursor: pointer; }
.edin { height: 28px; border: 1px solid var(--border); border-radius: 7px; padding: 0 9px; font-size: .82rem; background: var(--surface); outline: none; }
.edin:focus { border-color: var(--accent); }
.tp-notes {
  width: 100%; min-height: 60px; border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--surface-2); padding: 9px 11px; font-size: .84rem; color: var(--text-2);
  resize: vertical; outline: none; line-height: 1.5;
}
.tp-notes:focus { border-color: var(--accent); background: var(--surface); }

/* ---- board meta bar, lanes, trays --------------------------------------------- */
.bmeta { display: flex; align-items: center; gap: 8px; padding: 2px 28px 8px; }
.sortchip { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; color: var(--faint); font-weight: 500; }
.lane-h { display: flex; align-items: center; gap: 8px; padding: 8px 28px 0; }
.lane-h .nm { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.lane-h .n { font-size: .74rem; color: var(--faint); font-weight: 600; }
.board.lane { padding-bottom: 14px; }
.substage { font-size: .68rem; font-weight: 600; color: var(--faint); background: var(--surface-2); border-radius: 5px; padding: 1px 6px; }
.col.sep { margin-left: 22px; position: relative; }
.col.sep::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 1px; background: var(--border); }

/* ---- aligned property columns (all lists) ------------------------------------- */
.cols { padding-bottom: 4px; }
.lhead {
  display: grid; grid-template-columns: var(--cols); gap: 10px;
  padding: 10px 16px 7px; border-bottom: 1px solid var(--border-soft);
}
.lhead span {
  font-size: .66rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--faint); white-space: nowrap; overflow: hidden;
}
.lgroup { display: flex; align-items: center; gap: 8px; padding: 12px 16px 5px; }
.lgroup .n { font-size: .74rem; color: var(--faint); font-weight: 600; }
.lrow {
  display: grid; grid-template-columns: var(--cols); gap: 10px; align-items: center;
  padding: 7px 16px; position: relative; cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
}
.cols .lrow:last-child { border-bottom: none; }
.lrow:hover { background: #FAFBFD; }
.cell { min-width: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.cell .nil { visibility: hidden; }
.cell.t-c { display: block; overflow: hidden; text-overflow: ellipsis; font-size: .855rem; font-weight: 500; line-height: 1.9; }
.cell.t-c .auto-tag { margin-right: 5px; vertical-align: -1px; }
.cell.ord { font-size: .72rem; color: var(--faint); justify-content: flex-end; font-variant-numeric: tabular-nums; overflow: visible; }
.cell.when-c { display: block; font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; line-height: 2.1; }
.lrow.done .t-c { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--border); }
.rowact {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  opacity: 0; transition: opacity .1s; display: flex; gap: 4px;
  background: #FAFBFD; box-shadow: -14px 0 10px -6px #FAFBFD; padding: 2px 2px 2px 4px;
}
.lrow:hover .rowact { opacity: 1; }
.col-empty { border: 1px dashed var(--border-soft); border-radius: var(--radius); min-height: 54px; display: flex; align-items: center; justify-content: center; color: var(--border); font-size: .8rem; }
.tray { display: flex; gap: 8px; align-items: stretch; padding: 4px 28px 10px; overflow-x: auto; }
.tray .ap-card { width: 238px; flex: 0 0 238px; }

/* ---- My Day quick add, slots, cadence, aging, saved views ---------------------- */
.qadd { padding: 10px 16px 6px; border-bottom: 1px solid var(--border-soft); }
.qadd input {
  width: 100%; height: 34px; border: 1px dashed var(--border); border-radius: 9px;
  padding: 0 12px; font-size: .84rem; outline: none; background: var(--surface);
}
.qadd input:focus { border-style: solid; border-color: var(--accent); }
.qadd #qadd-chips { display: flex; gap: 6px; align-items: center; min-height: 26px; padding: 4px 2px 0; flex-wrap: wrap; }
.slots { display: inline-flex; gap: 8px; align-items: center; }
.slots .ck.sl { width: 15px; height: 15px; flex: 0 0 15px; }
.slots .ck.sl.on { background: var(--good); border-color: var(--good); color: #fff; }
.slots .ck.sl svg { width: 8px; height: 8px; }
.cad { font-size: .7rem; font-weight: 700; color: var(--s2); white-space: nowrap; }
.age { font-size: .7rem; font-weight: 600; color: var(--faint); }
.age.warn { color: var(--warn); font-weight: 700; }
.lgroup.red .eyebrow { color: var(--danger); }
.cell.edit:hover { box-shadow: inset 0 0 0 1px var(--border); border-radius: 6px; cursor: pointer; }
.sb-views { margin-top: 14px; padding: 0 0 8px; }
.sb-eyebrow {
  font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint); padding: 4px 10px 6px;
}
.sb-views .sv {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 8px; color: var(--muted); font-size: .82rem;
  position: relative;
}
.sb-views .sv:hover { background: var(--sb-hover); color: var(--sb-item); }
.sb-views .sv .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.sb-views .sv .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-views .sv .svx {
  margin-left: auto; width: 16px; height: 16px; flex: 0 0 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--faint); border-radius: 4px;
  opacity: 0; transition: opacity .1s;
}
.sb-views .sv:hover .svx { opacity: 1; }
.sb-views .sv .svx:hover { background: var(--bad-bg); color: var(--bad); }

/* ---- Toast ----------------------------------------------------------------------------------------------------------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; font-size: .8rem; font-weight: 500;
  padding: 9px 16px; border-radius: 9px; z-index: 99; box-shadow: 0 8px 30px rgba(26,31,54,.3);
  animation: pop-in .15s ease-out;
}

/* ---- Empty state ------------------------------------------------------------------------------------------------------- */
.empty { padding: 26px 16px; text-align: center; color: var(--faint); font-size: .82rem; }

/* ---- Responsive nudge ---------------------------------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .tb-search { width: 200px; }
}


/* ============================================================================
   App theme variants — same components, different identity. Pick in avatar menu.
   ============================================================================ */
:root[data-theme="violet"] {
  --accent: #6A48F0; --accent-strong: #5433D6; --accent-soft: #EEE9FE;
  --bg: #F7F6FB;
}
:root[data-theme="ink"] {
  --accent: #6A48F0; --accent-strong: #5433D6; --accent-soft: #EEE9FE;
  --bg: #F6F6F9;
  --sb-bg: #1D2130; --sb-border: #2A2F45;
  --sb-item: #B9C0D4; --sb-hover: #272C40;
  --sb-active-bg: rgba(122, 90, 248, .25); --sb-active-fg: #CFC3FC;
  --sb-title: #F1F2F8; --sb-muted: #8A93AD;
}
:root[data-theme="warm"] {
  --accent: #0E8578; --accent-strong: #0A6B60; --accent-soft: #DFF1EE;
  --bg: #FAF7F2;
  --sb-bg: #FFFDF9; --sb-border: #EFEAE0;
}
:root[data-theme="ink"] .sb-eyebrow { color: var(--sb-muted); }
:root[data-theme="ink"] .sb-foot a { color: var(--sb-muted) !important; }

/* ---- Me mode toggle ---- */
.memode { border-radius: 15px; padding: 0 12px; }
.memode.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- board stage-group bands ---- */
.board.bands { gap: 12px; }
.bgrp { border-radius: 14px; padding: 8px 9px 11px; flex: 0 0 auto; }
.g-intake { background: #F0F1F4; }
.g-office { background: #EEF3FB; }
.g-make { background: #FAF3EA; }
.g-out { background: #EBF4F1; }
.g-make .bgrp-h { color: #B08A5A; }
:root[data-theme="warm"] .g-office { background: #F2EFE8; }
.bgrp-h {
  font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint); padding: 2px 5px 7px; cursor: default;
}
.g-office .bgrp-h { color: #7A8BB0; }
.g-out .bgrp-h { color: #6E9C92; }
.bgrp-cols { display: flex; gap: 9px; align-items: flex-start; }
.bcol { width: 202px; flex: 0 0 202px; }
.bcol .col-h { padding: 2px 4px 7px; }
.bcol-empty { border: 1.5px dashed rgba(20, 30, 60, .08); border-radius: 10px; min-height: 64px; }

/* ---- filter button + panel ---- */
.fwrap { position: relative; }
.fbtn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: .78rem; font-weight: 600; color: var(--muted);
}
.fbtn svg { width: 13px; height: 13px; }
.fbtn:hover { color: var(--text-2); }
.fbtn.on { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.fpanel {
  position: absolute; top: 33px; left: 0; width: 250px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 36px rgba(26, 31, 54, .16); padding: 5px; max-height: 340px; overflow-y: auto;
}
.fp-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border-radius: 7px; font-size: .8rem; color: var(--text-2);
}
.fp-row:hover { background: var(--surface-2); }
.fp-row b { margin-left: auto; font-weight: 600; color: var(--muted); font-size: .76rem; }
.fp-row svg { width: 11px; height: 11px; transform: rotate(-90deg); color: var(--faint); }
.fp-back {
  display: block; width: 100%; text-align: left; padding: 7px 10px;
  font-size: .76rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em;
}
.fp-vals { max-height: 260px; overflow-y: auto; }
.fp-val { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 7px; font-size: .8rem; color: var(--text-2); }
.fp-val:hover { background: var(--surface-2); }
.fp-val.sel { color: var(--accent-strong); font-weight: 600; }
.ftoken {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 6px 0 10px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: .76rem; font-weight: 500;
}
.ftoken b { font-weight: 700; }
.ftoken button { width: 16px; height: 16px; border-radius: 4px; font-size: 9px; color: inherit; opacity: .7; }
.ftoken button:hover { opacity: 1; background: rgba(0, 0, 0, .07); }

/* ---- unified date picker ---- */
.dp {
  position: fixed; z-index: 96; width: 292px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(26, 31, 54, .22); padding: 10px;
}
.dp-in {
  width: 100%; height: 30px; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 10px; font-size: .8rem; outline: none; background: var(--surface-2);
}
.dp-in:focus { border-color: var(--accent); background: var(--surface); }
.dp-hint { min-height: 16px; font-size: .72rem; font-weight: 600; color: var(--accent-strong); padding: 2px 2px 4px; }
.dp-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding-bottom: 8px; }
.dp-chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 2px; border-radius: 7px; border: 1px solid var(--border-soft);
  font-size: .74rem; font-weight: 700; color: var(--text-2);
}
.dp-chip i { font-style: normal; font-size: .62rem; font-weight: 500; color: var(--faint); }
.dp-chip:hover { border-color: var(--accent); color: var(--accent-strong); }
.dp-chip.sel { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); }
.dp-nav { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; font-size: .8rem; }
.dp-nav button { width: 22px; height: 22px; border-radius: 6px; color: var(--muted); }
.dp-nav button:hover { background: var(--surface-2); }
.dp-dow, .dp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.dp-dow span { text-align: center; font-size: .62rem; font-weight: 700; color: var(--faint); padding-bottom: 2px; }
.dp-d {
  height: 26px; border-radius: 7px; font-size: .74rem; font-weight: 500; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.dp-d:hover { background: var(--surface-2); }
.dp-d.today { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 700; }
.dp-d.sel { background: var(--accent); color: #fff; font-weight: 700; }
.dp-d.dim { color: var(--border); pointer-events: none; }
.dp-clear { width: 100%; margin-top: 6px; padding: 6px; border-radius: 7px; font-size: .76rem; color: var(--faint); }
.dp-clear:hover { background: var(--bad-bg); color: var(--bad); }
.dp-btn {
  display: inline-flex; align-items: center; height: 28px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: .8rem; font-weight: 600; color: var(--text-2); background: var(--surface);
}
.dp-btn:hover { border-color: var(--accent); color: var(--accent-strong); }

/* ---- workflow tag + links ---- */
.wftag {
  display: inline-flex; align-items: center; margin-right: 6px;
  padding: 0 6px; height: 17px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: .68rem; font-weight: 700; vertical-align: 1px;
}
.lnk {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 9px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  font-size: .76rem; font-weight: 600; color: var(--accent-strong); cursor: pointer;
}
.lnk:hover { border-color: var(--accent); }

/* ---- descriptive form options ---- */
.ap-opt { align-items: flex-start; }
.ap-opt .cb { margin-top: 2px; }
.ap-opt-t { display: flex; flex-direction: column; text-align: left; min-width: 0; }
.ap-opt-t i { font-style: normal; font-size: .68rem; color: var(--faint); font-weight: 400; line-height: 1.3; }

.dp-btn.over { color: var(--danger); border-color: #F3C2CE; }
.dp-btn.today { color: var(--good); }
.dp-btn.soon { color: var(--warn); }

.modal input.title:disabled { background: transparent; color: var(--text); -webkit-text-fill-color: var(--text); opacity: 1; }


/* ============================================================================
   Mobile — true phone layout (≤740px): bottom tabs, single column, reflowed rows
   ============================================================================ */
.tabbar, .fab { display: none; }
@media (max-width: 740px) {
  /* shell */
  .sidebar { display: none; }
  #app { display: block; }
  .topbar { padding: 0 12px; gap: 8px; }
  .tb-search { display: none; }
  #newtask { display: none; }
  .tb-title { font-size: 14px; }
  .content, .content.wide { padding: 14px 12px calc(88px + env(safe-area-inset-bottom)); }
  .page-h { flex-wrap: wrap; gap: 8px 10px; }
  .page-h .right { margin-left: 0; width: 100%; display: flex; }
  .greet h1 { font-size: 20px; }
  .kpis { margin-left: 0; width: 100%; }
  .kpi { flex: 1; min-width: 0; }
  .role-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .qadd { padding: 8px 12px 6px; }

  /* bottom tab bar */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 72;
    background: var(--surface); border-top: 1px solid var(--border-soft);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: .6rem; font-weight: 700; color: var(--faint); letter-spacing: .02em;
  }
  .tabbar svg { width: 20px; height: 20px; }
  .tabbar .active { color: var(--accent-strong); }
  .fab {
    display: flex; position: fixed; right: 14px; bottom: calc(66px + env(safe-area-inset-bottom));
    width: 52px; height: 52px; border-radius: 50%; z-index: 73;
    background: var(--accent); color: #fff; font-size: 27px; font-weight: 300;
    align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(20, 30, 80, .35);
  }
  .more-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 86;
    background: var(--surface); border-radius: 16px 16px 0 0;
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 2px;
    animation: sheet-up .18s ease-out;
  }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }
  .more-sheet a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 10px; border-radius: 10px; font-weight: 600; font-size: .92rem;
  }
  .more-sheet a:active { background: var(--surface-2); }
  .more-sheet svg { width: 19px; height: 19px; color: var(--muted); }

  /* rows reflow: line 1 = check + title + due · line 2 = property chips */
  .lhead { display: none; }
  .lrow { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; padding: 10px 12px; }
  .cell { overflow: visible; }
  .cell.ord { display: none; }
  .cell.t-c { flex: 1 1 55%; min-width: 0; white-space: normal; line-height: 1.35; }
  .cell.c-due { flex: 0 0 auto; margin-left: auto; }
  .c-asg, .c-pt, .c-prio, .when-c { flex: 0 0 auto; }
  .when-c { line-height: 1.4; }
  .rowact { display: none; }
  .lgroup { padding: 12px 12px 4px; }

  /* lab list rows */
  .c-lab-pt { flex: 1 1 40%; }
  .c-items, .c-flags, .c-route, .c-appt { flex: 0 0 auto; }

  /* board: swipeable columns */
  .board, .bmeta, .tray { padding-left: 12px; padding-right: 12px; }
  .bgrp-cols { gap: 8px; }
  .bcol { width: 76vw; flex: 0 0 76vw; }

  /* overlays go full-bleed */
  .panel { width: 100vw; }
  .modal-wrap { padding-top: 0; align-items: flex-end; }
  .modal { width: 100% !important; max-height: 92dvh; border-radius: 16px 16px 0 0; }
  .ap-pick { grid-template-columns: 1fr; }
  .expando { max-width: calc(100vw - 16px); }
  .dp { width: min(292px, calc(100vw - 16px)); }
  .drop, .menu { width: min(350px, calc(100vw - 20px)); }

  /* calendar compaction */
  .cal-cell { min-height: 62px; padding: 3px 4px; }
  .cal-task { font-size: .62rem; }

  /* iOS: 16px inputs prevent focus zoom */
  .qadd input, .dp-in, .edin, .cmt-input input, .modal input, .modal textarea, .tp-notes { font-size: 16px !important; }
}

/* AR queue properties */
.chip.acct-ins { background: var(--accent-soft); color: var(--accent-strong); }
.chip.acct-pt { background: #FBEAF2; color: #C13B78; }
.pd { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; }
.pd.p1 { background: #FFF7E6; color: #B8860B; } /* 0–30 */
.pd.p2 { background: #FCF0E4; color: #C06A10; } /* 31–60 */
.pd.p3 { background: var(--bad-bg); color: var(--bad); } /* 61–90 */
.pd.p4 { background: #F6CDD6; color: #8E0E28; } /* 90+ */

/* workflow breakdown page */
.wf-meta { font-size: .82rem; color: var(--text-2); padding: 2px 0 10px; }
.wf-chain { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.wf-step {
  display: flex; flex-direction: column; gap: 6px; width: 190px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px;
  padding: 10px 12px;
}
.wf-step .n {
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.wf-step .t { font-size: .8rem; font-weight: 600; line-height: 1.35; flex: 1; }
.wf-gap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--faint); font-size: .9rem; gap: 0;
}
.wf-gap span { font-size: .68rem; font-weight: 700; color: var(--muted); }
@media (max-width: 740px) { .wf-step { width: 100%; } .wf-gap { flex-direction: row; gap: 6px; } }

/* owner round: smaller blocking chips, slots labels, subtasks, drag, rocks, att chip */
.flag.blk { font-size: .6rem; height: 16px; padding: 0 6px; letter-spacing: .03em; }
.att {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px;
  border-radius: 9px; background: var(--warn-bg); color: var(--warn);
  font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.slots { display: inline-flex; gap: 10px; align-items: center; }
.slot { display: inline-flex; align-items: center; gap: 4px; }
.slot i { font-style: normal; font-size: .64rem; font-weight: 700; color: var(--faint); }
.lrow.sub { background: var(--surface-2); }
.lrow.sub .t-c { font-size: .8rem; font-weight: 400; padding-left: 14px; }
.chev {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 5px; margin-left: 6px; vertical-align: -4px;
  color: var(--faint);
}
.chev svg { width: 11px; height: 11px; transition: transform .12s; transform: rotate(-90deg); }
.chev.open svg { transform: rotate(0); }
.chev:hover { background: var(--surface-2); color: var(--text-2); }
.subn { font-size: .7rem; color: var(--faint); font-weight: 600; margin-left: 5px; }
.ck.sub-agg.part { border-color: var(--good); box-shadow: inset 0 0 0 3px var(--good-bg); }
.lrow.drag { cursor: grab; }
.lrow.drag.dragging { opacity: .45; }
.lrow.drag.dragover { box-shadow: inset 0 2px 0 var(--accent); }
.cell.ord.grip { color: var(--border); cursor: grab; font-size: .8rem; justify-content: center; overflow: visible; }
.lrow.drag:hover .grip { color: var(--faint); }
.cell.t-c[data-week]::before {
  content: attr(data-week);
  display: inline-block; margin-right: 8px; padding: 1px 6px; border-radius: 5px;
  background: var(--surface-2); color: var(--faint); font-size: .68rem; font-weight: 700;
}
/* centered assignee column */
.cell.c-asg { justify-content: center; }
.lhead .h-assignee { text-align: center; }
/* board columns scroll independently */
.bcol .col-body { max-height: calc(100dvh - 330px); overflow-y: auto; scrollbar-width: thin; padding: 2px; margin: -2px; }

/* collapsible sidebar rail (CRM parity) */
.sb-collapse {
  margin-left: auto; width: 24px; height: 24px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--sb-muted, var(--faint));
}
.sb-collapse svg { width: 13px; height: 13px; transition: transform .15s; }
.sb-collapse:hover { background: var(--sb-hover); }
.sidebar.rail { width: 58px; flex-basis: 58px; }
.sidebar.rail .sb-logo { padding: 16px 0 14px; justify-content: center; }
.sidebar.rail .sb-logo .word, .sidebar.rail .lbl, .sidebar.rail .sb-sub,
.sidebar.rail .sb-views { display: none; }
.sidebar.rail .sb-collapse { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); }
.sidebar.rail .sb-collapse svg { transform: rotate(180deg); }
.sidebar.rail .sb-nav { padding: 30px 8px 4px; }
.sidebar.rail .sb-nav a.item { justify-content: center; padding: 9px 0; }
.sidebar.rail .sb-foot a { justify-content: center !important; }
.sidebar.rail .sb-foot a span { display: none; }
.sidebar { position: sticky; }
.sidebar.rail .sb-logo { position: relative; }

/* multi-select assign popover */
.asgmenu { width: 262px; max-height: 400px; overflow-y: auto; padding: 6px; }
.asgmenu .ap-opt { padding: 6px 8px; }
.asgmenu .ap-opt .avatar { flex: 0 0 auto; }
.am-h { display: flex; align-items: baseline; gap: 8px; padding: 4px 8px 6px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.am-h span { font-size: .66rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--accent-strong); }
.am-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.am-div { border-top: 1px solid var(--border-soft); margin: 5px 0; }
.am-branch { color: var(--accent-strong); font-weight: 600; }
.am-branch svg { width: 11px; height: 11px; transform: rotate(-90deg); margin-left: auto; }
.am-branch b { color: var(--muted); font-weight: 600; }

/* inline title editing */
.tedit { cursor: text; border-radius: 4px; }
.tedit:hover { box-shadow: inset 0 -1px 0 var(--border); }
.tedit-in {
  width: 100%; min-width: 200px; border: none; outline: none;
  font: inherit; color: inherit; background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--accent); border-radius: 5px; padding: 1px 6px;
}

.tedit-h { cursor: text; border-radius: 6px; }
.tedit-h:hover { box-shadow: inset 0 0 0 1px var(--border); }
.tedit-h-in {
  width: 100%; border: none; outline: none; resize: none;
  font: inherit; color: inherit; line-height: inherit;
  box-shadow: inset 0 0 0 1.5px var(--accent); border-radius: 6px; padding: 2px 6px;
  min-height: 2.6em; background: var(--surface);
}

/* ---- My Tasks toggles, week calendar, table dividers, saved-view form, sidebar user ---- */
.myf { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .8rem; font-weight: 600; color: var(--faint); cursor: pointer; }
.myf .dot { width: 8px; height: 8px; border-radius: 3px; opacity: .35; }
.myf .av { opacity: .45; }
.myf.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.myf.on .dot, .myf.on .av { opacity: 1; }

.cal-cell.wk { min-height: 380px; }
.cal-task.cdone { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--border); }
.cal-task .cd-ck { color: #09825D; font-size: .68rem; flex: 0 0 auto; display: inline-block; text-decoration: none; }

/* Asana-style column dividers: continuous, aligned by the shared grid template */
.cols .lrow { padding-top: 0; padding-bottom: 0; }
.cols .lrow .cell { align-self: stretch; padding-top: 6px; padding-bottom: 6px; }
.cols .lrow .cell:not(:last-child), .cols .lhead span:not(:last-child) { border-right: 1px solid var(--border-soft); padding-right: 10px; }

.svform { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.svform .edin { width: 240px; }
.sv .svg-g { font-size: .66rem; }

.sb-user { position: relative; margin-top: 6px; }
.sb-user > button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border-radius: 8px; color: var(--sb-muted, var(--muted)); font-size: .84rem; font-weight: 600; text-align: left; }
.sb-user > button:hover { background: var(--sb-hover, var(--surface-2)); }
.sb-user .unm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sb-user .swp { color: var(--faint); font-size: .8rem; }
.sb-user #memenu { position: absolute; bottom: calc(100% + 8px); left: 8px; top: auto; right: auto; z-index: 70; }
.sb-user #memenu .menu { position: static; width: 230px; } /* base .menu is top/right-anchored for topbar drops; here the anchor box is above the rail chip */
.menu .hint { padding: 4px 12px 8px; font-size: .72rem; color: var(--faint); line-height: 1.45; max-width: 230px; white-space: normal; }

/* ---- Asana-steal round 2: docked panel, vtabs, collapse, quick add, builder ---- */
.vtabs { margin: 12px 0 0; display: flex; }
.lrow.sel { background: var(--accent-soft); }
@media (min-width: 741px) {
  .pscrim { background: transparent; pointer-events: none; }
  .panel { border-left: 1px solid var(--border-soft); box-shadow: -14px 0 44px rgba(26,31,54,.16); }
}
.srcchip { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.srcchip .dot, .srcchip span:first-child { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; }
.lgroup { cursor: pointer; user-select: none; }
.gchev { color: var(--faint); display: inline-flex; transition: transform .12s; transform: rotate(-90deg); }
.gchev.open { transform: none; }
.addrow { display: block; width: 100%; text-align: left; padding: 8px 16px 9px 50px; color: var(--faint); font-size: .83rem; cursor: pointer; }
.addrow:hover { color: var(--accent-strong); background: #FAFBFD; }
.cal-cell .cal-add { opacity: 0; width: 100%; text-align: left; padding: 2px 5px; border-radius: 5px; color: var(--faint); font-size: .72rem; cursor: pointer; }
.cal-cell:hover .cal-add { opacity: 1; }
.cal-add:hover { background: var(--surface-2); color: var(--accent-strong); }
.fp-quick { display: flex; gap: 6px; padding: 9px 10px; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.fp-q { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: .76rem; font-weight: 600; color: var(--muted); cursor: pointer; background: var(--surface); }
.fp-q.sel { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.modal.wfb { max-width: 860px; width: min(860px, 94vw); }
.wfb-canvas { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; padding: 6px 0; }
.wfb-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px; width: 168px; display: flex; flex-direction: column; gap: 5px; background: var(--surface); box-shadow: var(--shadow-card); }
.wfb-card .k { font-size: .64rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.wfb-card b { font-size: .81rem; line-height: 1.35; font-weight: 600; }
.wfb-card .meta { display: flex; gap: 6px; align-items: center; margin-top: auto; }
.wfb-card.trig { border-color: var(--accent); background: var(--accent-soft); }
.wfb-card .hint2 { font-size: .7rem; color: var(--faint); }
.wfb-card.ghost { border-style: dashed; color: var(--faint); justify-content: center; align-items: center; cursor: pointer; font-size: .82rem; box-shadow: none; }
.wfb-card.ghost:hover { color: var(--accent-strong); border-color: var(--accent); }
.wfb-plus { align-self: center; color: var(--faint); font-weight: 700; }
.gchev svg { width: 11px; height: 11px; }
.t-c { position: relative; }
.rowopen { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .95rem; line-height: 1; opacity: 0; cursor: pointer; }
.lrow:hover .rowopen { opacity: 1; }
.rowopen:hover { color: var(--accent-strong); border-color: var(--accent); }

/* ---- one title bar: title + view tabs + filters (Asana consolidation) ---- */
.tb-title { margin-right: 0; }
.tb-ctl { display: flex; align-items: center; gap: 8px; margin-left: 12px; min-width: 0; }
.tb-ctl .seg { flex: 0 0 auto; }
.tb-search { margin-left: auto; }
.myf { height: 30px; padding: 0 12px; }
.myf .av, .myf .av.sm { width: 18px; height: 18px; font-size: .56rem; }
.svpanel { position: absolute; top: calc(100% + 8px); right: 0; width: 280px; z-index: 80; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 36px rgba(26,31,54,.16); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.svpanel .btns { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 740px) {
  .topbar { flex-wrap: wrap; }
  .tb-ctl { order: 99; width: 100%; margin: 0 0 8px; overflow-x: auto; }
}

/* ---- lists live on the page, not in cards (Asana); cards stay on the dashboard ---- */
.card { background: transparent; border: none; box-shadow: none; border-radius: 0; }
.dash-grid .card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
}
.lrow:hover { background: rgba(26, 31, 54, .04); }
.cols .lrow:last-child { border-bottom: 1px solid var(--border-soft); }

/* ---- assignee: avatar + name, left-aligned (Asana) ---- */
.asg-nm { font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cell.c-asg { justify-content: flex-start; }
.lhead .h-assignee { text-align: left; }

/* ---- two-column assign menu + template dropdown ---- */
.asgmenu.twocol { width: 470px; max-height: 430px; }
.am-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; align-items: start; }
.am-col { min-width: 0; }
.am-col .ap-opt { width: 100%; }
.rdot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.tplmenu { width: 330px; max-height: 400px; overflow-y: auto; left: 0; top: calc(100% + 6px); }
.tplmenu .sect { padding: 9px 10px 3px; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.tplmenu button { display: flex; align-items: center; width: 100%; text-align: left; padding: 7px 10px; border-radius: 7px; font-size: .8rem; }
.tplmenu button:hover { background: var(--surface-2); }
.tplmenu button.sel { background: var(--accent-soft); color: var(--accent-strong); }
.tplmenu button i { color: var(--faint); font-style: normal; font-size: .7rem; margin-left: auto; padding-left: 10px; }
#nt-asg .av, #nt-asg .av.sm { width: 18px; height: 18px; font-size: .56rem; }
#nt-asg .am-nm { font-weight: 600; margin: 0 6px 0 4px; }

/* role tiles are dashboard-style cards — exempt from the flat-list rule */
.role-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
}

/* tooltips near the top edge flip downward instead of clipping into a dark sliver */
.topbar [data-tip]:hover::after, .panel-h [data-tip]:hover::after, .m-h [data-tip]:hover::after,
#tp-title:hover::after, .sb-logo [data-tip]:hover::after {
  bottom: auto; top: calc(100% + 7px);
}
.topbar [data-tip]:hover::before, .panel-h [data-tip]:hover::before, .m-h [data-tip]:hover::before,
#tp-title:hover::before, .sb-logo [data-tip]:hover::before {
  bottom: auto; top: calc(100% + 2px);
  border-top-color: transparent; border-bottom-color: var(--text);
}

/* editable workflow builder + template editor */
.wfb-name { font-weight: 700; font-size: .95rem; width: 300px; }
.wfb-card .edin { border: 1px solid transparent; background: transparent; border-radius: 6px; }
.wfb-card .edin:hover, .wfb-card .edin:focus { border-color: var(--border); background: var(--surface); }
.wfb-card select.edin { color: inherit; }
.toast-act { margin-left: 12px; color: #fff; text-decoration: underline; font-weight: 700; font-size: .8rem; }

/* due-picker extras: time + repeat */
.dp-x { display: flex; gap: 6px; padding: 8px 10px 0; }
.dp-xb { flex: 1; padding: 6px 8px; border: 1px dashed var(--border); border-radius: 8px; font-size: .76rem; color: var(--muted); cursor: pointer; }
.dp-xb.on { border-style: solid; border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.dp-xsec { display: flex; gap: 5px; padding: 8px 10px 2px; flex-wrap: wrap; align-items: center; }
.due-plain { border: none; background: none; padding: 0; font-size: .86rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.due-plain.over { color: var(--danger); }
.due-plain.today { color: #09825D; }
.due-plain:hover { text-decoration: underline; }
.due-plain .tpt { color: var(--muted); font-weight: 500; }
.cfm-wrap { position: fixed; inset: 0; z-index: 130; background: rgba(26,31,54,.28); display: flex; align-items: center; justify-content: center; animation: fade .12s; }
.cfm { background: var(--surface); border-radius: 14px; box-shadow: 0 18px 60px rgba(26,31,54,.3); padding: 16px 18px; max-width: 380px; }
.cfm .t { font-size: .88rem; line-height: 1.55; }
.cfm .b { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* grouped sidebar + My Tasks toggle redesign + 4-up roles */
.sb-div { height: 1px; background: rgba(255,255,255,.09); margin: 9px 12px; }
:root[data-theme="ocean"] .sb-div { background: var(--border-soft); }
.myav { border: none; background: none; padding: 2px; border-radius: 50%; opacity: .38; cursor: pointer; display: inline-flex; }
.myav.on { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
.myrole { border: none; background: none; padding: 2px; opacity: .32; filter: grayscale(.6); cursor: pointer; display: inline-flex; }
.myrole.on { opacity: 1; filter: none; }
.role-grid { grid-template-columns: repeat(4, 1fr); }

/* appliance calendar + chip editor + done band */
.cal-task.cblk { color: var(--danger); font-weight: 600; }
.cal-stage { margin-left: auto; font-size: .62rem; color: var(--faint); background: var(--surface-2); padding: 1px 6px; border-radius: 4px; flex: 0 0 auto; }
.g-done { background: #F3F4F6; }
.apcol { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid transparent; margin-right: 3px; cursor: pointer; }
.apcol.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.ap-card.dragging { transform: rotate(3deg) scale(1.02); opacity: .85; box-shadow: 0 14px 34px rgba(26,31,54,.28); }
.col-body.dropover { background: var(--accent-soft); border-radius: 10px; }

.jtip {
  position: fixed; z-index: 220; background: var(--text); color: #fff;
  font-size: .74rem; font-weight: 500; line-height: 1.45; letter-spacing: 0; text-transform: none;
  padding: 7px 10px; border-radius: 7px; max-width: 280px; pointer-events: none; animation: fade .12s;
}

/* Asana-exact repeat controls */
.dpr { flex-direction: column; align-items: stretch; gap: 8px; }
.dpr-row { display: flex; align-items: center; gap: 8px; }
.dpr-k { font-size: .78rem; font-weight: 600; color: var(--text-2); flex: 1; }
.dpr-k2 { font-size: .78rem; font-weight: 600; color: var(--text-2); padding-top: 2px; }
.dpr-days { display: flex; gap: 10px; padding: 2px 0 4px; }
.dpr-days label { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .68rem; color: var(--muted); cursor: pointer; }
.dpr-radio { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--text-2); min-width: 64px; cursor: pointer; }

/* ---- mobile rows, Asana-style: check · one-line title · due pill / grey subtitle ---- */
.msub { display: none; }
@media (max-width: 740px) {
  /* neutralize desktop table treatment */
  .cols .lrow .cell:not(:last-child), .cols .lhead span:not(:last-child) { border-right: none; padding-right: 0; }
  .cols .lhead { display: none; }
  .cols .lrow { display: flex; align-items: flex-start; gap: 0 10px; padding: 11px 2px 10px; }
  .cols .lrow .cell { padding: 0; align-self: auto; }

  /* line 1: check + title + due pill · line 2: subtitle inside the title cell */
  .cols .lrow .cell:first-child { flex: 0 0 24px; padding-top: 1px; }
  .cols .lrow .t-c { flex: 1 1 0; min-width: 0; line-height: 1.35; font-size: .89rem; }
  .cols .lrow .t-c .tedit { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .msub { display: block; font-size: .72rem; font-weight: 500; color: var(--faint); margin-top: 2px; }
  .cols .lrow .c-due { flex: 0 0 auto; margin-left: auto; padding-top: 1px; }
  .c-due .due { padding: 3px 9px; border-radius: 8px; background: var(--surface-2); font-size: .72rem; }
  .c-due .due.over { background: #FCE7E9; }
  .c-due .due.today { background: #E3F4EB; }
  .c-due .due.soon { background: #FCF0E4; }

  /* everything else lives in the panel on a phone */
  .cols .lrow .c-asg, .cols .lrow .c-prio, .cols .lrow .c-pt, .cols .lrow .c-src,
  .cols .lrow .cell.ord, .cols .lrow .c-acct, .cols .lrow .rowopen,
  .cols .lrow .cell:has(> .chip.acct-ins), .cols .lrow .cell:has(> .chip.outline) { display: none; }
  .lrow .pd { font-size: .68rem; }

  /* HDWM: keep the slot checks, drop the frequency chip */
  .cols .lrow .when-c { flex: 1 0 100%; margin-left: 34px; line-height: 1.5; order: 9; }
  .lrow.sub .t-c { font-size: .84rem; }

  .addrow { padding: 10px 2px 10px 34px; }
  .lgroup { padding: 14px 2px 4px; }
  .lrow.sel { background: none; }
}

/* Todoist-style priority flags */
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; }
.pflag { width: 12px; height: 12px; flex: 0 0 12px; }
.pick.pf { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.pick.pf:not(.sel) { opacity: .55; }
.pick.pf.sel, .pick.pf:hover { opacity: 1; }
.pick.pf.sel { border-color: currentColor; background: color-mix(in srgb, currentColor 10%, white); }

/* CRM/Stats-style rail toggle: circle straddling the sidebar edge */
.sb-collapse {
  position: absolute; top: 34px; right: -12px; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface); color: var(--muted);
  box-shadow: 0 2px 8px rgba(26, 31, 54, .14);
  cursor: pointer; transition: color .12s, border-color .12s;
}
.sb-collapse:hover { color: var(--text); border-color: var(--faint); background: var(--surface); }
.sidebar { position: relative; overflow: visible; }
.sidebar.rail .sb-collapse { position: absolute; top: 34px; left: auto; right: -12px; transform: none; }

/* app switcher (top-left mark) + CRM-pattern switch menu */
.appswitch { cursor: pointer; position: relative; }
.asw-chev { color: var(--sb-muted, var(--faint)); display: inline-flex; margin-left: 2px; }
.asw-chev svg { width: 10px; height: 10px; }
.asw-menu { position: absolute; top: calc(100% + 6px); left: 10px; z-index: 90; width: 218px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 44px rgba(26,31,54,.2); padding: 6px; color: var(--text); }
.asw-h { font-size: .64rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 7px 10px 5px; }
.asw-menu a, .asw-menu .cur { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: .86rem; font-weight: 600; color: var(--text); }
.asw-menu a:hover { background: var(--surface-2); }
.asw-menu .cur { color: var(--faint); cursor: default; }
.asw-menu .cur i { font-style: normal; font-size: .72rem; }
.asw-dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.asw-f { font-size: .68rem; color: var(--faint); padding: 7px 10px 5px; border-top: 1px solid var(--border-soft); margin-top: 4px; line-height: 1.4; }
.menu-users { list-style: none; margin: 0; padding: 0; }
.menu-users .mutd { color: var(--faint); font-weight: 500; }
.menu-pin .menu-title { font-size: .82rem; padding: 8px 12px 2px; margin: 0; }
.menu-pin .menu-error { color: var(--danger); font-size: .76rem; padding: 0 12px; margin: 2px 0; }
.linklike { color: var(--muted); font-size: .78rem; text-decoration: underline; cursor: pointer; }
