:root {
  --bg: #f6f5fb;
  --card: #ffffff;
  --text: #1a1736;
  --text-2: #4a4766;
  --muted: #8b88a6;
  --border: #ebe9f5;
  --border-2: #dcd8ee;
  --primary: #6d28d9;
  --primary-soft: #f1ebff;
  --grad: linear-gradient(135deg, #7c3aed 0%, #c026d3 55%, #ec4899 100%);
  --todo: #6366f1;
  --progress: #f59e0b;
  --done: #10b981;
  --high: #ef4444;
  --medium: #f97316;
  --low: #22c55e;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(26, 23, 54, .05);
  --shadow: 0 1px 2px rgba(26, 23, 54, .04), 0 8px 24px rgba(26, 23, 54, .06);
  --shadow-lg: 0 24px 60px rgba(26, 23, 54, .18);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); margin: 0; font-size: 14px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h3 { font-size: 16px; font-weight: 700; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; display: block; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }

/* ========== buttons ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border-2); background: #fff; color: var(--text);
  padding: 10px 16px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .12s, box-shadow .2s, background .2s; white-space: nowrap;
}
.btn:hover { background: #faf9ff; box-shadow: var(--shadow); }
.btn:active { transform: scale(.98); }
.btn svg.i { width: 16px; height: 16px; }
.btn-primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(124, 58, 237, .3); }
.btn-primary:hover { background: var(--grad); box-shadow: 0 10px 24px rgba(124, 58, 237, .4); filter: brightness(1.05); }
.btn-lg { padding: 13px 20px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-danger { color: var(--high); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn:disabled { opacity: .6; cursor: wait; }
.icon-btn { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 8px; border-radius: 10px; }
.icon-btn:hover { background: #f3f2f9; color: var(--text); }
.link-btn { border: 0; background: none; color: var(--primary); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; }
.link-btn:hover { background: var(--primary-soft); }
.link-btn svg.i { width: 15px; height: 15px; }

/* ========== inputs ========== */
input, select, textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  padding: 11px 14px; border: 1.5px solid var(--border-2); border-radius: 12px; background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #b3b0c9; }
input:focus, select:focus, textarea:focus { border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }
input[type=date] { cursor: pointer; }
textarea { resize: vertical; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.error { color: var(--high); font-size: 13px; font-weight: 500; min-height: 18px; margin-bottom: 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.input-ico { position: relative; }
.input-ico > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-ico > i svg { width: 17px; height: 17px; }
.input-ico input { padding-left: 42px; padding-right: 44px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 8px; cursor: pointer; border-radius: 8px; }
.eye:hover { color: var(--text); background: #f3f2f9; }
.eye svg { width: 17px; height: 17px; }

/* ========== custom dropdown ========== */
select.enhanced { display: none; }
.dd { position: relative; display: inline-block; min-width: 170px; }
#f-date + .dd, #d-date + .dd { min-width: 200px; }
.field .dd { display: block; width: 100%; }
.dd-btn {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px 12px 10px 14px;
  background: #fff; border: 1.5px solid var(--border-2); border-radius: 12px; font: inherit; font-size: 14px;
  color: var(--text); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s;
}
.dd-btn:hover { border-color: #c4b5fd; }
.dd.open .dd-btn { border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }
.dd.active .dd-btn { background: var(--primary-soft); border-color: #c4b5fd; color: var(--primary); }
.dd-btn .lead { color: var(--muted); }
.dd.active .dd-btn .lead { color: var(--primary); }
.dd-btn .lead svg { width: 16px; height: 16px; }
.dd-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.dd-label small { color: var(--muted); font-weight: 500; margin-right: 4px; }
.dd.active .dd-label small { color: #8b5cf6; }
.dd-btn .chev { color: var(--muted); transition: transform .2s; }
.dd-btn .chev svg { width: 16px; height: 16px; }
.dd.open .chev { transform: rotate(180deg); }
.dd-menu {
  position: fixed; z-index: 80;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 6px; max-height: 300px; overflow-y: auto; animation: pop .14s ease-out;
}
.dd-opt {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none;
  font: inherit; font-size: 14px; color: var(--text); border-radius: 9px; cursor: pointer; text-align: left; white-space: nowrap;
}
.dd-opt:hover, .dd-opt.kb { background: #f5f3ff; }
.dd-opt.sel { color: var(--primary); font-weight: 600; }
.dd-opt .tick { margin-left: auto; color: var(--primary); opacity: 0; padding-left: 12px; }
.dd-opt.sel .tick { opacity: 1; }
.dd-opt .tick svg { width: 16px; height: 16px; }
.cdot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dd-opt .avatar, .dd-btn .avatar { width: 22px; height: 22px; font-size: 10px; border-width: 0; box-shadow: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ========== login ========== */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.login-art {
  position: relative; overflow: hidden; color: #fff; padding: 56px;
  background: linear-gradient(150deg, #4c1d95 0%, #7c3aed 45%, #db2777 100%);
  display: flex; align-items: center;
}
.blob { position: absolute; border-radius: 50%; filter: blur(10px); opacity: .55; }
.b1 { width: 360px; height: 360px; background: #f472b6; top: -120px; right: -100px; }
.b2 { width: 280px; height: 280px; background: #818cf8; bottom: -80px; left: -60px; }
.b3 { width: 160px; height: 160px; background: #fbbf24; bottom: 18%; right: 14%; opacity: .35; }
.login-art-inner { position: relative; max-width: 460px; }
.login-art h1 { font-size: 52px; line-height: 1.08; font-weight: 800; margin: 28px 0 32px; letter-spacing: -0.035em; }
.login-art h1 span { background: linear-gradient(90deg, #fde68a, #fbcfe8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.login-points li { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; opacity: .95; }
.login-points li span { width: 36px; height: 36px; border-radius: 11px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(4px); }
.login-points svg { width: 18px; height: 18px; }
.login-side { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 380px; }
.logo-row { display: flex; align-items: center; gap: 10px; font-size: 16px; margin-bottom: 36px; }
.login-card h2 { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.login-card .muted { margin-bottom: 28px; }
.login-card .btn-lg svg { width: 17px; height: 17px; }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 20px; }

.logo-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(124, 58, 237, .35); }
.logo-mark svg { width: 20px; height: 20px; }
.logo-mark.lg { width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .18); box-shadow: none; backdrop-filter: blur(6px); }
.logo-mark.lg svg { width: 28px; height: 28px; }
.logo-mark.light { background: rgba(255, 255, 255, .18); box-shadow: none; }

/* ========== layout ========== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; color: #fff; padding: 22px 14px; display: flex; flex-direction: column;
  background: linear-gradient(185deg, #2e1065 0%, #5b21b6 50%, #9d174d 100%);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; gap: 11px; align-items: center; margin: 0 6px 30px; }
.brand-title { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.brand-org { font-size: 12px; opacity: .7; margin-top: 1px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .5; font-weight: 700; margin: 0 12px 10px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav { display: none; }
.nav-item {
  display: flex; gap: 12px; align-items: center; text-align: left; padding: 11px 12px; border-radius: 12px;
  border: 0; background: transparent; color: rgba(255, 255, 255, .72); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.nav-item.active { background: #fff; color: var(--primary); box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
.nav-badge { margin-left: auto; background: #f472b6; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.nav-badge:empty { display: none; }
.nav-item.active .nav-badge { background: var(--primary-soft); color: var(--primary); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; margin-top: 24px; }
.me-info { flex: 1; min-width: 0; }
.me-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { font-size: 11px; opacity: .7; text-transform: capitalize; }
.logout-mini { border: 0; background: rgba(255, 255, 255, .12); color: #fff; padding: 8px; border-radius: 10px; cursor: pointer; }
.logout-mini:hover { background: rgba(255, 255, 255, .25); }
.logout-mini svg { width: 16px; height: 16px; }

.main { flex: 1; padding: 26px 34px 40px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 16px; }
.topbar h2 { font-size: 26px; font-weight: 800; }
.topbar .muted { margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* user menu */
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; background: #fff; border: 1px solid var(--border); border-radius: 99px; cursor: pointer; font: inherit; color: var(--text); box-shadow: var(--shadow-sm); }
.user-btn:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.user-btn-text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-btn-text b { font-size: 13px; }
.user-btn-text small { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.user-btn > i { color: var(--muted); }
.user-btn > i svg { width: 16px; height: 16px; }
.pop { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 45; animation: pop .14s ease-out; }
.pop-head { display: flex; align-items: center; gap: 10px; padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.pop-head b { display: block; font-size: 14px; }
.pop-head small { color: var(--muted); font-size: 12px; }
.pop-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; background: none; border-radius: 10px; font: inherit; font-weight: 500; color: var(--text); cursor: pointer; }
.pop-item:hover { background: #f5f3ff; }
.pop-item svg { width: 17px; height: 17px; color: var(--muted); }
.pop-item.danger { color: var(--high); }
.pop-item.danger svg { color: var(--high); }
.pop-item.danger:hover { background: #fef2f2; }

/* panels */
.panel { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; min-height: 28px; }
.pill { background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 99px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.team-grid { align-items: start; }

/* toolbar / filters */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.greet { font-size: 15px; color: var(--text-2); }
.greet b { color: var(--text); }
.filters { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search i svg { width: 16px; height: 16px; }
.search input { padding-left: 38px; }
.range { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid #c4b5fd; border-radius: 12px; padding: 4px 6px; }
.range input { border: 0; padding: 6px 8px; width: 140px; box-shadow: none !important; }
.range span { color: var(--muted); font-size: 13px; }

/* avatar */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
  color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .02em;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.lg { width: 42px; height: 42px; font-size: 14px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 20px; }
.stat {
  border-radius: var(--radius); padding: 18px 18px 16px; color: #fff; position: relative; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .2s;
}
.stat::after { content: ''; position: absolute; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .12); right: -40px; bottom: -60px; }
.stat:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(26, 23, 54, .16); }
.stat .ico { width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, .22); margin-bottom: 14px; }
.stat .ico svg { width: 19px; height: 19px; }
.stat .num { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.stat .lbl { font-size: 13px; font-weight: 600; opacity: .9; margin-top: 6px; }
.s-total { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.s-todo { background: linear-gradient(135deg, #4f46e5, #0ea5e9); }
.s-progress { background: linear-gradient(135deg, #f59e0b, #f97316); }
.s-done { background: linear-gradient(135deg, #059669, #14b8a6); }
.s-overdue { background: linear-gradient(135deg, #e11d48, #ec4899); }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.donut { width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; background: #eee; flex-shrink: 0; }
.donut-hole { width: 120px; height: 120px; border-radius: 50%; background: #fff; display: grid; place-items: center; align-content: center; }
.donut-hole span { font-size: 28px; font-weight: 800; color: var(--done); letter-spacing: -0.02em; }
.donut-hole small { color: var(--muted); font-size: 12px; font-weight: 500; }
.legend { display: grid; gap: 12px; font-size: 14px; flex: 1; min-width: 160px; }
.legend div { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.legend b { margin-left: auto; color: var(--text); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* team progress */
.tp-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.tp-row:last-child { margin-bottom: 0; }
.tp-info { flex: 1; min-width: 0; }
.tp-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.tp-top b { font-weight: 700; color: var(--text); }
.bar { height: 8px; border-radius: 99px; background: #f0eef8; overflow: hidden; display: flex; }
.bar > span { height: 100%; transition: width .4s; }

/* lists & feed */
.mini-list, .feed { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.feed-full { max-height: none; }
.mini-task { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #faf9fe; cursor: pointer; border: 1px solid transparent; transition: .15s; }
.mini-task:hover { background: #fff; border-color: var(--border-2); box-shadow: var(--shadow); }
.mini-task .bullet { width: 8px; height: 8px; border-radius: 50%; background: var(--todo); flex-shrink: 0; }
.mini-task.st-inprogress .bullet { background: var(--progress); }
.mini-task .t { flex: 1; font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }
.empty .em { font-size: 26px; display: block; margin-bottom: 6px; }

.feed-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 12px; }
.feed-item:hover { background: #faf9fe; }
.feed-text { font-size: 14px; flex: 1; color: var(--text-2); line-height: 1.55; }
.feed-text b { color: var(--text); }
.task-link { color: var(--primary); font-weight: 600; cursor: pointer; }
.task-link:hover { text-decoration: underline; }
.feed-time { font-size: 12px; color: var(--muted); margin-top: 2px; }
.day-sep { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
.day-sep:first-child { padding-top: 0; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.chip svg { width: 12px; height: 12px; }
.chip .dot { width: 7px; height: 7px; }
.p-high { background: #fef2f2; color: #dc2626; }
.p-high .dot { background: var(--high); }
.p-medium { background: #fff7ed; color: #ea580c; }
.p-medium .dot { background: var(--medium); }
.p-low { background: #f0fdf4; color: #16a34a; }
.p-low .dot { background: var(--low); }
.st-chip-todo { background: #eef2ff; color: #4f46e5; }
.st-chip-inprogress { background: #fffbeb; color: #d97706; }
.st-chip-done { background: #ecfdf5; color: #059669; }
.overdue { background: #fef2f2; color: #dc2626; }
.due { background: #f4f3f9; color: var(--text-2); }
.role-admin { background: #f1ebff; color: #6d28d9; }
.role-member { background: #e0f2fe; color: #0369a1; }

/* board */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.column { background: #efedf7; border-radius: var(--radius); overflow: hidden; }
.col-head { padding: 13px 16px; color: #fff; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.col-head > span:first-child { display: flex; align-items: center; gap: 8px; }
.col-head svg { width: 17px; height: 17px; }
.col-todo .col-head { background: linear-gradient(135deg, #4f46e5, #0ea5e9); }
.col-inprogress .col-head { background: linear-gradient(135deg, #f59e0b, #f97316); }
.col-done .col-head { background: linear-gradient(135deg, #059669, #14b8a6); }
.count { background: rgba(255, 255, 255, .25); min-width: 26px; text-align: center; padding: 2px 8px; border-radius: 99px; font-size: 12px; }
.col-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 140px; }
.col-body .empty { padding: 36px 10px; }

.card {
  background: #fff; border-radius: 14px; padding: 14px 14px 12px; box-shadow: var(--shadow-sm);
  cursor: pointer; border: 1px solid var(--border); position: relative; transition: transform .12s, box-shadow .2s;
}
.card::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--medium); }
.card.pr-high::before { background: var(--high); }
.card.pr-low::before { background: var(--low); }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(26, 23, 54, .1); }
.card-title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; word-break: break-word; line-height: 1.4; }
.col-done .card-title { text-decoration: line-through; color: var(--muted); }
.card-desc { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); gap: 8px; padding-top: 10px; border-top: 1px dashed var(--border); }
.card-foot .who { display: flex; align-items: center; gap: 7px; color: var(--text); font-weight: 600; }
.card-foot .upd { display: flex; align-items: center; gap: 4px; }
.card-foot .upd svg { width: 12px; height: 12px; }
.card-actions { margin-top: 10px; }
.card-actions .btn { width: 100%; }
.qa-start { color: #4f46e5; border-color: #c7d2fe; background: #eef2ff; }
.qa-start:hover { background: #e0e7ff; }
.qa-done { color: #059669; border-color: #a7f3d0; background: #ecfdf5; }
.qa-done:hover { background: #d1fae5; }

/* team */
.member { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); margin-bottom: 10px; transition: .15s; }
.member:hover { box-shadow: var(--shadow); }
.member.inactive { opacity: .5; }
.member .info { flex: 1; min-width: 0; }
.member .info b { display: block; font-size: 14px; }
.member .info small { color: var(--muted); font-size: 12px; }
.member .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.inline-form { display: flex; gap: 10px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(26, 23, 54, .45); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { background: #fff; border-radius: 22px; padding: 26px; width: 100%; max-width: 500px; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal-wide { max-width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 10px; }
.modal-head h3 { font-size: 20px; font-weight: 800; word-break: break-word; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.priority-pick { display: flex; gap: 8px; }
.pp { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 12px; border: 1.5px solid var(--border-2); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-2); transition: .15s; }
.pp input { display: none; }
.pp .dot { width: 9px; height: 9px; }
.pp-low .dot { background: var(--low); }
.pp-medium .dot { background: var(--medium); }
.pp-high .dot { background: var(--high); }
.pp-low:has(input:checked) { border-color: var(--low); background: #f0fdf4; color: #16a34a; }
.pp-medium:has(input:checked) { border-color: var(--medium); background: #fff7ed; color: #ea580c; }
.pp-high:has(input:checked) { border-color: var(--high); background: #fef2f2; color: #dc2626; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.detail-box { background: #faf9fe; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.detail-box > small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.detail-box .val { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.detail-box .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.detail-desc { background: #faf9fe; border: 1px solid var(--border); padding: 14px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; margin-bottom: 18px; color: var(--text-2); line-height: 1.6; }
.status-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.status-switch { display: flex; gap: 8px; margin-bottom: 20px; background: #f4f3f9; padding: 5px; border-radius: 14px; }
.status-switch button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px; border-radius: 10px; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; transition: .15s; }
.status-switch button svg { width: 16px; height: 16px; }
.status-switch button:not(:disabled):hover { color: var(--text); background: rgba(255, 255, 255, .6); }
.status-switch button:disabled { cursor: not-allowed; }
.status-switch .on-todo { background: #fff !important; color: #4f46e5 !important; box-shadow: var(--shadow); }
.status-switch .on-inprogress { background: #fff !important; color: #d97706 !important; box-shadow: var(--shadow); }
.status-switch .on-done { background: #fff !important; color: #059669 !important; box-shadow: var(--shadow); }
.timeline { border-left: 2px solid var(--border-2); margin: 12px 0 0 12px; padding-left: 16px; }
.timeline .feed-item { padding: 6px 0; position: relative; }
.timeline .feed-item:hover { background: none; }
.timeline .feed-item::before { content: ''; position: absolute; left: -22px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: #a78bfa; border: 2px solid #fff; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px);
  background: #1a1736; color: #fff; padding: 12px 20px; border-radius: 14px; font-size: 14px; font-weight: 500;
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.2); z-index: 100; pointer-events: none; box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d9d5ea; border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* responsive */
@media (max-width: 1200px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 960px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
/* ---------- phones & small tablets ---------- */
@media (max-width: 860px) {
  input, select, textarea, .dd-btn { font-size: 16px; } /* stops iPhone auto-zoom */
  .login-side { padding: 24px 18px; }

  .sidebar { display: none; }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 4px;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(26, 23, 54, .06);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav .nav-item {
    flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 8px 4px;
    font-size: 11px; font-weight: 600; color: var(--muted); background: none; box-shadow: none;
  }
  .mobile-nav .nav-item svg { width: 22px; height: 22px; }
  .mobile-nav .nav-item.active { color: var(--primary); background: var(--primary-soft); box-shadow: none; }

  .main { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 16px; gap: 10px; }
  .topbar h2 { font-size: 22px; }
  .topbar .muted { display: none; }
  .btn-text, .user-btn-text, .user-btn > i { display: none; }
  #new-task-btn { width: 44px; height: 44px; padding: 0; border-radius: 14px; }
  .user-btn { padding: 4px; }
  .pop { right: -2px; width: min(260px, calc(100vw - 28px)); }

  .grid-2, .row, .detail-grid { grid-template-columns: 1fr; }
  .grid-2 { gap: 14px; margin-bottom: 14px; }
  .panel { padding: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .stats .stat:first-child { grid-column: span 2; }
  .stat { padding: 14px; }
  .stat .ico { width: 32px; height: 32px; margin-bottom: 10px; }
  .stat .num { font-size: 24px; }
  .donut-wrap { justify-content: center; gap: 20px; }
  .donut { width: 150px; height: 150px; }
  .donut-hole { width: 104px; height: 104px; }

  .toolbar, .toolbar-right { flex-direction: column; align-items: stretch; }
  .filters { gap: 8px; margin-bottom: 14px; }
  .search { flex-basis: 100%; max-width: none; }
  .filters .dd, .toolbar .dd { flex: 1 1 calc(50% - 4px); min-width: 0 !important; }
  .range { flex-basis: 100%; }
  .range input { width: auto; flex: 1; min-width: 0; }

  /* board: swipe between columns */
  .board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -14px; padding: 0 14px 10px; }
  .column { flex: 0 0 86%; scroll-snap-align: center; }
  .board { scrollbar-width: none; }
  .board::-webkit-scrollbar { display: none; }

  /* popups slide up from the bottom */
  .modal { align-items: end; padding: 0; }
  .modal-card { max-width: none; border-radius: 22px 22px 0 0; max-height: 90vh; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
  .status-switch button { padding: 9px 4px; font-size: 13px; gap: 5px; }
  .modal-foot .btn { flex: 1; }

  .member { flex-wrap: wrap; }
  .member .acts { width: 100%; justify-content: flex-start; }
  .inline-form { flex-direction: column; }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
}
