*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a202c;
  --text-muted: #718096;
  --accent: #4f46e5;
  --accent-dim: #eef2ff;
  --green: #10b981;
  --green-dim: #ecfdf5;
  --blue: #3b82f6;
  --blue-dim: #eff6ff;
  --purple: #8b5cf6;
  --purple-dim: #f5f3ff;
  --pink: #ec4899;
  --pink-dim: #fdf2f8;
  --amber: #f59e0b;
  --amber-dim: #fffbeb;
  --red: #ef4444;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.03);
}

/* Base — 14px everywhere, scale up/down from here */
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; background: var(--bg); color: var(--text); line-height: 1.55; }

/* ─── Header ─────────────────────────────────────────── */
.app-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.app-title { font-size: 17px; font-weight: 700; }
.app-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.header-controls { display: flex; align-items: center; gap: 10px; }

/* ─── Layout ──────────────────────────────────────────── */
.main { padding: 24px 28px; max-width: 1400px; margin: 0 auto; }
.section-gap { margin-top: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ─── Cards ───────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }

/* ─── Week selector ───────────────────────────────────── */
.week-selector { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.week-selector label { font-size: 13px; color: var(--text-muted); }

/* ─── Buttons ─────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: all .15s; }
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: #4338ca; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: var(--red); color: white; border-color: var(--red); }

/* ─── Stats ───────────────────────────────────────────── */
.stat-row { display: flex; gap: 12px; margin-bottom: 16px; }
.stat { flex: 1; background: var(--bg); border-radius: var(--radius); padding: 12px 14px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ─── Badges ──────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-green  { background: var(--green-dim);  color: var(--green); }
.badge-blue   { background: var(--blue-dim);   color: var(--blue); }
.badge-purple { background: var(--purple-dim); color: var(--purple); }
.badge-pink   { background: var(--pink-dim);   color: var(--pink); }
.badge-amber  { background: var(--amber-dim);  color: var(--amber); }
.badge-red    { background: #fee2e2;            color: var(--red); }

/* ─── Shipped / Progress lists ────────────────────────── */
.shipped-list, .progress-list { display: flex; flex-direction: column; gap: 8px; }
.shipped-item, .progress-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); }
.item-title { flex: 1; font-size: 13px; font-weight: 600; }
.item-meta { font-size: 12px; color: var(--text-muted); }

select { font-size: 13px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }

/* ─── Slack table ─────────────────────────────────────── */
.slack-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.slack-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border); font-weight: 600; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.slack-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.slack-table tr:last-child td { border-bottom: none; }
.slack-table .total-row td { font-weight: 700; background: var(--bg); }
.slack-count { display: inline-block; min-width: 24px; text-align: center; font-weight: 600; color: var(--ch-color, var(--text)); }

.slack-table-toggle { font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; user-select: none; }
.slack-table-toggle::-webkit-details-marker { display: none; }
.slack-table-toggle::before { content: '▶'; font-size: 9px; transition: transform .15s; }
details[open] .slack-table-toggle::before { transform: rotate(90deg); }

/* ─── Standup cards ───────────────────────────────────── */
.standup-card { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.standup-card summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; background: var(--bg); user-select: none; }
.standup-card summary::-webkit-details-marker { display: none; }
.standup-card summary::before { content: '▶'; font-size: 9px; color: var(--text-muted); margin-right: 2px; transition: transform .15s; }
.standup-card[open] summary::before { transform: rotate(90deg); }
.standup-date { flex: 1; color: var(--text); }
.standup-section { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.standup-section strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; }
.standup-section ol, .standup-section ul { padding-left: 18px; }
.standup-section li { margin-bottom: 4px; line-height: 1.6; }

/* ─── Goals ───────────────────────────────────────────── */
.goals-content { font-size: 14px; line-height: 1.75; color: var(--text); }
.goals-content ul { padding-left: 18px; }
.goals-content li { margin-bottom: 5px; }

/* ─── Misc ────────────────────────────────────────────── */
.channel-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; background: var(--accent-dim); color: var(--accent); border-radius: 99px; font-size: 12px; font-weight: 600; margin: 2px; }
.loading { text-align: center; padding: 20px; color: var(--text-muted); font-size: 13px; }
.error { color: var(--red); font-size: 13px; padding: 10px; background: #fee2e2; border-radius: var(--radius); }

/* ─── PDF generation (html2pdf renders live DOM, not @media print) ── */
.generating-pdf .header-controls,
.generating-pdf .btn { display: none !important; }
/* sticky header confuses html2canvas — make it flow normally */
.generating-pdf .app-header { position: static !important; }

/* ─── Print ───────────────────────────────────────────── */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .header-controls, .btn,
  details summary::before, .standup-card summary::before { display: none !important; }

  details { display: block !important; }
  details > *:not(summary) { display: block !important; }

  body { background: white; font-size: 12px; }
  .app-header { position: static; border-bottom: 2px solid #000; padding: 8px 16px; }
  .app-title { font-size: 16px; }
  .main { padding: 12px 16px; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; margin-bottom: 10px; }
  .section-gap { margin-top: 10px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2.section-gap:first-of-type { break-after: avoid; }
  #slackChart { max-height: 180px; }
  .stat { background: #f8f9fa !important; }
}
