/*
Color tokens derived from the Tata Sky/Tata Play brand mark (blue "TATA" +
orange-to-magenta-to-violet "sky" gradient), validated as a categorical
palette with scripts/validate_palette.js from the dataviz skill (light mode,
surface #fcfcfb): lightness band, chroma floor, adjacent-pair CVD separation
(worst 9.1 protan), and normal-vision floor (worst 22.9) all pass. Orange,
aqua and yellow sit below 3:1 contrast on a light surface — the mitigation is
that no UI element here uses these as flat text-on-white; they're always a
filled chip/badge with its own explicit text color, or paired with a label.
*/
:root {
  /* Retint Bootstrap's primary role to the brand blue so buttons, links,
     .text-primary/.border-primary/.bg-primary follow it automatically. */
  --bs-primary: #1f5fa8;
  --bs-primary-rgb: 31, 95, 168;
  --bs-link-color: #1f5fa8;
  --bs-link-color-rgb: 31, 95, 168;
  --bs-link-hover-color: #164a85;
  --bs-link-hover-color-rgb: 22, 74, 133;

  --brand-blue: #1f5fa8;
  --brand-orange: #f4801f;
  --brand-magenta: #d6259d;
  --brand-violet: #8151a8;

  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;

  --ink-primary: #0b0b0b;
  --ink-secondary: #52514e;
  --ink-muted: #898781;
  --surface: #fcfcfb;
  --gridline: #e1e0d9;
}

/* Brand chrome */
.navbar-brand-strip {
  height: 4px;
  background: linear-gradient(90deg, var(--brand-orange), var(--brand-magenta), var(--brand-violet), var(--brand-blue));
}
.navbar.navbar-brand-bar {
  background-color: var(--brand-blue) !important;
}

/* Order lifecycle — evaluative states use reserved status colors, not identity hues. */
.badge-stage-pending   { background: var(--brand-blue); color: #fff; }
.badge-stage-activated { background: var(--status-good); color: #fff; }
.badge-stage-canceled  { background: var(--status-critical); color: #fff; }
.badge-stage-reorder   { background: var(--brand-magenta); color: #fff; }

/* Triage category — genuine identity (which path), categorical hues. */
.badge-triage-new_order      { background: var(--brand-blue); color: #fff; }
.badge-triage-not_responding { background: var(--brand-orange); color: var(--ink-primary); }
.badge-triage-old_customer   { background: var(--brand-violet); color: #fff; }
.badge-triage-not_interested { background: var(--status-critical); color: #fff; }
.badge-triage-internal       { background: var(--ink-muted); color: #fff; }
.badge-triage-others         { background: var(--brand-magenta); color: #fff; }
.badge-triage-followup       { background: var(--status-warning); color: var(--ink-primary); }
.badge-triage-untriaged      { background: var(--gridline); color: var(--ink-secondary); }

/* Human-call match state — "after" is the ideal outcome (AI flagged it, human
   followed up), "before" means a human had already touched this customer
   before the AI call, so it's worth telling apart at a glance. */
.badge-match-after     { background: var(--status-good); color: #fff; }
.badge-match-before    { background: var(--brand-violet); color: #fff; }
.badge-match-same      { background: var(--brand-blue); color: #fff; }
.badge-match-unknown   { background: var(--gridline); color: var(--ink-secondary); }
.badge-match-not-found { background: var(--gridline); color: var(--ink-secondary); }

/* Deviation / overdue emphasis */
.row-overdue { background-color: rgba(208, 59, 59, 0.08) !important; }

.kpi-tile {
  border-top: 3px solid var(--brand-blue);
}
.kpi-tile.kpi-warning { border-top-color: var(--status-warning); }
.kpi-tile.kpi-critical { border-top-color: var(--status-critical); }

/* ---- General polish ---------------------------------------------------- */

body {
  background-color: #f7f5f9;
}

.card {
  border: 1px solid rgba(11, 11, 11, 0.08);
  border-radius: 0.75rem;
  box-shadow: 0 2px 10px rgba(31, 95, 168, 0.06);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(11, 11, 11, 0.08);
  font-weight: 600;
}

.kpi-tile {
  border-radius: 0.75rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(214, 37, 157, 0.15);
}

/* Icon badge used inside KPI tiles and card headers */
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-magenta), var(--brand-blue));
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}
.icon-circle.icon-critical { background: linear-gradient(135deg, var(--status-critical), var(--brand-magenta)); }
.icon-circle.icon-good { background: linear-gradient(135deg, var(--status-good), var(--brand-blue)); }
.icon-circle.icon-warning { background: linear-gradient(135deg, var(--status-warning), var(--brand-orange)); }

/* Pink brand accent */
.text-brand-pink { color: var(--brand-magenta); }
.btn-brand-pink {
  background: linear-gradient(135deg, var(--brand-magenta), #b81886);
  border: none;
  color: #fff;
}
.btn-brand-pink:hover { background: linear-gradient(135deg, #b81886, #9e136f); color: #fff; }

/* Nav */
.navbar-brand-bar .nav-link {
  border-radius: 0.5rem;
  padding: 0.4rem 0.75rem;
  margin: 0 0.15rem;
  transition: background-color 0.15s ease;
}
.navbar-brand-bar .nav-link:hover,
.navbar-brand-bar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
}
.navbar-brand-bar .nav-link i { margin-right: 0.3rem; }

/* Stat banner — a headline metric card with a big number + chip breakdown */
.stat-banner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-left: 5px solid var(--brand-blue);
  text-align: left;
}
.stat-banner.stat-critical { border-left-color: var(--status-critical); }
.stat-banner.stat-warning { border-left-color: var(--status-warning); }
.stat-banner.stat-good { border-left-color: var(--status-good); }
.stat-banner .icon-circle {
  width: 3.25rem;
  height: 3.25rem;
  font-size: 1.4rem;
  margin-bottom: 0;
  flex-shrink: 0;
}
.stat-banner .stat-headline { min-width: 8rem; }
.stat-banner .stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f7f5f9;
  border-radius: 2rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  white-space: nowrap;
}
.stat-chip i { color: var(--brand-magenta); }
.stat-chip strong { color: var(--ink-primary); }

/* Login page */
.login-card {
  border-radius: 1rem;
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--brand-orange), var(--brand-magenta), var(--brand-violet), var(--brand-blue));
  border-image-slice: 1;
  box-shadow: 0 10px 30px rgba(31, 95, 168, 0.12);
}
