/*
 * iDo CRM — base stylesheet.
 * Design tokens sourced from ../ido-crm-mockups/DESIGN.md.
 * Component styles live in separate files under this directory (Propshaft concat).
 */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  /* Neutral */
  --bg-page: #f5f6f8;
  --bg-surface: #ffffff;
  --bg-surface-alt: #fafafb;
  --bg-muted: #f3f4f6;
  --bg-highlight: #eef2ff;
  --border-default: #e5e7eb;
  --border-soft: #f3f4f6;
  --text-primary: #111827;
  --text-body: #1f2937;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  /* Brand / accent */
  --accent-internal: #4f46e5;
  --accent-internal-hover: #4338ca;
  --accent-partner: #dc2626;
  --accent-partner-hover: #b91c1c;

  /* Status */
  --status-overdue-bg: #fef2f2;
  --status-overdue-fg: #991b1b;
  --status-warn-bg: #fef3c7;
  --status-warn-fg: #92400e;
  --status-info-bg: #dbeafe;
  --status-info-fg: #1e40af;
  --status-qualified-bg: #e0e7ff;
  --status-qualified-fg: #3730a3;
  --status-appointment-bg: #d1fae5;
  --status-appointment-fg: #065f46;
  --status-paid-bg: #bbf7d0;
  --status-paid-fg: #14532d;
  --status-stuck-bg: #f5f3ff;
  --status-stuck-fg: #5b21b6;

  /* Spacing */
  --s-1: 4px;
  --s-2: 6px;
  --s-3: 8px;
  --s-4: 12px;
  --s-5: 14px;
  --s-6: 16px;
  --s-7: 20px;
  --s-8: 24px;

  /* Radius */
  --r-1: 4px;
  --r-2: 5px;
  --r-3: 6px;
  --r-4: 8px;
  --r-pill: 10px;
}

/* ── Base reset + typography ───────────────────────────────── */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "微软雅黑",
    "Source Han Sans CN", "Noto Sans CJK SC",
    "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  background: var(--bg-page);
  color: var(--text-body);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1 { font-size: 22px; font-weight: 600; color: var(--text-primary); margin: 0; }
h2 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0; }

/* Tabular numbers for SLA timestamps, stats, and counters */
.num, .stat-value, .kpi-value, time { font-variant-numeric: tabular-nums; }

/* ── Accessibility baseline ────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent-internal);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

/* Visually hidden (for ARIA labels and screen-reader text) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Responsive guard ──────────────────────────────────────── */
/* v1 is desktop-only (D4). Show a banner below 1280px. */
.viewport-warning {
  display: none;
  padding: var(--s-4) var(--s-6);
  background: var(--status-warn-bg);
  color: var(--status-warn-fg);
  font-size: 12px;
  text-align: center;
}
@media (max-width: 1279px) {
  .viewport-warning { display: block; }
}

/* ── Welcome placeholder page (will be removed when /sign_in ships) ── */
.welcome {
  max-width: 520px;
  margin: 80px auto;
  padding: var(--s-8);
  text-align: center;
}
.welcome h1 { font-size: 28px; margin-bottom: var(--s-3); }
.welcome .sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: var(--s-6);
}
.welcome .body {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}
