/* ============ TaskQuest — Linear-inspired system ============ */
:root {
  --accent: #5E6AD2;
  --accent-hover: #6872E5;
  --accent-soft: rgba(94, 106, 210, 0.14);
  --accent-fg: #ffffff;

  --green: #4cb782;
  --green-soft: rgba(76, 183, 130, 0.14);
  --amber: #f2c94c;
  --amber-soft: rgba(242, 201, 76, 0.16);
  --red: #eb5757;
  --red-soft: rgba(235, 87, 87, 0.14);
  --purple: #8b7cf6;
  --purple-soft: rgba(139, 124, 246, 0.16);
  --blue: #4ea7fc;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.10);
  --shadow-pop: 0 8px 28px rgba(0,0,0,0.16);

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ---------- Light theme ---------- */
[data-theme="light"] {
  --bg: #f7f8f9;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, rgba(94,106,210,0.06), transparent 60%);
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --surface-3: #f2f3f5;
  --column-bg: #f1f2f4;
  --border: #e7e8ec;
  --border-strong: #d8dade;
  --text: #1a1b1f;
  --text-2: #3c3f45;
  --muted: #6b7079;
  --faint: #9ca1ab;
  --overlay: rgba(20, 22, 28, 0.42);
  --tile-bg: #ffffff;
  --hover: rgba(0,0,0,0.035);
  --header-bg: rgba(255,255,255,0.72);
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg: #0a0a0d;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, rgba(94,106,210,0.10), transparent 60%);
  --surface: #131318;
  --surface-2: #16161c;
  --surface-3: #1d1d25;
  --column-bg: #101015;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.13);
  --text: #f4f5f7;
  --text-2: #c8cbd2;
  --muted: #878b94;
  --faint: #5e626c;
  --overlay: rgba(0, 0, 0, 0.6);
  --tile-bg: #17171d;
  --hover: rgba(255,255,255,0.04);
  --header-bg: rgba(13,13,17,0.72);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-grad);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
}
#root { height: 100vh; display: flex; flex-direction: column; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
::selection { background: var(--accent-soft); }
.tabnum { font-variant-numeric: tabular-nums; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; border: 3px solid transparent; }

/* ============ Header ============ */
.app-header {
  height: 56px; flex: 0 0 56px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  position: relative; z-index: 60;
}
.brand { display: flex; align-items: center; gap: 9px; padding-right: 6px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(150deg, var(--accent), #8b7cf6);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 2px 8px rgba(94,106,210,0.4);
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.brand-name b { color: var(--accent); }
.header-divider { width: 1px; height: 22px; background: var(--border); }

.hbtn {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  height: 32px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: 13px;
  border: 1px solid transparent;
  transition: background .14s, border-color .14s, color .14s;
}
.hbtn:hover { background: var(--hover); color: var(--text); }
.hbtn .chev { color: var(--faint); }
.hbtn.bordered { border-color: var(--border); background: var(--surface); }
.hbtn.bordered:hover { border-color: var(--border-strong); }
.spacer { flex: 1; }

.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: grid; place-items: center; color: var(--muted);
  transition: background .14s, color .14s; position: relative;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.notif-dot {
  position: absolute; top: 6px; right: 6px; min-width: 15px; height: 15px;
  padding: 0 3px; border-radius: 8px; background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--red);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px;
  letter-spacing: -0.02em; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
.avatar.lg { width: 36px; height: 36px; flex-basis: 36px; font-size: 13px; }
.avatar.sm { width: 22px; height: 22px; flex-basis: 22px; font-size: 9.5px; }
.avatar.xs { width: 19px; height: 19px; flex-basis: 19px; font-size: 8.5px; }

/* ============ Dropdown / Popover ============ */
.pop {
  position: absolute; z-index: 80;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 5px; min-width: 220px;
  animation: pop-in .16s var(--ease);
  transform-origin: top;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.pop-label { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px 4px; }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; white-space: nowrap;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-2); font-weight: 500; text-align: left;
  transition: background .12s;
}
.pop-item:hover { background: var(--hover); color: var(--text); }
.pop-item.active { color: var(--text); }
.pop-item .check { margin-left: auto; color: var(--accent); display: flex; }
.pop-item .role-meta { margin-left: auto; font-size: 11px; color: var(--faint); font-weight: 500; }
.pop-sep { height: 1px; background: var(--border); margin: 5px 4px; }

/* ============ Body layout ============ */
.app-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.scroll-area { flex: 1; overflow-y: auto; overflow-x: hidden; }
.content { max-width: 1480px; margin: 0 auto; padding: 22px 26px 30px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 21px; font-weight: 700; letter-spacing: -0.025em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.role-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent);
}

/* ============ Summary cards ============ */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr) 1.5fr; gap: 14px; margin-bottom: 24px; }
@media (max-width: 1080px) { .summary-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .18s var(--ease), border-color .18s, box-shadow .18s;
}
.stat-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-top { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 12px; line-height: 1; display: flex; align-items: baseline; gap: 6px; }
.stat-value .unit { font-size: 15px; font-weight: 600; color: var(--muted); }
.stat-foot { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 5px; }
.trend-up { color: var(--green); font-weight: 700; }
.trend-down { color: var(--red); font-weight: 700; }
.progress-track { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: 13px; }
.progress-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), #8b7cf6); transition: width .7s var(--ease); }
.rank-badge { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.rank-badge .hash { color: var(--faint); font-size: 19px; font-weight: 700; }

/* leaderboard preview card */
.lb-card { grid-column: span 1; }
.lb-card .stat-top { margin-bottom: 12px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.lb-rank { width: 18px; text-align: center; font-weight: 700; font-size: 12px; color: var(--faint); }
.lb-rank.top { color: var(--amber); }
.lb-name { font-size: 13px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-pts { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.lb-pts span { color: var(--faint); font-weight: 500; font-size: 11px; }
.lb-row.me { background: var(--accent-soft); margin: 2px -8px; padding: 5px 8px; border-radius: var(--radius-sm); }

/* ============ Kanban ============ */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1080px) { .board { grid-template-columns: repeat(2, 1fr); } }
.column {
  background: var(--column-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 6px; display: flex; flex-direction: column;
  min-height: 200px; transition: background .15s, border-color .15s, box-shadow .15s;
}
.column.drag-over { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.column.drag-over.invalid { background: var(--red-soft); border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 9px; }
.col-dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.col-name { font-weight: 600; font-size: 13px; letter-spacing: -0.01em; white-space: nowrap; }
.col-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--faint); background: var(--surface-3); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; display: grid; place-items: center; }
.col-list { display: flex; flex-direction: column; gap: 7px; padding: 2px 3px 6px; min-height: 390px; max-height: 390px; overflow-y: auto; overflow-x: hidden; }
.col-empty { font-size: 12px; color: var(--faint); text-align: center; padding: 18px 8px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md); margin: 2px 3px; }

/* ============ Task tile ============ */
.tile {
  background: var(--tile-bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 11px 12px; box-shadow: var(--shadow-sm);
  cursor: pointer; position: relative; overflow: hidden; flex-shrink: 0;
  transition: border-color .14s, box-shadow .14s, transform .1s;
  animation: tile-in .25s var(--ease);
}
@keyframes tile-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.tile:active { cursor: grabbing; }
.tile.dragging { opacity: 0.4; }
.tile-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.tile.has-bar { padding-left: 14px; }
.tile-title { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; color: var(--text); }
.tile-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tile-id { font-size: 11px; color: var(--faint); font-weight: 600; white-space: nowrap; }
.tile-due { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.tile-due.overdue { color: var(--red); }
.tile-spacer { flex: 1; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 7px;
  border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.badge.overdue { background: var(--red-soft); color: var(--red); }
.badge.pending { background: var(--amber-soft); color: #b88a00; }
[data-theme="dark"] .badge.pending { color: var(--amber); }
.badge.approved { background: var(--green-soft); color: var(--green); }
.badge.ontime { background: var(--green-soft); color: var(--green); }
.badge.late { background: var(--surface-3); color: var(--muted); }
.tile-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
.tile-project { font-size: 10.5px; font-weight: 600; color: var(--faint); display: inline-flex; align-items: center; gap: 5px; }
.tile-project .pdot { width: 7px; height: 7px; border-radius: 50%; }

/* tile compact variant */
.tile.compact { padding: 9px 11px; }
.tile.compact.has-bar { padding-left: 13px; }
.tile.compact .tile-meta { margin-top: 7px; }
.tile.compact .tile-title { font-size: 13px; }
/* tile spacious variant */
.tile.spacious { padding: 14px 15px; }
.tile.spacious .tile-title { font-size: 14px; }

/* ============ FAB ============ */
.fab {
  position: fixed; right: 30px; bottom: 30px; z-index: 50;
  height: 48px; padding: 0 20px 0 16px; border-radius: 26px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 9px;
  box-shadow: 0 8px 24px rgba(94,106,210,0.45), 0 2px 6px rgba(0,0,0,0.2);
  transition: transform .16s var(--ease), background .14s; 
}
.fab:hover { background: var(--accent-hover); transform: translateY(-2px); }
.fab:active { transform: translateY(0); }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: var(--overlay);
  backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fade-in .18s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; max-height: 88vh; display: flex; flex-direction: column;
  animation: modal-in .22s var(--ease); overflow: hidden;
}
.modal.wide { max-width: 560px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.modal-head .mh-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 34px; }
.modal-title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.modal-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.modal-x { margin-left: auto; }
.modal-body { padding: 18px 20px; overflow-y: auto; overflow-x: hidden; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.modal-foot .spacer { flex: 1; }

/* form */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field-label .req { color: var(--red); }
.input, .textarea, .select-field {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px; color: var(--text);
  font-size: 13.5px; transition: border-color .14s, box-shadow .14s, background .14s;
}
.input:focus, .textarea:focus, .select-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
.select-field { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca1ab' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }

.assignee-grid { display: flex; flex-direction: column; gap: 6px; }
.assignee-opt {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color .12s, background .12s; background: var(--surface-2);
}
.assignee-opt:hover { border-color: var(--border-strong); }
.assignee-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.assignee-opt .ao-name { font-size: 13px; font-weight: 600; white-space: nowrap; }
.assignee-opt .ao-check { margin-left: auto; color: var(--accent); opacity: 0; }
.assignee-opt.sel .ao-check { opacity: 1; }

/* btns */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  height: 36px; padding: 0 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; transition: background .14s, border-color .14s, transform .08s, opacity .14s;
  border: 1px solid transparent;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-fg); box-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { color: var(--text-2); border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { background: var(--hover); border-color: var(--border-strong); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-soft-danger { color: var(--red); border-color: var(--border); background: var(--surface); }
.btn-soft-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { filter: brightness(1.05); }
.btn-block { width: 100%; }

/* detail modal pieces */
.detail-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-k { font-size: 12px; color: var(--muted); font-weight: 600; width: 96px; flex: 0 0 96px; padding-top: 1px; }
.detail-v { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }
.comment-list { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; max-height: 230px; overflow-y: auto; padding-right: 4px; }
.comment {
  display: flex; gap: 10px;
}
.comment-body { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 9px 11px; }
.comment-top { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.comment-author { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.comment-role { font-size: 10.5px; color: var(--faint); font-weight: 600; white-space: nowrap; }
.comment-time { font-size: 10.5px; color: var(--faint); margin-left: auto; }
.comment-text { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.comment-sys { background: var(--accent-soft); border-color: transparent; }
.comment-empty { font-size: 12.5px; color: var(--faint); text-align: center; padding: 16px; }
.comment-compose { display: flex; gap: 9px; margin-top: 14px; align-items: flex-start; }
.section-label { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin: 4px 0 8px; }

/* bonus options */
.bonus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bonus-opt {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 10px;
  text-align: center; cursor: pointer; transition: border-color .14s, background .14s, transform .1s;
  background: var(--surface-2);
}
.bonus-opt:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.bonus-opt.sel { border-color: var(--amber); background: var(--amber-soft); }
.bonus-pts { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.bonus-pts .plus { color: var(--amber); }
.bonus-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 600; }

/* notifications */
.notif-pop { width: 360px; max-width: 92vw; padding: 0; overflow: hidden; }
.notif-head { display: flex; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.notif-head-title { font-weight: 700; font-size: 14px; }
.notif-mark { margin-left: auto; font-size: 12px; color: var(--accent); font-weight: 600; }
.notif-mark:hover { text-decoration: underline; }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif {
  display: flex; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--border);
  transition: background .12s; cursor: pointer; position: relative;
}
.notif:hover { background: var(--hover); }
.notif:last-child { border-bottom: none; }
.notif.unread { background: var(--accent-soft); }
.notif.unread:hover { background: var(--accent-soft); filter: brightness(1.04); }
.notif-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 30px; }
.notif-c { flex: 1; min-width: 0; }
.notif-text { font-size: 12.5px; color: var(--text); line-height: 1.45; }
.notif-text b { font-weight: 700; }
.notif-time { font-size: 11px; color: var(--faint); margin-top: 3px; }
.notif-empty { padding: 40px 20px; text-align: center; color: var(--faint); font-size: 13px; }

/* recognition activity (DM) */
.activity-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.activity-row { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); align-items: center; }
.activity-row:last-child { border-bottom: none; }
.activity-text { font-size: 13px; flex: 1; }
.activity-text b { font-weight: 700; }
.activity-pts { font-size: 13px; font-weight: 800; color: var(--amber); }
.activity-time { font-size: 11px; color: var(--faint); }

/* toast */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; color: var(--text);
  animation: toast-in .28s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.toast .toast-ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 22px; }

/* calendar */
.cal { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-month { font-size: 13px; font-weight: 700; }
.cal-nav { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.cal-nav:hover { background: var(--hover); color: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { font-size: 10px; font-weight: 700; color: var(--faint); text-align: center; padding: 4px 0; text-transform: uppercase; }
.cal-day { aspect-ratio: 1; display: grid; place-items: center; font-size: 12px; font-weight: 500; border-radius: 7px; cursor: pointer; transition: background .1s; color: var(--text-2); }
.cal-day:hover { background: var(--hover); }
.cal-day.muted { color: var(--faint); opacity: .45; }
.cal-day.sel { background: var(--accent); color: #fff; font-weight: 700; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.cal-day.disabled { opacity: .25; cursor: not-allowed; pointer-events: none; }

/* approvals banner inside detail */
.approval-box { background: var(--amber-soft); border: 1px solid rgba(242,201,76,0.4); border-radius: var(--radius-md); padding: 12px 13px; margin-bottom: 16px; }
.approval-box.done { background: var(--green-soft); border-color: rgba(76,183,130,0.4); }
.approval-title { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.approval-meta { font-size: 12px; color: var(--text-2); margin-top: 6px; line-height: 1.5; }
.approval-actions { display: flex; gap: 8px; margin-top: 11px; }
.approval-date-edit { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.approval-date-edit .input { height: 32px; }

/* ============ Admin ============ */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1080px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-col { display: flex; flex-direction: column; gap: 16px; }
.admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.admin-card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.admin-card-title { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.admin-card-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.admin-list { display: flex; flex-direction: column; }
.admin-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.admin-row:last-child { border-bottom: none; }
.admin-row-name { font-size: 13.5px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-tag { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.role-tag.t-consultant { background: var(--accent-soft); color: var(--accent); }
.role-tag.t-pm { background: var(--purple-soft); color: var(--purple); }
.role-tag.t-dm { background: var(--red-soft); color: var(--red); }
.role-tag.t-admin { background: var(--surface-3); color: var(--muted); }
.role-tag.t-muted { background: var(--surface-3); color: var(--faint); font-weight: 600; }
.admin-form { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border-strong); display: flex; flex-direction: column; gap: 11px; }
.admin-form-row { display: flex; gap: 9px; }
.admin-form-row .input { flex: 1; }
.swatch-row { display: flex; gap: 7px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 7px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); transition: transform .12s; }
.swatch:hover { transform: scale(1.1); }
.swatch.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }

/* admin: edit profile + segmented toggle */
.admin-edit-btn { width: 28px; height: 28px; flex: none; opacity: .6; }
.admin-edit-btn:hover { opacity: 1; }
.admin-edit-form { padding: 14px; margin: 6px 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2, var(--surface-3)); display: flex; flex-direction: column; gap: 11px; }
.seg-toggle { display: flex; gap: 4px; padding: 3px; background: var(--surface-3); border-radius: var(--radius-sm); }
.seg-btn { flex: 1; height: 30px; border: 0; border-radius: calc(var(--radius-sm) - 3px); background: transparent;
  color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .14s, color .14s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.sel { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.18); }
.admin-danger { margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.admin-danger-confirm { display: flex; flex-direction: column; gap: 10px; }
.admin-danger-text { font-size: 12.5px; line-height: 1.45; color: var(--muted); }

/* multi-project chip picker */
.proj-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.proj-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .14s, border-color .14s, color .14s; }
.proj-chip:hover { background: var(--hover); color: var(--text); }
.proj-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.proj-chip .pdot-sm { width: 9px; height: 9px; }
.proj-chip-name { white-space: nowrap; }
/* multiple project tags on a member row */
.admin-row-projs { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-row-proj.more { color: var(--faint); font-weight: 600; }
.points-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.points-field .field-label { margin-bottom: 7px; }
.num-wrap { position: relative; }
.num-wrap .input { padding-right: 38px; }
.num-suffix { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--faint); font-weight: 600; pointer-events: none; }
.formula-box { margin-top: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; }
.formula-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.formula-k { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.formula-v { font-size: 12px; color: var(--text-2); font-weight: 600; text-align: right; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .es-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 14px; color: var(--faint); }
.empty-state h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }

/* fade for role transitions */
.view-fade { animation: view-in .3s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ============ Login ============ */
.login-stage { height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden; }
@media (max-width: 880px) { .login-stage { grid-template-columns: 1fr; } .login-brand { display: none !important; } }

.login-brand {
  position: relative; overflow: hidden; padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(139,124,246,0.45), transparent 55%),
    radial-gradient(800px 600px at 90% 90%, rgba(94,106,210,0.55), transparent 55%),
    linear-gradient(150deg, #2a2f6a, #14152b 70%);
  color: #fff;
}
.login-brand::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 38px 38px; -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%); mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%); pointer-events: none;
}
.login-brand-top { display: flex; align-items: center; gap: 11px; position: relative; z-index: 2; }
.login-brand-name { font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.login-brand-mid { position: relative; z-index: 2; }
.login-tagline { font-size: 34px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; max-width: 420px; text-wrap: balance; }
.login-sub { font-size: 15px; color: rgba(255,255,255,0.7); margin-top: 16px; max-width: 380px; line-height: 1.5; }
.login-mini-board { display: flex; gap: 10px; margin-top: 36px; max-width: 460px; }
.lmb-col { flex: 1; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; padding: 9px; backdrop-filter: blur(8px); }
.lmb-col-h { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.75); margin-bottom: 8px; }
.lmb-dot { width: 7px; height: 7px; border-radius: 2px; }
.lmb-card { height: 24px; border-radius: 7px; background: rgba(255,255,255,0.13); margin-bottom: 6px; }
.lmb-card.sm { width: 70%; }
.login-brand-foot { font-size: 12.5px; color: rgba(255,255,255,0.55); position: relative; z-index: 2; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--bg); background-image: var(--bg-grad); position: relative; }
.login-theme-btn { position: absolute; top: 20px; right: 20px; }
.login-card { width: 100%; max-width: 380px; }
.login-card-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 28px; }
@media (max-width: 880px) { .login-card-mobile-brand { display: flex; } }
.login-h { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.login-hsub { color: var(--muted); font-size: 14px; margin-top: 5px; margin-bottom: 26px; }
.login-form .field { margin-bottom: 15px; }
.login-pw-wrap { position: relative; }
.login-pw-wrap .input { padding-right: 42px; }
.login-pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--faint); }
.login-pw-toggle:hover { color: var(--text); background: var(--hover); }
.login-error { display: flex; align-items: center; gap: 8px; background: var(--red-soft); color: var(--red); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px; font-weight: 600; margin-bottom: 15px; animation: pop-in .16s var(--ease); }
.login-submit { width: 100%; height: 42px; font-size: 14px; margin-top: 4px; }
.login-demo { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.login-demo-label { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 11px; display: flex; align-items: center; gap: 7px; }
.login-demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.login-demo-acct {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .12s, background .12s, transform .08s;
}
.login-demo-acct:hover { border-color: var(--accent); background: var(--accent-soft); }
.login-demo-acct:active { transform: scale(.98); }
.lda-meta { min-width: 0; }
.lda-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lda-role { font-size: 10.5px; color: var(--faint); font-weight: 600; white-space: nowrap; }
.login-hint { font-size: 11.5px; color: var(--faint); margin-top: 14px; text-align: center; line-height: 1.6; }
.login-hint code { background: var(--surface-3); padding: 1px 6px; border-radius: 5px; font-size: 11px; color: var(--text-2); }

/* account menu (header avatar) */
.acct-card { padding: 11px 12px; display: flex; align-items: center; gap: 11px; }
.acct-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.acct-user { font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.acct-trigger { padding: 0; border-radius: 50%; background: none; }

/* ============ Task inline edit form ============ */
.task-edit-form { display: flex; flex-direction: column; gap: 14px; padding: 14px; margin-bottom: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }

/* Danger button */
.btn-danger { background: #e05252; color: #fff; border: none; }
.btn-danger:hover { background: #c94040; }

/* ============ Board employee filter bar ============ */
.board-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.board-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--faint);
  white-space: nowrap;
}
.board-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bfc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.bfc:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.bfc.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ============ Stacked signed-in identity (name over role) ============ */
.hbtn.identity {
  height: auto;
  padding: 5px 11px;
  align-items: center;
}
.identity-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.identity-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.identity-role {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--faint);
  white-space: nowrap;
}

/* ============ Searchable select (combobox) ============ */
.ssel {
  position: relative;
}
.ssel-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s, background .14s;
  text-align: left;
}
.ssel-trigger:hover {
  border-color: var(--border-strong);
}
.ssel-trigger .chev {
  margin-left: auto;
  color: var(--faint);
  flex: none;
}
.ssel-cur {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
.ssel-ph {
  color: var(--faint);
}
.ssel-pop {
  position: absolute;
  z-index: 90;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: pop-in .14s var(--ease);
}
.ssel-search {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-bottom: 6px;
}
.ssel-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.ssel-input::placeholder {
  color: var(--faint);
}
.ssel-list {
  max-height: 230px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ssel-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  transition: background .12s;
}
.ssel-opt:hover {
  background: var(--hover, var(--surface-3));
}
.ssel-opt.sel {
  background: var(--accent-soft);
}
.ssel-opt-c {
  flex: 1;
  min-width: 0;
}
.ssel-check {
  color: var(--accent);
  flex: none;
}
.ssel-empty {
  font-size: 12.5px;
  color: var(--faint);
  text-align: center;
  padding: 14px 8px;
}
.ssel-person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.ssel-person-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ssel-person-role {
  font-size: 11px;
  color: var(--faint);
  font-weight: 600;
  white-space: nowrap;
  margin-left: auto;
  padding-left: 8px;
}

/* ============ Sub-category chooser ============ */
.subcat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.subcat-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.subcat-opt:hover {
  border-color: var(--border-strong);
}
.subcat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

/* ============ Reassign inline box ============ */
.reassign-box {
  margin: -2px 0 14px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.reassign-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}

/* ============ Task description block ============ */
.task-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-2);
  white-space: pre-wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
}

/* ============ Unassigned-members banner (manager visibility) ============ */
.unassigned-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 4px 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(242,201,76,0.4);
  background: var(--amber-soft);
  border-radius: var(--radius-md);
}
.ub-ic {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: rgba(242,201,76,0.22);
  color: #b88a00;
}
.ub-body {
  flex: 1;
  min-width: 0;
}
.ub-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.ub-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ub-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

/* ============ Compact date field ============ */
.datefield {
  position: relative;
}
.datefield-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s, background .14s;
  text-align: left;
}
.datefield-trigger:hover {
  border-color: var(--border-strong);
}
.datefield-trigger .chev {
  margin-left: auto;
  color: var(--faint);
  flex: none;
}
.datefield-trigger .df-ph {
  color: var(--faint);
}
.datefield-trigger .df-val {
  font-weight: 600;
}
.datefield-pop {
  position: absolute;
  z-index: 90;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  animation: pop-in .14s var(--ease);
  min-width: 268px;
}
