/* Access CRM design tokens (docs/UI-GUIDE.md). Use these variables everywhere. */
:root {
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --border: #E3E8EF;
  --border-strong: #D5DCE6;
  --row-line: #EEF1F6;
  --table-head: #F8FAFC;

  --text: #16202E;
  --text-muted: #5B6778;
  --text-label: #344054;

  --primary: #1F5FD6;
  --primary-hover: #1A52BC;
  --primary-ink: #1747A6;
  --primary-tint: #E6EEFC;

  --nav-bg: #0E1A2F;
  --nav-text: #B9C5D9;
  --nav-text-dim: #8FA0BB;
  --nav-active-bg: #1F3A68;
  --nav-hover-bg: #16263F;
  --nav-line: #1B2A45;
  --nav-button-line: #2A3B59;
  --nav-avatar: #2B4A7E;

  --success: #0D6445;
  --success-tint: #DDF3E8;
  --warning: #8A4B00;
  --warning-tint: #FFF1D6;
  --danger: #A32A22;
  --danger-tint: #FBE3E1;
  --danger-line: #F2C4C0;
  --danger-dot: #C2342B;
  --neutral: #475264;
  --neutral-tint: #EAEEF3;
  --purple: #5A34B0;
  --purple-tint: #EDE6FB;

  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius-card: 10px;
  --radius-control: 8px;
  --shadow-float: 0 12px 32px rgba(14, 26, 47, 0.16);

  --sidebar-w-expanded: 248px;
  --sidebar-w-collapsed: 72px;
  --sidebar-w: var(--sidebar-w-expanded);
  --drawer-w: 304px;
  --topbar-h: 64px;
  --bottomnav-h: 64px;

  --page-pad-y: 28px;
  --page-pad-x: 32px;

  /* Bootstrap hooks */
  --bs-body-font-family: var(--font);
  --bs-body-font-size: 14px;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-primary: #1F5FD6;
  --bs-primary-rgb: 31, 95, 214;
  --bs-link-color: var(--primary-ink);
}

html.sidebar-collapsed {
  --sidebar-w: var(--sidebar-w-collapsed);
}

@media (max-width: 767.98px) {
  :root {
    --page-pad-y: 16px;
    --page-pad-x: 16px;
    --topbar-h: 56px;
  }
}

/* Base */
*, *::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-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--text); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.n, .num, table td.num { font-variant-numeric: tabular-nums; }

.text-muted-c { color: var(--text-muted) !important; }

.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}
