/* ═══════════════════════════════════════════════════════════════════
   Bondking copy of the HiBond / Totachi design system — only the palette
   differs (Bondking orange + black instead of HiBond green).

   Totachi ERP — Design Tokens
   Extracted verbatim from totachi_app/templates/base.html's :root block,
   plus the semantic extensions used consistently across dashboard.html,
   kanban.html, and the badge/status-pill patterns repeated app-wide.

   Drop this file (+ components.css) into any new Django project's
   base.html to start from the same visual language.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* ── Core palette (Bondking: the crown's orange on black) ─────── */
  --brand:        #ec6c23;  /* the logo's orange, for accents only */
  --brand-ink:    #212529;  /* the navbar's black */
  --primary:      #c45512;  /* brand orange, deepened so white text on it passes 4.5:1 */
  --primary-dk:   #a3460e;
  --primary-ring: rgba(196,85,18,.22);  /* focus / required-field ring */
  --bg:           #f3f3f8;
  --surface:      #ffffff;
  --surface-alt:  #f9f9fc;  /* a step below surface, lighter than --bg: child rows under a group header */
  --border:       #eaedf2;
  --text:         #111827;
  --muted:        #6b7280;
  --success:      #15803d;
  --danger:       #dc3545;
  --warning:      #f59e0b;

  /* ── Shape ────────────────────────────────────────────────────── */
  --radius:       10px;
  --radius-sm:    6px;
  --radius-pill:  99px;
  /* Shadow scale: the bigger the surface, the deeper the shadow.
     card < dropdown / menu / toast < modal / slide panel. Never a one-off. */
  --shadow:       0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.02);
  --shadow-pop:   0 4px 16px rgba(0,0,0,.1);
  --shadow-modal: 0 12px 40px rgba(0,0,0,.2);
  --scrim:        rgba(17,24,39,.4);   /* dim behind a blocking modal */

  /* ── Motion ───────────────────────────────────────────────────────
     Every transition uses one of these; never a hand-typed duration.
     press = feedback on mouse/finger down, fast = hover and small menus,
     base = modals and panels, slow = progress bars and other long fills.
     ease-in is the mirror of ease-out: use it for the way back. */
  --dur-press:    100ms;
  --dur-fast:     120ms;
  --dur-base:     180ms;
  --dur-slow:     400ms;
  --ease-out:     cubic-bezier(.2,.8,.2,1);
  --ease-in:      cubic-bezier(.8,0,.8,.2);

  /* ── Layout (chrome sizing) ───────────────────────────────────── */
  --nav-h:        56px;
  --side-w:       210px;

  /* ── Semantic status colors (bg/fg pairs) ────────────────────────
     Every badge/pill/card-accent in the app is built from one of these
     pairs — never a one-off color. Reuse the pair, not just the hue. */
  --status-neutral-bg:  #f1f5f9;  --status-neutral-fg:  #475569;
  --status-good-bg:     #dcfce7;  --status-good-fg:     #166534;
  --status-bad-bg:      #fee2e2;  --status-bad-fg:      #991b1b;
  --status-warn-bg:     #fef3c7;  --status-warn-fg:     #92400e;
  --status-info-bg:     #fdf1e8;  --status-info-fg:     #8a3a0b; /* tints of primary */

  /* Category tones: tell kinds of things apart (search badges and pills:
     Client, SO #, Product…) where the status pairs would imply a state. */
  --tone-teal-bg:       #ccfbf1;  --tone-teal-fg:       #115e59;
  --tone-violet-bg:     #ede9fe;  --tone-violet-fg:     #5b21b6;
  --tone-orange-bg:     #ffedd5;  --tone-orange-fg:     #9a3412;
  --tone-pink-bg:       #fce7f3;  --tone-pink-fg:       #9d174d;

  /* softer variants used for alert/callout boxes (rejection/warning strips) */
  --alert-danger-bg:    #fef2f2;  --alert-danger-border: #fca5a5;
  --alert-warning-bg:   #fffbeb;  --alert-warning-border:#fcd34d;
  --alert-success-bg:   #f0fdf4;  --alert-success-border:#bbf7d0;
  --alert-info-bg:      #fef7f2;  --alert-info-border:   #f5c9a8; /* tints of primary */

  /* aging / receivable buckets (dashboard.html) */
  --aging-ok-bg:    #f0fdf4;  --aging-ok-border:    #bbf7d0;  --aging-ok-fg:    #15803d;
  --aging-warn-bg:  #fefce8;  --aging-warn-border:  #fde68a;  --aging-warn-fg:  #b45309;
  --aging-alert-bg: #fff7ed; --aging-alert-border: #fed7aa;  --aging-alert-fg: #c2410c;
  --aging-crit-bg:  #fef2f2; --aging-crit-border:  #fecaca;  --aging-crit-fg:  #dc2626;

  /* ── Typography ───────────────────────────────────────────────── */
  --font-body:    system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Montserrat', sans-serif; /* weights 500/600/700 loaded from Google Fonts */
  --fs-base:      .98rem;
  /* Tracking and leading change with size: big text is tightened, body is
     left alone, small uppercase labels are opened up (.06–.1em, set per class). */
  --track-tight:  -.02em;   /* page titles, KPI numbers */
  --track-snug:   -.01em;   /* section and card headings */
  --lh-tight:     1.15;     /* big numbers and page titles */
  --lh-heading:   1.3;
  --lh-body:      1.5;
}

/* More contrast: firmer borders and darker secondary text. */
@media (prefers-contrast: more) {
  :root { --border: #8b93a1; --muted: #374151; --scrim: rgba(17,24,39,.7); }
}
/* Less transparency: the dim behind a modal becomes close to solid. */
@media (prefers-reduced-transparency: reduce) {
  :root { --scrim: rgba(17,24,39,.85); }
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); line-height: var(--lh-heading); letter-spacing: var(--track-snug); }
h1, h2 { letter-spacing: var(--track-tight); line-height: var(--lh-tight); }
