@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f0f2f7;
  --bg-accent: #e8ecf6;
  --surface: #ffffff;
  --ink: #141824;
  --muted: #6b7285;
  --line: #e2e6ef;
  --line-strong: #d0d6e4;
  --brand: #2e4dff;
  --brand-dark: #1f35d6;
  --brand-soft: rgba(46, 77, 255, 0.1);
  --ok: #15803d;
  --warn: #b45309;
  --danger: #dc2626;
  --sidebar: #0f1220;
  --sidebar-2: #171b2e;
  --shadow: 0 1px 2px rgba(20, 24, 36, 0.04), 0 8px 24px rgba(20, 24, 36, 0.05);
  --shadow-sm: 0 1px 2px rgba(20, 24, 36, 0.05);
  --radius: 10px;
  --radius-sm: 8px;
  --font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 0% -10%, rgba(46, 77, 255, 0.07), transparent 55%),
    var(--bg);
  min-height: 100vh;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* —— Sidebar —— */
.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #f5f5f5;
  padding: 22px 14px 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 12px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 18px;
}
.brand-logo {
  display: block;
  width: 88px;
  height: auto;
  color: #fff;
}
.brand-sub {
  color: #8b92a8;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section {
  margin: 14px 12px 6px;
  color: #6f7690;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav a {
  color: #c4c9d8;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  transition: background .15s ease, color .15s ease;
}
.nav a .nav-ico {
  width: 18px;
  height: 18px;
  opacity: 0.75;
  flex: 0 0 auto;
}
.nav a:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.nav a.active {
  background: rgba(46, 77, 255, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand);
}
.nav a.active .nav-ico { opacity: 1; }

.sidebar-foot {
  margin-top: auto;
  padding: 18px 12px 0;
  color: #6f7690;
  font-size: 0.75rem;
}

/* —— Main / topbar —— */
.main {
  padding: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.main-inner {
  padding: 28px 32px 48px;
  width: min(1280px, 100%);
  margin: 0 auto;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 18px 32px;
  background: rgba(255,255,255,0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.page-title h1 {
  margin: 0 0 4px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: none;
}
.page-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}
.page-title p a { font-weight: 600; }

.user-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px 6px 6px;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #6b83ff);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.user-chip a, .user-chip button {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  margin-right: 6px;
}

/* —— Stats / cards —— */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.grid-stats-4 {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plain-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand);
  opacity: 0.85;
}
.stat .label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stat .value {
  font-size: 1.85rem;
  font-weight: 800;
  margin-top: 6px;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.1;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.panel h2, .panel h3 {
  margin-top: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
  font-size: 1rem;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* —— Buttons / inputs —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
  box-shadow: 0 1px 0 rgba(31, 53, 214, 0.25);
}
.btn:hover,
a.btn:hover {
  background: var(--brand-dark);
  color: #fff;
}
.btn:active { transform: translateY(1px); }
.btn-secondary {
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: none;
}
.btn-secondary:hover,
a.btn-secondary:hover {
  background: rgba(46, 77, 255, 0.16);
  color: var(--brand-dark);
}
.btn-danger { background: var(--danger); color: #fff; box-shadow: none; }
.btn-danger:hover,
a.btn-danger:hover {
  background: #b91c1c;
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-ghost:hover,
a.btn-ghost:hover {
  border-color: var(--line-strong);
  background: #f7f8fb;
  color: var(--ink);
}
.btn-sm { padding: 7px 11px; font-size: 0.74rem; }

.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(46, 77, 255, 0.14);
}
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: none;
  color: #3d4458;
}
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }

/* —— Tables —— */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.table th, .table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.92rem;
}
.table th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f7f8fc;
  position: sticky;
  top: 0;
}
.table tbody tr {
  transition: background .12s ease;
}
.table tbody tr:hover {
  background: #f7f9ff;
}
.table tbody tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  background: #eef0f5;
  color: var(--muted);
  white-space: nowrap;
}
.badge-active, .badge-in_progress, .badge-todo { background: var(--brand-soft); color: var(--brand); }
.badge-done, .badge-won { background: #dcfce7; color: var(--ok); }
.badge-paused, .badge-review { background: #fef3c7; color: var(--warn); }
.badge-lost, .badge-cancelled, .badge-archived { background: #fee2e2; color: var(--danger); }
.badge-new, .badge-draft { background: #eef0f5; color: var(--muted); }
.badge-high, .badge-urgent { background: #fee2e2; color: var(--danger); }

.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 0;
  border-bottom: 0;
  background: #eef1f8;
  padding: 4px;
  border-radius: var(--radius-sm);
  width: fit-content;
  max-width: 100%;
}
.tabs a {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 0;
}
.tabs a.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 500;
  border: 1px solid rgba(46, 77, 255, 0.12);
}
.messages .error { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.messages .success { background: #dcfce7; color: var(--ok); border-color: #bbf7d0; }
.messages .warning { background: #fef3c7; color: var(--warn); border-color: #fde68a; }

/* —— Auth —— */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 15% 10%, rgba(46, 77, 255, 0.22), transparent 55%),
    linear-gradient(165deg, #0f1220 0%, #171b2e 48%, var(--bg) 48%);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 14px;
  padding: 32px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.auth-card .brand-logo {
  width: 110px;
  color: var(--ink);
  margin-bottom: 18px;
}
.auth-card h1 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: none;
}
.auth-card .lead { color: var(--muted); margin-bottom: 22px; }

/* —— Board / kanban —— */
.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}
.board-tasks {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-toggle a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  border-right: 1px solid var(--line);
}
.view-toggle a:last-child { border-right: 0; }
.view-toggle a:hover { color: var(--ink); background: var(--bg); }
.view-toggle a.active {
  color: var(--brand);
  background: var(--brand-soft);
}
.inline-status-form { margin: 0; }
.input-compact {
  width: auto;
  min-width: 140px;
  max-width: 200px;
  padding: 7px 10px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}
.time-filters { display: flex; flex-direction: column; gap: 12px; }
.time-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.time-filters-row .input {
  width: auto;
  min-width: 180px;
  flex: 1 1 160px;
}
.time-filters-row input[type="date"] {
  min-width: 150px;
  flex: 0 1 160px;
}
.period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--line);
  width: fit-content;
  max-width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.period-tab {
  display: inline-flex;
  align-items: center;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
}
.period-tab:last-child { border-right: 0; }
.period-tab:hover { color: var(--ink); background: var(--bg); }
.period-tab.active {
  color: var(--brand);
  background: var(--brand-soft);
}
.board-projects {
  grid-template-columns: repeat(5, minmax(200px, 1fr));
}
.board-col {
  background: #e9edf6;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px;
  min-height: 280px;
  min-width: 0;
}
.board-col h3 {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: #4b5568;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 4px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.board-drop {
  min-height: 120px;
}
.board-drop.is-over {
  outline: 2px dashed var(--brand);
  outline-offset: 2px;
  background: rgba(46, 77, 255, 0.08);
  border-radius: var(--radius-sm);
}
.kanban-card, .lead-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
.kanban-card:hover, .lead-card:hover {
  border-color: #c9d2ea;
  box-shadow: var(--shadow);
}
.kanban-card.is-dragging, .lead-card.is-dragging {
  opacity: 0.55;
  transform: rotate(1deg);
}
.kanban-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.kanban-card h4, .lead-card h4 { margin: 0 0 6px; font-size: 0.95rem; font-weight: 700; }
.kanban-card p, .lead-card p { margin: 0 0 4px; color: var(--muted); font-size: 0.84rem; }

.report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.report-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.report-card:hover {
  border-color: #b8c4ef;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  color: inherit;
}
.report-card h3 {
  margin: 0 0 8px;
  text-transform: none;
  letter-spacing: -0.02em;
  font-size: 1rem;
}
.report-card p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.report-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
  margin-bottom: 4px;
}
.report-bar-track {
  height: 8px;
  background: #eceff5;
  border-radius: 999px;
  overflow: hidden;
}
.report-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #6b83ff);
  min-width: 0;
  border-radius: 999px;
}
.daily-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 160px;
  overflow-x: auto;
  padding-top: 8px;
}
.daily-col {
  flex: 1 0 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  min-width: 18px;
}
.daily-fill {
  width: 100%;
  background: linear-gradient(180deg, #6b83ff, var(--brand));
  min-height: 2px;
  border-radius: 4px 4px 0 0;
}
.daily-col span {
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 4px;
  transform: rotate(-60deg);
  white-space: nowrap;
}

.stack-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}
.muted { color: var(--muted); }
.secret-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #111;
  color: #d7e9fb;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  word-break: break-all;
}
.perm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.perm-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fafbfe;
}
.perm-group h4 {
  margin: 0 0 10px;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.perm-group label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  font-weight: 400;
}

.empty {
  color: var(--muted);
  padding: 28px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fafbfe;
}

.timer-elapsed {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: 0.02em;
  color: var(--brand);
  margin: 8px 0 0;
}
.timer-elapsed-inline {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--brand);
}

.git-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.git-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.git-feed li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fafbfe;
  border-radius: var(--radius-sm);
  line-height: 1.45;
}
.git-feed code, .panel code {
  font-size: 0.86em;
  background: #eef1ff;
  padding: 1px 6px;
  border-radius: 4px;
}

.check-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.check-list li { margin: 0; }
.check-list label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
}

.roadmap {
  list-style: none;
  margin: 0;
  padding: 0 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.roadmap-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding-bottom: 18px;
}
.roadmap-item:last-child { padding-bottom: 0; }
.roadmap-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--line-strong);
}
.roadmap-marker {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  margin-left: 4px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #9aa3bd;
  box-shadow: 0 0 0 4px #eef1f8;
  z-index: 1;
}
.roadmap-item.status-planned .roadmap-marker { border-color: #9aa3bd; }
.roadmap-item.status-in_progress .roadmap-marker {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.roadmap-item.status-done .roadmap-marker {
  border-color: var(--ok);
  background: #dcfce7;
}
.roadmap-item.status-blocked .roadmap-marker {
  border-color: var(--danger);
  background: #fee2e2;
}
.roadmap-card {
  background: #fafbfe;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.roadmap-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.roadmap-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  text-transform: none;
  letter-spacing: -0.02em;
}
.roadmap-edit {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.roadmap-edit summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.84rem;
}
.badge-planned { background: #eef0f5; color: var(--muted); }
.badge-blocked { background: #fee2e2; color: var(--danger); }
.badge-kind-bug { background: #fee2e2; color: var(--danger); }
.badge-kind-rework { background: #fef3c7; color: var(--warn); }
.badge-kind-feature { background: #e0e7ff; color: var(--brand); }

.project-assign-list {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: #fafbfe;
}
.project-assign-list ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

/* —— Passport CRM —— */
.stat-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.text-ok { color: var(--ok); }
.text-danger { color: var(--danger); }
.num { text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

.passport-toolbar { gap: 12px; align-items: center; }
.passport-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.passport-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.passport-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: #eef0f5;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.passport-chip:hover { color: var(--brand); background: var(--brand-soft); }
.passport-chip.is-active {
  background: var(--brand);
  color: #fff;
}
.passport-chip.is-active:hover { color: #fff; }

.passport-list-panel { margin-top: 16px; }
.passport-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.passport-list-head h2 { margin: 0; }
.passport-table .passport-row { cursor: pointer; }
.passport-table .passport-row:hover td { background: #f7f8fc; }
.passport-row__title {
  font-weight: 800;
  color: var(--ink);
}
.passport-row__title:hover { color: var(--brand); }
.passport-pct {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.crm-progress { min-width: 120px; }
.crm-progress--lg { min-width: 0; }
.crm-progress__track {
  height: 8px;
  background: #e8ebf3;
  border-radius: 999px;
  overflow: hidden;
}
.crm-progress--lg .crm-progress__track { height: 10px; }
.crm-progress__track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #5b7cff);
  border-radius: 999px;
  min-width: 0;
}
.crm-progress--hours .crm-progress__track span {
  background: linear-gradient(90deg, #0f9f6e, #34d399);
}
.crm-progress__label {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.passport-tabs-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(240, 242, 247, 0.92);
  backdrop-filter: blur(8px);
  padding: 10px 0;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.passport-overview-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.passport-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.86rem;
  font-weight: 700;
}
.passport-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.passport-links a {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  font-size: 0.8rem;
  font-weight: 700;
}
.passport-side-form .form-row { margin-bottom: 10px; }
.passport-labor-totals { font-size: 0.8rem; font-weight: 600; }

.table th[title] { cursor: help; }
.passport-labor-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}
.num-input {
  width: 88px;
  text-align: right;
}
.passport-add-details {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.passport-add-details summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.88rem;
}
.passport-add-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 12px;
  max-width: 640px;
}
.passport-add-form .btn { grid-column: 1 / -1; justify-self: start; }
.passport-date-range {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
  }
  .grid-stats, .grid-stats-4, .board, .stack-2, .form-grid, .perm-grid, .project-assign-list ul, .report-cards, .passport-overview-bars, .passport-add-form {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 14px 16px;
    position: relative;
  }
  .main-inner { padding: 16px 16px 40px; }
  .user-chip span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  .passport-tabs-bar { position: static; }
}

.text-warn { color: var(--warn); }
.qa-panel {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fafbfe;
}
.qa-panel--warn { border-color: #f59e0b; background: #fffbeb; }
.qa-panel--critical { border-color: #ef4444; background: #fef2f2; }
.qa-panel__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.qa-panel__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.qa-panel__value {
  font-size: 1.15rem;
  font-weight: 800;
  margin-top: 4px;
}
@media (max-width: 980px) {
  .qa-panel__grid { grid-template-columns: 1fr; }
}

