/* ============ TaskFlow design system v2 ============ */
:root {
  --bg: #0a0c12;
  --panel: #131722;
  --panel-2: #1a1f2e;
  --border: #262d40;
  --text: #eef1f8;
  --muted: #8a93ab;
  --accent: #6b9bff;
  --accent-2: #8fb3ff;
  --green: #45c97e;
  --red: #f06055;
  --orange: #f0a04b;
  --purple: #b58aff;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(0,0,0,.25);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.4);
  --glow-1: rgba(107,155,255,.08);
  --glow-2: rgba(181,138,255,.06);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #eef1f8;
  --panel: #ffffff;
  --panel-2: #f2f5fb;
  --border: #dde3f0;
  --text: #171b26;
  --muted: #5d6679;
  --accent: #3b6fe0;
  --accent-2: #2f5cc4;
  --green: #1e9e57;
  --red: #d94336;
  --orange: #d97f1a;
  --purple: #8357d6;
  --shadow: 0 1px 4px rgba(23,27,38,.08);
  --shadow-lg: 0 10px 30px rgba(23,27,38,.12);
  --glow-1: rgba(59,111,224,.06);
  --glow-2: rgba(131,87,214,.05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--border) var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
body {
  margin: 0;
  background:
    radial-gradient(1100px 550px at 85% -10%, var(--glow-1), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--glow-2), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 14px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
  transition: background .25s, color .25s;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; }
.muted { color: var(--muted); }
.sm-text { font-size: 12px; }
.red { color: var(--red); }
.green { color: var(--green); }
.accent { color: var(--accent-2); }
.pre-wrap { white-space: pre-wrap; margin: 0; }

/* layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.content { flex: 1; padding: 26px 32px; max-width: 1500px; }

.brand { display: flex; align-items: center; gap: 9px; font-size: 20px; padding: 2px 8px 18px; }
.brand-mark {
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--purple));
  width: 32px; height: 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
  box-shadow: 0 3px 10px rgba(107,155,255,.35);
}
.brand-name { font-weight: 600; }
.brand-name b { color: var(--accent-2); }
.brand.center { justify-content: center; padding-bottom: 6px; }
.center { text-align: center; }

/* project switcher */
.proj-switch { position: relative; margin-bottom: 16px; }
.proj-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 10px 11px; cursor: pointer; font-size: 13px;
  transition: border-color .15s;
}
.proj-btn:hover { border-color: var(--accent); }
.proj-key {
  background: linear-gradient(135deg, var(--accent), #4a76e8); color: #fff;
  border-radius: 6px; font-size: 11px; font-weight: 700; padding: 2px 7px;
}
.proj-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chev { color: var(--muted); }
.proj-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.proj-menu.open { display: block; }
.proj-menu a { display: flex; gap: 8px; align-items: center; padding: 10px 12px; color: var(--text); }
.proj-menu a:hover { background: var(--panel); text-decoration: none; }
.proj-menu a.active { background: rgba(107,155,255,.12); }
.proj-menu .proj-new { color: var(--accent-2); border-top: 1px solid var(--border); }

/* nav */
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px; color: var(--muted); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a svg { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; }
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.active {
  background: linear-gradient(90deg, rgba(107,155,255,.16), rgba(107,155,255,.04));
  color: var(--accent-2);
  box-shadow: inset 2.5px 0 0 var(--accent);
}
.nav-badge {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 10px;
}

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.me { display: flex; align-items: center; gap: 9px; padding: 7px; border-radius: 9px; color: var(--text); }
.me:hover { background: var(--panel-2); text-decoration: none; }
.foot-row { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.logout { color: var(--muted); font-size: 12px; }
.badge { background: rgba(107,155,255,.15); color: var(--accent-2); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }

.theme-toggle {
  width: 48px; height: 26px; border-radius: 13px; position: relative;
  background: var(--panel-2); border: 1px solid var(--border); cursor: pointer;
  transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple));
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  transition: transform .3s cubic-bezier(.2,.9,.3,1.3);
}
[data-theme="light"] .theme-toggle::after { transform: translateX(22px); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.avatar.sm { width: 22px; height: 22px; font-size: 11px; box-shadow: none; }
.avatar.xl { width: 56px; height: 56px; font-size: 24px; }

/* buttons & forms */
.btn {
  display: inline-block; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 9px; padding: 9px 16px; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: all .15s;
}
.btn:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #4a76e8);
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 12px rgba(107,155,255,.3);
  position: relative; overflow: hidden;
}
.btn.primary:hover { box-shadow: 0 5px 18px rgba(107,155,255,.45); }
.btn.primary::after {
  content: ""; position: absolute; top: 0; left: -70%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .55s ease;
}
.btn.primary:hover::after { left: 135%; }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.lg { padding: 12px 22px; font-size: 15px; }
.btn.block { width: 100%; margin-top: 6px; }

label { display: block; margin-bottom: 13px; font-weight: 600; font-size: 13px; }
input, select, textarea {
  width: 100%; margin-top: 5px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); padding: 9px 11px; font: inherit; font-weight: 400;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107,155,255,.18);
}
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input, .inline-form select { width: auto; margin: 0; padding: 4px 8px; font-size: 12px; }

.toast-stack {
  position: fixed; top: 18px; right: 18px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.flash {
  padding: 12px 18px; border-radius: 11px; font-size: 13px; font-weight: 600;
  min-width: 280px; max-width: 380px; cursor: pointer; pointer-events: auto;
  background: var(--panel); box-shadow: var(--shadow-lg);
  animation: toastIn .4s cubic-bezier(.2,.9,.3,1.15) both;
  backdrop-filter: blur(8px);
}
.flash.hide { animation: toastOut .3s ease-in both; }
.flash.success { border: 1px solid rgba(69,201,126,.5); color: var(--green); }
.flash.error { border: 1px solid rgba(240,96,85,.5); color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(60px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(60px) scale(.95); } }

/* cards */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card.narrow { max-width: 580px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2.align-start { align-items: start; }
.row-gap { display: flex; gap: 8px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.danger-zone { border-color: rgba(240,96,85,.4); }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head-actions select, .head-actions input { width: auto; margin: 0; }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-num { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat-grid.inner { grid-template-columns: repeat(4, 1fr); margin-bottom: 0; }
.stat-grid.inner .stat { padding: 12px; }
.stat-grid.inner .stat-num { font-size: 20px; }

/* bars & progress */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-label { width: 110px; font-size: 12px; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.bar-track { flex: 1; height: 10px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 6px; transition: width .35s ease-out; }
.bar-num { width: 30px; text-align: right; font-size: 12px; color: var(--muted); }
.progress { height: 10px; background: var(--panel-2); border-radius: 6px; overflow: hidden; margin: 10px 0; }
.progress.sm { height: 7px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--green), #6fdc9f); border-radius: 6px; transition: width .35s; }

/* chips */
.chip {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2.5px 9px;
  border-radius: 7px; white-space: nowrap; letter-spacing: .01em;
}
.type-task { background: rgba(107,155,255,.16); color: var(--accent-2); }
.type-bug { background: rgba(240,96,85,.16); color: var(--red); }
.type-story { background: rgba(69,201,126,.16); color: var(--green); }
.type-epic { background: rgba(181,138,255,.16); color: var(--purple); }
.prio-low { background: rgba(138,147,171,.16); color: var(--muted); }
.prio-medium { background: rgba(107,155,255,.16); color: var(--accent-2); }
.prio-high { background: rgba(240,160,75,.16); color: var(--orange); }
.prio-urgent { background: rgba(240,96,85,.16); color: var(--red); }
.status-todo { background: rgba(138,147,171,.16); color: var(--muted); }
.status-inprogress { background: rgba(107,155,255,.16); color: var(--accent-2); }
.status-inreview { background: rgba(240,160,75,.16); color: var(--orange); }
.status-done { background: rgba(69,201,126,.16); color: var(--green); }
.sprint-planned { background: rgba(138,147,171,.16); color: var(--muted); }
.sprint-active { background: rgba(69,201,126,.16); color: var(--green); }
.sprint-completed { background: rgba(107,155,255,.16); color: var(--accent-2); }
.status-bg-todo { background: var(--muted); }
.status-bg-inprogress { background: var(--accent); }
.status-bg-inreview { background: var(--orange); }
.status-bg-done { background: var(--green); }
.prio-bg-low { background: var(--muted); }
.prio-bg-medium { background: var(--accent); }
.prio-bg-high { background: var(--orange); }
.prio-bg-urgent { background: var(--red); }
.type-bg-task { background: var(--accent); }
.type-bg-bug { background: var(--red); }
.type-bg-story { background: var(--green); }
.type-bg-epic { background: var(--purple); }

.label-tag {
  display: inline-block; font-size: 11px; padding: 1px 8px; margin-left: 4px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 11px; color: var(--muted);
}

/* kanban board */
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.col {
  flex: 1; min-width: 255px; max-width: 350px;
  background: var(--panel); border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.col[data-status="todo"] { border-top-color: var(--muted); }
.col[data-status="inprogress"] { border-top-color: var(--accent); }
.col[data-status="inreview"] { border-top-color: var(--orange); }
.col[data-status="done"] { border-top-color: var(--green); }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 14px 9px; }
.col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 3px 10px; border-radius: 7px; }
.col-count { color: var(--muted); font-size: 12px; background: var(--panel-2); border-radius: 10px; padding: 1px 8px; }
.col-body { padding: 6px 10px; min-height: 60px; flex: 1; border-radius: 0 0 9px 9px; transition: background .15s; }
.col-body.dragover { background: rgba(107,155,255,.08); outline: 2px dashed rgba(107,155,255,.45); outline-offset: -4px; }
.col-add {
  display: block; width: 100%; text-align: left; padding: 10px 14px;
  color: var(--muted); font-size: 12px; font-weight: 600;
  background: none; border: none; border-top: 1px solid var(--border); cursor: pointer;
  border-radius: 0 0 var(--radius) var(--radius); transition: color .15s, background .15s;
}
.col-add:hover { color: var(--accent-2); background: var(--panel-2); }

.kcard {
  display: block; background: var(--panel-2); border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 9px; padding: 11px 12px; margin-bottom: 8px; cursor: grab;
  color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.kcard:hover {
  border-color: var(--accent); border-left-color: var(--accent);
  text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-1px);
}
.kcard.dragging { opacity: .55; cursor: grabbing; transform: rotate(2deg) scale(1.02); box-shadow: 0 12px 26px rgba(0,0,0,.45); }
.kcard-top { display: flex; gap: 6px; margin-bottom: 7px; }
.kcard-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.kcard-labels { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 7px; }
.kcard-labels .label-tag { margin-left: 0; }
.kcard-meta { display: flex; align-items: center; gap: 8px; }
.kcard-key { color: var(--muted); font-size: 11px; font-weight: 700; }
.kcard-badge { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; }
.kcard-badge svg { width: 12px; height: 12px; fill: currentColor; }
.kcard-due { color: var(--muted); font-size: 11px; }
.kcard-due.overdue { color: var(--red); font-weight: 700; }
.kcard-meta .avatar { margin-left: auto; }
.quick-add textarea {
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: 9px;
  padding: 9px 11px; font-size: 13px; margin: 0 0 8px;
}
.board-filter { width: 170px; }

/* tables */
.table-card { padding: 0; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--border); font-size: 13px; }
th {
  color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; background: var(--panel-2);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(107,155,255,.05); }
.issue-link { font-weight: 700; color: var(--accent-2); white-space: nowrap; }

.filter-bar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-bar input { flex: 1; min-width: 200px; margin: 0; }
.filter-bar select { width: auto; margin: 0; }

/* issue detail */
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.issue-layout { display: grid; grid-template-columns: 1fr 330px; gap: 20px; align-items: start; }
.issue-title { font-size: 25px; margin-bottom: 10px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.issue-side .card { position: sticky; top: 20px; }
.meta-list { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; }
.meta-list dt { color: var(--muted); float: left; width: 70px; }
.meta-list dd { margin: 0 0 6px 70px; }

.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment-body { flex: 1; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; }
.comment-head { margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline; }
.comment-form { margin-top: 14px; }
.comment-form .btn { margin-top: 8px; }

.attach-list { list-style: none; padding: 0; margin: 0 0 12px; }
.attach-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.attach-list li:last-child { border-bottom: none; }
.attach-form { display: flex; gap: 8px; align-items: center; }
.attach-form input { flex: 1; margin: 0; }

.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.activity-list li:last-child { border-bottom: none; }

/* sprints */
.sprint-list { list-style: none; padding: 0; margin: 0; }
.sprint-item { border: 1px solid var(--border); border-radius: 10px; padding: 15px; margin-bottom: 12px; transition: border-color .15s; }
.sprint-item:hover { border-color: var(--accent); }
.sprint-item.active { border-color: var(--green); box-shadow: 0 0 0 3px rgba(69,201,126,.12); }
.sprint-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }

/* sheets page */
.help-box { margin-top: 14px; border: 1px solid var(--border); border-radius: 9px; padding: 10px 14px; }
.help-box summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.help-box ol { padding-left: 18px; margin: 10px 0 4px; }
.help-box li { margin-bottom: 5px; }
.sync-actions form { margin-bottom: 14px; }

/* empty states */
.empty-state { text-align: center; padding: 70px 20px; }
.empty-icon { font-size: 44px; color: var(--accent); margin-bottom: 10px; }
.empty-state h1, .empty-state h2 { margin-bottom: 6px; }
.empty-state .row-gap { justify-content: center; margin-top: 14px; }

/* profile & dashboard extras */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.my-issues { list-style: none; padding: 0; margin: 0; }
.my-issues li { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.my-issues li:last-child { border-bottom: none; }
.my-issue-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.my-issue-title:hover { color: var(--accent-2); }

.trend { display: flex; gap: 8px; align-items: flex-end; height: 110px; padding-top: 8px; }
.trend-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.trend-bars { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.trend-bar { width: 12px; min-height: 2px; border-radius: 3px 3px 0 0; transition: height .3s; }
.trend-bar.created { background: var(--accent); }
.trend-bar.done { background: var(--green); }
.trend-label { font-size: 10px; color: var(--muted); }
.legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.legend .dot.created { background: var(--accent); }
.legend .dot.done { background: var(--green); }

/* ============ animations ============ */
.content > * { animation: contentIn .35s ease-out both; }
@keyframes contentIn { from { opacity: 0; transform: translateY(10px); } }
.stat-grid .stat:nth-child(1) { animation-delay: .0s; }
.stat-grid .stat:nth-child(2) { animation-delay: .06s; }
.stat-grid .stat:nth-child(3) { animation-delay: .12s; }
.stat-grid .stat:nth-child(4) { animation-delay: .18s; }
.stat-grid .stat:nth-child(5) { animation-delay: .24s; }
.stat-grid .stat { animation: contentIn .4s ease-out both; }
.board .col { animation: contentIn .35s ease-out both; }
.board .col:nth-child(2) { animation-delay: .06s; }
.board .col:nth-child(3) { animation-delay: .12s; }
.board .col:nth-child(4) { animation-delay: .18s; }
.bar-fill, .progress-fill { animation: growX .8s cubic-bezier(.2,.8,.3,1) both; }
@keyframes growX { from { width: 0 !important; } }
.trend-bar { animation: growY .7s cubic-bezier(.2,.8,.3,1) both; }
@keyframes growY { from { height: 0 !important; } }
.brand-mark { animation: brandPulse 4s ease-in-out infinite; }
@keyframes brandPulse {
  0%, 100% { box-shadow: 0 3px 10px rgba(107,155,255,.35); }
  50% { box-shadow: 0 3px 18px rgba(107,155,255,.6); }
}

/* ============ command palette ============ */
.palette-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 9px;
  color: var(--muted); padding: 8px 11px; font-size: 13px; cursor: pointer;
  margin-bottom: 14px; transition: border-color .15s, color .15s;
}
.palette-trigger:hover { border-color: var(--accent); color: var(--text); }
.palette-trigger svg { width: 14px; height: 14px; fill: currentColor; }
.palette-trigger span { flex: 1; text-align: left; }
.palette-trigger kbd {
  background: var(--bg); border: 1px solid var(--border); border-radius: 5px;
  font-size: 10px; padding: 1px 6px; font-family: inherit;
}
.palette-overlay {
  position: fixed; inset: 0; z-index: 900; display: none;
  background: rgba(5,7,12,.55); backdrop-filter: blur(5px);
}
.palette-overlay.open { display: flex; justify-content: center; padding-top: 13vh; }
.palette {
  width: 580px; max-width: 92vw; height: fit-content;
  background: var(--panel); border: 1px solid var(--border); border-radius: 15px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: paletteIn .18s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes paletteIn { from { opacity: 0; transform: scale(.96) translateY(-10px); } }
.palette input {
  border: none; border-bottom: 1px solid var(--border); border-radius: 0;
  padding: 16px 18px; font-size: 15px; background: transparent; margin: 0;
}
.palette input:focus { box-shadow: none; }
.palette-list { max-height: 330px; overflow-y: auto; padding: 7px; }
.palette-item {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 9px; cursor: pointer; color: var(--text);
}
.palette-item.sel { background: rgba(107,155,255,.14); }
.palette-item .p-label { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .muted { margin-left: auto; font-size: 11px; flex-shrink: 0; }
.palette-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }

/* auth pages */
.auth-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background:
    radial-gradient(800px 500px at 20% 20%, var(--glow-1), transparent 60%),
    radial-gradient(700px 500px at 80% 80%, var(--glow-2), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 370px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 34px;
  box-shadow: var(--shadow-lg);
  animation: rise .4s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .issue-layout { grid-template-columns: 1fr; }
  .issue-side .card { position: static; }
}
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 18px; }
}
