/* =====================================================================
   PTX COSMIC — Master Design System
   One file. All apps. Dark cosmic glassmorphism.
   ===================================================================== */

/* ---------- Fonts: SF Pro (Apple) ---------- */
@font-face {
  font-family: "SF Pro Display";
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff2") format("woff2");
}

/* ---------- Design Tokens ---------- */
:root {
  /* Core palette */
  --ptx-base:        #0D1B2A;   /* Deep Cosmic Blue (canvas) */
  --ptx-violet:      #7B2CBF;   /* Electric Violet (every button) */
  --ptx-neon-blue:   #00B4D8;   /* Bright Neon Blue (accent 1) */
  --ptx-gold:        #FFD700;   /* Cyber Gold (accent 2) */
  --ptx-deep:        #1A1147;   /* Gradient terminus */

  /* Derived */
  --ptx-violet-soft: rgba(123, 44, 191, 0.6);
  --ptx-neon-soft:   rgba(0, 180, 216, 0.5);
  --ptx-gold-soft:   rgba(255, 215, 0, 0.6);
  --ptx-white:       #FFFFFF;
  --ptx-text:        rgba(255, 255, 255, 0.92);
  --ptx-text-muted:  rgba(255, 255, 255, 0.62);
  --ptx-text-dim:    rgba(255, 255, 255, 0.42);

  /* Glass */
  --ptx-glass-bg:     rgba(255, 255, 255, 0.05);
  --ptx-glass-bg-hi:  rgba(255, 255, 255, 0.08);
  --ptx-glass-border: rgba(255, 255, 255, 0.10);
  --ptx-glass-blur:   12px;
  --ptx-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);

  /* Active-nav gradient */
  --ptx-active-grad: linear-gradient(90deg, #7c3aed, #a855f7, #c084fc);
  --ptx-glow:        0 0 12px rgba(168, 85, 247, 0.5);

  /* Canvas gradient */
  --ptx-canvas-grad: linear-gradient(135deg, #0D1B2A 0%, #1A1147 100%);

  /* Radii (Apple-refined) */
  --ptx-r-sm: 6px;
  --ptx-r-md: 8px;
  --ptx-r-lg: 10px;
  --ptx-r-xl: 14px;
  --ptx-r-pill: 999px;

  /* Spacing scale */
  --ptx-s-1: 4px;
  --ptx-s-2: 8px;
  --ptx-s-3: 12px;
  --ptx-s-4: 16px;
  --ptx-s-5: 20px;
  --ptx-s-6: 24px;
  --ptx-s-8: 32px;
  --ptx-s-10: 40px;
  --ptx-s-12: 48px;
  --ptx-s-16: 64px;

  /* Type scale */
  --ptx-font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --ptx-font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --ptx-fs-xs: 11px;
  --ptx-fs-sm: 13px;
  --ptx-fs-md: 15px;
  --ptx-fs-lg: 17px;
  --ptx-fs-xl: 22px;
  --ptx-fs-2xl: 30px;
  --ptx-fs-3xl: 44px;
  --ptx-fs-hero: 64px;

  /* Layout */
  --ptx-nav-top-h: 64px;
  --ptx-nav-left-w: 248px;
  --ptx-nav-left-w-mobile: 0px;
  --ptx-bottom-tab-h: 64px;

  /* Motion */
  --ptx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ptx-dur-1: 140ms;
  --ptx-dur-2: 220ms;
  --ptx-dur-3: 360ms;

  /* Density (compact toggles override) */
  --ptx-row-h: 44px;
  --ptx-pad-y: 12px;
  --ptx-pad-x: 16px;
}

[data-density="compact"] {
  --ptx-row-h: 32px;
  --ptx-pad-y: 6px;
  --ptx-pad-x: 10px;
  --ptx-fs-md: 13px;
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  font-family: var(--ptx-font);
  font-size: var(--ptx-fs-md);
  line-height: 1.55;
  color: var(--ptx-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background: var(--ptx-canvas-grad);
  background-attachment: fixed;
  color: var(--ptx-text);
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}

/* Subtle starfield speckle on canvas (pure CSS, no asset) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.20), transparent 50%),
    radial-gradient(1px 1px at 70% 60%, rgba(0,180,216,0.20), transparent 50%),
    radial-gradient(1px 1px at 40% 80%, rgba(255,215,0,0.15), transparent 50%),
    radial-gradient(1px 1px at 85% 15%, rgba(123,44,191,0.20), transparent 50%);
  background-size: 800px 800px;
  opacity: 0.6;
}

a { color: var(--ptx-neon-blue); text-decoration: none; transition: color var(--ptx-dur-1) var(--ptx-ease); }
a:hover { color: var(--ptx-gold); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ptx-font);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ptx-white);
  margin: 0 0 var(--ptx-s-4);
}

h1 { font-size: var(--ptx-fs-3xl); letter-spacing: -0.025em; font-weight: 700; }
h2 { font-size: var(--ptx-fs-2xl); letter-spacing: -0.02em; }
h3 { font-size: var(--ptx-fs-xl); }
h4 { font-size: var(--ptx-fs-lg); }

p { margin: 0 0 var(--ptx-s-4); color: var(--ptx-text); }
small, .ptx-muted { color: var(--ptx-text-muted); }

/* ---------- Glassmorphism utilities ---------- */
.ptx-glass {
  background: var(--ptx-glass-bg);
  -webkit-backdrop-filter: blur(var(--ptx-glass-blur));
  backdrop-filter: blur(var(--ptx-glass-blur));
  border: 1px solid var(--ptx-glass-border);
  box-shadow: var(--ptx-glass-shadow);
  border-radius: var(--ptx-r-lg);
}
.ptx-glass-hi {
  background: var(--ptx-glass-bg-hi);
  -webkit-backdrop-filter: blur(calc(var(--ptx-glass-blur) + 4px));
  backdrop-filter: blur(calc(var(--ptx-glass-blur) + 4px));
  border: 1px solid var(--ptx-glass-border);
  box-shadow: var(--ptx-glass-shadow);
  border-radius: var(--ptx-r-lg);
}

/* ---------- Buttons (UNIFORM SOLID VIOLET — no gradients) ---------- */
.ptx-btn,
button.ptx-btn,
a.ptx-btn,
input[type="submit"].ptx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ptx-s-2);
  font-family: var(--ptx-font);
  font-size: var(--ptx-fs-md);
  font-weight: 600;
  letter-spacing: -0.005em;
  background: var(--ptx-violet);   /* exact solid color, every button */
  color: #FFFFFF;
  border: 1px solid var(--ptx-violet);
  border-radius: var(--ptx-r-md);
  padding: 10px 18px;
  cursor: pointer;
  transition:
    transform var(--ptx-dur-1) var(--ptx-ease),
    box-shadow var(--ptx-dur-2) var(--ptx-ease),
    background var(--ptx-dur-2) var(--ptx-ease),
    filter var(--ptx-dur-2) var(--ptx-ease);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}
.ptx-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px var(--ptx-violet-soft);
  transform: translateY(-1px);
}
.ptx-btn:active { transform: translateY(0); filter: brightness(0.95); }
.ptx-btn:focus-visible {
  outline: 2px solid var(--ptx-gold);
  outline-offset: 2px;
}
.ptx-btn[disabled],
.ptx-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Ghost (secondary) — still on glass, but violet remains the only filled color */
.ptx-btn-ghost {
  background: transparent;
  color: var(--ptx-white);
  border: 1px solid var(--ptx-glass-border);
}
.ptx-btn-ghost:hover {
  background: var(--ptx-glass-bg-hi);
  box-shadow: none;
}

/* Sizes */
.ptx-btn-sm { padding: 6px 12px; font-size: var(--ptx-fs-sm); border-radius: var(--ptx-r-sm); }
.ptx-btn-lg { padding: 14px 24px; font-size: var(--ptx-fs-lg); border-radius: var(--ptx-r-md); }

/* ---------- Active nav text treatment ---------- */
.ptx-nav-active {
  background: var(--ptx-active-grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: var(--ptx-glow);
  font-weight: 600;
}

/* ---------- Forms (glass inputs) ---------- */
.ptx-input,
.ptx-select,
.ptx-textarea {
  width: 100%;
  font-family: var(--ptx-font);
  font-size: var(--ptx-fs-md);
  color: var(--ptx-white);
  background: var(--ptx-glass-bg);
  -webkit-backdrop-filter: blur(var(--ptx-glass-blur));
  backdrop-filter: blur(var(--ptx-glass-blur));
  border: 1px solid var(--ptx-glass-border);
  border-radius: var(--ptx-r-md);
  padding: 10px 14px;
  transition: border-color var(--ptx-dur-1) var(--ptx-ease), box-shadow var(--ptx-dur-2) var(--ptx-ease);
}
.ptx-input::placeholder { color: var(--ptx-text-dim); }
.ptx-input:focus,
.ptx-select:focus,
.ptx-textarea:focus {
  outline: none;
  border-color: var(--ptx-violet);
  box-shadow: 0 0 0 3px var(--ptx-violet-soft);
}

/* ---------- Cards ---------- */
.ptx-card {
  background: var(--ptx-glass-bg);
  -webkit-backdrop-filter: blur(var(--ptx-glass-blur));
  backdrop-filter: blur(var(--ptx-glass-blur));
  border: 1px solid var(--ptx-glass-border);
  border-radius: var(--ptx-r-lg);
  padding: var(--ptx-s-6);
  box-shadow: var(--ptx-glass-shadow);
  transition: transform var(--ptx-dur-2) var(--ptx-ease), border-color var(--ptx-dur-2) var(--ptx-ease);
}
.ptx-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

/* KPI tile */
.ptx-kpi {
  display: flex; flex-direction: column; gap: var(--ptx-s-2);
  padding: var(--ptx-s-5);
  border-radius: var(--ptx-r-lg);
  background: var(--ptx-glass-bg);
  -webkit-backdrop-filter: blur(var(--ptx-glass-blur));
  backdrop-filter: blur(var(--ptx-glass-blur));
  border: 1px solid var(--ptx-glass-border);
}
.ptx-kpi__label { font-size: var(--ptx-fs-sm); color: var(--ptx-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ptx-kpi__value { font-size: var(--ptx-fs-2xl); font-weight: 700; color: var(--ptx-white); letter-spacing: -0.02em; }
.ptx-kpi__delta { font-size: var(--ptx-fs-sm); color: var(--ptx-neon-blue); }

/* ---------- Layout shell ---------- */
.ptx-app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--ptx-nav-left-w) 1fr;
  grid-template-rows: var(--ptx-nav-top-h) 1fr;
  grid-template-areas:
    "topnav topnav"
    "leftnav main";
  min-height: 100vh;
}
.ptx-topnav { grid-area: topnav; }
.ptx-leftnav { grid-area: leftnav; }
.ptx-main   { grid-area: main; padding: var(--ptx-s-8); min-width: 0; }

/* ---------- Top nav ---------- */
.ptx-topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--ptx-s-6);
  height: var(--ptx-nav-top-h);
  background: rgba(13, 27, 42, 0.65);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--ptx-glass-border);
}
.ptx-topnav__brand {
  display: flex; align-items: baseline; gap: var(--ptx-s-3);
}
.ptx-topnav__brand-mark {
  font-family: var(--ptx-font);
  font-weight: 700;
  font-size: var(--ptx-fs-xl);
  letter-spacing: -0.02em;
  background: var(--ptx-active-grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.ptx-topnav__brand-sub {
  font-size: var(--ptx-fs-sm);
  color: var(--ptx-text-muted);
  letter-spacing: 0.02em;
}
.ptx-topnav__right {
  display: flex; align-items: center; gap: var(--ptx-s-4);
}

/* Warehouse switcher */
.ptx-switcher {
  position: relative;
}
.ptx-switcher__trigger {
  display: inline-flex; align-items: center; gap: var(--ptx-s-2);
  padding: 6px 12px;
  background: var(--ptx-glass-bg);
  border: 1px solid var(--ptx-glass-border);
  border-radius: var(--ptx-r-md);
  color: var(--ptx-white);
  font-size: var(--ptx-fs-sm);
  cursor: pointer;
  transition: background var(--ptx-dur-1) var(--ptx-ease);
}
.ptx-switcher__trigger:hover { background: var(--ptx-glass-bg-hi); }
.ptx-switcher__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ptx-neon-blue);
  box-shadow: 0 0 8px var(--ptx-neon-soft);
}
.ptx-switcher__menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 280px;
  background: rgba(13, 27, 42, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--ptx-glass-border);
  border-radius: var(--ptx-r-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  padding: var(--ptx-s-3);
  display: none;
}
.ptx-switcher.is-open .ptx-switcher__menu { display: block; }
.ptx-switcher__search {
  width: 100%;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--ptx-glass-border);
  border-radius: var(--ptx-r-sm);
  color: var(--ptx-white);
  font-size: var(--ptx-fs-sm);
  margin-bottom: var(--ptx-s-2);
}
.ptx-switcher__item {
  display: flex; align-items: center; gap: var(--ptx-s-2);
  padding: 8px 10px;
  border-radius: var(--ptx-r-sm);
  cursor: pointer;
  color: var(--ptx-text);
  font-size: var(--ptx-fs-sm);
}
.ptx-switcher__item:hover { background: rgba(255,255,255,0.06); }
.ptx-switcher__item.is-active { color: var(--ptx-gold); }

/* Notification bell */
.ptx-bell {
  position: relative;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ptx-glass-bg);
  border: 1px solid var(--ptx-glass-border);
  border-radius: var(--ptx-r-md);
  color: var(--ptx-white);
  cursor: pointer;
  transition: background var(--ptx-dur-1) var(--ptx-ease);
}
.ptx-bell:hover { background: var(--ptx-glass-bg-hi); }
.ptx-bell__badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--ptx-gold);
  color: #1A1147;
  font-size: 10px; font-weight: 700;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 10px var(--ptx-gold-soft);
}
.ptx-bell__panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; max-height: 480px; overflow: auto;
  background: rgba(13, 27, 42, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--ptx-glass-border);
  border-radius: var(--ptx-r-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  padding: var(--ptx-s-3);
  display: none;
  z-index: 100;
}
.ptx-bell.is-open .ptx-bell__panel { display: block; }
.ptx-bell__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px var(--ptx-s-3);
  border-bottom: 1px solid var(--ptx-glass-border);
  margin-bottom: var(--ptx-s-2);
}
.ptx-bell__title { font-weight: 600; color: var(--ptx-white); font-size: var(--ptx-fs-md); }
.ptx-bell__clear { background: none; border: none; color: var(--ptx-neon-blue); font-size: var(--ptx-fs-sm); cursor: pointer; }
.ptx-notice {
  display: grid; grid-template-columns: 8px 1fr auto; gap: var(--ptx-s-3); align-items: start;
  padding: 10px;
  border-radius: var(--ptx-r-sm);
  cursor: pointer;
  transition: background var(--ptx-dur-1) var(--ptx-ease);
}
.ptx-notice:hover { background: rgba(255,255,255,0.05); }
.ptx-notice__dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: transparent; }
.ptx-notice.is-unread .ptx-notice__dot { background: var(--ptx-neon-blue); box-shadow: 0 0 8px var(--ptx-neon-soft); }
.ptx-notice__title { color: var(--ptx-white); font-size: var(--ptx-fs-sm); font-weight: 500; }
.ptx-notice__body { color: var(--ptx-text-muted); font-size: var(--ptx-fs-sm); }
.ptx-notice__time { color: var(--ptx-text-dim); font-size: var(--ptx-fs-xs); white-space: nowrap; }

/* Profile */
.ptx-profile {
  position: relative;
}
.ptx-profile__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ptx-violet), var(--ptx-neon-blue));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: var(--ptx-fs-sm);
  border: 1px solid var(--ptx-glass-border);
  cursor: pointer;
}
.ptx-profile__menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px;
  background: rgba(13, 27, 42, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--ptx-glass-border);
  border-radius: var(--ptx-r-lg);
  padding: var(--ptx-s-2);
  display: none;
  z-index: 100;
}
.ptx-profile.is-open .ptx-profile__menu { display: block; }
.ptx-profile__item {
  display: flex; align-items: center; gap: var(--ptx-s-2);
  padding: 8px 10px;
  border-radius: var(--ptx-r-sm);
  color: var(--ptx-text);
  font-size: var(--ptx-fs-sm);
  cursor: pointer;
}
.ptx-profile__item:hover { background: rgba(255,255,255,0.06); color: var(--ptx-white); }

/* ---------- Left nav ---------- */
.ptx-leftnav {
  position: sticky; top: var(--ptx-nav-top-h);
  align-self: start;
  height: calc(100vh - var(--ptx-nav-top-h));
  overflow-y: auto;
  padding: var(--ptx-s-5) var(--ptx-s-3);
  background: rgba(13, 27, 42, 0.55);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--ptx-glass-border);
}
.ptx-leftnav__section {
  margin-bottom: var(--ptx-s-6);
}
.ptx-leftnav__label {
  font-size: var(--ptx-fs-xs);
  color: var(--ptx-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 var(--ptx-s-3);
  margin-bottom: var(--ptx-s-2);
}
.ptx-leftnav__link {
  display: flex; align-items: center; gap: var(--ptx-s-3);
  padding: 10px 12px;
  border-radius: var(--ptx-r-md);
  color: var(--ptx-text);
  font-size: var(--ptx-fs-md);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--ptx-dur-1) var(--ptx-ease), color var(--ptx-dur-1) var(--ptx-ease);
}
.ptx-leftnav__link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--ptx-white);
}
.ptx-leftnav__link {
  position: relative;
}
.ptx-leftnav__link.is-active {
  background: transparent;
}
.ptx-leftnav__link.is-active::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--ptx-active-grad);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  filter: drop-shadow(0 0 6px var(--ptx-violet-soft));
}
.ptx-leftnav__link.is-active .ptx-leftnav__text {
  background: var(--ptx-active-grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: var(--ptx-glow);
  font-weight: 600;
}
.ptx-leftnav__icon {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ptx-text-muted);
  flex-shrink: 0;
}
.ptx-leftnav__link.is-active .ptx-leftnav__icon { color: var(--ptx-gold); filter: drop-shadow(0 0 6px var(--ptx-violet-soft)); }
.ptx-leftnav__link:hover .ptx-leftnav__icon { color: var(--ptx-neon-blue); }

/* ---------- Mobile bottom tab bar ---------- */
.ptx-bottom-tabs {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--ptx-bottom-tab-h);
  background: rgba(13, 27, 42, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--ptx-glass-border);
  padding: 6px 8px;
  z-index: 60;
}
.ptx-bottom-tabs__inner {
  display: flex; justify-content: space-around; align-items: stretch;
  width: 100%; max-width: 640px; margin: 0 auto;
}
.ptx-bottom-tabs__tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--ptx-text-muted);
  font-size: 10px;
  text-decoration: none;
  border-radius: var(--ptx-r-sm);
  transition: color var(--ptx-dur-1) var(--ptx-ease);
}
.ptx-bottom-tabs__tab.is-active {
  color: var(--ptx-gold);
}
.ptx-bottom-tabs__tab.is-active .ptx-leftnav__icon {
  filter: drop-shadow(0 0 6px var(--ptx-violet-soft));
}

/* ---------- Cinematic banner ---------- */
.ptx-hero {
  position: relative;
  border-radius: var(--ptx-r-xl);
  overflow: hidden;
  min-height: 280px;
  display: flex; align-items: flex-end;
  padding: var(--ptx-s-10);
  margin-bottom: var(--ptx-s-8);
  border: 1px solid var(--ptx-glass-border);
  isolation: isolate;
}
.ptx-hero__image {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: saturate(0.85);
  z-index: -2;
}
.ptx-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(13,27,42,0.75) 0%, rgba(26,17,71,0.85) 100%);
  z-index: -1;
}
.ptx-hero__content { max-width: 720px; }
.ptx-hero__eyebrow {
  display: inline-block;
  font-size: var(--ptx-fs-sm);
  color: var(--ptx-neon-blue);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--ptx-s-3);
}
.ptx-hero__title {
  font-size: var(--ptx-fs-hero);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 var(--ptx-s-4);
  color: var(--ptx-white);
}
.ptx-hero__title .ptx-hero__accent {
  background: var(--ptx-active-grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ptx-hero__sub {
  font-size: var(--ptx-fs-lg);
  color: var(--ptx-text-muted);
  margin-bottom: var(--ptx-s-6);
}

/* KPI row under hero */
.ptx-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--ptx-s-4);
  margin-bottom: var(--ptx-s-8);
}

/* ---------- Tables (data screens) ---------- */
.ptx-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--ptx-glass-bg);
  border: 1px solid var(--ptx-glass-border);
  border-radius: var(--ptx-r-lg);
  overflow: hidden;
}
.ptx-table th {
  text-align: left;
  font-size: var(--ptx-fs-xs);
  color: var(--ptx-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--ptx-pad-y) var(--ptx-pad-x);
  border-bottom: 1px solid var(--ptx-glass-border);
  background: rgba(0,0,0,0.18);
}
.ptx-table td {
  padding: var(--ptx-pad-y) var(--ptx-pad-x);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--ptx-text);
  font-size: var(--ptx-fs-md);
}
.ptx-table tbody tr:hover td { background: rgba(255,255,255,0.03); }

/* ---------- Density toggle ---------- */
.ptx-density {
  display: inline-flex;
  background: var(--ptx-glass-bg);
  border: 1px solid var(--ptx-glass-border);
  border-radius: var(--ptx-r-md);
  padding: 2px;
}
.ptx-density button {
  background: transparent;
  color: var(--ptx-text-muted);
  border: none;
  padding: 4px 10px;
  font-size: var(--ptx-fs-xs);
  border-radius: var(--ptx-r-sm);
  cursor: pointer;
}
.ptx-density button.is-active {
  background: var(--ptx-violet);
  color: #fff;
}

/* ---------- Nano canvas (landing only) ---------- */
.ptx-nano-canvas {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Mobile breakpoint: bottom tabs + hide sidebar ---------- */
@media (max-width: 900px) {
  .ptx-app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topnav"
      "main";
    padding-bottom: var(--ptx-bottom-tab-h);
  }
  .ptx-leftnav { display: none; }
  .ptx-bottom-tabs { display: block; }
  .ptx-main { padding: var(--ptx-s-4); }
  .ptx-hero { padding: var(--ptx-s-6); min-height: 220px; }
  .ptx-hero__title { font-size: var(--ptx-fs-2xl); }
  .ptx-topnav__brand-sub { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Scrollbar polish ---------- */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--ptx-violet-soft); background-clip: padding-box; }

/* =====================================================================
   VIBRANT CONTENT — Category Color System
   Each page declares its identity via <body data-category="inbound">.
   Section panels are deeper-blue layered backdrops. Cards inherit the
   category color through --ptx-cat (icon, glow border, tinted glass,
   gradient title). Platform-wide rule.
   ===================================================================== */

:root {
  /* Category palette (RGB triplets so we can compose rgba on the fly) */
  --ptx-cat-inbound-rgb:    0,180,216;     /* #00B4D8 cyan      */
  --ptx-cat-outbound-rgb:   255,215,0;     /* #FFD700 gold      */
  --ptx-cat-prep-rgb:       123,44,191;    /* #7B2CBF violet    */
  --ptx-cat-stations-rgb:   16,185,129;    /* #10B981 emerald   */
  --ptx-cat-inventory-rgb:  236,72,153;    /* #EC4899 magenta   */
  --ptx-cat-admin-rgb:      59,130,246;    /* #3B82F6 blue      */
  --ptx-cat-client-rgb:     251,113,133;   /* #FB7185 coral     */
  --ptx-cat-alert-rgb:      239,68,68;     /* #EF4444 red       */

  /* Default category falls back to violet (brand) */
  --ptx-cat-rgb: var(--ptx-cat-prep-rgb);
  --ptx-cat:        rgb(var(--ptx-cat-rgb));
  --ptx-cat-soft:   rgba(var(--ptx-cat-rgb), 0.55);
  --ptx-cat-tint:   rgba(var(--ptx-cat-rgb), 0.08);
  --ptx-cat-tint-hi:rgba(var(--ptx-cat-rgb), 0.16);
  --ptx-cat-glow:   rgba(var(--ptx-cat-rgb), 0.45);
  --ptx-cat-grad:   linear-gradient(120deg, rgb(var(--ptx-cat-rgb)), #FFFFFF 130%);

  /* Section panel — the deeper-blue backdrop cards float on */
  --ptx-panel-bg:       linear-gradient(180deg, rgba(8, 16, 30, 0.78) 0%, rgba(10, 20, 36, 0.62) 100%);
  --ptx-panel-border:   rgba(255, 255, 255, 0.06);
  --ptx-panel-shadow:   0 12px 40px rgba(0, 0, 0, 0.32);
}

/* ---- Category resolvers ---- */
body[data-category="inbound"]   { --ptx-cat-rgb: var(--ptx-cat-inbound-rgb); }
body[data-category="outbound"]  { --ptx-cat-rgb: var(--ptx-cat-outbound-rgb); }
body[data-category="prep"]      { --ptx-cat-rgb: var(--ptx-cat-prep-rgb); }
body[data-category="stations"]  { --ptx-cat-rgb: var(--ptx-cat-stations-rgb); }
body[data-category="inventory"] { --ptx-cat-rgb: var(--ptx-cat-inventory-rgb); }
body[data-category="admin"]     { --ptx-cat-rgb: var(--ptx-cat-admin-rgb); }
body[data-category="client"]    { --ptx-cat-rgb: var(--ptx-cat-client-rgb); }
body[data-category="alert"]     { --ptx-cat-rgb: var(--ptx-cat-alert-rgb); }
/* Per-element override (lets you mix categories inside one page) */
[data-cat="inbound"]   { --ptx-cat-rgb: var(--ptx-cat-inbound-rgb); }
[data-cat="outbound"]  { --ptx-cat-rgb: var(--ptx-cat-outbound-rgb); }
[data-cat="prep"]      { --ptx-cat-rgb: var(--ptx-cat-prep-rgb); }
[data-cat="stations"]  { --ptx-cat-rgb: var(--ptx-cat-stations-rgb); }
[data-cat="inventory"] { --ptx-cat-rgb: var(--ptx-cat-inventory-rgb); }
[data-cat="admin"]     { --ptx-cat-rgb: var(--ptx-cat-admin-rgb); }
[data-cat="client"]    { --ptx-cat-rgb: var(--ptx-cat-client-rgb); }
[data-cat="alert"]     { --ptx-cat-rgb: var(--ptx-cat-alert-rgb); }

/* Refresh derived tokens whenever category changes */
body[data-category], [data-cat] {
  --ptx-cat:        rgb(var(--ptx-cat-rgb));
  --ptx-cat-soft:   rgba(var(--ptx-cat-rgb), 0.55);
  --ptx-cat-tint:   rgba(var(--ptx-cat-rgb), 0.10);
  --ptx-cat-tint-hi:rgba(var(--ptx-cat-rgb), 0.20);
  --ptx-cat-glow:   rgba(var(--ptx-cat-rgb), 0.45);
  --ptx-cat-grad:   linear-gradient(120deg, rgb(var(--ptx-cat-rgb)), #FFFFFF 140%);
}

/* ---- Dark-blue section panel (the layered backdrop) ---- */
.ptx-section-panel {
  position: relative;
  background: var(--ptx-panel-bg);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  border: 1px solid var(--ptx-panel-border);
  border-radius: var(--ptx-r-xl);
  padding: var(--ptx-s-8);
  margin: var(--ptx-s-6) 0;
  box-shadow: var(--ptx-panel-shadow);
  overflow: hidden;
  isolation: isolate;
}
/* Soft category-tinted halo at the top edge of each section */
.ptx-section-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--ptx-cat-soft) 50%,
    transparent 100%);
  z-index: 1;
}
.ptx-section-panel::after {
  content: "";
  position: absolute;
  top: -120px; left: 20%;
  width: 460px; height: 240px;
  background: radial-gradient(closest-side, var(--ptx-cat-tint-hi), transparent 70%);
  z-index: 0;
  pointer-events: none;
  filter: blur(10px);
}
.ptx-section-panel > * { position: relative; z-index: 2; }

/* Section heading inside a panel */
.ptx-section-panel .ptx-section-kicker {
  display: inline-block;
  font-size: var(--ptx-fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ptx-cat);
  text-shadow: 0 0 8px var(--ptx-cat-glow);
  margin-bottom: var(--ptx-s-2);
  font-weight: 600;
}
.ptx-section-panel .ptx-section-title {
  font-size: var(--ptx-fs-2xl);
  font-weight: 700;
  color: var(--ptx-white);
  letter-spacing: -0.02em;
  margin: 0 0 var(--ptx-s-2);
}
.ptx-section-panel .ptx-section-subtitle {
  color: var(--ptx-text-muted);
  font-size: var(--ptx-fs-md);
  margin: 0 0 var(--ptx-s-6);
}

/* ---- Bold category card (the workflow / KPI card style) ---- */
.ptx-vcard {
  position: relative;
  background:
    linear-gradient(150deg, var(--ptx-cat-tint) 0%, rgba(255,255,255,0.02) 80%),
    rgba(255,255,255,0.04);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border: 1px solid rgba(var(--ptx-cat-rgb), 0.28);
  border-radius: var(--ptx-r-lg);
  padding: var(--ptx-s-6);
  color: var(--ptx-text);
  transition:
    transform var(--ptx-dur-2) var(--ptx-ease),
    box-shadow var(--ptx-dur-2) var(--ptx-ease),
    border-color var(--ptx-dur-2) var(--ptx-ease);
  overflow: hidden;
  isolation: isolate;
}
.ptx-vcard::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(var(--ptx-cat-rgb), 0.55) 0%,
    rgba(255,255,255,0.05) 40%,
    rgba(var(--ptx-cat-rgb), 0.35) 100%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}
.ptx-vcard::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 var(--ptx-cat-glow);
  transition: box-shadow var(--ptx-dur-2) var(--ptx-ease);
  pointer-events: none;
  z-index: 0;
}
.ptx-vcard:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--ptx-cat-rgb), 0.55);
}
.ptx-vcard:hover::after {
  box-shadow: 0 12px 36px var(--ptx-cat-glow);
}
.ptx-vcard > * { position: relative; z-index: 2; }

.ptx-vcard__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--ptx-r-md);
  background: var(--ptx-cat-tint-hi);
  color: var(--ptx-cat);
  filter: drop-shadow(0 0 10px var(--ptx-cat-glow));
  margin-bottom: var(--ptx-s-4);
}
.ptx-vcard__icon svg { width: 22px; height: 22px; }
.ptx-vcard__title {
  font-size: var(--ptx-fs-xl);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 var(--ptx-s-2);
  background: var(--ptx-cat-grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.ptx-vcard__body {
  color: var(--ptx-text-muted);
  font-size: var(--ptx-fs-md);
  line-height: 1.55;
  margin: 0;
}
.ptx-vcard__meta {
  display: flex; align-items: center; gap: var(--ptx-s-2);
  margin-top: var(--ptx-s-4);
  font-size: var(--ptx-fs-xs);
  color: var(--ptx-text-dim);
}

/* Bold KPI variant (smaller, used for stat rows) */
.ptx-vkpi {
  position: relative;
  background:
    linear-gradient(150deg, var(--ptx-cat-tint) 0%, rgba(255,255,255,0.02) 80%),
    rgba(255,255,255,0.04);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border: 1px solid rgba(var(--ptx-cat-rgb), 0.22);
  border-radius: var(--ptx-r-lg);
  padding: var(--ptx-s-5);
  display: flex; flex-direction: column; gap: var(--ptx-s-1);
  overflow: hidden;
  isolation: isolate;
}
.ptx-vkpi::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--ptx-cat-soft) 35%,
    var(--ptx-cat) 50%,
    var(--ptx-cat-soft) 65%,
    transparent 100%);
}
.ptx-vkpi__label {
  font-size: var(--ptx-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ptx-text-muted);
}
.ptx-vkpi__value {
  font-size: var(--ptx-fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ptx-white);
  text-shadow: 0 0 12px var(--ptx-cat-glow);
}
.ptx-vkpi__note {
  font-size: var(--ptx-fs-sm);
  color: var(--ptx-text-dim);
}

/* Grid utility for card rows */
.ptx-vcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--ptx-s-5);
}
.ptx-vkpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--ptx-s-4);
  margin-bottom: var(--ptx-s-6);
}

/* Category pill (tiny badge with the category color) */
.ptx-cat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--ptx-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ptx-cat);
  background: var(--ptx-cat-tint);
  border: 1px solid rgba(var(--ptx-cat-rgb), 0.30);
  padding: 4px 10px;
  border-radius: var(--ptx-r-pill);
  font-weight: 600;
}
.ptx-cat-pill::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ptx-cat);
  box-shadow: 0 0 6px var(--ptx-cat-glow);
}
