/* =====================================================================
   Extreme Fitness — Task Manager
   Brand: crimson red + black (matches the EXF / "Extreme" logo), "since 1914".
   Green is kept only as a small success accent.
   Single hand-written stylesheet, no build step.
   ===================================================================== */

:root {
  /* Brand — softened red (matches the logo wordmark but easier on the eyes) */
  --brand:        #e23744;   /* warm red — primary action */
  --brand-strong: #c52230;   /* hover/active */
  --brand-soft:   #fdeef0;   /* tint backgrounds */
  --brand-ink:    #8a1a23;   /* text on soft tint */
  --gold:         #f5b301;   /* heritage accent (STAR gold) */

  /* Success accent (the green from the equipment) — used sparingly */
  --accent:       #16a34a;
  --accent-soft:  #dcfce7;
  --accent-ink:   #15803d;

  /* Surfaces — true black/charcoal to match the logo (black on white) */
  --ink:    #111113;         /* near-black brand surface */
  --ink-2:  #1a1a1d;
  --ink-3:  #26262b;
  --page:   #f3f4f6;         /* app background (clean light grey) */
  --card:   #ffffff;
  --text:   #0f172a;
  --muted:  #64748b;
  --faint:  #94a3b8;
  --line:   #e6eaf0;
  --line-2: #eef1f6;

  /* Status */
  --ok:     #16a34a;
  --warn:   #ea8a04;
  --danger: #e11d48;
  --info:   #2563eb;

  --radius:    14px;
  --radius-lg: 20px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(15,23,42,.06), 0 6px 18px rgba(15,23,42,.06);
  --shadow-lg: 0 24px 60px rgba(8,15,30,.30);
  --ring:      0 0 0 3px rgba(226,55,68,.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 480px at 100% -10%, #ffe9ea 0%, rgba(255,233,234,0) 60%),
    var(--page);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--brand-strong); }

/* Form controls */
input, select, textarea {
  font-family: inherit; font-size: 14px; width: 100%;
  padding: 11px 13px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--ring);
}
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 14px; color: #334155; }
label input, label select, label textarea { margin-top: 6px; font-weight: 400; }

/* ------------------------------- Buttons ------------------------------- */
.btn {
  border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius-sm);
  padding: 10px 16px; font-weight: 700; font-size: 14px; color: var(--text);
  transition: transform .05s, background .15s, box-shadow .15s, border-color .15s;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.btn:hover { background: #f8fafc; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-strong) 100%);
  border-color: var(--brand-strong); color: #fff;
  box-shadow: 0 5px 14px rgba(226,55,68,.28);
}
.btn.primary:hover { filter: brightness(1.04); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #eef2f7; color: var(--text); }
.btn.block { width: 100%; justify-content: center; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.xs { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.danger { color: var(--danger); border-color: #fecdd3; background: #fff; }
.btn.danger:hover { background: #fff1f3; }

/* -------------------------------- Login -------------------------------- */
.login-wrap {
  position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(226,55,68,.18), transparent 55%),
    radial-gradient(700px 500px at 100% 100%, rgba(226,55,68,.10), transparent 60%),
    linear-gradient(160deg, #0d0d0f 0%, #18181b 60%, #0d0d0f 100%);
}
/* Animated moving red glow + a slowly drifting EXF "X" watermark — gives the
   login a living, branded backdrop without a heavy GIF file. */
.login-wrap::before {
  content: ""; position: absolute; inset: -30%;
  background:
    radial-gradient(40% 40% at 30% 30%, rgba(226,55,68,.22), transparent 70%),
    radial-gradient(35% 35% at 70% 60%, rgba(226,55,68,.16), transparent 70%);
  animation: bgFloat 18s ease-in-out infinite alternate;
  z-index: 0;
}
.login-wrap::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -120px; bottom: -120px;
  background: url('assets/favicon.png') center/contain no-repeat;
  opacity: .06; filter: grayscale(0); animation: xDrift 22s ease-in-out infinite alternate;
  z-index: 0; pointer-events: none;
}
@keyframes bgFloat {
  0%   { transform: translate(-4%, -2%) scale(1); }
  100% { transform: translate(6%, 4%) scale(1.15); }
}
@keyframes xDrift {
  0%   { transform: translateY(0) rotate(-6deg); opacity: .05; }
  100% { transform: translateY(-40px) rotate(6deg); opacity: .10; }
}
.login-card { position: relative; z-index: 1; }
.login-card {
  background: #fff; padding: 34px 32px; border-radius: var(--radius-lg);
  width: 100%; max-width: 400px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.6);
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.brand h1 { margin: 0; font-size: 21px; letter-spacing: -.01em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.brand-mark {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(150deg, #1a1a1d, #2b2b30);
  color: #fff; font-weight: 900; display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; letter-spacing: .5px; flex: none; line-height: 1; white-space: nowrap;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif; font-style: italic;
  box-shadow: inset 0 0 0 1.5px rgba(226,55,68,.6), 0 6px 16px rgba(0,0,0,.22);
}
.brand-mark .exf-x { color: var(--brand); margin: 0 -.5px; }
/* When the brand mark holds the EXF logo image, use a white tile so the red X reads. */
.brand-mark:has(img) { background: #fff; box-shadow: inset 0 0 0 1.5px rgba(226,55,68,.4), 0 6px 16px rgba(0,0,0,.22); }
.brand-mark img { width: 74%; height: 74%; object-fit: contain; }
.brand-mark.sm { width: 38px; height: 38px; font-size: 13px; border-radius: 11px; letter-spacing: .3px; }
.login-tag {
  margin: 18px 0 22px; font-size: 12.5px; color: var(--muted);
  border-left: 3px solid var(--brand); padding: 6px 0 6px 12px; font-style: italic;
}
.hint { color: var(--muted); font-size: 12px; text-align: center; margin: 16px 0 0; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 8px 0 0; font-weight: 600; }

/* -------------------------------- Topbar -------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, #232830, #1b1f26);
  color: #fff; padding: 0 18px; height: 58px;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 6px 18px rgba(15,23,42,.14);
  border-bottom: 3px solid var(--brand);
}
/* Brand stays on one line and never shrinks. It's a button (→ home). */
.topbar-left { display: flex; align-items: center; gap: 11px; font-size: 16px; flex: none; white-space: nowrap; background: none; border: none; color: #fff; cursor: pointer; padding: 4px 2px; border-radius: 10px; transition: opacity .12s; }
.topbar-left:hover { opacity: .85; }
.topbar-left strong { letter-spacing: -.01em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }

/* Tabs take the middle space and scroll horizontally if they don't fit —
   they never wrap into the brand/right zones. */
.tabs {
  display: flex; gap: 2px; flex: 1 1 auto; min-width: 0;
  overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: transparent; border: none; color: #c2cad6; padding: 8px 13px;
  border-radius: 9px; font-weight: 600; font-size: 14px; position: relative;
  transition: color .15s, background .15s; white-space: nowrap; flex: none;
}
.tabs button:hover { background: rgba(255,255,255,.08); color: #fff; }
.tabs button.active { background: rgba(226,55,68,.18); color: #fff; }
.tabs button.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px;
  height: 2.5px; border-radius: 2px; background: var(--brand);
}

/* "Manage ▾" dropdown */
.menu-wrap { position: relative; flex: none; }
.menu-btn {
  background: transparent; border: none; color: #c2cad6; padding: 8px 13px;
  border-radius: 9px; font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.menu-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu-btn.active { background: rgba(226,55,68,.18); color: #fff; }
.menu-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 190px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); overflow: hidden; z-index: 60; padding: 6px;
}
.menu-dropdown button {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--text);
}
.menu-dropdown button:hover { background: #f4f6f9; }
.menu-dropdown button.active { background: var(--brand-soft); color: var(--brand-ink); }

/* Profile chip + its dropdown (anchored to the RIGHT edge). */
.profile-wrap { position: relative; flex: none; }
.me-btn {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10); color: #fff; border-radius: 11px;
  padding: 5px 10px; cursor: pointer; height: 40px; transition: background .15s;
}
.me-btn:hover { background: rgba(255,255,255,.14); }
.me-btn .caret { color: #aeb9cc; font-size: 11px; }
.profile-menu { left: auto; right: 0; min-width: 210px; }

.me { font-size: 13px; color: #e2e8f0; text-align: right; line-height: 1.2; font-weight: 700; white-space: nowrap; }
.me small { color: #8da0bc; display: block; font-size: 11px; text-transform: capitalize; font-weight: 500; }
.bell {
  position: relative; background: rgba(255,255,255,.08); border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 11px; font-size: 17px;
  display: grid; place-items: center; transition: background .15s;
}
.bell:hover { background: rgba(255,255,255,.18); }
.badge {
  position: absolute; top: -5px; right: -5px; background: var(--danger); color: #fff;
  font-size: 11px; min-width: 19px; height: 19px; border-radius: 10px;
  display: grid; place-items: center; padding: 0 5px; font-weight: 800;
  box-shadow: 0 0 0 2px var(--ink);
}

/* ----------------------------- Notif panel ----------------------------- */
.notif-panel {
  position: absolute; top: 66px; right: 16px; width: 380px; max-width: calc(100vw - 24px);
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 50; overflow: hidden; border: 1px solid var(--line);
}
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-head strong { font-size: 15px; }
.notif-list { max-height: 62vh; overflow-y: auto; }
.notif-item { padding: 13px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .12s; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: var(--brand-soft); }
.notif-item.unread .nt::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-strong); margin-right: 7px; vertical-align: middle;
}
.notif-item .nt { font-weight: 700; font-size: 13.5px; }
.notif-item .nb { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.notif-item .ntime { color: var(--faint); font-size: 11px; margin-top: 5px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

/* ---------------------------- Main / layout ---------------------------- */
.main { max-width: 1140px; margin: 0 auto; padding: 26px 18px 72px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.page-head .spacer { flex: 1; }

/* ----------------------------- Stat cards ------------------------------ */
/* One row, equal columns; on narrow screens it scrolls horizontally rather
   than wrapping to a second line. */
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; margin-bottom: 26px; }
.stat {
  position: relative; background: var(--card); border-radius: var(--radius);
  padding: 16px 16px 14px; box-shadow: var(--shadow); border: 1px solid var(--line);
  overflow: hidden; min-width: 0;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--brand); opacity: .85;
}
.stat.warn::before  { background: var(--warn); }
.stat.alert::before { background: var(--danger); }
.stat.ok::before    { background: var(--ok); }
.stat .num { font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.stat .lbl { color: var(--muted); font-size: 11.5px; margin-top: 8px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.stat.alert .num { color: var(--danger); }
.stat.warn  .num { color: var(--warn); }
.stat.ok    .num { color: var(--ok); }

/* ------------------------------- Filters ------------------------------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filters select, .filters input { width: auto; min-width: 150px; background: #fff; }

/* ---------------------------- Cards / lists ---------------------------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; border: 1px solid var(--line); overflow: hidden; }
.card-pad { padding: 18px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 12px; font-weight: 800; display: flex; align-items: center; gap: 8px; }

/* ------------------------------ Task row ------------------------------- */
.task { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .12s; }
.task:last-child { border-bottom: none; }
.task:hover { background: #fff7f7; }
.task .tmain { flex: 1; min-width: 0; }
.task .ttitle { font-weight: 700; font-size: 14.5px; }
.task .tmeta { color: var(--muted); font-size: 12.5px; margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.task .tright { text-align: right; white-space: nowrap; }

/* -------------------------------- Pills -------------------------------- */
.pill { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: capitalize; letter-spacing: .01em; line-height: 1.7; }
.pill.open        { background: #eef2ff; color: #4338ca; }
.pill.in_progress { background: #e0f2fe; color: #0369a1; }
.pill.blocked     { background: #ffe4e6; color: #be123c; }
.pill.done        { background: var(--accent-soft); color: var(--accent-ink); }
.pill.cancelled   { background: #eef1f6; color: #64748b; }
.pill.low    { background: #f1f5f9; color: #64748b; }
.pill.normal { background: #e8edf3; color: #475569; }
.pill.high   { background: #fff3d6; color: #b45309; }
.pill.urgent { background: #ffe4e6; color: #be123c; }
.pill.role   { background: #eef1f6; color: #475569; }
.overdue-txt { color: var(--danger); font-weight: 800; }

/* ----------------------------- Progress bar ---------------------------- */
.prog { height: 8px; background: #eef1f6; border-radius: 999px; overflow: hidden; margin-top: 10px; }
/* Progress fill is colour-coded by status: in-progress = amber, done = green,
   blocked = red, otherwise neutral grey. */
.prog > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#94a3b8,#64748b); transition: width .3s ease; }
.prog.p-in_progress > i { background: linear-gradient(90deg,#fbbf24,#f59e0b); }
.prog.p-done > i        { background: linear-gradient(90deg,#34d399,#16a34a); }
.prog.p-blocked > i     { background: linear-gradient(90deg,#fb7185,#e11d48); }
.prog.p-open > i        { background: linear-gradient(90deg,#cbd5e1,#94a3b8); }
/* Progress bar + % label on cards/rows */
.prog-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.prog-line .prog { flex: 1; margin-top: 0; }
.prog-pct { font-size: 11.5px; font-weight: 800; color: var(--muted); min-width: 34px; text-align: right; }

/* -------------------- Who's doing what — person cards ------------------ */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.person { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border: 1px solid var(--line); transition: transform .12s, box-shadow .12s; }
.person:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.person .phead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: linear-gradient(150deg, var(--ink-2), var(--ink-3));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px;
  box-shadow: inset 0 0 0 2px rgba(226,55,68,.45);
}
.person .pcounts { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0; }
.person .ptasks { margin-top: 8px; }
.person .ptask { font-size: 13px; padding: 8px 0; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 8px; align-items: center; cursor: pointer; }
.person .ptask:hover { color: var(--brand-strong); }
.person .ptask:first-child { border-top: none; }
.count-chip { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 8px; background: #eef1f6; color: #475569; }

/* --------------------------- Department grid --------------------------- */
.depts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 14px; }
.dept { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border: 1px solid var(--line); transition: transform .12s, box-shadow .12s; }
.dept:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.dept h3 { margin: 0 0 6px; font-size: 16px; }

/* -------------------------------- Modal -------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8,15,30,.55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s ease; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 580px; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2,.9,.3,1.3); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop  { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; padding-right: 12px; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
.x { background: #f1f5f9; border: none; font-size: 20px; color: var(--muted); line-height: 1; width: 34px; height: 34px; border-radius: 9px; flex: none; transition: background .12s, color .12s; }
.x:hover { background: #fee2e2; color: var(--danger); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ------------------------------- Comments ------------------------------ */
.comment { padding: 12px 0; border-top: 1px solid var(--line-2); }
.comment .cwho { font-weight: 800; font-size: 13px; }
.comment .cwhen { color: var(--faint); font-size: 11px; margin-left: 7px; }
.comment .ctext { font-size: 13.5px; margin-top: 4px; white-space: pre-wrap; }

/* -------------------------------- Toast -------------------------------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 12px; z-index: 200; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); border-left: 4px solid var(--brand); animation: pop .18s ease; }
.toast.err { border-left-color: var(--danger); }

/* -------------------------------- Table -------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
table.tbl th, table.tbl td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
table.tbl th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; background: #fafbfc; }
table.tbl tr:hover td { background: #f8fafc; }

/* ============== Worker-first UI (My Work Today, big buttons) ============ */
.empty.big { font-size: 18px; padding: 56px 20px; }

.bigcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; cursor: pointer; border: 1px solid var(--line); border-left: 5px solid var(--brand); transition: transform .1s, box-shadow .12s; }
.bigcard:hover { box-shadow: var(--shadow-lg); }
.bigcard:active { transform: scale(.995); }
.bigcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.bigcard-title { font-size: 18px; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; }
.bigcard-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; margin-top: 10px; }
.bigcard-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Big tap-friendly buttons */
.bigbtn { border: none; border-radius: 12px; padding: 15px 18px; font-size: 16px; font-weight: 800; color: #fff; flex: 1; min-width: 130px; transition: transform .06s, filter .12s; box-shadow: 0 6px 14px rgba(8,15,30,.14); }
.bigbtn:hover { filter: brightness(1.05); }
.bigbtn.start { background: linear-gradient(180deg,#2f8bff,#1f6fe0); }
.bigbtn.done  { background: linear-gradient(180deg, #1bbf5e, var(--accent)); color: #fff; }
.bigbtn.stuck { background: linear-gradient(180deg,#fb9a2e,#ef7e11); }
.bigbtn.todo  { background: linear-gradient(180deg,#5a6b85,#445270); }
.bigbtn.ghost { background: #eef2f7; color: var(--text); font-weight: 700; box-shadow: none; }
.bigbtn.ghost:hover { background: #e3e9f1; }
.bigbtn.on { outline: 3px solid rgba(8,15,30,.18); outline-offset: 2px; }
.bigbtn:active { transform: scale(.97); }

/* Status grid in task detail */
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Owner/manager "change status" override (collapsed by default) */
.status-more { margin-top: 10px; }
.status-more summary { cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 700; list-style: none; padding: 4px 0; }
.status-more summary::-webkit-details-marker { display: none; }
.status-more summary::before { content: "⚙ "; }
.status-more .bigbtn { font-size: 14px; padding: 11px 14px; }

/* Progress block (auto from status; slider only while Working) */
.prog-block .prog { height: 10px; }
.prog-label { font-weight: 700; font-size: 13px; color: #334155; }
.prog-hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.bigbtn.start.block, .bigbtn.accept.block { width: 100%; flex: none; }

/* Quick-reply chips */
.quick-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px; }
.chip { border: 1.5px solid var(--line); background: #f8fafc; border-radius: 999px; padding: 9px 15px; font-size: 14px; font-weight: 700; color: #334155; transition: background .12s, border-color .12s; }
.chip:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.chip:active { transform: scale(.97); }

/* Update bar (text on its own row; icons + Send share a perfectly aligned row) */
.update-bar { display: flex; gap: 10px; align-items: stretch; margin-top: 6px; flex-wrap: wrap; }
.update-bar input { flex: 1 1 100%; min-width: 0; height: 46px; }
.update-bar .iconbtn { flex: 0 0 auto; }
.update-bar #addComment { flex: 1 1 auto; justify-content: center; height: 46px; border-radius: 11px; padding: 0 18px; }
/* All controls on the second row are exactly 46px tall with matching corners. */
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 46px; border: 1.5px solid var(--line); border-radius: 11px; background: #fff; font-size: 18px; line-height: 1; cursor: pointer; flex: none; transition: background .12s; padding: 0; margin: 0; }
.iconbtn:hover { background: #f1f5f9; }
.iconbtn.recording, .iconbtn.listening { background: #ffe4e6; border-color: #fda4af; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.voice-prev { background: var(--brand-soft); border-radius: 11px; padding: 9px 13px; margin: 8px 0; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; font-weight: 600; color: var(--brand-ink); }

/* Comment attachments */
.att-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.att-img { width: 100px; height: 100px; object-fit: cover; border-radius: 11px; border: 1px solid var(--line); }
.att-audio { height: 38px; max-width: 240px; }

/* Range / progress slider */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 10px; border-radius: 999px; background: #e6eaf0; padding: 0; }
/* Progress slider: fill the left side (amber = working) so it reads as a bar. */
#progRange { background: linear-gradient(90deg, #fbbf24 0%, #f59e0b var(--p,0%), #e6eaf0 var(--p,0%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); cursor: pointer; box-shadow: 0 2px 6px rgba(226,55,68,.45); border: 3px solid #fff; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--brand); cursor: pointer; border: 3px solid #fff; }

/* ===================== Client + accountability + AI ==================== */
.client-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: #b45309; background: #fff7e6; border: 1px solid #ffe2a8; padding: 3px 10px; border-radius: 8px; }
.product-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: #3730a3; background: #eef2ff; border: 1px solid #c7d2fe; padding: 3px 10px; border-radius: 8px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.field-hint { font-size: 12px; color: var(--muted); margin: -8px 0 14px; }
.client-card { cursor: pointer; }
.ok-txt { color: var(--accent-ink); font-weight: 700; }
.pill.not-accepted { background: #fff3d6; color: #b45309; }

/* Accept button (own the task) */
.bigbtn.accept { background: linear-gradient(180deg,#fb9a2e,#ef7e11); color: #fff; }
.bigbtn.accept.block { width: 100%; flex: none; margin-bottom: 14px; }
.bigbtn.committed { background: var(--accent-soft); color: var(--accent-ink); box-shadow: none; }
.bigbtn.warnline { background: #fff; color: var(--danger); border: 1.5px solid #fecdd3; box-shadow: none; }
.bigbtn.warnline:hover { background: #fff1f3; }
.bigcard.awaiting { border-left-color: var(--warn); background: #fffdf7; }
.awaiting-banner { margin-top: 10px; background: #fff3d6; color: #92500a; font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 9px; }

/* Conflict box */
.conflict-box { background: #fff1f3; border: 1px solid #fecdd3; color: #9f1239; border-radius: 11px; padding: 12px 14px; margin: 12px 0; font-size: 13.5px; line-height: 1.5; }

/* Activity / accountability log */
.act-list { margin-top: 4px; }
.act-item { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.act-item:first-child { border-top: none; }
.act-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--faint); }
.act-accepted, .act-done { background: var(--accent); }
.act-assigned, .act-started, .act-progress { background: var(--info); }
.act-blocked, .act-conflict_raised, .act-reassigned { background: var(--danger); }
.act-conflict_resolved { background: var(--brand); }
.act-who { font-weight: 800; font-size: 13px; }
.act-note { color: var(--muted); }
.act-time { color: var(--faint); font-size: 11px; margin-top: 2px; }

/* Dictation buttons */
.ta-wrap { position: relative; }
.ta-wrap textarea { padding-right: 44px; }
.dictate-btn { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; font-size: 16px; cursor: pointer; }
.dictate-btn:hover { background: #f1f5f9; }
.dictate-btn.listening, .iconbtn.listening { background: #ffe4e6; border-color: #fda4af; animation: pulse 1s infinite; }

/* AI insight panel on the dashboard (at-a-glance) */
.ai-glance { background: linear-gradient(180deg,#fff,#fff8f8); border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: var(--radius); padding: 14px 18px 16px; margin-bottom: 22px; box-shadow: var(--shadow); }
.ai-glance-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.ai-glance-body { margin-top: 4px; }
.ai-glance .ai-line { position: relative; padding: 6px 0 6px 22px; font-size: 14px; line-height: 1.5; border-bottom: 1px solid var(--line-2); }
.ai-glance .ai-line:last-child { border-bottom: none; }
.ai-glance .ai-line::before { content: "▸"; position: absolute; left: 2px; color: var(--brand); font-weight: 800; }
.ai-glance .ai-line.muted { color: var(--muted); }
.ai-glance .ai-line.muted::before { content: ""; }
.ai-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* AI insights (full tab) */
.ai-card { background: linear-gradient(180deg,#fff,#fff7f7); border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.ai-card.muted-card { border-left-color: var(--faint); color: var(--muted); }
.ai-line { position: relative; padding: 7px 0 7px 22px; font-size: 14.5px; line-height: 1.5; border-bottom: 1px solid var(--line-2); }
.ai-line:last-child { border-bottom: none; }
.ai-line::before { content: "▸"; position: absolute; left: 2px; color: var(--brand); font-weight: 800; }
/* AI section heading (from **Heading:**) */
.ai-head { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 2px; }
.ai-head:first-child { margin-top: 0; }
.ai-glance .ai-head { margin: 10px 0 2px; }
.ai-foot { margin-top: 10px; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.load-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.load-row:first-of-type { border-top: none; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0 4px; }
.pager-info { color: var(--muted); font-size: 13px; font-weight: 600; }
.btn[disabled] { opacity: .45; cursor: default; }

/* ----------------------------- Due-date chips -------------------------- */
.due-chip { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.due-chip.due-overdue { color: var(--danger); font-weight: 800; }
.due-chip.due-soon { color: #b45309; font-weight: 800; }

/* ------------------------------- Profiles ------------------------------ */
img.avatar { object-fit: cover; }
.avatar.lg { width: 84px; height: 84px; font-size: 28px; border-radius: 18px; }
.pf-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.pf-avatar-wrap { position: relative; flex: none; }
.pf-photo-btn { position: absolute; right: -6px; bottom: -6px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.25); border: 2px solid #fff; }
.pf-name { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.pf-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.pf-spec { color: var(--brand-ink); font-size: 13px; font-weight: 700; margin-top: 6px; }
.pf-info { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; margin-bottom: 8px; }
.pf-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.pf-row:last-child { border-bottom: none; }
.pf-ico { width: 20px; text-align: center; }
.pf-lbl { color: var(--muted); min-width: 110px; }
.pf-val { font-weight: 600; }
/* Profile workload mini-stats */
.pf-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 6px; }
.pf-stat { background: #f8fafc; border: 1px solid var(--line); border-radius: 11px; padding: 12px 8px; text-align: center; }
.pf-stat-n { font-size: 22px; font-weight: 800; line-height: 1; }
.pf-stat-l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 700; margin-top: 5px; }
.pf-stat.alert .pf-stat-n { color: var(--danger); }
.pf-stat.ok .pf-stat-n { color: var(--accent-ink); }
/* Tasks collapsed under the profile */
.pf-tasks { margin-top: 18px; }
.pf-tasks summary { cursor: pointer; font-weight: 800; font-size: 13px; color: var(--text); padding: 8px 0; list-style: none; }
.pf-tasks summary::-webkit-details-marker { display: none; }
.pf-tasks summary::before { content: "▸ "; color: var(--brand); }
.pf-tasks[open] summary::before { content: "▾ "; }
@media (max-width: 640px) { .pf-stats { grid-template-columns: repeat(2, 1fr); } }
/* Clickable name + avatar buttons (Who's Doing What / Team) */
.av-btn { background: none; border: none; padding: 0; cursor: pointer; }
.link-name { background: none; border: none; padding: 0; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; text-align: left; }
.link-name:hover { color: var(--brand-strong); text-decoration: underline; }

/* --------------------------- AI status dot ----------------------------- */
.ai-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #c2cad6; padding: 0 8px; white-space: nowrap; }
.ai-dot i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); display: inline-block; }
.ai-dot.online i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.ai-dot.offline i { background: #ef4444; }

/* --------------------- Due-soon banner (My Work Today) ----------------- */
.due-banner { background: linear-gradient(180deg,#fff7e6,#fff3d6); border: 1px solid #ffe2a8; border-left: 5px solid var(--warn); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.due-banner b { color: #92500a; }
.due-banner .db-item { font-size: 13.5px; color: #7a4708; padding: 3px 0; }

/* Task group headings (Overdue / Today / This week / Later) */
.group-head { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; margin: 20px 0 10px; }
.group-head .gh-count { background: var(--line); color: var(--muted); border-radius: 999px; padding: 1px 9px; font-size: 11px; }
.group-head.gh-overdue { color: var(--danger); } .group-head.gh-overdue .gh-count { background: #ffe4e6; color: var(--danger); }
.group-head.gh-today { color: #b45309; } .group-head.gh-today .gh-count { background: #fff3d6; color: #b45309; }

/* ------------------------------ Global search -------------------------- */
.search-overlay { position: fixed; inset: 0; background: rgba(8,15,30,.5); backdrop-filter: blur(3px); z-index: 120; display: flex; justify-content: center; align-items: flex-start; padding: 80px 16px 16px; animation: fade .15s ease; }
.search-box { width: 100%; max-width: 620px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease; }
.search-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search-ico { font-size: 18px; }
.search-input-row input { border: none; font-size: 17px; flex: 1; padding: 4px 0; }
.search-input-row input:focus { outline: none; box-shadow: none; }
.search-results { max-height: 60vh; overflow-y: auto; padding: 6px; }
.search-hint { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.search-group { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 12px 6px; }
.search-item { display: block; width: 100%; text-align: left; background: transparent; border: none; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.search-item:hover { background: var(--brand-soft); }
.si-title { display: block; font-weight: 700; font-size: 14px; }
.si-sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ------------------------------ Responsive ----------------------------- */
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px 12px; }
  .topbar-left { flex: 1 1 auto; }
  .topbar-right { gap: 8px; flex: none; }
  /* The profile chip becomes a compact icon button (just the caret stays an
     affordance) — keep the name hidden but make the button look intentional. */
  .me { display: none; }
  .me-btn { width: 40px; height: 40px; justify-content: center; padding: 0; border-radius: 11px; }
  .me-btn::before { content: "👤"; font-size: 17px; }
  .me-btn .caret { display: none; }
  /* AI dot: show only the lamp, hide the "AI online" text to save room. */
  .ai-dot { padding: 0 4px; }
  .ai-dot span { display: none; }
  .tabs { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; }
  /* Profile menu spans nicely on small screens. */
  .profile-menu { min-width: 200px; }
}
@media (max-width: 760px) {
  /* Too many stat cards to fit cleanly — let the row scroll sideways. */
  .stats { grid-auto-columns: minmax(130px, 1fr); overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .stats::-webkit-scrollbar { display: none; }
}
@media (max-width: 640px) {
  .main { padding: 18px 14px 64px; }
  .page-head h2 { font-size: 21px; }
  .row2 { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .bigcard-title { font-size: 17px; }
  .notif-panel { top: auto; }
}
