/* =====================================================================
   TRAXIUM INTELLIGENCE — MASTER STYLESHEET  (traxium.css)
   One file for the whole application. Light + dark mode.
   Tablet-first (iPad landscape 1366 x 1024), works on desktop.

   HOW TO USE
   1. <link rel="stylesheet" href="css/traxium.css">
   2. Light mode is the default.  Dark mode: <html data-theme="dark">
   3. Build pages with the .tx-* classes below (see example/index.html).
   4. Never hard-code colors in pages. Always use the var(--tx-*) tokens.

   ACCESSIBILITY RULES (non-negotiable)
   - Minimum text size 18px, labels/buttons/inputs weight 700+.
   - Text is pure dark on light, or pure white on dark. No gray text.
   - Touch targets at least 48px tall.
   - Inputs always have a high-contrast 2px border.
   ===================================================================== */

/* ---------- Brand font (logo lockup + optional headings) ---------- */
@font-face {
  font-family: "Outfit";
  src: url("../fonts/Outfit-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- UI font (body, headings, figures) ---------- */
@font-face {
  font-family: "Mona Sans";
  src: url("../fonts/MonaSansVF.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
}

/* =====================================================================
   1. TOKENS
   ===================================================================== */
:root {
  /* Brand palette (fixed, same in both modes) */
  --tx-brand-teal: #0F4F4B;      /* deep teal: primary brand color */
  --tx-brand-teal-mid: #2F8F83;  /* logo piece 2 */
  --tx-brand-mint: #7CC4B5;      /* logo piece 3 */
  --tx-brand-apricot: #F2A65A;   /* logo piece 4: the forward arrow / accent */
  --tx-brand-ivory: #F3EEE6;     /* warm sand */

  /* Sidebar: flat deep teal, NO gradient, identical in light + dark */
  --tx-side-bg: #0F4F4B;
  --tx-side-text: #FFFFFF;
  --tx-side-tile-bg: rgba(255,255,255,0.12);
  --tx-side-tile-border: rgba(255,255,255,0.40);
  --tx-side-active-bg: rgba(255,255,255,0.18);
  --tx-side-active-border: #F2A65A;
  --tx-side-card-bg: rgba(255,255,255,0.10);
  --tx-side-hair: rgba(255,255,255,0.30);

  /* Light mode (default) */
  --tx-canvas: #F3EEE6;
  --tx-card: #FFFDF9;
  --tx-row-alt: #EEF5F0;
  --tx-line: #E3DACC;
  --tx-input-border: #3A4B49;
  --tx-text: #10201F;
  --tx-primary: #0F4F4B;
  --tx-on-primary: #FFFFFF;
  --tx-numbers: #0F5E58;
  --tx-mid: #2C7A73;
  --tx-sage: #D3E6DA;
  --tx-on-sage: #10302C;
  --tx-apricot: #F2A65A;
  --tx-on-apricot: #1E150B;
  --tx-pending-bg: rgba(242,166,90,0.24);
  --tx-pending-text: #8A4A0C;
  --tx-problem-bg: #FBE4DE;
  --tx-problem-text: #B8322A;
  --tx-good-bg: rgba(31,107,69,0.12);
  --tx-good-text: #1F6B45;
  --tx-table-head-bg: #0F4F4B;
  --tx-table-head-text: #FFFFFF;
  --tx-focus: #F2A65A;
  --tx-text-shadow: none;

  /* Type */
  --tx-font: "Mona Sans", "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, "Helvetica Neue", Arial, sans-serif;
  --tx-font-display: "Mona Sans", "Inter Display", "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, system-ui, "Helvetica Neue", Arial, sans-serif;
  --tx-font-numbers: var(--tx-font);   /* always with tabular-nums */
  --tx-font-mono: "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --tx-font-brand: "Outfit", var(--tx-font);

  --tx-weight-regular: 400;
  --tx-weight-body: 500;
  --tx-weight-semibold: 600;
  --tx-weight-bold: 700;
  --tx-tracking-display: -0.02em;
  --tx-tracking-heading: -0.01em;
  --tx-tracking-caps: 0.06em;

  --tx-size-page-title: 42px;   /* bold, display tracking */
  --tx-size-section: 26px;      /* bold, heading tracking */
  --tx-size-sidebar: 22px;      /* bold */
  --tx-size-label: 21px;        /* bold */
  --tx-size-body: 20px;         /* body weight */
  --tx-size-min: 18px;          /* nothing smaller than this, ever */
  --tx-size-hero-number: 112px;
  --tx-size-pipeline-number: 76px;
  --tx-size-kpi-number: 84px;

  /* Layout */
  --tx-sidebar-w: 262px;
  --tx-nav-row-h: 72px;
  --tx-topbar-h: 72px;
  --tx-page-pad: 26px 30px 28px;
  --tx-gap: 16px;
  --tx-radius-card: 22px;
  --tx-radius-row: 16px;
  --tx-radius-tile: 13px;
  --tx-card-pad: 20px 22px;
  --tx-btn-h: 48px;
  --tx-btn-h-lg: 56px;
  --tx-table-head-h: 56px;
  --tx-table-row-h: 86px;
  --tx-touch-min: 48px;
}

/* Dark mode: the dark twin of the same palette */
[data-theme="dark"] {
  --tx-canvas: #0B1A1A;
  --tx-card: #122726;
  --tx-row-alt: rgba(122,211,199,0.07);
  --tx-line: #244140;
  --tx-input-border: #A9C4BE;
  --tx-text: #FFFFFF;
  --tx-primary: #1B6A64;
  --tx-on-primary: #FFFFFF;
  --tx-numbers: #7AD3C7;
  --tx-mid: #245B56;
  --tx-sage: #23403B;
  --tx-on-sage: #D8F0E4;
  --tx-apricot: #F2A65A;
  --tx-on-apricot: #1E150B;
  --tx-pending-bg: rgba(242,166,90,0.20);
  --tx-pending-text: #F6BD83;
  --tx-problem-bg: #2C1A18;
  --tx-problem-text: #FF8A7A;
  --tx-good-bg: rgba(143,227,176,0.14);
  --tx-good-text: #8FE3B0;
  --tx-table-head-bg: #1B6A64;
  --tx-table-head-text: #FFFFFF;
  --tx-text-shadow: 0 1px 1px rgba(0,0,0,0.45), 0 2px 10px rgba(0,0,0,0.5);
  color-scheme: dark;
}

/* =====================================================================
   2. BASE
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--tx-font);
  font-size: var(--tx-size-body);
  font-weight: var(--tx-weight-body);
  line-height: 1.4;
  color: var(--tx-text);
  background: var(--tx-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-shadow: var(--tx-text-shadow);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--tx-focus); outline-offset: 3px; }
.tx-num { font-family: var(--tx-font-numbers); font-variant-numeric: tabular-nums; }
code, kbd, samp, pre { font-family: var(--tx-font-mono); }

/* =====================================================================
   3. APP SHELL: sidebar + main
   ===================================================================== */
.tx-app {
  display: flex;
  min-height: 100vh;
}
.tx-main {
  flex: 1 1 0;
  min-width: 0;
  padding: var(--tx-page-pad);
  display: flex;
  flex-direction: column;
  gap: var(--tx-gap);
}

/* ---------- Sidebar ---------- */
.tx-sidebar {
  width: var(--tx-sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 14px 18px;
  background: var(--tx-side-bg);
  color: var(--tx-side-text);
  text-shadow: none;
}
.tx-brand { padding: 4px 10px 26px; }
.tx-brand img { width: 224px; height: auto; }   /* use logo/traxium-logo-dark.svg */
.tx-nav-heading {
  font-size: 19px;
  font-weight: var(--tx-weight-bold);
  letter-spacing: var(--tx-tracking-caps);
  text-transform: uppercase;
  padding: 18px 12px 6px;
}
.tx-nav-item {
  height: var(--tx-nav-row-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 10px;
  border-radius: var(--tx-radius-row);
  border: 2px solid transparent;
  font-size: var(--tx-size-sidebar);
  font-weight: var(--tx-weight-bold);
  color: var(--tx-side-text);
  white-space: nowrap;
}
.tx-nav-item:hover { background: rgba(255,255,255,0.08); }
.tx-nav-item[aria-current="page"],
.tx-nav-item.is-active {
  background: var(--tx-side-active-bg);
  border-color: var(--tx-side-active-border);
  font-weight: var(--tx-weight-bold);
}
.tx-nav-icon {
  width: 50px; height: 50px; flex-shrink: 0;
  border-radius: var(--tx-radius-tile);
  background: var(--tx-side-tile-bg);
  border: 1.5px solid var(--tx-side-tile-border);
  display: flex; align-items: center; justify-content: center;
}
.tx-nav-icon svg, .tx-nav-icon img { width: 30px; height: 30px; }
.tx-nav-spacer { flex-grow: 1; }
.tx-account {
  padding: 12px 10px;
  border-radius: 14px;
  background: var(--tx-side-card-bg);
  border: 1.5px solid var(--tx-side-hair);
  display: flex; align-items: center; gap: 12px;
  font-size: var(--tx-size-min);
}
.tx-avatar {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  background: var(--tx-side-tile-bg); border: 1.5px solid var(--tx-side-tile-border);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}

/* =====================================================================
   4. PAGE HEADER
   ===================================================================== */
.tx-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--tx-gap); }
.tx-date { font-size: var(--tx-size-min); font-weight: var(--tx-weight-semibold); }
.tx-title {
  margin: 0;
  font-family: var(--tx-font-display);
  font-size: var(--tx-size-page-title);
  font-weight: var(--tx-weight-bold);
  letter-spacing: var(--tx-tracking-display);
  line-height: 1.1;
  display: flex; align-items: center; gap: 12px;
}
.tx-title::before {           /* the short teal bar before every page title */
  content: ""; width: 10px; height: 38px; border-radius: 5px; background: var(--tx-primary);
}
.tx-header-actions { display: flex; align-items: center; gap: 12px; }
.tx-section-title { margin: 0 0 8px; font-family: var(--tx-font-display); font-size: var(--tx-size-section); font-weight: var(--tx-weight-bold); letter-spacing: var(--tx-tracking-heading); }

/* =====================================================================
   5. BUTTONS  (flat, pill-shaped)
   ===================================================================== */
.tx-btn {
  height: var(--tx-btn-h);
  min-width: var(--tx-touch-min);
  padding: 0 22px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: var(--tx-size-body);
  font-weight: var(--tx-weight-bold);
  cursor: pointer;
  border: 2px solid transparent;
  background: var(--tx-primary);
  color: var(--tx-on-primary);
  text-shadow: none;
}
.tx-btn svg { width: 26px; height: 26px; }
.tx-btn--lg { height: var(--tx-btn-h-lg); }
.tx-btn--outline { background: var(--tx-card); color: var(--tx-text); border-color: var(--tx-input-border); }
.tx-btn--accent  { background: var(--tx-apricot); color: var(--tx-on-apricot); }
.tx-btn--round   { width: var(--tx-btn-h); padding: 0; }
.tx-btn--block   { width: 100%; }
.tx-btn:hover    { filter: brightness(1.08); }

/* =====================================================================
   6. CARDS + HERO TILES
   ===================================================================== */
.tx-card {
  background: var(--tx-card);
  border: 1.5px solid var(--tx-line);
  border-radius: var(--tx-radius-card);
  padding: var(--tx-card-pad);
}
.tx-grid { display: grid; gap: var(--tx-gap); }
.tx-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tx-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tx-grid--hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); }

/* Big number tiles (Overview hero row) */
.tx-tile {
  border-radius: var(--tx-radius-card);
  padding: var(--tx-card-pad);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
}
.tx-tile__label { align-self: flex-start; display: flex; align-items: center; gap: 12px; font-size: var(--tx-size-label); font-weight: var(--tx-weight-bold); }
.tx-tile__badge { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tx-tile__badge svg { width: 30px; height: 30px; stroke-width: 2.5; }

/* Card icon box: 50px, tinted by semantic tone */
.tx-icon-box {
  width: 50px; height: 50px; flex: 0 0 50px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tx-sage); color: var(--tx-primary);
}
.tx-icon-box svg { width: 30px; height: 30px; stroke: currentColor; stroke-width: 2.5; }
.tx-icon-box--primary { background: var(--tx-primary); color: var(--tx-on-primary); }
.tx-icon-box--good    { background: var(--tx-good-bg); color: var(--tx-good-text); }
.tx-icon-box--pending { background: var(--tx-apricot); color: var(--tx-on-apricot); }
.tx-icon-box--problem { background: var(--tx-problem-bg); color: var(--tx-problem-text); }
.tx-tile__number { font-family: var(--tx-font-numbers); font-variant-numeric: tabular-nums; font-size: var(--tx-size-hero-number); font-weight: var(--tx-weight-bold); line-height: 1; letter-spacing: var(--tx-tracking-display); }
.tx-tile__sub { font-size: var(--tx-size-body); font-weight: var(--tx-weight-semibold); }

.tx-tile--teal    { background: var(--tx-primary); color: #FFFFFF; }
.tx-tile--teal .tx-tile__badge { background: rgba(255,255,255,0.16); }
.tx-tile--problem { background: var(--tx-problem-bg); color: var(--tx-text); }
.tx-tile--problem .tx-tile__number { color: var(--tx-problem-text); }
.tx-tile--problem .tx-tile__badge  { background: var(--tx-problem-text); color: #FFFFFF; }
.tx-tile--sage    { background: var(--tx-sage); color: var(--tx-on-sage); }
.tx-tile--sage .tx-tile__badge { background: rgba(255,255,255,0.55); }
[data-theme="dark"] .tx-tile--sage .tx-tile__badge { background: rgba(255,255,255,0.12); }
.tx-tile--apricot { background: var(--tx-apricot); color: var(--tx-on-apricot); text-shadow: none; }
.tx-tile--apricot .tx-tile__badge { background: var(--tx-on-apricot); color: #FFFFFF; }

/* =====================================================================
   7. PIPELINE (In transit > Receiving > FBA Prep > Outbound)
   ===================================================================== */
.tx-pipeline { display: flex; align-items: center; justify-content: space-around; gap: var(--tx-gap); }
.tx-stage { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: var(--tx-touch-min); }
.tx-stage__number { font-family: var(--tx-font-numbers); font-variant-numeric: tabular-nums; font-size: var(--tx-size-pipeline-number); font-weight: var(--tx-weight-bold); line-height: 1; letter-spacing: var(--tx-tracking-display); color: var(--tx-numbers); }
.tx-stage__label { font-size: var(--tx-size-body); font-weight: var(--tx-weight-bold); }
.tx-stage-arrow { font-size: 34px; font-weight: var(--tx-weight-bold); }
.tx-stage__go { width: 76px; height: 76px; border-radius: 50%; background: var(--tx-sage); color: var(--tx-numbers); display: flex; align-items: center; justify-content: center; }

/* KPI number inside a normal card */
.tx-kpi { font-family: var(--tx-font-numbers); font-variant-numeric: tabular-nums; font-size: var(--tx-size-kpi-number); font-weight: var(--tx-weight-bold); line-height: 1; letter-spacing: var(--tx-tracking-display); color: var(--tx-numbers); }

/* =====================================================================
   8. LISTS ("Needs action") + QUICK ACTIONS
   ===================================================================== */
.tx-list { display: flex; flex-direction: column; }
.tx-list-row {
  min-height: 84px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
  border-top: 1.5px solid var(--tx-line);
  font-size: 24px; font-weight: var(--tx-weight-semibold);
}
.tx-list-row:first-child { border-top: 0; }
.tx-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--tx-apricot); flex-shrink: 0; }
.tx-action {
  min-height: 96px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
  border-radius: var(--tx-radius-card);
  background: var(--tx-card);
  border: 1.5px solid var(--tx-line);
  font-size: 22px; font-weight: var(--tx-weight-bold);
}
.tx-action--accent { background: var(--tx-apricot); color: var(--tx-on-apricot); border-color: transparent; text-shadow: none; }
.tx-action__icon { width: 54px; height: 54px; border-radius: 14px; background: var(--tx-sage); color: var(--tx-numbers); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tx-action--accent .tx-action__icon { background: var(--tx-on-apricot); color: #FFFFFF; }

/* =====================================================================
   9. STATUS PILLS
   ===================================================================== */
.tx-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px;
  border: 1.5px solid color-mix(in srgb, currentColor 40%, transparent);
  border-radius: 999px; font-size: var(--tx-size-min); font-weight: var(--tx-weight-bold); white-space: nowrap;
}
.tx-pill::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.tx-pill--pending { background: var(--tx-pending-bg); color: var(--tx-pending-text); }
.tx-pill--warning { background: var(--tx-apricot);    color: var(--tx-on-apricot); }
.tx-pill--problem { background: var(--tx-problem-bg); color: var(--tx-problem-text); }
.tx-pill--good    { background: var(--tx-good-bg);    color: var(--tx-good-text); }
.tx-pill--info    { background: var(--tx-sage);       color: var(--tx-on-sage); }

/* =====================================================================
   10. DATA TABLE  (bold teal header band + zebra rows)
   ===================================================================== */
.tx-table-wrap { background: var(--tx-card); border: 1.5px solid var(--tx-line); border-radius: var(--tx-radius-card); overflow: hidden; }
.tx-table { width: 100%; border-collapse: collapse; font-size: var(--tx-size-body); }
.tx-table thead th {
  height: var(--tx-table-head-h);
  padding: 0 18px;
  background: var(--tx-table-head-bg);
  color: var(--tx-table-head-text);
  text-align: left;
  font-size: var(--tx-size-min);
  font-weight: var(--tx-weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: none;
}
.tx-table tbody td { height: var(--tx-table-row-h); padding: 0 18px; font-weight: var(--tx-weight-body); }
.tx-table tbody tr:nth-child(even) td { background: var(--tx-row-alt); }
.tx-table .tx-col-num { text-align: right; font-family: var(--tx-font-numbers); font-size: 30px; color: var(--tx-numbers); }
.tx-table .tx-col-id  { font-weight: var(--tx-weight-bold); }

/* Status-toned rows: tinted cells + 5px leading accent */
.tx-table tbody tr[data-status-tone] > td { background: color-mix(in srgb, var(--tx-row-tone, transparent) 12%, var(--tx-card)); }
.tx-table tbody tr[data-status-tone] > td:first-child { box-shadow: inset 5px 0 0 var(--tx-row-tone, transparent); }
.tx-table tbody tr:is([data-status-tone="good"], [data-status-tone="complete"]) { --tx-row-tone: var(--tx-good-text); }
.tx-table tbody tr:is([data-status-tone="pending"], [data-status-tone="progress"]) { --tx-row-tone: var(--tx-apricot); }
.tx-table tbody tr[data-status-tone="warning"] { --tx-row-tone: var(--tx-pending-text); }
.tx-table tbody tr:is([data-status-tone="problem"], [data-status-tone="alert"]) { --tx-row-tone: var(--tx-problem-text); }

/* =====================================================================
   11. FORMS  (search, inputs, selects)
   ===================================================================== */
.tx-input, .tx-select {
  height: var(--tx-btn-h-lg);
  padding: 0 18px;
  border-radius: 14px;
  border: 2px solid var(--tx-input-border);
  background: var(--tx-card);
  color: var(--tx-text);
  font-size: var(--tx-size-body);
  font-weight: var(--tx-weight-bold);
}
.tx-input::placeholder { color: var(--tx-text); opacity: 1; }
.tx-label { display: block; font-size: var(--tx-size-label); font-weight: var(--tx-weight-bold); margin-bottom: 8px; }
.tx-search { display: inline-flex; align-items: center; gap: 10px; }

/* =====================================================================
   12. RESPONSIVE: phones / narrow windows
   ===================================================================== */
@media (max-width: 1100px) {
  .tx-grid--3, .tx-grid--hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tx-app { flex-direction: column; }
  .tx-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .tx-brand { padding-bottom: 8px; }
  .tx-grid--3, .tx-grid--2, .tx-grid--hero { grid-template-columns: 1fr; }
  .tx-pipeline { flex-wrap: wrap; }
  :root { --tx-size-page-title: 34px; --tx-size-hero-number: 96px; --tx-page-pad: 16px; }
}
