/* FOMO Launch Tracker — modern dashboard UI */
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e7ebf2;
  --brand: #1d4ed8;
  --brand-soft: #e8effd;
  --pink: #ec4899;
  --green: #16a34a;
  --green-soft: #e5f6ec;
  --amber: #d97706;
  --amber-soft: #fef3e2;
  --red: #dc2626;
  --red-soft: #fdecec;
  --slate: #94a3b8;
  --slate-soft: #eef1f6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
h1, h2, h3, h4 { margin: 0; }
h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% -10%, #dbe7ff 0%, transparent 60%),
              radial-gradient(1000px 500px at 90% 110%, #ffd9ea 0%, transparent 55%), var(--bg);
  padding: 20px;
}
.login-card {
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow);
  padding: 40px 36px; width: 100%; max-width: 380px; text-align: center;
}
.login-mark {
  display: inline-block; font-weight: 800; font-size: 26px; letter-spacing: .14em;
  background: linear-gradient(120deg, var(--brand), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 6px;
}
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-card p { margin: 0 0 22px; font-size: 13px; }
.login-card input {
  width: 100%; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; font-family: var(--font);
}
.login-card input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

/* ---------- buttons / inputs ---------- */
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 10px 16px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #1a45bd; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: #dc2626; border-color: #f3c2c2; }
.btn.danger:hover { background: #fef2f2; border-color: #dc2626; }
.tp-foot .btn.danger { flex: 0 0 auto; }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.icon-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  width: 34px; height: 34px; cursor: pointer; font-size: 16px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--ink); border-color: var(--slate); }
select, input[type="text"], input[type="date"], textarea {
  font-family: var(--font); font-size: 13.5px; border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; background: #fff; color: var(--ink); width: 100%;
}
textarea { resize: vertical; }
label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; }
label > select, label > input, label > textarea { margin-top: 6px; font-weight: 400; color: var(--ink); }
.error { color: var(--red); font-size: 13px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 20px; background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-mark {
  font-weight: 800; letter-spacing: .12em; font-size: 17px;
  background: linear-gradient(120deg, var(--brand), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-size: 13px; color: var(--muted); font-weight: 600; }
.launch-pill {
  display: flex; align-items: center; gap: 8px; background: var(--ink); color: #fff;
  border-radius: 999px; padding: 6px 14px 6px 8px; font-size: 12.5px;
}
.launch-pill strong {
  background: var(--pink); border-radius: 999px; min-width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; padding: 0 8px;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  font-size: 13px; width: 190px; font-family: var(--font); background: #fff;
}
.search:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.user-chip {
  font-size: 12.5px; color: var(--muted); background: var(--slate-soft);
  border-radius: 999px; padding: 6px 12px; max-width: 200px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 20px 60px; }

/* ---------- health banner ---------- */
.health {
  display: flex; align-items: center; gap: 14px; border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 16px; box-shadow: var(--shadow); background: var(--card);
  border-left: 5px solid var(--green);
}
.health.risk { border-left-color: var(--amber); }
.health.off { border-left-color: var(--red); }
.health-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.health.risk .health-dot { background: var(--amber); }
.health.off .health-dot { background: var(--red); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.health-status { font-weight: 800; font-size: 15px; white-space: nowrap; }
.health-text { color: var(--muted); font-size: 13.5px; }
.health-date { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px; min-width: 0;
}
.stat-ic {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.stat-num { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-sub { font-size: 11.5px; color: var(--muted); }

/* ---------- panels ---------- */
.panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
}
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.count-badge {
  background: var(--red-soft); color: var(--red); font-weight: 700; font-size: 12px;
  border-radius: 999px; padding: 2px 10px;
}
.count-badge.ok { background: var(--green-soft); color: var(--green); }

/* ---------- attention rows ---------- */
.attn-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer;
  background: #fff; transition: border-color .12s, box-shadow .12s;
}
.attn-row:hover { border-color: var(--slate); box-shadow: var(--shadow); }
.attn-row:last-child { margin-bottom: 0; }
.done-check {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--slate);
  flex-shrink: 0; cursor: pointer; background: #fff; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px;
}
.done-check:hover { border-color: var(--green); }
.done-check.is-done { background: var(--green); border-color: var(--green); }
.attn-main { min-width: 0; flex: 1; }
.attn-title { font-weight: 600; font-size: 13.5px; }
.attn-title.is-done { text-decoration: line-through; color: var(--muted); }
.attn-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ws-tag {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: 6px; padding: 1px 7px; margin-right: 6px;
}
.owner-chip {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--slate-soft); border-radius: 6px; padding: 1px 7px;
}
.due-badge { font-size: 12px; font-weight: 700; white-space: nowrap; padding: 3px 10px; border-radius: 999px; }
.due-badge.overdue { background: var(--red-soft); color: var(--red); }
.due-badge.soon { background: var(--amber-soft); color: var(--amber); }
.due-badge.later { background: var(--slate-soft); color: var(--muted); }
.due-badge.doneb { background: var(--green-soft); color: var(--green); }
.status-pill { font-size: 11.5px; font-weight: 700; white-space: nowrap; padding: 3px 10px; border-radius: 999px; }
.status-pill.not_started { background: var(--slate-soft); color: #475569; }
.status-pill.in_progress { background: #dbeafe; color: #1d4ed8; }
.status-pill.blocked { background: var(--red-soft); color: var(--red); }
.status-pill.done { background: var(--green-soft); color: var(--green); }
.empty-note { color: var(--muted); font-size: 13px; padding: 8px 2px; }

/* ---------- tabs + filters ---------- */
.tabs-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 20px 0 14px; flex-wrap: wrap;
}
.tabs { display: flex; gap: 4px; background: var(--slate-soft); border-radius: 12px; padding: 4px; }
.tab {
  border: 0; background: transparent; border-radius: 9px; padding: 8px 16px;
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: var(--font);
}
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.owner-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: var(--font);
}
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- overview grid ---------- */
.ov-grid { display: grid; grid-template-columns: 1.9fr 1fr; gap: 12px; align-items: start; }
.ws-row {
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-bottom: 10px;
  cursor: pointer; background: #fff; transition: border-color .12s, box-shadow .12s;
}
.ws-row:hover { border-color: var(--slate); box-shadow: var(--shadow); }
.ws-row:last-child { margin-bottom: 0; }
.ws-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ws-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ws-dot.track { background: var(--green); }
.ws-dot.risk { background: var(--amber); }
.ws-dot.off { background: var(--red); }
.ws-name { font-weight: 700; font-size: 13.5px; flex: 1; min-width: 0; }
.ws-count { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.battery { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: var(--slate-soft); }
.battery > div { height: 100%; }
.battery .b-done { background: var(--green); }
.battery .b-prog { background: var(--brand); }
.battery .b-block { background: var(--red); }
.ws-legend { display: flex; gap: 12px; margin-top: 7px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.ws-legend b { color: var(--ink); }
.ws-tasks { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 6px; }
.mini-task {
  display: flex; align-items: center; gap: 9px; padding: 7px 4px; font-size: 13px;
  border-bottom: 1px solid #f1f4f9; cursor: pointer;
}
.mini-task:last-child { border-bottom: 0; }
.mini-task .sdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sdot.not_started { background: var(--slate); }
.sdot.in_progress { background: var(--brand); }
.sdot.blocked { background: var(--red); }
.sdot.done { background: var(--green); }
.mini-task .mt-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-task .mt-title.is-done { text-decoration: line-through; color: var(--muted); }

/* workload + donut */
.side-stack { display: flex; flex-direction: column; gap: 12px; }
.wl-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f4f9; }
.wl-row:last-child { border-bottom: 0; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.wl-main { flex: 1; min-width: 0; }
.wl-name { font-size: 13px; font-weight: 700; }
.wl-bar { height: 6px; border-radius: 999px; background: var(--slate-soft); margin-top: 5px; overflow: hidden; }
.wl-bar > div { height: 100%; background: var(--brand); border-radius: 999px; }
.wl-bar.hot > div { background: var(--red); }
.wl-num { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.wl-num .hot { color: var(--red); font-weight: 800; }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut-legend { font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; }
.donut-legend .li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.donut-legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend b { color: var(--ink); margin-left: auto; padding-left: 12px; }

/* ---------- board ---------- */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.board-col { background: #eceff4; border-radius: var(--radius); padding: 10px; min-height: 120px; }
.board-col > h4 {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  margin: 2px 4px 10px; display: flex; align-items: center; gap: 8px;
}
.board-col > h4 .n {
  background: #fff; border-radius: 999px; font-size: 11px; padding: 1px 8px; color: var(--muted);
}
.bcard {
  background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.07);
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer; border-top: 3px solid var(--slate);
}
.bcard.in_progress { border-top-color: var(--brand); }
.bcard.blocked { border-top-color: var(--red); }
.bcard.done { border-top-color: var(--green); }
.bcard:hover { box-shadow: var(--shadow); }
.bcard .bt { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.bcard .bt.is-done { text-decoration: line-through; color: var(--muted); }
.bcard .bm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- timeline ---------- */
.tl-week { margin-bottom: 14px; }
.tl-week-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  font-size: 13px; font-weight: 800;
}
.tl-now {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  background: var(--brand); color: #fff; border-radius: 999px; padding: 2px 9px;
}
.tl-row {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; cursor: pointer;
}
.tl-row:hover { border-color: var(--slate); box-shadow: var(--shadow); }
.tl-date-col { font-size: 12px; color: var(--muted); font-weight: 700; width: 52px; flex-shrink: 0; }
.tl-meta { display: contents; }
.tl-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-title.is-done { text-decoration: line-through; color: var(--muted); }

/* ---------- calendar tab ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-title { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.cal-head #cal-today { margin-left: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  min-height: 96px; min-width: 0; padding: 6px; transition: border-color .12s, background .12s;
}
.cal-day.other-month { opacity: .45; background: #f8fafc; }
.cal-day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.cal-day.drop-hint { border-color: var(--brand); background: #eff4ff; }
.cal-num { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-day.today .cal-num { color: var(--brand); }
.cal-tasks { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; max-height: 168px; overflow-y: auto; }
.cal-chip {
  font-size: 11.5px; font-weight: 600; padding: 4px 6px; border-radius: 7px;
  background: #f1f5f9; border-left: 3px solid #94a3b8; cursor: grab;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none;
}
.cal-chip:active { cursor: grabbing; }
.cal-chip.dragging { opacity: .35; }
.cal-chip.not_started { border-left-color: #94a3b8; }
.cal-chip.in_progress { border-left-color: #1d4ed8; background: #e8effc; }
.cal-chip.blocked { border-left-color: #dc2626; background: #fdecec; }
.cal-chip.done { border-left-color: #16a34a; }
.cal-chip.is-done { text-decoration: line-through; opacity: .6; }
.cal-chip.moving { outline: 2px dashed var(--brand); outline-offset: 1px; background: #dbeafe; }
/* mobile agenda view (hidden on desktop) */
.cal-agenda { display: none; }
.ag-title.is-done { text-decoration: line-through; color: var(--muted); }

/* ---------- task slide-over ---------- */
.backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 60;
}
.task-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 94vw; z-index: 75;
  background: #fff; box-shadow: -12px 0 40px rgba(16, 24, 40, .18);
  display: flex; flex-direction: column; animation: slidein .18s ease-out;
}
@keyframes slidein { from { transform: translateX(40px); opacity: .4; } }
.tp-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
}
.tp-head h3 { font-size: 16px; margin-top: 4px; letter-spacing: -.01em; }
.tp-ws { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
select.tp-ws {
  border: 1px solid transparent; background: transparent; cursor: pointer;
  font-family: var(--font); padding: 2px 4px; margin-left: -4px; border-radius: 6px; max-width: 100%;
}
select.tp-ws:hover { border-color: var(--line); background: #fff; }
.mini-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 10px;
  font-size: 12px; font-weight: 700; color: var(--brand); cursor: pointer; font-family: var(--font);
}
.mini-btn:hover { border-color: var(--brand); }
#add-ws-btn { margin-left: auto; }
.tp-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.tp-label { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
.tp-label:first-child { margin-top: 0; }
.status-stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stp {
  border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 4px;
  font-size: 11.5px; font-weight: 700; cursor: pointer; font-family: var(--font); color: var(--muted);
}
.stp.sel-not_started { border-color: var(--slate); background: var(--slate-soft); color: #475569; }
.stp.sel-in_progress { border-color: var(--brand); background: #dbeafe; color: #1d4ed8; }
.stp.sel-blocked { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.stp.sel-done { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.tp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.dep-row {
  display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px;
}
.tp-updated { margin-top: 14px; }
.tp-foot {
  display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line);
  background: #fafbfc;
}
.tp-foot .btn { flex: 1; }
#tp-error { padding: 0 20px 14px; margin: 0; }

/* ---------- new task modal ---------- */
.modal {
  position: fixed; z-index: 61; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 520px; max-width: calc(100vw - 32px); max-height: calc(100vh - 60px);
  background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(16, 24, 40, .25);
  display: flex; flex-direction: column; overflow: hidden;
  animation: popin .16s ease-out;
}
@keyframes popin { from { transform: translate(-50%, -48%); opacity: .5; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16px; letter-spacing: -.01em; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-body .field { margin-bottom: 12px; }
.modal-body .tp-grid { margin-top: 0; }
.modal-body .tp-grid + .tp-grid { margin-top: 12px; }
.field-hint { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 4px; }
#nt-deps { min-height: 104px; }
#nt-error { margin: 4px 0 0; }
.modal-foot {
  display: flex; gap: 10px; padding: 14px 20px;
  border-top: 1px solid var(--line); background: #fafbfc;
}
.modal-foot .btn { flex: 1; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  border-radius: 999px; padding: 10px 20px; box-shadow: var(--shadow);
}

/* ---------- chat ---------- */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff;
  box-shadow: 0 8px 24px rgba(124,58,237,.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab-icon { font-size: 24px; }
.chat-badge {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
  padding: 0 6px; border: 2px solid #fff;
}
.chat-panel {
  position: fixed; right: 22px; bottom: 92px; z-index: 70;
  width: 380px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 140px);
  background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(15,23,42,.22);
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line);
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafbfc;
}
.chat-title { display: flex; align-items: center; gap: 10px; }
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.chat-title strong { display: block; font-size: 14px; }
.chat-status { font-size: 12px; color: var(--muted); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px;
  background: #f6f7f9;
}
.chat-msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; }
.chat-msg.user {
  align-self: flex-end; background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.ramu {
  align-self: flex-start; background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-bottom-left-radius: 4px;
}
.chat-msg .chat-time { display: block; font-size: 10.5px; opacity: .65; margin-top: 4px; }
.chat-input-row {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff;
}
.chat-input-row input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; font-size: 13.5px;
}
.chat-input-row input:focus { outline: 2px solid #c4b5fd; border-color: #7c3aed; }

/* ---------- responsive ---------- */
@media (min-width: 961px) {
  /* desktop: keep filters + side widgets pinned while workstreams scroll */
  .tabs-row {
    position: sticky; top: 68px; z-index: 30;
    background: var(--bg); padding: 10px 0; margin: 10px 0 14px;
  }
  .side-stack {
    position: sticky; top: 144px;
    max-height: calc(100vh - 164px); overflow-y: auto;
  }
}
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .ov-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, 260px); overflow-x: auto; padding-bottom: 8px; }
}
@media (max-width: 640px) {
  body { -webkit-tap-highlight-color: transparent; }
  .wrap { padding: 14px 12px 50px; }
  .topbar { padding: 10px 12px; gap: 10px; }
  .brand-sub { display: none; }
  .launch-pill .pill-txt { display: none; }
  .search { width: 100%; order: 5; flex-basis: 100%; }
  .user-chip { display: none; }
  .health { flex-wrap: wrap; }
  .health-date { margin-left: 0; }
  .stat { padding: 12px; gap: 10px; }
  .stat-ic { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
  .stat-num { font-size: 20px; }
  .attn-row { padding: 10px; gap: 10px; }
  .tabs { max-width: 100%; overflow-x: auto; }
  .tab { padding: 8px 12px; font-size: 12.5px; white-space: nowrap; }
  .ws-top { gap: 8px; }
  .ws-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* timeline → two-line cards */
  .tl-row { flex-wrap: wrap; row-gap: 6px; }
  .tl-row .sdot { order: 1; }
  .tl-title { order: 2; flex: 1; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .tl-row .due-badge { order: 3; margin-left: auto; }
  .tl-meta { order: 4; display: flex; flex: 1 1 100%; gap: 6px 10px; align-items: center; margin-left: 18px; flex-wrap: wrap; }
  .tl-date-col { width: auto; }
  /* timeline meta row: quiet text + avatar instead of competing pills */
  .tl-meta .ws-tag {
    background: none; color: var(--muted); font-weight: 600;
    padding: 0; margin: 0;
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .tl-meta .ws-tag::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: var(--brand); flex-shrink: 0;
  }
  .tl-meta .owner-chip {
    background: none; padding: 0; margin: 0 0 0 auto;
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--muted); font-weight: 600; font-size: 11.5px;
  }
  .tl-meta .owner-chip::before {
    content: attr(data-initials);
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--slate); color: #fff;
    font-size: 10px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  /* calendar → agenda list */
  .cal-grid { display: none; }
  .cal-agenda { display: block; }
  .cal-agenda-day { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
  .cal-agenda-day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
  .cal-agenda-day.drop-hint { border-color: var(--brand); background: #eff4ff; }
  .cal-agenda-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  .cal-agenda-dow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .cal-agenda-date { font-size: 13.5px; font-weight: 800; }
  .cal-agenda-count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--slate-soft); border-radius: 999px; padding: 2px 9px; }
  .cal-agenda .cal-chip { display: flex; align-items: center; gap: 9px; font-size: 13px; padding: 10px 12px; white-space: normal; margin-bottom: 6px; }
  .cal-agenda .cal-chip:last-child { margin-bottom: 0; }
  .cal-agenda .cal-chip.done { opacity: .65; }
  .cal-agenda .ag-title { flex: 1; min-width: 0; }
  .cal-agenda .owner-chip { flex-shrink: 0; }
  .task-panel { width: 100vw; max-width: 100vw; }
  .tp-grid { grid-template-columns: 1fr; }
  .stp { font-size: 11px; padding: 8px 2px; }
  .chat-panel { right: 12px; bottom: 86px; }
  .chat-fab { right: 16px; bottom: 16px; width: 54px; height: 54px; }
  .board { grid-template-columns: repeat(4, 240px); }
  .cal-chip { -webkit-touch-callout: none; }
}

/* ---------- completion celebrations ---------- */
.celebrate-layer { position: fixed; inset: 0; z-index: 9999; pointer-events: none; overflow: hidden; }
.celebrate-particle { position: absolute; will-change: transform, opacity; }

/* 1. confetti rain — falls from top */
@keyframes celeb-fall {
  from { transform: translateY(-8vh) rotate(0deg); opacity: 1; }
  to { transform: translateY(112vh) rotate(680deg); opacity: .85; }
}
.celeb-fall { top: -4vh; animation: celeb-fall linear forwards; }

/* 2. confetti burst — explodes upward from bottom center */
@keyframes celeb-burst {
  0% { transform: translate(-50%, 0) scale(.6) rotate(0deg); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--tx)), var(--ty)) scale(1) rotate(var(--rot)); opacity: 0; }
}
.celeb-burst { left: 50%; top: 78%; animation: celeb-burst cubic-bezier(.15,.6,.4,1) forwards; }

/* 3/4. bloom — radial pop from a point (stars, firework sparks) */
@keyframes celeb-bloom {
  0% { transform: translate(-50%,-50%) scale(.3); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.1); opacity: 0; }
}
.celeb-bloom { animation: celeb-bloom ease-out forwards; }

/* 5/10. rise — emoji float upward */
@keyframes celeb-rise {
  0% { transform: translateY(10vh) scale(.5) rotate(-12deg); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translateY(-75vh) translateX(var(--tx)) scale(1.05) rotate(10deg); opacity: 0; }
}
.celeb-rise { bottom: 8vh; animation: celeb-rise ease-in forwards; }

/* 6. twinkle — sparkles blink on/off */
@keyframes celeb-twinkle {
  0%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { transform: scale(1.25) rotate(100deg); opacity: 1; }
}
.celeb-twinkle { animation: celeb-twinkle ease-in-out forwards; }

/* 7. ring pulse — expanding rings */
@keyframes celeb-ring {
  0% { transform: translate(-50%,-50%) scale(.25); opacity: .9; }
  100% { transform: translate(-50%,-50%) scale(2.6); opacity: 0; }
}
.celeb-ring { left: 50%; top: 42%; border-radius: 50%; animation: celeb-ring ease-out forwards; }

/* 8. balloons — rise to top with sway */
@keyframes celeb-balloon {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(-118vh) translateX(var(--tx)); opacity: 0; }
}
.celeb-balloon { bottom: -10vh; animation: celeb-balloon linear forwards; }

/* 9. streamers — sway-fall from top */
@keyframes celeb-sway {
  0% { transform: translateY(-6vh) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(112vh) translateX(var(--tx)) rotate(560deg); opacity: .8; }
}
.celeb-sway { top: -4vh; animation: celeb-sway linear forwards; }

/* 11. sequential pops across the screen */
@keyframes celeb-pop {
  0% { transform: translate(-50%,-50%) scale(0); opacity: 0; }
  35% { transform: translate(-50%,-50%) scale(1.35); opacity: 1; }
  65% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%,-64%) scale(1); opacity: 0; }
}
.celeb-pop { animation: celeb-pop ease-out forwards; }

/* 12. done stamp */
@keyframes celeb-stamp {
  0% { transform: translate(-50%,-50%) scale(2.6) rotate(-16deg); opacity: 0; }
  28% { transform: translate(-50%,-50%) scale(.94) rotate(-7deg); opacity: 1; }
  45% { transform: translate(-50%,-50%) scale(1.05) rotate(-7deg); opacity: 1; }
  60% { transform: translate(-50%,-50%) scale(1) rotate(-7deg); opacity: 1; }
  82% { opacity: 1; }
  100% { transform: translate(-50%,-54%) scale(1.06) rotate(-7deg); opacity: 0; }
}
.celeb-stamp {
  left: 50%; top: 42%;
  display: flex; align-items: center; justify-content: center;
  width: 34vmin; height: 34vmin; border-radius: 50%;
  background: #2fbf71; color: #fff;
  font-size: 11vmin; font-weight: 800;
  box-shadow: 0 18px 50px rgba(47,191,113,.45);
  border: 1vmin solid rgba(255,255,255,.85);
  animation: celeb-stamp 1.9s ease-out forwards;
}
