/* ==========================================================================
   DevBoard — application styles (no build step, no framework)
   ========================================================================== */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e4e7ec;
  --border-strong: #cfd4dc;
  --text: #1d2430;
  --text-2: #3f4a5a;
  --muted: #6b7482;
  --primary: #3b6ef5;
  --primary-hover: #2f5cd6;
  --primary-soft: #e9efff;
  --danger: #d92d20;
  --danger-soft: #fee4e2;
  --warning: #b54708;
  --warning-soft: #fef0c7;
  --success: #067647;
  --success-soft: #dcfae6;
  --purple: #6941c6;
  --purple-soft: #ebe9fe;
  --teal: #107569;
  --teal-soft: #ccfbef;
  --orange: #c4320a;
  --orange-soft: #ffead5;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 12px; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
pre { white-space: pre-wrap; word-break: break-word; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.muted-link { color: var(--text-2); }
.muted-link:hover { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-right: 16px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--primary);
  position: relative; flex: none;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; background: #fff; border-radius: 1px;
}
.brand-mark::before { left: 5px; top: 5px; width: 4px; height: 12px; }
.brand-mark::after { left: 11px; top: 5px; width: 4px; height: 7px; opacity: .7; box-shadow: 4px 0 0 rgba(255,255,255,.45); height: 5px; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-link {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--primary-soft); color: var(--primary); }
.search-form input {
  width: 200px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font: inherit;
  font-size: 13px;
}
.search-form input:focus { outline: none; border-color: var(--primary); background: #fff; }
.user-menu { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.user-name { font-weight: 500; color: var(--text-2); }
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}
.nav-toggle span { display: block; width: 16px; height: 2px; background: var(--text-2); border-radius: 1px; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container { max-width: 1240px; margin: 0 auto; padding: 24px 20px 48px; }
.container-wide { max-width: none; }
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-header h1 { margin-bottom: 2px; }
.page-header .subtitle { color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card + .card { margin-top: 16px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-header h2 { margin: 0; }
.card-header .card-link { font-size: 13px; }
.section { margin-top: 24px; }
.section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.count {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  line-height: 18px;
}
.count-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.count-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.empty { color: var(--muted); padding: 12px 0; margin: 0; }
.empty-box {
  text-align: center; padding: 36px 16px; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b42318; border-color: #b42318; }
.btn-danger-outline { color: var(--danger); border-color: var(--danger-soft); background: #fff; }
.btn-danger-outline:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-link {
  background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit;
}
.btn-link:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form { max-width: 720px; }
.form-group { margin-bottom: 14px; }
.form-group label, .sidebar-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
}
.form-group .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="search"], input[type="url"], select, textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  color: var(--text);
}
select { height: 34px; padding-top: 0; padding-bottom: 0; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 110, 245, 0.15);
}
input[type="file"] { font: inherit; }
input[type="checkbox"] { width: 16px; height: 16px; vertical-align: middle; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; }

/* Filters bar */
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filters select, .filters input[type="search"], .filters input[type="text"] {
  width: auto;
  min-width: 140px;
  height: 32px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
}
.filters .filter-label { color: var(--muted); font-size: 13px; }
.filter-tabs { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; }
.filter-tabs a {
  padding: 4px 10px; border-radius: 4px; color: var(--text-2); font-size: 13px; font-weight: 500;
}
.filter-tabs a:hover { text-decoration: none; color: var(--text); }
.filter-tabs a.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.card .table-wrap { border: 0; border-radius: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfc; }
.table .col-title { min-width: 220px; }
.table .col-status, .table .col-priority, .table .col-due, .table .col-date { white-space: nowrap; }
.task-link { color: var(--text); font-weight: 500; }
.task-link:hover { color: var(--primary); }
.blocked-reason-inline { color: var(--danger); font-size: 12.5px; margin-top: 2px; }
.row-critical td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.row-high td:first-child { box-shadow: inset 3px 0 0 #f79009; }
.assignee { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid transparent;
}
/* task status */
.badge-status-backlog   { background: #f2f4f7; color: #475467; }
.badge-status-todo      { background: #eaecf0; color: #344054; }
.badge-status-in_progress { background: var(--primary-soft); color: var(--primary); }
.badge-status-review    { background: var(--purple-soft); color: var(--purple); }
.badge-status-testing   { background: var(--warning-soft); color: var(--warning); }
.badge-status-blocked   { background: var(--danger); color: #fff; font-weight: 600; }
.badge-status-done      { background: var(--success-soft); color: var(--success); }
.badge-status-cancelled { background: #f2f4f7; color: #98a2b3; text-decoration: line-through; }
/* priority / severity */
.badge-priority-low, .badge-priority-medium, .badge-priority-high, .badge-priority-critical {
  background: transparent; padding-left: 0; color: var(--text-2);
}
[class*="badge-priority-"]::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none;
}
.badge-priority-low      { color: #98a2b3; }
.badge-priority-medium   { color: var(--primary); }
.badge-priority-high     { color: #dc6803; font-weight: 600; }
.badge-priority-critical { color: var(--danger); font-weight: 700; }
/* issue status */
.badge-istatus-open        { background: var(--primary-soft); color: var(--primary); }
.badge-istatus-in_progress { background: var(--primary-soft); color: var(--primary); }
.badge-istatus-fixed       { background: var(--teal-soft); color: var(--teal); }
.badge-istatus-testing     { background: var(--warning-soft); color: var(--warning); }
.badge-istatus-closed      { background: var(--success-soft); color: var(--success); }
.badge-istatus-rejected    { background: #f2f4f7; color: #98a2b3; }
/* issue type */
.badge-type-bug         { background: var(--danger-soft); color: var(--danger); }
.badge-type-security    { background: var(--purple-soft); color: var(--purple); }
.badge-type-performance { background: var(--orange-soft); color: var(--orange); }
.badge-type-ui_ux       { background: var(--primary-soft); color: var(--primary); }
.badge-type-other       { background: #f2f4f7; color: #475467; }
/* project + milestone status */
.badge-pstatus-planned, .badge-mstatus-planned { background: #eaecf0; color: #344054; }
.badge-pstatus-active, .badge-mstatus-in_progress { background: var(--success-soft); color: var(--success); }
.badge-pstatus-on_hold { background: var(--warning-soft); color: var(--warning); }
.badge-pstatus-completed, .badge-mstatus-completed { background: var(--primary-soft); color: var(--primary); }
.badge-pstatus-archived { background: #f2f4f7; color: #98a2b3; }
.badge-lg { font-size: 13px; padding: 3px 10px; }

/* --------------------------------------------------------------------------
   Avatars, progress, stats
   -------------------------------------------------------------------------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #dfe5f3;
  color: #3f4a5a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  flex: none;
}
.avatar-xs { width: 22px; height: 22px; font-size: 9.5px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-empty { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); }

.progress { height: 6px; background: #e9ecf1; border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 3px; transition: width .2s; }
.progress-lg { height: 10px; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress { flex: 1; }
.progress-value { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 36px; text-align: right; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stat a { color: inherit; }
.stat a:hover { text-decoration: none; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat-danger .stat-value { color: var(--danger); }
.stat-warning .stat-value { color: var(--warning); }
.stat-success .stat-value { color: var(--success); }
.stat-primary .stat-value { color: var(--primary); }
.stat-purple .stat-value { color: var(--purple); }

/* --------------------------------------------------------------------------
   Lists (dashboard / my work)
   -------------------------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { display: block; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .title:hover { color: var(--primary); }
.list-item .meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; }
.due { white-space: nowrap; }
.due-overdue { color: var(--danger); font-weight: 600; }
.due-soon { color: var(--warning); font-weight: 500; }

/* Project cards */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project-card:hover { border-color: var(--border-strong); }
.project-card .project-title { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.project-card .project-title a { font-weight: 600; font-size: 15px; color: var(--text); }
.project-card .project-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.project-card .project-meta b { color: var(--text-2); font-weight: 600; }
.project-card .project-meta .warn b { color: var(--danger); }

/* --------------------------------------------------------------------------
   Detail pages (task / issue)
   -------------------------------------------------------------------------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.detail-main { min-width: 0; }
.detail-title { font-size: 20px; margin-bottom: 4px; }
.detail-meta { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.detail-meta a { color: var(--text-2); }
.description { white-space: normal; line-height: 1.6; }
.description:empty::before, .description.is-empty { color: var(--muted); font-style: italic; }
.sidebar { position: sticky; top: 68px; }
.sidebar .card { padding: 14px 16px; }
.sidebar-field { margin-bottom: 12px; }
.sidebar-field:last-child { margin-bottom: 0; }
.sidebar-field .value { color: var(--text); }
.sidebar-field select { height: 32px; font-size: 13px; }
.blocked-box {
  border: 1px solid #fecdca;
  background: #fff5f4;
  color: #912018;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 16px;
}
.blocked-box b { display: block; margin-bottom: 2px; }
.detail-block { margin-bottom: 20px; }
.detail-block h3 { color: var(--text-2); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.code-ref { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
code.code-ref { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }

/* Comments */
.comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.comment { display: flex; gap: 10px; }
.comment-body { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.comment-meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; font-size: 13px; }
.comment-text { line-height: 1.6; word-break: break-word; }
.comment-form textarea { margin-bottom: 0; }

/* Activity */
.activity { list-style: none; margin: 0; padding: 0; }
.activity-item { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.activity-item:last-child { border-bottom: 0; }
.activity-body { flex: 1; min-width: 0; line-height: 1.5; }
.activity-time { margin-left: 6px; }
.activity-entity { font-weight: 500; }

/* Attachments */
.attachments { list-style: none; margin: 0 0 12px; padding: 0; }
.attachment { display: flex; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.attachment:last-child { border-bottom: 0; }
.attachment-name { font-weight: 500; }
.upload-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Kanban board
   -------------------------------------------------------------------------- */
.board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: flex-start;
  min-height: 60vh;
}
.board-column {
  flex: 0 0 272px;
  width: 272px;
  background: #eef0f4;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 190px);
}
.board-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 6px;
  font-weight: 600;
  font-size: 13px;
}
.board-column-header .column-count { margin-left: auto; }
.board-column-blocked .board-column-header { color: var(--danger); }
.board-column-blocked { background: #fbeeed; }
.board-column-done .board-column-header { color: var(--success); }
.board-cards {
  padding: 4px 8px 8px;
  overflow-y: auto;
  min-height: 60px;
  flex: 1;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background .12s;
}
.board-cards.drop-over { background: rgba(59, 110, 245, 0.10); outline: 2px dashed var(--primary); outline-offset: -4px; }
.board-cards.is-empty::after {
  content: "No tasks"; display: block; color: var(--muted); font-size: 12.5px; text-align: center; padding: 14px 0;
}
.board-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 10px 8px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  cursor: default;
}
.board-card[draggable="true"] { cursor: grab; }
.board-card.dragging { opacity: .45; }
.board-card.saving { opacity: .6; }
.board-card:hover { border-color: var(--border-strong); }
.board-card .card-title { display: block; color: var(--text); font-weight: 500; line-height: 1.35; margin-bottom: 6px; }
.board-card .card-title:hover { color: var(--primary); }
.board-card .card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.board-card .card-meta .badge { font-size: 11.5px; padding: 0 6px; line-height: 16px; }
.board-card .card-milestone { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.board-card .card-blocked { color: var(--danger); font-size: 12px; margin: 4px 0 2px; line-height: 1.4; }
.board-card .card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.board-card .card-status {
  width: auto; height: 24px; font-size: 11.5px; padding: 0 4px; border-color: transparent; background: transparent; color: var(--muted);
}
.board-card .card-status:hover { border-color: var(--border-strong); background: #fff; }
.board-card.priority-critical { border-left: 3px solid var(--danger); }
.board-card.priority-high { border-left: 3px solid #f79009; }

/* --------------------------------------------------------------------------
   Milestones
   -------------------------------------------------------------------------- */
.milestone-list { display: flex; flex-direction: column; gap: 10px; }
.milestone { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.milestone-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.milestone-head h3 { margin: 0; font-size: 15px; }
.milestone-head .spacer { flex: 1; }
.milestone details { margin-top: 10px; }
.milestone summary { cursor: pointer; color: var(--primary); font-size: 13px; font-weight: 500; }
.milestone .form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

/* --------------------------------------------------------------------------
   Team
   -------------------------------------------------------------------------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.member-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.member-card:hover { border-color: var(--border-strong); }
.member-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.member-head a { font-weight: 600; color: var(--text); font-size: 15px; }
.member-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.member-counts div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 4px; }
.member-counts b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.member-counts span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.member-counts .warn b { color: var(--danger); }

/* --------------------------------------------------------------------------
   Flash, toast, dialog, pagination, errors, auth
   -------------------------------------------------------------------------- */
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border: 1px solid transparent;
  font-weight: 500;
}
.flash-success { background: var(--success-soft); color: var(--success); border-color: #abefc6; }
.flash-error { background: var(--danger-soft); color: #912018; border-color: #fecdca; }
.flash-info { background: var(--primary-soft); color: var(--primary); }
.flash-close { background: none; border: 0; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; opacity: .7; }
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1d2430;
  color: #fff;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(16, 24, 40, .2);
  z-index: 100;
  max-width: 90vw;
}
.toast-error { background: var(--danger); }

dialog.dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  width: 420px;
  max-width: 92vw;
  box-shadow: 0 10px 40px rgba(16, 24, 40, .2);
}
dialog.dialog::backdrop { background: rgba(16, 24, 40, .4); }
.dialog-form h3 { margin-bottom: 4px; }
.dialog-form textarea { margin: 10px 0 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pagination-info { color: var(--muted); font-size: 13px; }
.pagination-links { display: flex; gap: 4px; }
.page-link {
  display: inline-block; min-width: 30px; height: 30px; line-height: 28px; text-align: center; padding: 0 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font-size: 13px;
}
.page-link:hover { text-decoration: none; border-color: var(--border-strong); }
.page-link.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-gap { color: var(--muted); padding: 0 4px; line-height: 30px; }

.error-page { text-align: center; padding: 60px 0; }
.error-code { font-size: 56px; font-weight: 700; color: var(--border-strong); line-height: 1; margin-bottom: 8px; }
.error-detail { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-top: 24px; font-size: 12px; overflow: auto; }

.auth-body { background: var(--bg); }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; margin-bottom: 20px; }
.auth-title { font-size: 18px; margin-bottom: 16px; }

/* --------------------------------------------------------------------------
   Search results
   -------------------------------------------------------------------------- */
.search-results .card { margin-bottom: 16px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 760px) {
  .container { padding: 16px 12px 40px; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .brand { margin-right: 0; }
  .nav-toggle { display: flex; }
  .nav, .search-form, .user-menu { display: none; width: 100%; }
  .nav { flex-direction: column; align-items: stretch; margin-top: 6px; }
  .nav-link { padding: 9px 10px; }
  .search-form { margin-top: 6px; }
  .search-form input { width: 100%; }
  .user-menu { justify-content: space-between; margin: 8px 0 4px; }
  body.nav-open .nav, body.nav-open .search-form, body.nav-open .user-menu { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .table th, .table td { padding: 8px 10px; }
  .assignee-name { display: none; }
  .table .col-project { display: none; }
  .board-column { flex-basis: 250px; width: 250px; max-height: none; }
  .member-counts { grid-template-columns: repeat(4, 1fr); }
  .page-header { flex-direction: column; }
}
@media (max-width: 480px) {
  .table .col-due, .table .col-milestone { display: none; }
}
