/* HogTron Dashboard — dark theme (navy / cyan / gold) */
:root {
  --bg:        #0a1628;
  --bg-2:     #0d1b2e;
  --card:      #142440;
  --card-hi:   #1b2e52;
  --border:    #1f3358;
  --text:      #e5e7eb;
  --text-dim:  #9ca3af;
  --primary:   #22d3ee;     /* cyan */
  --primary-2: #06b6d4;
  --gold:      #fbbf24;
  --green:     #34d399;
  --red:       #f87171;
  --yellow:    #facc15;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }

/* Layout ------------------------------------------------------------------ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  text-decoration: none;
  color: var(--text);
}
.sidebar .brand:hover { text-decoration: none; }
.sidebar .brand:hover .brand-logo { filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.45)); }
.sidebar .brand-logo {
  width: 100%;
  max-width: 140px;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  transition: filter 0.2s;
}
.sidebar .brand-name {
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  margin-top: 4px;
}
.sidebar .brand-sub {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 2px;
  transition: background 0.12s, color 0.12s;
}
.sidebar nav a:hover { background: var(--card); color: var(--text); }
.sidebar nav a.active {
  background: var(--card-hi);
  color: var(--primary);
  border-left: 2px solid var(--primary);
  padding-left: 8px;
}
.sidebar nav .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  font-size: 17px;
  line-height: 1;
  flex-shrink: 0;
  /* Emojis ignore CSS color, so they retain their native multi-color glyph */
}

.sidebar .who {
  position: absolute;
  bottom: 16px;
  left: 14px;
  right: 14px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.sidebar .who a { font-size: 12px; }

/* Build badge — bottom-left, shows which commit/PR is currently deployed */
.build-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-2, var(--card));
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  cursor: help;
}
.build-env {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.build-env-hosted { background: rgba(34, 211, 238, 0.18); color: var(--primary); }
.build-env-local  { background: rgba(251, 191, 36, 0.18); color: var(--gold); }
.build-link {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}
.build-link:hover { color: var(--primary); text-decoration: none; }
.build-sha {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 12px;
}
.build-dirty {
  color: var(--red);
  font-size: 14px;
  line-height: 1;
}

.main {
  padding: 24px 32px 64px;
  max-width: 1280px;
}

/* Page header ------------------------------------------------------------- */
.page-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 22px;
}
.page-h h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.page-h .actions { display: flex; gap: 8px; }

/* Cards ------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}
.kpi .label { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi .num   { font-size: 28px; font-weight: 700; margin-top: 4px; font-feature-settings: "tnum"; }
.kpi.gold .num   { color: var(--gold); }
.kpi.cyan .num   { color: var(--primary); }
.kpi.green .num  { color: var(--green); }

/* Tables ------------------------------------------------------------------ */
table.t {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
table.t th, table.t td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
table.t th {
  background: var(--bg-2);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
table.t tr:last-child td { border-bottom: none; }
table.t tbody tr:hover { background: var(--card-hi); }

/* Buttons / forms --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #04161f;
  border: none;
  padding: 8px 14px;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}
.btn:hover { background: var(--primary-2); color: #04161f; }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.ghost:hover { background: var(--card); color: var(--text); }
.btn.gold { background: var(--gold); color: #1c1303; }
.btn.gold:hover { background: #f59e0b; color: #1c1303; }
.btn.danger { background: var(--red); color: #fff; }

input, select, textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.18);
}

label {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.field { margin-bottom: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* Status pills ------------------------------------------------------------ */
.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid var(--border);
}
.pill.new          { background: rgba(34, 211, 238, 0.14); color: var(--primary); border-color: rgba(34,211,238,0.3); }
.pill.contacted    { background: rgba(250, 204, 21, 0.14); color: var(--yellow); border-color: rgba(250,204,21,0.3); }
.pill.audited      { background: rgba(251, 191, 36, 0.14); color: var(--gold); border-color: rgba(251,191,36,0.3); }
.pill.proposal     { background: rgba(168, 85, 247, 0.16); color: #c4b5fd; border-color: rgba(168,85,247,0.3); }
.pill.closed_won   { background: rgba(52, 211, 153, 0.16); color: var(--green); border-color: rgba(52,211,153,0.3); }
.pill.closed_lost  { background: rgba(248, 113, 113, 0.16); color: var(--red); border-color: rgba(248,113,113,0.3); }

/* Flash messages ---------------------------------------------------------- */
.flash {
  padding: 10px 14px;
  border-radius: 7px;
  margin-bottom: 16px;
  font-size: 14px;
}
.flash.error   { background: rgba(248, 113, 113, 0.12); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
.flash.success { background: rgba(52, 211, 153, 0.12); color: var(--green); border: 1px solid rgba(52,211,153,0.3); }
.flash.info    { background: rgba(34, 211, 238, 0.12); color: var(--primary); border: 1px solid rgba(34,211,238,0.3); }

/* Login ------------------------------------------------------------------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, #142440 0%, #0a1628 70%);
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 32px 36px;
  border-radius: 14px;
  width: 360px;
  text-align: center;
}
.login-card img { height: 56px; margin-bottom: 14px; }
.login-card h1 { margin: 0 0 6px; font-size: 20px; }
.login-card p  { color: var(--text-dim); margin: 0 0 24px; font-size: 13px; }

/* Filter bar -------------------------------------------------------------- */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 10px;
  align-items: center;
}
.filter-bar input, .filter-bar select { width: auto; min-width: 140px; }

/* Score badge ------------------------------------------------------------- */
.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 16px;
  background: var(--bg-2);
  border: 2px solid var(--border);
}
.score.A { color: var(--green); border-color: var(--green); }
.score.B { color: var(--primary); border-color: var(--primary); }
.score.C { color: var(--gold); border-color: var(--gold); }
.score.D { color: #fb923c; border-color: #fb923c; }
.score.F { color: var(--red); border-color: var(--red); }

/* Config-warning banner --------------------------------------------------- */
.config-warn {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--gold);
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* Tool cards -------------------------------------------------------------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 10px;
  transition: border-color 0.15s, transform 0.15s;
}
.tool-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.tool-card h3 { margin: 0 0 6px; font-size: 16px; }
.tool-card p  { color: var(--text-dim); font-size: 13px; margin: 0 0 14px; }

/* Markdown report preview ------------------------------------------------- */
.md-preview {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 36px;
  line-height: 1.65;
}
.md-preview h1, .md-preview h2, .md-preview h3 { color: var(--gold); }
.md-preview h1 { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.md-preview code {
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}
.md-preview pre { background: var(--bg-2); padding: 14px; border-radius: 7px; overflow-x: auto; }
.md-preview blockquote {
  border-left: 3px solid var(--primary);
  margin: 0;
  padding: 4px 16px;
  color: var(--text-dim);
}

/* Comparison report (structured layout) ---------------------------------- */
.report {
  max-width: 980px;
  margin: 0 auto;
  --r-text:    var(--text);
  --r-dim:     var(--text-dim);
  --r-bg:      var(--bg-2);
  --r-card:    var(--card);
  --r-border:  var(--border);
  --r-accent:  var(--gold);
  --r-cyan:    var(--primary);
}

.report .r-hero {
  background: linear-gradient(135deg, #142440 0%, #0d1b2e 100%);
  border: 1px solid var(--r-border);
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.report .r-hero img { height: 44px; }
.report .r-hero .meta { text-align: right; color: var(--r-dim); font-size: 12px; }
.report .r-hero h1 {
  margin: 6px 0 4px;
  font-size: 28px;
  letter-spacing: -0.4px;
}
.report .r-hero .sub { color: var(--r-dim); font-size: 14px; }

.report .r-section {
  background: var(--r-card);
  border: 1px solid var(--r-border);
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 16px;
}
.report .r-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--r-dim);
  margin: 0 0 14px;
  font-weight: 600;
}

/* Big 3-column score hero */
.report .r-scores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
}
.report .r-scores .col { text-align: center; }
.report .r-scores .col .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--r-dim); }
.report .r-scores .col .num   { font-size: 64px; font-weight: 800; line-height: 1; margin: 8px 0; font-feature-settings: "tnum"; }
.report .r-scores .col .grade { font-size: 13px; color: var(--r-dim); }
.report .r-scores .col.live   .num { color: var(--r-text); }
.report .r-scores .col.mockup .num { color: var(--r-accent); }
.report .r-scores .delta {
  text-align: center;
  border-left: 1px dashed var(--r-border);
  border-right: 1px dashed var(--r-border);
  padding: 0 24px;
}
.report .r-scores .delta .arrow { font-size: 20px; color: var(--r-dim); }
.report .r-scores .delta .num   { font-size: 56px; font-weight: 800; line-height: 1; margin: 6px 0; color: var(--green); }
.report .r-scores .delta .lbl   { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--r-dim); }

/* Pillar bars */
.report .r-pillar { padding: 10px 0; border-bottom: 1px solid var(--r-border); }
.report .r-pillar:last-child { border-bottom: none; }
.report .r-pillar .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
}
.report .r-pillar .top .delta-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.16);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.report .r-pillar .top .delta-pill.small  { background: rgba(251, 191, 36, 0.14); color: var(--gold);    border-color: rgba(251, 191, 36, 0.3); }
.report .r-pillar .top .delta-pill.muted  { background: rgba(255, 255, 255, 0.04); color: var(--r-dim); border-color: var(--r-border); }
.report .r-pillar .bars { display: grid; grid-template-columns: 70px 1fr 40px; gap: 10px; align-items: center; padding: 4px 0; font-size: 12px; }
.report .r-pillar .bars .lbl { color: var(--r-dim); }
.report .r-pillar .bars .track {
  height: 8px;
  background: var(--r-bg);
  border-radius: 4px;
  overflow: hidden;
}
.report .r-pillar .bars .fill { height: 100%; border-radius: 4px; transition: width 0.4s; }
.report .r-pillar .bars .fill.live   { background: var(--r-dim); }
.report .r-pillar .bars .fill.mockup { background: var(--r-accent); }
.report .r-pillar .bars .num { text-align: right; font-feature-settings: "tnum"; font-weight: 600; }

/* ROI hero */
.report .r-roi {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(34, 211, 238, 0.05));
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.report .r-roi-headline {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  text-align: center;
}
.report .r-roi-headline .col { padding: 8px 0; }
.report .r-roi-headline .col .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.report .r-roi-headline .col.low  .label { color: var(--r-dim); }
.report .r-roi-headline .col.mid  .label { color: var(--r-accent); }
.report .r-roi-headline .col.high .label { color: var(--green); }
.report .r-roi-headline .col .num { font-feature-settings: "tnum"; font-weight: 800; line-height: 1; margin: 8px 0; }
.report .r-roi-headline .col.low  .num { font-size: 30px; color: var(--r-dim); }
.report .r-roi-headline .col.mid  .num { font-size: 46px; color: var(--r-accent); }
.report .r-roi-headline .col.high .num { font-size: 30px; color: var(--green); }
.report .r-roi-headline .col .sub { font-size: 11px; color: var(--r-dim); }

.report .r-roi-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  font-size: 13px;
}
.report .r-roi-table th, .report .r-roi-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--r-border);
  text-align: right;
}
.report .r-roi-table th:first-child, .report .r-roi-table td:first-child { text-align: left; color: var(--r-dim); }
.report .r-roi-table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--r-dim); font-weight: 600; }
.report .r-roi-table tr:last-child td { border-bottom: none; }
.report .r-roi-table .col-mid { color: var(--r-accent); font-weight: 600; }

.report .r-assumptions {
  background: var(--r-bg);
  border: 1px solid var(--r-border);
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 14px;
  font-size: 13px;
}
.report .r-assumptions ul { margin: 4px 0 0; padding-left: 18px; line-height: 1.7; }

.report .r-next ol { padding-left: 22px; line-height: 1.85; }
.report .r-next li { margin-bottom: 4px; }

.report .r-method, .report .r-disclaimer {
  font-size: 11.5px;
  color: var(--r-dim);
  line-height: 1.6;
}
.report .r-disclaimer {
  border-top: 1px solid var(--r-border);
  margin-top: 18px;
  padding-top: 14px;
  font-style: italic;
}

.report .r-footer {
  text-align: center;
  font-size: 12px;
  color: var(--r-dim);
  padding: 18px 0 8px;
  border-top: 1px solid var(--r-border);
  margin-top: 18px;
}

/* Kanban board (Tasks) --------------------------------------------------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.kanban-col {
  background: var(--bg-2);
  border-radius: 10px;
  padding: 12px;
  min-height: 180px;
}
.kanban-col-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 12px;
  padding: 0 4px;
}
.kanban-count {
  background: var(--card);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}
.kanban-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
  font-style: italic;
}
.task-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-dim);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.1s, opacity 0.15s;
  cursor: grab;
}
.task-card:active { cursor: grabbing; }
.task-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  text-decoration: none;
}
.task-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
}
.kanban-col.drag-over {
  background: var(--card-hi);
  outline: 2px dashed var(--primary);
  outline-offset: -4px;
}
.kanban-col.drag-over .kanban-empty { display: none; }
.kanban-col-body { min-height: 40px; }
.task-card.priority-low      { border-left-color: var(--text-dim); }
.task-card.priority-normal   { border-left-color: var(--primary); }
.task-card.priority-high     { border-left-color: var(--gold); }
.task-card.priority-urgent   { border-left-color: var(--red); }

/* Whole-card tint by category. Priority keeps its 3px left border on top. */
.task-card.cat-lead {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.65);
}
.task-card.cat-lead:hover     { background: rgba(59, 130, 246, 0.32); border-color: rgba(59, 130, 246, 0.95); }
.task-card.cat-customer {
  background: rgba(52, 211, 153, 0.22);
  border-color: rgba(52, 211, 153, 0.65);
}
.task-card.cat-customer:hover { background: rgba(52, 211, 153, 0.32); border-color: rgba(52, 211, 153, 0.95); }
.task-card.cat-internal {
  background: rgba(167, 139, 250, 0.22);
  border-color: rgba(167, 139, 250, 0.65);
}
.task-card.cat-internal:hover { background: rgba(167, 139, 250, 0.32); border-color: rgba(167, 139, 250, 0.95); }
.task-card.cat-research {
  background: rgba(244, 114, 182, 0.22);
  border-color: rgba(244, 114, 182, 0.65);
}
.task-card.cat-research:hover { background: rgba(244, 114, 182, 0.32); border-color: rgba(244, 114, 182, 0.95); }
.task-card.cat-other {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.55);
}
.task-card.cat-other:hover    { background: rgba(148, 163, 184, 0.28); border-color: rgba(148, 163, 184, 0.85); }

/* Plain text-only category label inside the card (no bg pill, just colored text) */
.task-cat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.task-cat-label.cat-lead     { color: #60a5fa; }
.task-cat-label.cat-customer { color: #34d399; }
.task-cat-label.cat-internal { color: #a78bfa; }
.task-cat-label.cat-research { color: #f472b6; }
.task-cat-label.cat-other    { color: #94a3b8; }

/* Journal — daily wrap-up calendar + Markdown viewer */
.journal-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 14px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.journal-legend-item { display: inline-flex; align-items: center; gap: 6px; }

.journal-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.journal-dot.user-sean     { background: #22d3ee; }
.journal-dot.user-anthony  { background: #fbbf24; }
.journal-dot.user-combined { background: #a78bfa; }

.journal-cal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.journal-cal-h {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--card-hi);
  border-bottom: 1px solid var(--border);
}
.journal-cal-h > div {
  padding: 8px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  font-weight: 700;
}
.journal-cal-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.journal-cal-row:last-child { border-bottom: none; }
.journal-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 88px;
  padding: 8px 10px;
  border-right: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
}
.journal-cell:last-child { border-right: none; }
.journal-cell.out-of-month { color: var(--text-dim); background: rgba(0,0,0,0.18); }
.journal-cell.today .journal-cell-day {
  background: var(--primary);
  color: var(--bg);
  border-radius: 999px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.journal-cell.has-logs:hover {
  background: var(--card-hi);
  text-decoration: none;
}
.journal-cell-day { font-weight: 600; }
.journal-cell-dots { display: flex; gap: 4px; }

/* Tab switcher on the day view (Sean / Anthony / Combined) */
.journal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.journal-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.journal-tab:hover { color: var(--text); text-decoration: none; }
.journal-tab.active {
  color: var(--text);
  border-bottom-color: var(--primary);
}

/* Rendered Markdown */
.journal-md {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 26px 32px;
  line-height: 1.65;
  font-size: 15px;
  color: var(--text);
}
.journal-md h1, .journal-md h2, .journal-md h3 { color: var(--text); margin-top: 24px; }
.journal-md h1 { font-size: 24px; margin-top: 0; }
.journal-md h2 { font-size: 19px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.journal-md h3 { font-size: 16px; }
.journal-md a  { color: var(--primary); }
.journal-md code {
  background: var(--card-hi);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
}
.journal-md pre {
  background: var(--card-hi);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  overflow: auto;
  font-size: 13px;
}
.journal-md pre code { background: none; padding: 0; }
.journal-md blockquote {
  border-left: 3px solid var(--primary);
  padding: 4px 14px;
  color: var(--text-dim);
  margin: 12px 0;
  background: rgba(34, 211, 238, 0.05);
}
.journal-md table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13px;
}
.journal-md th, .journal-md td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
.journal-md th { background: var(--card-hi); }
.journal-md ul, .journal-md ol { padding-left: 24px; }
.journal-md hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* Live deploy-status pill — sidebar bottom-left, polls /_status/deploy */
.deploy-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin: 0 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.deploy-pill:hover { transform: translateY(-1px); text-decoration: none; }

.deploy-pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.deploy-pill-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deploy-pill-arrow { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }

/* Per-state colors */
.deploy-pill.deploy-green {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.08);
}
.deploy-pill.deploy-green .deploy-pill-dot {
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  animation: deploy-pulse-green 2.2s infinite;
}
.deploy-pill.deploy-gold {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
}
.deploy-pill.deploy-gold .deploy-pill-dot {
  background: #fbbf24;
  box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.6);
  animation: deploy-pulse-gold 1.2s infinite;
}
.deploy-pill.deploy-red {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.10);
  color: #fecaca;
}
.deploy-pill.deploy-red .deploy-pill-dot { background: #f87171; }
.deploy-pill.deploy-dim   { border-color: var(--border); }

@keyframes deploy-pulse-green {
  0%   { box-shadow: 0 0 0 0    rgba(52, 211, 153, 0.55); }
  70%  { box-shadow: 0 0 0 8px  rgba(52, 211, 153, 0);    }
  100% { box-shadow: 0 0 0 0    rgba(52, 211, 153, 0);    }
}
@keyframes deploy-pulse-gold {
  0%   { box-shadow: 0 0 0 0    rgba(251, 191, 36, 0.7); }
  70%  { box-shadow: 0 0 0 9px  rgba(251, 191, 36, 0);   }
  100% { box-shadow: 0 0 0 0    rgba(251, 191, 36, 0);   }
}

/* Dashboard sections — clear visual separation between At-a-glance / My Tasks / Recent activity */
.dash-section {
  margin: 28px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.dash-section:first-of-type {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}
.dash-section-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.dash-section-h h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.dash-section-sub {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 400;
  margin-left: 4px;
}
.dash-subhead {
  margin: 4px 0 10px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* My Tasks grid on the dashboard home */
.my-tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.task-status-mini {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  background: var(--card-hi);
  color: var(--text-dim);
}

.task-title {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}
.task-lead {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.task-lead a { color: var(--primary); }
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}
.task-assignee {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--card-hi);
  color: var(--text);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0;
}
.task-assignee.assignee-sean    { background: rgba(34, 211, 238, 0.18); color: var(--primary); }
.task-assignee.assignee-anthony { background: rgba(251, 191, 36, 0.18); color: var(--gold); }
.task-assignee.unassigned       { background: var(--bg-2); color: var(--text-muted); border: 1px dashed var(--border); }

.task-priority {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.task-priority.priority-low      { background: rgba(148, 163, 184, 0.16); color: var(--text-dim); }
.task-priority.priority-normal   { background: rgba(34, 211, 238, 0.14);  color: var(--primary); }
.task-priority.priority-high     { background: rgba(251, 191, 36, 0.16);  color: var(--gold); }
.task-priority.priority-urgent   { background: rgba(248, 113, 113, 0.16); color: var(--red); }

.task-due {
  color: var(--text-dim);
  font-size: 11px;
}
.task-due.past   { color: var(--red); }
.task-due.today  { color: var(--gold); font-weight: 600; }

.task-comments {
  color: var(--text-dim);
  font-size: 11px;
}

.task-priority-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.task-priority-dot.priority-low      { background: var(--text-dim); }
.task-priority-dot.priority-normal   { background: var(--primary); }
.task-priority-dot.priority-high     { background: var(--gold); }
.task-priority-dot.priority-urgent   { background: var(--red); }

/* Category badges (Jira-style issue type) ------------------------------- */
.task-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 3px;
  line-height: 1.4;
}
.task-cat::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}
.task-cat.cat-lead     { background: rgba(59, 130, 246, 0.16); color: #60a5fa; }
.task-cat.cat-customer { background: rgba(52, 211, 153, 0.16); color: #34d399; }
.task-cat.cat-internal { background: rgba(167, 139, 250, 0.16); color: #a78bfa; }
.task-cat.cat-research { background: rgba(244, 114, 182, 0.16); color: #f472b6; }
.task-cat.cat-other    { background: rgba(148, 163, 184, 0.16); color: #94a3b8; }

/* Larger version on detail page meta */
.task-cat.task-cat-lg { font-size: 11px; padding: 3px 9px; }
.task-cat.task-cat-lg::before { width: 9px; height: 9px; }

/* Filter pills (Jira-style quick filters above the board) --------------- */
.cat-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 4px 0 12px;
}
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  border: 1px solid;
  transition: border-color 0.15s, background 0.15s, color 0.15s, filter 0.15s;
}
.cat-pill::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
}
.cat-pill:hover { text-decoration: none; filter: brightness(1.15); }
.cat-pill .cat-pill-count {
  font-size: 10px;
  background: rgba(0, 0, 0, 0.30);
  color: currentColor;
  padding: 1px 7px;
  border-radius: 8px;
  font-weight: 700;
}

/* Per-category pill colors — both inactive (subtle bg) and active (full bg) */
.cat-pill.cat-lead {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.45);
}
.cat-pill.cat-lead.active {
  background: rgba(59, 130, 246, 0.40);
  border-color: rgba(59, 130, 246, 0.85);
  color: #dbeafe;
}

.cat-pill.cat-customer {
  color: #34d399;
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.45);
}
.cat-pill.cat-customer.active {
  background: rgba(52, 211, 153, 0.40);
  border-color: rgba(52, 211, 153, 0.85);
  color: #d1fae5;
}

.cat-pill.cat-internal {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.45);
}
.cat-pill.cat-internal.active {
  background: rgba(167, 139, 250, 0.40);
  border-color: rgba(167, 139, 250, 0.85);
  color: #ede9fe;
}

.cat-pill.cat-research {
  color: #f472b6;
  background: rgba(244, 114, 182, 0.18);
  border-color: rgba(244, 114, 182, 0.45);
}
.cat-pill.cat-research.active {
  background: rgba(244, 114, 182, 0.40);
  border-color: rgba(244, 114, 182, 0.85);
  color: #fce7f3;
}

.cat-pill.cat-other {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.45);
}
.cat-pill.cat-other.active {
  background: rgba(148, 163, 184, 0.40);
  border-color: rgba(148, 163, 184, 0.85);
  color: #f1f5f9;
}

.cat-pill.cat-all {
  color: var(--primary);
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.40);
}
.cat-pill.cat-all.active {
  background: rgba(34, 211, 238, 0.32);
  border-color: rgba(34, 211, 238, 0.85);
  color: #cffafe;
}
.cat-pill.cat-all::before { display: none; }

/* Print stylesheet for PDF reports --------------------------------------- */
@media print {
  @page { margin: 14mm; size: letter; }

  html, body {
    background: white !important;
    color: #1a1a1a !important;
    font-size: 12px;
  }

  /* Break the dashboard's grid (sidebar + main) so the report uses the full page. */
  .app {
    display: block !important;
    min-height: auto !important;
  }
  .sidebar, .page-h, .no-print { display: none !important; }
  .main {
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
  }

  /* Generic MD reports */
  .md-preview { background: white; border: none; padding: 0; color: #111; }
  .md-preview h1, .md-preview h2, .md-preview h3 { color: #0a1628; }

  /* Comparison report — light theme for print */
  .report {
    --r-text:    #1a1a1a;
    --r-dim:     #555;
    --r-bg:      #f3f4f6;
    --r-card:    #ffffff;
    --r-border:  #d1d5db;
    --r-accent:  #b88706;
    --r-cyan:    #0e7490;
    max-width: 100% !important;
    width: 100%;
    margin: 0;
    color: #1a1a1a;
  }

  /* Hero — keep the dark band but tone down the size for print */
  .report .r-hero {
    background: #0a1628 !important;
    color: #fff !important;
    border: none;
    padding: 20px 28px !important;
    margin-bottom: 14px !important;
    page-break-after: avoid;
    -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
  }
  .report .r-hero img { height: 36px; }
  .report .r-hero h1 {
    color: #fff !important;
    font-size: 22px !important;
    line-height: 1.2 !important;
    margin: 4px 0 2px !important;
  }
  .report .r-hero .sub  { color: #cbd5e1 !important; font-size: 12px !important; }
  .report .r-hero .meta { color: #cbd5e1 !important; font-size: 11px !important; }
  .report .r-hero .meta strong { color: #fff !important; }

  /* Sections — tighter padding, no shadows, no awkward page breaks */
  .report .r-section {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 16px 22px !important;
    margin-bottom: 12px !important;
    break-inside: avoid;
    box-shadow: none !important;
  }
  .report .r-section-title { color: #555 !important; }
  .report strong { color: #1a1a1a !important; }

  /* Score hero — scale numbers down so they fit nicely */
  .report .r-scores .col .num            { font-size: 44px !important; }
  .report .r-scores .col.live   .num     { color: #1a1a1a !important; }
  .report .r-scores .col.mockup .num     { color: #b88706 !important; }
  .report .r-scores .col .label          { color: #555 !important; }
  .report .r-scores .col .grade          { color: #555 !important; }
  .report .r-scores .delta .num          { color: #047857 !important; font-size: 38px !important; }
  .report .r-scores .delta .arrow        { color: #555 !important; }
  .report .r-scores .delta .lbl          { color: #555 !important; }
  .report .r-scores .delta               { border-color: #d1d5db !important; padding: 0 18px !important; }

  /* Pillar bars */
  .report .r-pillar                       { border-color: #e5e7eb !important; padding: 8px 0 !important; }
  .report .r-pillar .top                  { font-size: 13px !important; }
  .report .r-pillar .bars                 { font-size: 11.5px !important; padding: 2px 0 !important; }
  .report .r-pillar .bars .lbl            { color: #555 !important; }
  .report .r-pillar .bars .track          { background: #e5e7eb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report .r-pillar .bars .fill.live      { background: #6b7280 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report .r-pillar .bars .fill.mockup    { background: #b88706 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report .r-pillar .top .delta-pill       { background: #ecfdf5 !important; color: #047857 !important; border-color: #a7f3d0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report .r-pillar .top .delta-pill.small { background: #fffbeb !important; color: #b88706 !important; border-color: #fde68a !important; }
  .report .r-pillar .top .delta-pill.muted { background: #f3f4f6 !important; color: #555 !important;    border-color: #e5e7eb !important; }

  /* ROI section — soft cream tint, scaled-down numbers */
  .report .r-roi {
    background: #fffaf0 !important;
    border: 1px solid #f3d986 !important;
    -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
  }
  .report .r-roi-headline .col.low  .num  { font-size: 26px !important; color: #555 !important; }
  .report .r-roi-headline .col.mid  .num  { font-size: 36px !important; color: #b88706 !important; }
  .report .r-roi-headline .col.high .num  { font-size: 26px !important; color: #047857 !important; }
  .report .r-roi-headline .col .label     { font-size: 10px !important; }
  .report .r-roi-headline .col .sub       { color: #555 !important; }

  .report .r-roi-table                   { font-size: 11.5px !important; }
  .report .r-roi-table th, .report .r-roi-table td { padding: 6px 8px !important; border-color: #e5e7eb !important; }
  .report .r-roi-table thead th          { color: #555 !important; }
  .report .r-roi-table .col-mid          { color: #b88706 !important; }

  .report .r-assumptions { background: #f9fafb !important; border-color: #e5e7eb !important; font-size: 11.5px !important; }

  .report .r-next ol, .report .r-method p, .report .r-disclaimer { font-size: 12px !important; }
  .report .r-method, .report .r-disclaimer { color: #555 !important; }
  .report .r-disclaimer { border-color: #e5e7eb !important; }
  .report .r-footer     { color: #555 !important; border-color: #e5e7eb !important; }
  .report .r-footer strong { color: #b88706 !important; }
}
