/* ==========================================================================
   SJMX · Protein OS  —  Tuxedo Corporate Design System
   Palette: near-black, charcoal, bone, midnight steel, gold
   Last updated: 2026
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Background layers — classic near-black to dark grey */
  --bg:              #0c0e12;
  --surface:         #13161c;
  --surface-2:       #191d25;
  --surface-3:       #1f242e;
  --surface-4:       #252b36;

  /* Navigation */
  --nav-bg:          #090b0e;
  --nav-border:      #181c23;

  /* Borders */
  --border:          #1e2330;
  --border-active:   #2e3548;
  --border-strong:   #3d4558;

  /* Text */
  --bone:            #dcd8d0;
  --bone-dim:        #b8b3aa;
  --muted:           #7d8799;
  --subtle:          #4c5568;
  --faint:           #272e3d;

  /* Midnight Steel — primary action / brand accent */
  --oxblood:         #1e3a5f;
  --oxblood-hover:   #254a7a;
  --oxblood-active:  #172d4c;
  --oxblood-pale:    #091522;
  --oxblood-glow:    rgba(30, 58, 95, 0.22);
  --oxblood-border:  #142238;

  /* Gold — numerical / price data */
  --gold:            #c4a251;
  --gold-dim:        #8a6e32;
  --gold-pale:       #1c1608;
  --gold-border:     #6b5228;

  /* Semantic */
  --green:           #3a7a5a;
  --green-bright:    #52a878;
  --green-pale:      #0c1f16;
  --green-border:    #2a5a40;

  --red:             #a03030;
  --red-bright:      #cc5050;
  --red-pale:        #1c0c0c;
  --red-border:      #7a2222;

  --amber:           #9a7228;
  --amber-bright:    #c49840;
  --amber-pale:      #18120a;
  --amber-border:    #6a5020;

  --blue:            #2a5a7a;
  --blue-bright:     #4a8aaa;
  --blue-pale:       #0a1820;
  --blue-border:     #1e4060;

  /* Supplier palette — single gold protagonist + monochromatic blue
     gradient for the rest. Gold is reserved for SJMX when grouped by
     proveedor, or for the largest key value otherwise (whichever lands
     at index 0). No other slot should compete with gold. */
  --sp-sjmx:         #c4a251;   /* gold — protagonist (house or largest) */
  --sp-bafar:        #1e3a5f;   /* midnight steel — darkest blue */
  --sp-lala:         #2f5479;   /* dark blue */
  --sp-qualtia:      #4c7099;   /* medium blue */
  --sp-sigma:        #7094b8;   /* light blue */
  --sp-otros:        #4c5568;   /* subtle neutral — lowest emphasis */

  /* Shape — hard edges, architectural rigidity */
  --radius-sm:       1px;
  --radius:          1px;
  --radius-md:       2px;
  --radius-lg:       3px;

  /* Typography */
  --font-display:    'Spectral', Georgia, 'Times New Roman', serif;
  --font:            'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                     system-ui, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:       'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code',
                     'Roboto Mono', 'Courier New', monospace;

  /* Type scale — px values, used on uppercase labels and densities
     where rem-based sizing would drift. Body stays on 15px / 1.65. */
  --fs-xs:           9px;
  --fs-sm:           10px;
  --fs-base:         11px;
  --fs-md:           12px;
  --fs-lg:           13px;
  --fs-xl:           15px;
  --fs-h3:           17px;
  --fs-h2:           20px;
  --fs-h1:           25px;
  --fs-kpi:          32px;

  /* Weight scale */
  --fw-regular:      400;
  --fw-medium:       500;
  --fw-semibold:     600;
  --fw-bold:         700;
  --fw-heavy:        800;

  /* Letter-spacing — non-negotiable minima for uppercase labels.
     Always pair with text-transform: uppercase. */
  --ls-button:        0.10em;
  --ls-nav:           0.10em;
  --ls-badge:         0.09em;
  --ls-table-header:  0.14em;
  --ls-card-header:   0.14em;
  --ls-op-label:      0.15em;
  --ls-eyebrow:       0.15em;
  --ls-divider:       0.18em;

  /* Line-height */
  --lh-tight:         1.1;
  --lh-snug:          1.35;
  --lh-normal:        1.45;
  --lh-relaxed:       1.55;
  --lh-loose:         1.65;

  /* Elevation — replaces all glow-based box-shadows */
  --shadow-sm:       0 1px 3px rgba(0,0,0,0.24), 0 1px 2px rgba(0,0,0,0.14);
  --shadow-md:       0 4px 12px rgba(0,0,0,0.30), 0 2px 4px rgba(0,0,0,0.16);
  --shadow-lg:       0 8px 24px rgba(0,0,0,0.38), 0 4px 8px rgba(0,0,0,0.20);

  /* Motion */
  --ease:            cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast:          100ms;
  --t:               150ms;
  --t-slow:          220ms;

  /* Layout */
  --nav-h:           60px;
  --content-max:     1800px;

  /* Spacing scale — use these tokens for all new padding/margin/gap.
     Never invent intermediate values. */
  --space-0:         0;
  --space-1:         4px;
  --space-2:         8px;
  --space-3:         12px;
  --space-4:         16px;
  --space-5:         20px;
  --space-6:         24px;
  --space-8:         32px;
  --space-10:        40px;
  --space-12:        48px;
  --space-16:        64px;

  /* Z-index ladder — single source of truth for stacking. */
  --z-base:             0;
  --z-dropdown:         100;
  --z-sticky:           200;
  --z-subnav:           1030;
  --z-topbar:           1040;
  --z-modal-backdrop:   1050;
  --z-modal:            1060;
  --z-toast:            1080;
  --z-tooltip:          1100;

  /* Focus — single ruleset for every interactive element.
     Use `outline`, never `box-shadow`. */
  --focus-color:     var(--oxblood);
  --focus-width:     1.5px;
  --focus-offset:    3px;

  /* Icon sizes — apply via width/height or font-size. Color inherits. */
  --icon-sm:         14px;
  --icon-md:         16px;
  --icon-lg:         20px;

  /* Breakpoints — use these values in matchMedia() and @media queries. */
  --bp-sm:           640px;
  --bp-md:           768px;
  --bp-lg:           1024px;
  --bp-xl:           1280px;
  --bp-2xl:          1536px;

  /* Chart palette — explicit exports for Chart.js and SVG graphics.
     All canvas/SVG code should read these via getComputedStyle(). */
  --chart-grid:      var(--border);
  --chart-tick:      var(--muted);
  --chart-label:     var(--bone-dim);
  --chart-primary:   var(--gold);
  --chart-accent:    var(--oxblood-hover);
  --chart-positive:  var(--green-bright);
  --chart-negative:  var(--red-bright);
  --chart-neutral:   var(--muted);

  /* ── Dashboard tokens — remapped to Tuxedo dark-mode system ── */
  /* Surfaces */
  --surface-page:       var(--bg);
  --surface-card:       var(--surface);
  --surface-muted:      var(--surface-2);

  /* Borders */
  --border-tertiary:    var(--border);
  --border-secondary:   var(--border-active);

  /* Text */
  --text-primary:       var(--bone);
  --text-secondary:     var(--bone-dim);
  --text-tertiary:      var(--muted);
  --text-info:          var(--blue-bright);

  /* Priority stripe colors */
  --priority-p1:        var(--red-bright);
  --priority-p2:        var(--amber-bright);
  --priority-p3:        var(--gold);
  --priority-p4:        var(--subtle);

  /* Priority badge backgrounds + foregrounds */
  --p1-bg: var(--red-pale);    --p1-fg: var(--red-bright);
  --p2-bg: var(--amber-pale);  --p2-fg: var(--amber-bright);
  --p3-bg: var(--gold-pale);   --p3-fg: var(--gold);
  --p4-bg: var(--surface-3);   --p4-fg: var(--muted);

  /* Eisenhower quadrant fills */
  --quad-do-bg:         var(--red-pale);   --quad-do-text:       var(--red-bright);   --quad-do-label:       var(--red-bright);
  --quad-schedule-bg:   var(--amber-pale); --quad-schedule-text: var(--amber-bright); --quad-schedule-label: var(--amber-bright);
  --quad-delegate-bg:   var(--blue-pale);  --quad-delegate-text: var(--blue-bright);  --quad-delegate-label: var(--blue-bright);
  --quad-defer-bg:      var(--surface-3);  --quad-defer-text:    var(--muted);        --quad-defer-label:    var(--subtle);

  /* Entity tag colors */
  --tag-client-bg:      var(--blue-pale);    --tag-client-fg:      var(--blue-bright);
  --tag-dept-mkt-bg:    var(--red-pale);     --tag-dept-mkt-fg:    var(--red-bright);
  --tag-dept-npd-bg:    var(--oxblood-pale); --tag-dept-npd-fg:    var(--blue-bright);
  --tag-sku-bg:         var(--surface-3);    --tag-sku-fg:         var(--muted);

  /* Project accent stripes */
  --accent-blue:        var(--blue-bright);
  --accent-pink:        var(--red-bright);
  --accent-teal:        var(--green-bright);
  --accent-purple:      #6c63ff;

  /* Dashboard radius — match Tuxedo hard-edge aesthetic */
  --dash-radius-md: var(--radius-md);
  --dash-radius-lg: var(--radius-lg);
}

/* --------------------------------------------------------------------------
   2. GLOBAL RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body.sjmx-body {
  background-color: var(--bg);
  color: var(--bone);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   3. PAGE LAYOUT SHELL
   -------------------------------------------------------------------------- */
.sjmx-topbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 1px 0 rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.3);
}

.sjmx-main {
  flex: 1 1 auto;
  padding: 2rem 0 3.5rem;
}

.sjmx-footer {
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  padding: 12px 0;
  flex-shrink: 0;
}

.sjmx-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sjmx-footer-brand {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--subtle);
}

.sjmx-footer-copy {
  font-size: 10.5px;
  color: var(--faint);
}

/* ── Container width overrides — wider on large screens ─── */
@media (min-width: 1400px) {
  .container-xl { max-width: 1440px; }
}
@media (min-width: 1600px) {
  .container-xl { max-width: 1540px; }
}
@media (min-width: 1920px) {
  .container-xl { max-width: 1800px; }
}

/* --------------------------------------------------------------------------
   4. NAVIGATION
   -------------------------------------------------------------------------- */
.sjmx-nav { width: 100%; }

.sjmx-nav-inner {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  gap: 0;
}

/* --- Brand --- */
.sjmx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--bone-dim);
  padding: 0 1.25rem 0 0;
  border-right: 1px solid var(--border);
  margin-right: 0.75rem;
  flex-shrink: 0;
  transition: color var(--t) var(--ease);
}
.sjmx-brand:hover { color: var(--bone); }

.sjmx-brand-logo {
  width: 26px;
  height: 26px;
  opacity: .85;
  filter: brightness(1.1);
}

.sjmx-brand-name {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: inherit;
}

.sjmx-brand-accent {
  color: var(--oxblood-hover);
  font-weight: 600;
}

/* --- Nav list --- */
.sjmx-nav-list {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  height: 100%;
}

.sjmx-nav-item {
  display: flex;
  align-items: stretch;
  position: relative;
}

/* --- Nav links (top-level) --- */
.sjmx-nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .10em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color var(--t) var(--ease);

  /* Bottom accent line */
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; /* align with nav container border */
}

.sjmx-nav-link:hover,
.sjmx-nav-link.active {
  color: var(--bone);
  border-bottom-color: var(--oxblood);
}

.sjmx-nav-link:focus-visible {
  outline: 1.5px solid var(--oxblood);
  outline-offset: -2px;
}

/* Dropdown caret */
.sjmx-dropdown-toggle::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  margin-left: 4px;
  opacity: .5;
  transition: transform var(--t) var(--ease), opacity var(--t);
  flex-shrink: 0;
}

.sjmx-dropdown-toggle[aria-expanded="true"] {
  color: var(--bone);
  border-bottom-color: transparent; /* dropdown border-top replaces this line */
}

.sjmx-dropdown-toggle[aria-expanded="true"]::after {
  transform: rotate(225deg) translateY(1px);
  opacity: .8;
}

/* --- Dropdown menus --- */
.sjmx-dropdown-menu {
  background: var(--surface-3);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 8px 0;
  min-width: 210px;
  list-style: none;
  animation: dropIn var(--t-slow) var(--ease);
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sjmx-dropdown-header {
  display: block;
  padding: 8px 16px 3px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--subtle);
  pointer-events: none;
  user-select: none;
}

.sjmx-dropdown-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 5px 0;
  opacity: 1;
}

.sjmx-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
  line-height: 1.4;
}

.sjmx-dropdown-item:hover,
.sjmx-dropdown-item:focus {
  background: rgba(255,255,255,.05);
  color: var(--bone);
  outline: none;
}

.sjmx-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  font-size: 11px;
  font-style: normal;
  color: var(--subtle);
  flex-shrink: 0;
  transition: color var(--t-fast);
}

.sjmx-dropdown-item:hover .sjmx-item-icon {
  color: var(--muted);
}

/* --- User / account section --- */
.sjmx-user-toggle { gap: 8px; }

.sjmx-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--oxblood);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
  border: 1px solid var(--oxblood-hover);
}

.sjmx-user-menu { min-width: 180px; }

.sjmx-signout {
  color: var(--red-bright) !important;
}
.sjmx-signout:hover {
  background: var(--red-pale) !important;
  color: var(--red-bright) !important;
}

.sjmx-admin-link {
  color: var(--subtle) !important;
  font-style: italic;
}
.sjmx-admin-link:hover { color: var(--muted) !important; }

.sjmx-signin-link { color: var(--oxblood-hover) !important; }
.sjmx-signin-link:hover { color: var(--bone-dim) !important; }

/* --- Mobile hamburger --- */
.sjmx-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  padding: 7px 8px;
  cursor: pointer;
  margin-left: auto;
}

.sjmx-toggle-bar {
  display: block;
  width: 17px;
  height: 1.5px;
  background: var(--muted);
  transition: background var(--t);
}

.sjmx-nav-toggle:hover .sjmx-toggle-bar { background: var(--bone-dim); }

/* Desktop: navbar-collapse must stretch to fill nav height so
   sjmx-nav-list's height:100% resolves correctly */
@media (min-width: 992px) {
  .navbar-collapse {
    display: flex !important;
    align-items: stretch;
    height: 100%;
  }

  .sjmx-nav-list {
    height: 100%;
  }

  /* Dropdowns — anchor to bottom of nav item (which spans full nav-bar height),
     so the panel always appears below the bar, never overlapping other items.
     Bootstrap 5 without Popper.js needs top/left set explicitly via CSS. */
  .sjmx-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0;
    margin-top: 0 !important;
    border-top: 2px solid var(--oxblood);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    min-width: 220px;
  }

  /* Right-aligned menus (user dropdown) */
  .dropdown-menu-end.sjmx-dropdown-menu {
    left: auto;
    right: 0;
  }
}

/* Mobile / tablet collapse — matches Bootstrap navbar-expand-lg (992px) */
@media (max-width: 991.98px) {
  .sjmx-nav-toggle { display: flex; }

  .sjmx-brand { border-right: none; padding-right: 0; }

  /* Drop-down panel below the topbar */
  .navbar-collapse {
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    padding: 6px 0 10px;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 1039;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
  }

  .sjmx-nav-list {
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }

  .sjmx-nav-item { flex-direction: column; }

  .sjmx-nav-link {
    height: auto;
    padding: 9px 18px;
    border-bottom: none;
    border-left: 2px solid transparent;
    margin-bottom: 0;
    font-size: 12px;
  }

  .sjmx-nav-link:hover,
  .sjmx-nav-link.active {
    border-left-color: var(--oxblood);
    border-bottom-color: transparent;
    background: rgba(255,255,255,.03);
  }

  .sjmx-dropdown-menu {
    position: static !important;
    transform: none !important;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: var(--surface-4);
    border-left: 2px solid var(--border-active);
    margin-left: 18px !important;
    padding: 4px 0;
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   4b. PER-APP SUBNAV
   -------------------------------------------------------------------------- */
.sjmx-subnav {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--nav-h);
  z-index: 1030;
}

.sjmx-subnav-inner {
  display: flex;
  align-items: center;
  gap: 0;
  height: 38px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sjmx-subnav-inner::-webkit-scrollbar { display: none; }

/* Optional label that identifies the current module */
.sjmx-subnav-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--subtle);
  padding: 0 14px 0 0;
  margin-right: 6px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

.sjmx-subnav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 100%;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.sjmx-subnav-link:hover { color: var(--bone-dim); }
.sjmx-subnav-link.active {
  color: var(--bone);
  border-bottom-color: var(--oxblood);
}

.sjmx-subnav-sep {
  width: 1px;
  height: 14px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   5. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3 {
  color: var(--bone);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
}

h4, h5, h6 {
  color: var(--bone);
  font-family: var(--font);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
}

a {
  color: var(--oxblood-hover);
  text-decoration: none;
  transition: color var(--t);
}
a:hover { color: var(--bone-dim); }

/* Page header section */
.sjmx-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.sjmx-page-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--bone);
  margin: 0;
  letter-spacing: -.01em;
}

.sjmx-page-subtitle {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-top: 4px;
}

/* Operational label (uppercase micro-text) */
.op-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--subtle);
}

/* --------------------------------------------------------------------------
   6. CARDS
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: var(--bone);
}

.card-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 14px 24px;
}

.card-body { padding: 24px; }

.card-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 14px 24px;
}

/* SJMX variant (explicit) */
.sjmx-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.sjmx-card-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sjmx-card-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.sjmx-card-body { padding: 24px; }

/* Metric / KPI tiles */
.sjmx-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.sjmx-stat-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 6px;
}

.sjmx-stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.sjmx-stat-delta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.sjmx-stat-delta.up   { color: var(--green-bright); }
.sjmx-stat-delta.down { color: var(--red-bright);   }

/* --------------------------------------------------------------------------
   7. TABLES
   -------------------------------------------------------------------------- */
.sjmx-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.sjmx-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  gap: 1rem;
  flex-wrap: wrap;
}

.sjmx-table-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Core table */
.table,
.sjmx-table {
  color: var(--bone);
  border-color: var(--border);
  font-size: 13px;
  margin-bottom: 0;
  width: 100%;
}

.table > thead {
  border-bottom: 1px solid var(--border-active);
}

.table > thead > tr > th {
  background: var(--surface-2);
  color: var(--subtle);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-bottom: none;
  white-space: nowrap;
  vertical-align: middle;
}

.table > tbody > tr > td {
  padding: 10px 16px;
  border-color: var(--border);
  vertical-align: middle;
}

.table > tbody > tr {
  transition: background var(--t-fast);
}

.table > tbody > tr:hover > td {
  background: rgba(255,255,255,.022);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background: rgba(255,255,255,.012);
}

/* Specialized cells */
.cell-price,
.cell-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  text-align: right;
}

.cell-code,
.cell-id {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--subtle);
}

.cell-date { color: var(--muted); font-size: 12.5px; }

/* --------------------------------------------------------------------------
   8. FORMS
   -------------------------------------------------------------------------- */
.form-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}

.form-control,
.form-select {
  background: var(--surface-2);
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  color: var(--bone);
  font-size: 13.5px;
  padding: 8px 12px;
  transition:
    border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    background var(--t);
  width: 100%;
}

.form-control:focus,
.form-select:focus {
  background: var(--surface-3);
  border-color: var(--oxblood);
  box-shadow: none;
  color: var(--bone);
  outline: none;
}

.form-control::placeholder    { color: var(--subtle); }
.form-control:disabled,
.form-select:disabled {
  background: var(--surface);
  color: var(--subtle);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: .7;
}

.form-select option {
  background: var(--surface-3);
  color: var(--bone);
}

.form-check-input {
  background-color: var(--surface-3);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  width: 15px;
  height: 15px;
}

.form-check-input:checked {
  background-color: var(--oxblood);
  border-color: var(--oxblood-hover);
}

.form-check-input:focus {
  box-shadow: none;
  border-color: var(--oxblood);
  outline: 1.5px solid var(--oxblood);
  outline-offset: 1px;
}

.form-check-label {
  color: var(--bone-dim);
  font-size: 13.5px;
}

.form-text {
  color: var(--subtle);
  font-size: 11.5px;
  margin-top: 4px;
}

.invalid-feedback {
  font-size: 11.5px;
  color: var(--red-bright);
}

.is-invalid { border-color: var(--red) !important; }
.is-invalid:focus { box-shadow: none !important; outline: 1.5px solid var(--red) !important; }

/* Form section blocks */
.sjmx-form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 1.5rem;
}

.sjmx-form-section + .sjmx-form-section {
  margin-top: 0;
}

.sjmx-form-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 1.25rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   9. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  padding: 8px 20px;
  border-width: 1px;
  border-style: solid;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition:
    background var(--t) var(--ease),
    border-color var(--t) var(--ease),
    color var(--t) var(--ease);
}

.btn:focus-visible {
  outline: 1.5px solid var(--oxblood);
  outline-offset: 3px;
}

/* Primary — oxblood */
.btn-primary {
  background: var(--oxblood);
  border-color: var(--oxblood-border);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--oxblood-hover);
  border-color: var(--oxblood-hover);
  color: #fff;
}
.btn-primary:active {
  background: var(--oxblood-active);
  border-color: var(--oxblood-active);
}

/* Secondary — steel ghost */
.btn-secondary {
  background: transparent;
  border-color: var(--border-active);
  color: var(--bone-dim);
}
.btn-secondary:hover {
  background: rgba(255,255,255,.05);
  border-color: var(--border-strong);
  color: var(--bone);
}

/* Outline primary */
.btn-outline-primary {
  background: transparent;
  border-color: var(--oxblood);
  color: var(--oxblood-hover);
}
.btn-outline-primary:hover {
  background: var(--oxblood-pale);
  border-color: var(--oxblood-hover);
  color: var(--bone);
}

/* Danger */
.btn-danger {
  background: var(--red-pale);
  border-color: var(--red-border);
  color: var(--red-bright);
}
.btn-danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* Sizes */
.btn-sm {
  font-size: 10px;
  padding: 5px 13px;
  letter-spacing: .09em;
}
.btn-lg {
  font-size: 13px;
  padding: 10px 28px;
}
.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   10. BADGES & STATUS TAGS
   -------------------------------------------------------------------------- */
.badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Semantic variants */
.badge-oxblood { background: var(--oxblood);     color: #fff; }
.badge-steel   { background: var(--surface-4);   color: var(--muted);        border: 1px solid var(--border-active); }
.badge-gold    { background: var(--gold-pale);    color: var(--gold);         border: 1px solid var(--gold-border);   }
.badge-green   { background: var(--green-pale);   color: var(--green-bright); border: 1px solid var(--green-border);  }
.badge-red     { background: var(--red-pale);     color: var(--red-bright);   border: 1px solid var(--red-border);    }
.badge-amber   { background: var(--amber-pale);   color: var(--amber-bright); border: 1px solid var(--amber-border);  }
.badge-blue    { background: var(--blue-pale);    color: var(--blue-bright);  border: 1px solid var(--blue-border);   }

/* Bootstrap bg overrides */
.bg-primary   { background-color: var(--oxblood) !important; }
.bg-secondary { background-color: var(--surface-4) !important; color: var(--muted) !important; }
.bg-success   { background-color: var(--green) !important; }
.bg-danger    { background-color: var(--red) !important; }
.bg-warning   { background-color: var(--amber) !important; color: var(--bg) !important; }
.bg-info      { background-color: var(--blue) !important; }

/* --------------------------------------------------------------------------
   11. ALERTS & MESSAGES
   -------------------------------------------------------------------------- */
.alert,
.sjmx-alert {
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  border-left-width: 3px;
  background: var(--surface-2);
  color: var(--bone-dim);
  font-size: 13px;
  padding: 11px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.sjmx-alert-icon {
  font-size: 12px;
  font-style: normal;
  flex-shrink: 0;
  margin-top: 2px;
  font-weight: 700;
}

.btn-close {
  filter: invert(1) opacity(.4);
  margin-left: auto;
  flex-shrink: 0;
  align-self: flex-start;
}
.btn-close:hover { opacity: .8; }

/* Variants */
.alert-success,
.sjmx-alert-success {
  background: var(--green-pale);
  border-color: var(--green-border);
  border-left-color: var(--green);
  color: var(--green-bright);
}
.alert-danger,
.alert-error,
.sjmx-alert-danger,
.sjmx-alert-error {
  background: var(--red-pale);
  border-color: var(--red-border);
  border-left-color: var(--red);
  color: var(--red-bright);
}
.alert-warning,
.sjmx-alert-warning {
  background: var(--amber-pale);
  border-color: var(--amber-border);
  border-left-color: var(--amber);
  color: var(--amber-bright);
}
.alert-info,
.sjmx-alert-info {
  background: var(--blue-pale);
  border-color: var(--blue-border);
  border-left-color: var(--blue);
  color: var(--blue-bright);
}
.alert-debug,
.sjmx-alert-debug {
  background: var(--surface-2);
  border-color: var(--border-active);
  border-left-color: var(--subtle);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   12. PAGINATION
   -------------------------------------------------------------------------- */
.pagination { gap: 3px; flex-wrap: wrap; }

.page-link {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius) !important;
  transition: all var(--t-fast);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.page-link:hover {
  background: var(--surface-3);
  border-color: var(--border-active);
  color: var(--bone);
}
.page-item.active .page-link {
  background: var(--oxblood);
  border-color: var(--oxblood-border);
  color: #fff;
}
.page-item.disabled .page-link {
  background: var(--surface);
  color: var(--faint);
  border-color: var(--border);
}

/* --------------------------------------------------------------------------
   13. BREADCRUMB
   -------------------------------------------------------------------------- */
.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 1rem;
  font-size: 11.5px;
  gap: 0;
  flex-wrap: wrap;
}
.breadcrumb-item { color: var(--subtle); }
.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  color: var(--faint);
  padding: 0 7px;
}
.breadcrumb-item a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb-item a:hover { color: var(--bone-dim); }
.breadcrumb-item.active  { color: var(--muted); }

/* --------------------------------------------------------------------------
   14. MODALS
   -------------------------------------------------------------------------- */
.modal-content {
  background: var(--surface-2);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  color: var(--bone);
}
.modal-header {
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
}
.modal-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--bone);
}
.modal-body { padding: 20px; }
.modal-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-3);
  padding: 12px 20px;
  gap: 8px;
}
.modal-backdrop.show { opacity: .65; }

/* --------------------------------------------------------------------------
   15. PROGRESS
   -------------------------------------------------------------------------- */
.progress {
  background: var(--surface-3);
  border-radius: 0;
  height: 3px;
  overflow: hidden;
}
.progress-bar {
  background: var(--oxblood);
  transition: width .4s var(--ease);
}
.progress-bar.bg-success { background: var(--green) !important; }
.progress-bar.bg-warning { background: var(--amber) !important; }

/* --------------------------------------------------------------------------
   16. SCROLLBARS
   -------------------------------------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--surface-4);
  border-radius: 1px;
}
::-webkit-scrollbar-thumb:hover { background: var(--subtle); }

/* --------------------------------------------------------------------------
   17. HORIZONTAL RULES
   -------------------------------------------------------------------------- */
hr {
  border: none;
  border-top: 1px solid var(--border);
  opacity: 1;
  margin: 1.5rem 0;
}

/* --------------------------------------------------------------------------
   18. UTILITY CLASSES
   -------------------------------------------------------------------------- */

/* Color */
.text-bone      { color: var(--bone) !important; }
.text-muted     { color: var(--muted) !important; }
.text-subtle    { color: var(--subtle) !important; }
.text-gold      { color: var(--gold) !important; }
.text-oxblood   { color: var(--oxblood-hover) !important; }
.text-red       { color: var(--red-bright) !important; }
.text-green     { color: var(--green-bright) !important; }
.text-amber     { color: var(--amber-bright) !important; }

/* Background */
.bg-surface     { background: var(--surface) !important; }
.bg-surface-2   { background: var(--surface-2) !important; }

/* Borders */
.border-subtle  { border-color: var(--border) !important; }

/* Typography */
.mono    { font-family: var(--font-mono); }
.tabnum  { font-variant-numeric: tabular-nums; }
.caps    {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Inline tag chip */
.sjmx-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-active);
  color: var(--subtle);
  background: var(--surface-3);
  white-space: nowrap;
}

/* Divider with label */
.sjmx-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin: 1.5rem 0;
}
.sjmx-divider::before,
.sjmx-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* Messages container */
.sjmx-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   19. SHARED DESIGN SYSTEM COMPONENTS
   Introduced as part of the unified design system. All tokens; never
   hardcoded colors. Documented in docs/design-system/02-components.md.
   ========================================================================== */

/* --- Skip link (a11y) ----------------------------------------------------- */
.sjmx-skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--oxblood);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  transform: translateY(-200%);
  transition: transform var(--t) var(--ease);
  z-index: var(--z-tooltip);
  text-decoration: none;
}
.sjmx-skip-link:focus-visible {
  transform: translateY(0);
  outline: var(--focus-width) solid #fff;
  outline-offset: 2px;
}

/* --- Tabs (.sjmx-tabs) ---------------------------------------------------- */
.sjmx-tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}
.sjmx-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: var(--space-3) var(--space-4);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--t) var(--ease),
              border-color var(--t) var(--ease);
}
.sjmx-tab:hover { color: var(--bone); }
.sjmx-tab[aria-selected="true"],
.sjmx-tab.is-active {
  color: var(--bone);
  border-bottom-color: var(--oxblood);
}
.sjmx-tab:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: -2px;
}

/* --- Breadcrumb (.sjmx-breadcrumb) ---------------------------------------- */
.sjmx-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  font-size: 11.5px;
  margin-bottom: var(--space-4);
}
.sjmx-breadcrumb-item {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--t) var(--ease);
}
.sjmx-breadcrumb-item:hover { color: var(--bone); }
.sjmx-breadcrumb-item[aria-current="page"] {
  color: var(--bone-dim);
  font-weight: 500;
}
.sjmx-breadcrumb-separator {
  color: var(--faint);
  padding: 0 var(--space-1);
  user-select: none;
}

/* --- Modal (.sjmx-modal) -------------------------------------------------- */
.sjmx-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}
.sjmx-modal-backdrop.is-open { opacity: 1; }

.sjmx-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: var(--z-modal);
  pointer-events: none;
}
.sjmx-modal.is-open { pointer-events: auto; }

.sjmx-modal-dialog {
  background: var(--surface-2);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - var(--space-8));
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t-slow) var(--ease),
              transform var(--t-slow) var(--ease);
}
.sjmx-modal.is-open .sjmx-modal-dialog {
  opacity: 1;
  transform: translateY(0);
}
.sjmx-modal--sm .sjmx-modal-dialog { max-width: 400px; }
.sjmx-modal--lg .sjmx-modal-dialog { max-width: 900px; }

.sjmx-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}
.sjmx-modal-title {
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--bone);
  margin: 0;
}
.sjmx-modal-body {
  padding: var(--space-5);
  overflow-y: auto;
  color: var(--bone);
  font-size: 14px;
  line-height: 1.55;
}
.sjmx-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--surface-3);
  border-top: 1px solid var(--border);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* --- Tooltip (.sjmx-tooltip) --------------------------------------------- */
.sjmx-tooltip {
  position: absolute;
  z-index: var(--z-tooltip);
  background: var(--surface-4);
  color: var(--bone);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--space-2) var(--space-3);
  font-size: 12px;
  line-height: 1.45;
  max-width: 280px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--t) var(--ease),
              transform var(--t) var(--ease);
}
.sjmx-tooltip.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.sjmx-tooltip-arrow {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--surface-4);
  border: 1px solid var(--border-active);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* --- Empty state (.sjmx-empty) ------------------------------------------- */
.sjmx-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-6);
  border: 1px dashed var(--border-active);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
}
.sjmx-empty-icon {
  font-size: 2.2rem;
  line-height: 1;
  color: var(--subtle);
}
.sjmx-empty-title {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin: 0;
}
.sjmx-empty-desc {
  font-size: 13px;
  color: var(--muted);
  max-width: 44ch;
  margin: 0;
}
.sjmx-empty-cta {
  margin-top: var(--space-3);
  display: flex;
  gap: var(--space-2);
}

/* --- Skeleton (.sjmx-skeleton) ------------------------------------------- */
.sjmx-skeleton {
  display: block;
}
.sjmx-skeleton-block,
.sjmx-skeleton-bar,
.sjmx-skeleton-row {
  position: relative;
  background: var(--surface-3);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.sjmx-skeleton-block { height: 120px; }
.sjmx-skeleton-bar   { height: 12px; }
.sjmx-skeleton-row   { height: 40px; }

.sjmx-skeleton-block::after,
.sjmx-skeleton-bar::after,
.sjmx-skeleton-row::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--surface-4) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: sjmx-skeleton-shimmer 1.4s var(--ease) infinite;
}
@keyframes sjmx-skeleton-shimmer {
  100% { transform: translateX(100%); }
}

/* --- Toast (.sjmx-toast) ------------------------------------------------- */
.sjmx-toast-container {
  position: fixed;
  top: calc(var(--nav-h) + var(--space-3));
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-toast);
  max-width: 380px;
  pointer-events: none;
}
.sjmx-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--border-active);
  background: var(--surface-2);
  color: var(--bone);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity var(--t-slow) var(--ease),
              transform var(--t-slow) var(--ease);
}
.sjmx-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.sjmx-toast--success {
  background: var(--green-pale);
  border-left-color: var(--green);
  color: var(--green-bright);
}
.sjmx-toast--error {
  background: var(--red-pale);
  border-left-color: var(--red);
  color: var(--red-bright);
}
.sjmx-toast--warning {
  background: var(--amber-pale);
  border-left-color: var(--amber);
  color: var(--amber-bright);
}
.sjmx-toast--info {
  background: var(--blue-pale);
  border-left-color: var(--blue);
  color: var(--blue-bright);
}
.sjmx-toast-icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1.45;
}
.sjmx-toast-body { flex: 1; }
.sjmx-toast-close {
  appearance: none;
  background: transparent;
  border: none;
  color: inherit;
  opacity: .7;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  font-size: 14px;
  transition: opacity var(--t) var(--ease);
}
.sjmx-toast-close:hover { opacity: 1; }

/* --- Segmented control (.sjmx-segmented) --------------------------------- */
.sjmx-segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}
.sjmx-segmented-option {
  appearance: none;
  background: transparent;
  border: none;
  padding: 6px var(--space-4);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--muted);
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--t) var(--ease),
              color var(--t) var(--ease);
}
.sjmx-segmented-option:hover { color: var(--bone); }
.sjmx-segmented-option[aria-pressed="true"] {
  background: var(--surface-4);
  color: var(--bone);
}
.sjmx-segmented-option:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: 1px;
}

/* --- Switch (.sjmx-switch) ----------------------------------------------- */
.sjmx-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 13px;
  color: var(--bone);
}
.sjmx-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.sjmx-switch-track {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  background: var(--surface-4);
  border: 1px solid var(--border-active);
  border-radius: 999px;
  transition: background var(--t) var(--ease),
              border-color var(--t) var(--ease);
  flex-shrink: 0;
}
.sjmx-switch-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  background: var(--bone-dim);
  border-radius: 999px;
  transition: transform var(--t) var(--ease),
              background var(--t) var(--ease);
}
.sjmx-switch input:checked ~ .sjmx-switch-track {
  background: var(--oxblood);
  border-color: var(--oxblood-border);
}
.sjmx-switch input:checked ~ .sjmx-switch-track .sjmx-switch-thumb {
  transform: translateX(14px);
  background: #fff;
}
.sjmx-switch input:focus-visible ~ .sjmx-switch-track {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: 2px;
}
.sjmx-switch input:disabled ~ .sjmx-switch-track {
  opacity: .5;
  cursor: not-allowed;
}

/* --- Spinner (.sjmx-spinner) --------------------------------------------- */
.sjmx-spinner {
  display: inline-block;
  width: var(--icon-md);
  height: var(--icon-md);
  border: 2px solid var(--border-active);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: sjmx-spinner-rotate .8s linear infinite;
}
.sjmx-spinner--sm { width: var(--icon-sm); height: var(--icon-sm); border-width: 1.5px; }
.sjmx-spinner--lg { width: var(--icon-lg); height: var(--icon-lg); }
@keyframes sjmx-spinner-rotate {
  100% { transform: rotate(360deg); }
}

/* --- KPI tile (.sjmx-kpi) ------------------------------------------------- */
.sjmx-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow: hidden;
}
.sjmx-kpi-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--subtle);
  margin: 0;
}
.sjmx-kpi-value {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.7vw, 2rem);
  font-weight: 700;
  color: var(--gold);
  margin: 0;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.sjmx-kpi-sub {
  font-size: 12px;
  color: var(--bone-dim);
  margin: 0;
}
.sjmx-kpi--positive .sjmx-kpi-sub { color: var(--green-bright); }
.sjmx-kpi--negative .sjmx-kpi-sub { color: var(--red-bright); }

/* --- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .sjmx-skeleton-block::after,
  .sjmx-skeleton-bar::after,
  .sjmx-skeleton-row::after {
    animation: none;
    display: none;
  }
}

/* ==========================================================================
   20. MATERIAS PRIMAS — Price Intelligence components
   Classes used across upload.html, batch_list.html, batch_detail.html.
   All tokens resolve from the shared design system.
   ========================================================================== */

/* --- Page header (MP breadcrumb + title pattern) --- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-header__breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--subtle);
  margin-bottom: 6px;
  letter-spacing: .04em;
  flex-wrap: wrap;
}
.page-header__breadcrumb-sep { color: var(--faint); }
.page-header__breadcrumb a  { color: var(--muted); text-decoration: none; }
.page-header__breadcrumb a:hover { color: var(--bone-dim); }
.page-header__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bone);
  letter-spacing: -.01em;
  line-height: 1.2;
  margin: 0;
}
.page-header__subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* --- Stat row (flush KPI tiles) --- */
.stat-row {
  display: flex;
  gap: 1px;
  margin-bottom: 24px;
  background: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.stat {
  flex: 1;
  background: var(--surface);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--subtle);
}
.stat__value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--bone);
  font-variant-numeric: tabular-nums;
}
.stat__value--green { color: var(--green-bright); }
.stat__value--red   { color: var(--red-bright);   }
.stat__value--amber { color: var(--amber-bright);  }
.stat__value--muted { color: var(--subtle);        }

/* --- Status badges with dot indicator (MP batch/row statuses) --- */
/* Dot is added via ::before on badge-- variants */
.badge[class*="badge--"]::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}
.badge--valid    { background: var(--green-pale);  color: var(--green-bright);  border: 1px solid var(--green-border);  }
.badge--warning  { background: var(--amber-pale);  color: var(--amber-bright);  border: 1px solid var(--amber-border);  }
.badge--error    { background: var(--red-pale);    color: var(--red-bright);    border: 1px solid var(--red-border);    }
.badge--promoted { background: var(--blue-pale);   color: var(--blue-bright);   border: 1px solid var(--blue-border);   }
.badge--staged   { background: var(--gold-pale);   color: var(--gold);          border: 1px solid var(--gold-border);   }
.badge--done     { background: var(--green-pale);  color: var(--green-bright);  border: 1px solid var(--green-border);  }
.badge--failed   { background: var(--red-pale);    color: var(--red-bright);    border: 1px solid var(--red-border);    }
.badge--skipped,
.badge--ignored  { background: var(--surface-4);   color: var(--subtle);        border: 1px solid var(--border-active); }
.badge--pending  { background: var(--surface-3);   color: var(--muted);         border: 1px solid var(--border-active); }

/* --- Data table (MP-specific table with dense rows) --- */
.data-table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th {
  padding: 9px 12px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--subtle);
  border-bottom: 1px solid var(--border-active);
  background: var(--surface-2);
  white-space: nowrap;
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--muted);
}
.data-table tbody tr:hover td  { background: rgba(255,255,255,.022); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .td-primary { color: var(--bone); font-weight: 500; }
.data-table .td-num     { font-family: var(--font-mono); text-align: right; color: var(--gold); font-variant-numeric: tabular-nums; }
.data-table .td-muted   { color: var(--subtle); font-style: italic; }
.data-table .mono       { font-family: var(--font-mono); }

/* --- Error list (inside table rows) --- */
.error-list { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.error-list li { display: flex; align-items: baseline; gap: 6px; font-size: 11px; }
.error-list .field-tag { font-family: var(--font-mono); font-size: 10px; color: var(--subtle); flex-shrink: 0; }
.error-list .sev-error   { color: var(--red-bright);   }
.error-list .sev-warning { color: var(--amber-bright); }

/* --- Form components (MP-specific, extends base form styles) --- */
.form-group    { display: flex; flex-direction: column; gap: 6px; }
.form-hint     { font-size: 11.5px; color: var(--subtle); line-height: 1.5; }
.field-errors  { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.field-error   { font-size: 11.5px; color: var(--red-bright); }

/* Checkbox row */
.form-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.form-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--oxblood);
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.form-check-label { font-size: 13px; color: var(--bone-dim); cursor: pointer; }

/* --- Tab bar (batch detail page) --- */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 10px 16px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--subtle);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--t), border-color var(--t);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  text-decoration: none;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover { color: var(--muted); }
.tab.active { color: var(--bone); border-bottom-color: var(--oxblood); }
.tab__count {
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--subtle);
}
.tab.active .tab__count { background: var(--oxblood-pale); color: var(--oxblood-hover); }

.tab__count--red   { background: var(--red-pale);   color: var(--red-bright);   border: 1px solid var(--red-border);   }
.tab__count--amber { background: var(--amber-pale); color: var(--amber-bright); border: 1px solid var(--amber-border); }
.tab__count--green { background: var(--green-pale); color: var(--green-bright); border: 1px solid var(--green-border); }
/* Keep color modifier visible even when tab is active */
.tab.active .tab__count--red   { background: var(--red-pale);   color: var(--red-bright);   }
.tab.active .tab__count--amber { background: var(--amber-pale); color: var(--amber-bright); }
.tab.active .tab__count--green { background: var(--green-pale); color: var(--green-bright); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* --- MP button variants (map onto design-system tokens) --- */
.btn--primary {
  background: var(--oxblood);
  border-color: var(--oxblood-border);
  color: #fff;
}
.btn--primary:hover:not(:disabled) {
  background: var(--oxblood-hover);
  border-color: var(--oxblood-hover);
}
.btn--ghost {
  background: transparent;
  border-color: var(--border-active);
  color: var(--muted);
}
.btn--ghost:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--bone);
  background: rgba(255,255,255,.05);
}
.btn--danger {
  background: var(--red-pale);
  border-color: var(--red-border);
  color: var(--red-bright);
}
.btn--danger:hover:not(:disabled) {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn--promote {
  background: var(--green-pale);
  border-color: var(--green-border);
  color: var(--green-bright);
}
.btn--promote:hover:not(:disabled) {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.btn--sm { padding: 4px 10px; font-size: 11px; }
.btn--lg { padding: 10px 22px; font-size: 13.5px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* --- Empty state --- */
.empty-state { padding: 48px 20px; text-align: center; color: var(--subtle); }
.empty-state__icon { font-size: 28px; margin-bottom: 12px; opacity: .35; display: block; }
.empty-state__text { font-size: 13px; }
.empty-state__text a { color: var(--oxblood-hover); }

/* --- Expandable raw-data blocks --- */
details.raw-data-block { margin-top: 8px; }
details.raw-data-block summary {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--subtle);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 5px;
}
details.raw-data-block summary::before {
  content: '▶';
  font-size: 8px;
  transition: transform var(--t);
}
details[open].raw-data-block summary::before { transform: rotate(90deg); }
details.raw-data-block pre {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-top: 6px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* --- Light-theme overrides for MP components --- */
[data-theme="light"] details.raw-data-block pre { background: var(--surface-2); }

/* ==========================================================================
   20. LIGHT THEME  —  white / light grey base, dark charcoal text
   Oxblood + gold accents identical to dark theme.
   Activated via [data-theme="light"] on <html> (JS-toggled, persisted in localStorage).
   ========================================================================== */
[data-theme="light"] {
  /* Background layers — clean white to light grey */
  --bg:              #f4f5f7;
  --surface:         #ffffff;
  --surface-2:       #f4f5f7;
  --surface-3:       #eaecf0;
  --surface-4:       #dfe1e6;

  /* Navigation — white bar, clean edge */
  --nav-bg:          #ffffff;
  --nav-border:      #dfe1e6;

  /* Borders — neutral greys */
  --border:          #dfe1e6;
  --border-active:   #c1c7d0;
  --border-strong:   #a5adba;

  /* Text — dark charcoal scale */
  --bone:            #172b4d;
  --bone-dim:        #344563;
  --muted:           #5e6c84;
  --subtle:          #8993a4;
  --faint:           #c1c7d0;

  /* Midnight Steel — same hue, light-mode pale/border variants */
  --oxblood:         #1e3a5f;
  --oxblood-hover:   #254a7a;
  --oxblood-active:  #172d4c;
  --oxblood-pale:    #e8f2fd;
  --oxblood-glow:    rgba(30, 58, 95, 0.12);
  --oxblood-border:  #b0ccea;

  /* Gold — darkened for legibility on white */
  --gold:            #7a5c00;
  --gold-dim:        #5a4400;
  --gold-pale:       #fffae6;
  --gold-border:     #ffe380;

  /* Semantic — standard accessible tones on white */
  --green:           #006644;
  --green-bright:    #00875a;
  --green-pale:      #e3fcef;
  --green-border:    #abf5d1;

  --red:             #bf2600;
  --red-bright:      #de350b;
  --red-pale:        #ffebe6;
  --red-border:      #ffbdad;

  --amber:           #974f0c;
  --amber-bright:    #c45c00;
  --amber-pale:      #fffae6;
  --amber-border:    #ffe380;

  --blue:            #0747a6;
  --blue-bright:     #0052cc;
  --blue-pale:       #deebff;
  --blue-border:     #4c9aff;

  /* Supplier palette — light-mode variants (single gold + blue gradient) */
  --sp-sjmx:         #8a6e32;   /* gold — protagonist */
  --sp-bafar:        #0c2744;   /* darkest navy */
  --sp-lala:         #1e3a5f;   /* midnight steel */
  --sp-qualtia:      #365e89;   /* medium blue */
  --sp-sigma:        #5a82aa;   /* light blue */
  --sp-otros:        #7d8799;   /* subtle */

  /* Elevation — lighter shadows on white */
  --shadow-sm:       0 1px 3px rgba(9,30,66,0.10), 0 1px 2px rgba(9,30,66,0.06);
  --shadow-md:       0 4px 12px rgba(9,30,66,0.12), 0 2px 4px rgba(9,30,66,0.08);
  --shadow-lg:       0 8px 24px rgba(9,30,66,0.15), 0 4px 8px rgba(9,30,66,0.10);

  /* Chart palette — light-mode overrides. Only grid/tick/label shift;
     semantic and primary colors inherit legibility on white. */
  --chart-grid:      var(--border);
  --chart-tick:      var(--muted);
  --chart-label:     var(--bone-dim);
}

/* btn-close: no invert needed on light bg */
[data-theme="light"] .btn-close { filter: opacity(.45); }

/* Table row backgrounds — white rows against grey page */
[data-theme="light"] .table > tbody > tr > td,
[data-theme="light"] .sjmx-table > tbody > tr > td { background: var(--surface); }
[data-theme="light"] .data-table td                { background: var(--surface); }

/* Table row hovers */
[data-theme="light"] .table > tbody > tr:hover > td { background: rgba(9,30,66,.04); }
[data-theme="light"] .table-striped > tbody > tr:nth-of-type(odd) > * { background: rgba(9,30,66,.02); }
[data-theme="light"] .data-table tbody tr:hover td  { background: rgba(9,30,66,.03); }

/* Form controls — white inputs, standard feel */
[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
  background: var(--surface);
  color: var(--bone);
  border-color: var(--border-active);
}
[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
  background: var(--surface);
  border-color: var(--oxblood);
  box-shadow: none;
}
[data-theme="light"] .form-control::placeholder { color: var(--subtle); }
[data-theme="light"] .form-select option {
  background: var(--surface);
  color: var(--bone);
}
[data-theme="light"] .form-control:disabled,
[data-theme="light"] .form-select:disabled {
  background: var(--surface-2);
  color: var(--muted);
}

/* Nav — crisper shadow on white */
[data-theme="light"] .sjmx-topbar {
  box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(9,30,66,.08);
}

/* Dropdown — crisper shadow on white bg */
[data-theme="light"] .sjmx-dropdown-menu {
  box-shadow:
    0 0 0 1px rgba(9,30,66,.08),
    0 8px 24px rgba(9,30,66,.12),
    0 2px 6px rgba(9,30,66,.06);
}

/* Modal backdrop */
[data-theme="light"] .modal-backdrop.show { opacity: .35; }

/* Card hover — subtle lift instead of brightening */
[data-theme="light"] .home-module:hover { background: var(--surface-2); }

/* --------------------------------------------------------------------------
   21. THEME TOGGLE BUTTON
   -------------------------------------------------------------------------- */

/* Smooth color transitions when switching theme */
html {
  color-scheme: dark light;
}
body.sjmx-body,
.sjmx-topbar,
.sjmx-dropdown-menu,
.sjmx-footer {
  transition:
    background-color var(--t-slow) var(--ease),
    border-color var(--t-slow) var(--ease),
    color var(--t-slow) var(--ease);
}

.sjmx-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 4px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--t), border-color var(--t), background var(--t);
  align-self: center;
}
.sjmx-theme-toggle:hover {
  color: var(--bone);
  border-color: var(--border-active);
  background: var(--surface-2);
}

/* Sun icon — shown in dark mode (click to switch to light) */
.sjmx-theme-icon::before {
  content: '☀';
  font-size: 14px;
  line-height: 1;
}

/* Moon icon — shown in light mode (click to switch to dark) */
[data-theme="light"] .sjmx-theme-icon::before {
  content: '☾';
}

/* ============================================================
   Tasks / Proyectos app
   ============================================================ */

/* Strip sjmx-main padding and container-xl constraints so the
   tasks shell starts flush below the sticky topbar. */
.tasks-page .sjmx-main {
  padding: 0;
}
.tasks-page .sjmx-main > .container-xl {
  padding-left: 0;
  padding-right: 0;
  max-width: 100%;
}

/* Shell layout */
.tasks-shell {
  display: block;
  min-height: calc(100vh - var(--nav-h) - 42px);
}

/* ── Tasks sub-navigation bar ── */
.tasks-subnav {
  position: sticky;
  top: var(--nav-h);
  z-index: var(--z-subnav);
  height: 42px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}
.tasks-subnav::-webkit-scrollbar { display: none; }

.tasks-subnav-item {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--bone-dim);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  gap: 6px;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font);
  cursor: pointer;
  line-height: 1;
}
.tasks-subnav-item:hover { color: var(--bone); background: rgba(255,255,255,.04); }
.tasks-subnav-item.active {
  color: var(--bone);
  border-bottom-color: var(--oxblood);
  font-weight: 600;
  background: rgba(255,255,255,.025);
}
[data-theme="light"] .tasks-subnav-item:hover { background: rgba(9,30,66,.04); }
[data-theme="light"] .tasks-subnav-item.active { background: rgba(9,30,66,.03); }

.tasks-subnav-sep {
  width: 1px;
  background: var(--border);
  margin: 10px var(--space-2);
  flex-shrink: 0;
}
.tasks-subnav-spacer { flex: 1; min-width: var(--space-4); }

/* Dropdown containers */
.tasks-subnav-dd { position: relative; display: flex; }

/* Animated chevron */
.tasks-subnav-chevron {
  font-size: 9px;
  display: inline-block;
  transition: transform 140ms ease-out;
  opacity: 0.5;
}
.tasks-subnav-dd.open .tasks-subnav-chevron { transform: rotate(180deg); }

/* Dropdown panel — position:fixed so subnav overflow-x cannot clip it */
.tasks-subnav-dd-menu {
  position: fixed;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: calc(var(--z-subnav) + 1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 120ms ease-out, transform 120ms ease-out, visibility 0s 120ms;
}
.tasks-subnav-dd.open .tasks-subnav-dd-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 120ms ease-out, transform 120ms ease-out;
}

.tasks-subnav-dd-item {
  display: flex;
  align-items: center;
  padding: 8px var(--space-4);
  font-size: 12px;
  color: var(--bone-dim);
  text-decoration: none;
  gap: var(--space-2);
}
.tasks-subnav-dd-item:hover { background: rgba(255,255,255,.025); color: var(--bone); }
.tasks-subnav-dd-item.active { background: var(--oxblood-pale); color: var(--bone); }
.tasks-subnav-dd-item .count { margin-left: auto; }
[data-theme="light"] .tasks-subnav-dd-item:hover { background: rgba(9,30,66,.04); }

/* Main content area — margin:auto centers when viewport > max-width */
.tasks-main {
  padding: var(--space-6) var(--space-8);
  max-width: 1572px;
  overflow-x: hidden;
  margin: 0 auto;
}

/* Project grid */
.tasks-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

.tasks-project-card {
  display: block; position: relative; overflow: hidden;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.tasks-project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.tasks-project-card-accent {
  height: 3px; width: 100%;
}

.tasks-project-card-meta { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.tasks-project-card-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--bone); margin-bottom: 4px; }
.tasks-project-card-type { margin-bottom: var(--space-3); }
.tasks-project-card-due { font-size: 11px; color: var(--muted); margin-top: var(--space-2); }
.tasks-project-card-footer { margin-top: var(--space-3); display: flex; gap: var(--space-2); }

/* Task row */
.tasks-task-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px var(--space-4); border-bottom: 1px solid var(--border);
  background: var(--surface); transition: background var(--t-fast);
}
.tasks-task-row:hover { background: var(--surface-2); }

/* Personal task visual cue — dim background + lock icon */
.tasks-task-row--personal {
  background: var(--surface-2);
}

.tasks-personal-indicator { font-size: 11px; color: var(--subtle); flex-shrink: 0; }
.tasks-priority-badge { flex-shrink: 0; }
.tasks-task-title { flex: 1; font-size: 13px; color: var(--bone); }
.tasks-due-date { font-size: 11px; color: var(--muted); }
.tasks-task-actions { display: flex; gap: var(--space-2); opacity: 0; transition: opacity var(--t-fast); }
.tasks-task-row:hover .tasks-task-actions { opacity: 1; }

/* Board header */
.tasks-board-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}
.tasks-board-indicator { font-size: 12px; color: var(--bone-dim); }

.tasks-board-body { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }

/* Group headers */
.tasks-group { margin-bottom: var(--space-6); }
.tasks-group-header {
  font-size: 10px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--subtle);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}

/* Avatar */
.tasks-avatar {
  width: 26px; height: 26px; border-radius: 2px;
  background: var(--oxblood); color: var(--bone);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 10px; letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* Modal */
.tasks-modal-backdrop {
  position: fixed; inset: 0; z-index: var(--z-modal-backdrop);
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 80px;
}
.tasks-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 540px; max-width: 96vw; max-height: 80vh; overflow-y: auto;
}
.tasks-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--border);
}
.tasks-modal-loading { padding: var(--space-6); color: var(--muted); text-align: center; }

/* Quick-add form */
.tasks-quick-add-form { padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.tasks-quick-add-row { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.tasks-quick-add-row .field { flex: 1; min-width: 140px; }
.tasks-quick-add-actions { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-2); }
.tasks-quick-add-success { padding: var(--space-6); text-align: center; }
.tasks-field-error { font-size: 11px; color: var(--red-bright); margin-top: 2px; }

/* Shared input style (mirrors .field select/.field input from sjmx-shell) */
.sjmx-input, .sjmx-select {
  height: 36px; background: var(--surface-2); border: 1px solid var(--border-active);
  border-radius: var(--radius-md); color: var(--bone); font-family: var(--font);
  font-size: 13px; padding: 0 10px; outline: none; width: 100%;
}
.sjmx-input:focus, .sjmx-select:focus {
  border-color: var(--oxblood); outline: none;
}

/* Overview grid */
.tasks-overview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-6);
}

/* Note row */
.tasks-note-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--border);
}

/* filter-bar divider (tasks version) */
.filter-bar-divider { width: 1px; height: 22px; background: var(--border); }

/* ============================================================
   Home Dashboard
   ============================================================ */

.dash-page {
  padding: var(--space-5) var(--space-6);
  max-width: 1400px;
}

/* Header */
.dash-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--space-5);
}
.dash-greeting {
  font-family: var(--font); font-size: 18px; font-weight: 500;
  color: var(--bone); margin: 0;
}
.dash-subtitle {
  font-size: 12px; color: var(--muted); margin: 2px 0 0;
}

/* Grid rows */
.dash-row {
  display: grid; gap: var(--space-3); margin-bottom: var(--space-3);
}
.dash-row--wide-narrow { grid-template-columns: 1.4fr 1fr; }
.dash-row--3col        { grid-template-columns: 1fr 1fr 1fr; }

/* Widget card */
.dash-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 0;
}
.dash-widget-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.dash-widget-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--bone);
}
.dash-widget-count { font-size: 11px; color: var(--muted); }
.dash-widget-action { font-size: 11px; color: var(--muted); cursor: pointer; }
.dash-widget-action:hover { color: var(--bone-dim); }
.dash-widget-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 11px; color: var(--muted);
}
.dash-widget-footer a { color: var(--muted); }
.dash-widget-footer a:hover { color: var(--bone-dim); }
.dash-widget-footer--center { justify-content: center; gap: 4px; }

/* Widget icon (brand dot) */
.dash-widget-icon {
  width: 14px; height: 14px; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dash-widget-icon::after {
  content: ''; width: 6px; height: 6px; background: currentColor; border-radius: 1px;
}
.dash-widget-icon--brand { background: rgba(83,74,183,.15); color: var(--oxblood-hover); }

/* Empty state */
.dash-empty { font-size: 12px; color: var(--muted); padding: var(--space-3) 0; text-align: center; }

/* ── Recommended task rows ── */
.dash-task-list { display: flex; flex-direction: column; gap: 3px; }

.dash-task-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 8px; border-radius: 5px;
}
.dash-task-row--p1 { background: var(--red-pale); }
.dash-task-row--p2 { background: var(--amber-pale); }
.dash-task-row--personal {
  background: var(--surface-2);
}

.dash-checkbox {
  width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px;
  border: 1px solid var(--border-active); border-radius: 3px;
}
.dash-checkbox--sm { width: 11px; height: 11px; border-radius: 2px; }
.dash-lock-icon { flex-shrink: 0; margin-top: 1px; opacity: 0.5; color: var(--muted); }

.dash-task-body { flex: 1; min-width: 0; }
.dash-task-title {
  font-size: 13px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-task-title a { color: var(--bone); }
.dash-task-title a:hover { color: var(--bone-dim); }
.dash-task-title--personal { color: var(--bone-dim); font-style: italic; }
.dash-task-title--personal a { color: var(--bone-dim); }

.dash-task-chips {
  display: flex; gap: 4px; margin-top: 3px; align-items: center; flex-wrap: wrap;
}

/* Priority + label chips */
.dash-chip {
  font-size: 10px; padding: 1px 6px; border-radius: 3px;
  font-weight: 500; white-space: nowrap;
}
.dash-chip--p1 { background: var(--red-pale); color: var(--red-bright); border: 1px solid var(--red-border); }
.dash-chip--p2 { background: var(--amber-pale); color: var(--amber-bright); border: 1px solid var(--amber-border); }
.dash-chip--p3 { background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); }
.dash-chip--p4 { background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); }
.dash-chip--client { background: var(--blue-pale); color: var(--blue-bright); border: 1px solid var(--blue-border); }
.dash-chip--sku { background: var(--surface-3); color: var(--bone-dim); border: 1px solid var(--border); }
.dash-chip--neutral { background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); }

.dash-chip-meta { font-size: 10px; color: var(--muted); }
.dash-chip-meta--urgent { color: var(--red-bright); }

/* ── Eisenhower 2×2 ── */
.dash-quadrant-grid {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 6px; flex: 1; min-height: 200px;
}
.dash-quadrant {
  border-radius: 5px; padding: 8px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.dash-quadrant-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
}
.dash-quadrant-sub { font-size: 11px; opacity: 0.65; margin-top: 1px; }
.dash-quadrant-count { font-size: 26px; font-weight: 500; }

.dash-quadrant--do-now   { background: var(--red-pale); }
.dash-quadrant--do-now .dash-quadrant-label,
.dash-quadrant--do-now .dash-quadrant-count { color: var(--red-bright); }
.dash-quadrant--do-now .dash-quadrant-sub   { color: var(--red-bright); }

.dash-quadrant--schedule { background: var(--amber-pale); }
.dash-quadrant--schedule .dash-quadrant-label,
.dash-quadrant--schedule .dash-quadrant-count { color: var(--amber-bright); }
.dash-quadrant--schedule .dash-quadrant-sub   { color: var(--amber-bright); }

.dash-quadrant--delegate { background: var(--blue-pale); }
.dash-quadrant--delegate .dash-quadrant-label,
.dash-quadrant--delegate .dash-quadrant-count { color: var(--blue-bright); }
.dash-quadrant--delegate .dash-quadrant-sub   { color: var(--blue-bright); }

.dash-quadrant--defer    { background: var(--surface-3); }
.dash-quadrant--defer .dash-quadrant-label,
.dash-quadrant--defer .dash-quadrant-count { color: var(--bone-dim); }
.dash-quadrant--defer .dash-quadrant-sub   { color: var(--muted); }

/* ── 7-day calendar strip ── */
.dash-cal-strip {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.dash-cal-day {
  text-align: center; padding: 4px 2px;
}
.dash-cal-day--today {
  background: var(--surface-2); border-radius: 5px;
}
.dash-cal-day--weekend { opacity: 0.45; }
.dash-cal-dow {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
}
.dash-cal-day--today .dash-cal-dow { color: var(--gold); font-weight: 500; }
.dash-cal-num { font-size: 14px; font-weight: 500; color: var(--bone); margin: 2px 0; }
.dash-cal-day--today .dash-cal-num { color: var(--gold); }
.dash-cal-bars { display: flex; flex-direction: column; gap: 2px; margin: 2px 4px; }
.dash-cal-bar { height: 4px; border-radius: 2px; }
.dash-cal-bar--p1 { background: var(--red-bright); }
.dash-cal-bar--p2 { background: var(--amber-bright); }
.dash-cal-bar--p3 { background: var(--subtle); }
.dash-cal-count { font-size: 10px; color: var(--muted); margin-top: 3px; }
.dash-cal-day--today .dash-cal-count { color: var(--gold); font-weight: 500; }

.dash-cal-legend { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.dash-cal-legend-dot { width: 8px; height: 4px; border-radius: 2px; }
.dash-cal-legend-dot--p1 { background: var(--red-bright); }
.dash-cal-legend-dot--p2 { background: var(--amber-bright); }
.dash-cal-legend-dot--p3 { background: var(--subtle); }

/* ── Personal inbox ── */
.dash-inbox-list { display: flex; flex-direction: column; gap: 1px; }
.dash-inbox-row {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 0; font-size: 12px; border-bottom: 1px solid var(--border);
}
.dash-inbox-row:last-child { border-bottom: none; }
.dash-inbox-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--bone); }
.dash-inbox-tag { font-size: 10px; color: var(--blue-bright); flex-shrink: 0; }

/* ── Recent projects ── */
.dash-project-list { display: flex; flex-direction: column; gap: 4px; }
.dash-project-row {
  display: flex; align-items: center; gap: 8px; padding: 4px 0;
  text-decoration: none; color: inherit;
}
.dash-project-row:hover .dash-project-name { color: var(--gold); }
.dash-project-accent { width: 3px; height: 22px; border-radius: 1px; flex-shrink: 0; }
.dash-project-info { flex: 1; min-width: 0; }
.dash-project-name {
  font-size: 12px; font-weight: 500; color: var(--bone);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color var(--t-fast);
}
.dash-project-meta { font-size: 10px; color: var(--muted); }

/* ── Meetings ── */
.dash-meeting-list { display: flex; flex-direction: column; gap: 6px; }
.dash-meeting-row { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.dash-meeting-row:last-child { border-bottom: none; }
.dash-meeting-date { text-align: center; width: 30px; flex-shrink: 0; }
.dash-meeting-dow { font-size: 9px; color: var(--muted); text-transform: uppercase; }
.dash-meeting-day { font-size: 14px; font-weight: 500; color: var(--bone); }
.dash-meeting-info { flex: 1; min-width: 0; }
.dash-meeting-name { font-size: 12px; font-weight: 500; color: var(--bone); }
.dash-meeting-meta { font-size: 10px; color: var(--muted); margin-top: 1px; }

/* ── Follow-up ── */
.dash-followup-list { display: flex; flex-direction: column; gap: 2px; }
.dash-followup-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; padding: 3px 0;
  border-bottom: 1px dashed var(--border);
}
.dash-followup-row:last-child { border-bottom: none; }
.dash-followup-title {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--bone); flex: 1; min-width: 0;
}
.dash-followup-age { font-size: 10px; flex-shrink: 0; margin-left: 6px; color: var(--muted); }
.dash-followup-age--alert { color: var(--red-bright); }
.dash-followup-age--warn  { color: var(--amber-bright); }

/* ============================================================
   Task OS Component Library
   Ported from staticfiles/claude_design/Tareas y Proyectos/app.css
   ============================================================ */

/* ── Button typography override for task shell ── */
.tasks-shell .btn {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
}

/* ── Button secondary (missing from task section) ── */
.btn--secondary { background: transparent; color: var(--bone-dim); border-color: var(--border-active); }
.btn--secondary:hover { color: var(--bone); background: rgba(255,255,255,.05); }
[data-theme="light"] .btn--secondary:hover { background: rgba(9,30,66,.04); }

/* ── Icon button ── */
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--border-active); background: transparent; color: var(--bone-dim); border-radius: 2px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--bone); border-color: var(--border-strong); }

/* ── Badge variants (Task OS color set) ── */
.badge--green   { background: var(--green-pale);   color: var(--green-bright);  border-color: var(--green-border);   }
.badge--red     { background: var(--red-pale);     color: var(--red-bright);    border-color: var(--red-border);     }
.badge--amber   { background: var(--amber-pale);   color: var(--amber-bright);  border-color: var(--amber-border);   }
.badge--blue    { background: var(--blue-pale);    color: var(--blue-bright);   border-color: var(--blue-border);    }
.badge--gold    { background: var(--gold-pale);    color: var(--gold);          border-color: var(--gold-border);    }
.badge--neutral { background: var(--surface-3);   color: var(--muted);         border-color: var(--border);         }
.badge--oxblood { background: var(--oxblood-pale); color: var(--blue-bright);   border-color: var(--oxblood-border); }

/* ── Card BEM extensions (outer .card/.sjmx-card already defined above) ── */
.card { overflow: hidden; }
.card__head {
  background: var(--surface-2);
  padding: 12px var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--space-3);
}
.card__title-row { display: flex; align-items: center; gap: 10px; }
.card__title {
  font-family: var(--font); font-weight: 600; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--subtle); margin: 0;
}
.card__count { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.card__body { padding: var(--space-5); }
.card__body--flush { padding: 0; }

/* ── Chips ── */
.chip {
  font-family: var(--font); font-size: 10px; font-weight: 500;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--bone-dim);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 5px; line-height: 1.5;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; }
.chip--dept    { color: var(--green-bright); border-color: var(--green-border); background: var(--green-pale); }
.chip--client  { color: var(--blue-bright);  border-color: var(--blue-border);  background: var(--blue-pale); }
.chip--sku     { color: var(--gold);          border-color: var(--gold-border);  background: var(--gold-pale); font-family: var(--font-mono); }
.chip--project { color: var(--bone-dim); }
.chip--tag     { color: var(--muted); }
.chip--mono    { font-family: var(--font-mono); font-size: 10px; }

/* ── Priority dot ── */
.prio { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.prio--p1 { background: var(--red-bright); }
.prio--p2 { background: var(--amber-bright); }
.prio--p3 { background: var(--gold); }
.prio--p4 { background: var(--subtle); }

/* ── Inline priority select overlay ── */
.prio-wrap { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.prio-overlay {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; padding: 0; border: none;
}

/* ── Inline status circle (replaces checkbox) ── */
.status-select-wrap { position: relative; display: inline-flex; align-items: center; }
.status-select-overlay {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; padding: 0; border: none;
}
.status-icon {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.status-icon--todo        { border: 1.5px solid var(--muted); }
.status-icon--in_progress { background: var(--blue-bright); }
.status-icon--standby     { background: var(--muted); }
.status-icon--blocked     { background: var(--red-bright); }
.status-icon--in_review   { background: var(--amber-bright); }
.status-icon--done        { background: var(--green-bright); }
.status-icon--cancelled   { background: var(--subtle); opacity: 0.5; }

/* ── Status pill (mirrors app.css; adds Django status names) ── */
.status {
  font-family: var(--font); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 1px; border: 1px solid;
  display: inline-flex; align-items: center; gap: 5px;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status--todo,
.status--todo::before { }
.status--todo     { background: var(--surface-3);  color: var(--muted);         border-color: var(--border);         }
.status--todo::before { background: var(--subtle); }
.status--in_progress,
.status--progress { background: var(--blue-pale);  color: var(--blue-bright);   border-color: var(--blue-border);    }
.status--in_progress::before,
.status--progress::before { background: var(--blue-bright); }
.status--blocked  { background: var(--red-pale);   color: var(--red-bright);    border-color: var(--red-border);     }
.status--blocked::before  { background: var(--red-bright); }
.status--in_review,
.status--review   { background: var(--amber-pale); color: var(--amber-bright);  border-color: var(--amber-border);   }
.status--in_review::before,
.status--review::before   { background: var(--amber-bright); }
.status--done     { background: var(--green-pale); color: var(--green-bright);  border-color: var(--green-border);   }
.status--done::before     { background: var(--green-bright); }
.status--cancelled { background: var(--surface-3); color: var(--subtle);        border-color: var(--border);         }
.status--cancelled::before { background: var(--faint); }
.status--standby   { background: var(--surface-3); color: var(--muted);          border-color: var(--border);         }
.status--standby::before   { background: var(--muted); }
.status--planned   { background: var(--surface-3); color: var(--muted);          border-color: var(--border);         }
.status--planned::before   { background: var(--subtle); }
.status--completed { background: var(--green-pale); color: var(--green-bright);  border-color: var(--green-border);   }
.status--completed::before { background: var(--green-bright); }

/* ── Filter bar ── */
.filterbar {
  display: flex; gap: var(--space-3); align-items: flex-end;
  padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: var(--space-4); flex-wrap: wrap;
}
.filterbar .divider { width: 1px; height: 22px; background: var(--border); align-self: center; }
.filterbar .field label { font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--subtle); }
.filterbar .field select, .filterbar .field input, .filterbar .input {
  height: 30px; background: var(--surface-2); border: 1px solid var(--border-active);
  border-radius: 2px; color: var(--bone); font-family: var(--font); font-size: 12px;
  padding: 0 10px; outline: none; min-width: 130px;
}
.filterbar .field input::placeholder { color: var(--subtle); }
.filterbar .field input:focus, .filterbar .field select:focus { border-color: var(--oxblood); }
.segmented {
  display: inline-flex; border: 1px solid var(--border-active);
  border-radius: 2px; overflow: hidden; background: var(--surface-2);
}
.segmented button {
  background: transparent; border: 0; padding: 6px 10px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--bone-dim); cursor: pointer; border-right: 1px solid var(--border-active);
}
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--oxblood-pale); color: var(--gold); }
.segmented button:hover:not(.active) { color: var(--bone); }

/* ── Task row (7-column CSS grid — new design) ── */
.task-row {
  display: grid;
  grid-template-columns: 14px 18px 1fr auto auto auto auto;
  gap: 12px; align-items: center;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  font-size: 12.5px; cursor: pointer; position: relative;
  background: var(--surface);
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: rgba(255,255,255,.022); }
[data-theme="light"] .task-row:hover { background: rgba(9,30,66,.03); }
.task-row .tr-check {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.task-row.done .tr-title { color: var(--muted); }
.task-row.done .task-title-text { text-decoration: line-through; }
.task-row--collapsing { pointer-events: none; animation: task-row-fade 280ms ease forwards; }
@keyframes task-row-fade { from { opacity: 1; } to { opacity: 0; } }
.task-row .tr-title { display: flex; flex-direction: column; justify-content: center; min-width: 0; overflow: hidden; gap: 3px; }
.task-title-text { color: var(--bone); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.task-row .tr-meta  { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; margin-top: 1px; }
.task-row .tr-due   { font-family: var(--font-mono); font-size: 11px; color: var(--bone-dim); white-space: nowrap; }
.task-row .tr-due.overdue { color: var(--red-bright); }
.task-row .tr-due.today   { color: var(--amber-bright); }
.task-row.personal { background: color-mix(in srgb, var(--gold-pale) 60%, var(--surface)); }
.task-row .tr-chevron { color: var(--subtle); font-size: 10px; width: 12px; text-align: center; }

/* ── Subtask indicators ── */
.task-row--subtask {
  padding-left: 30px;
  border-left: 2px solid var(--border);
  background: rgba(0,0,0,.012);
}
[data-theme="light"] .task-row--subtask { background: rgba(9,30,66,.015); }
.task-row--subtask .task-title-text { font-size: 12px; color: var(--bone-dim); }
.subtask-rows-container { display: contents; }
.subtask-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  background: none; border: 1px solid var(--border); border-radius: 3px; cursor: pointer;
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  padding: 1px 5px; margin-left: 2px;
  transition: background .12s, color .12s, border-color .12s;
  vertical-align: middle; flex-shrink: 0;
}
.subtask-toggle:hover  { background: var(--surface-2); color: var(--bone); border-color: var(--subtle); }
.subtask-toggle.open   { background: var(--surface-2); color: var(--bone); border-color: var(--subtle); }
.chip--parent-task {
  font-size: 10px; color: var(--muted); font-family: var(--font-mono);
  display: inline-flex; align-items: center; gap: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px;
}

/* ── Group header ── */
.group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font); font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--subtle); cursor: pointer;
}
.group-head .caret { color: var(--muted); font-size: 9px; }
.group-head .name  { color: var(--bone-dim); }
.group-head .pill-count { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 0; text-transform: none; }
.group-head .group-progress { width: 80px; height: 3px; background: var(--surface-3); }
.group-head .group-progress b { display: block; height: 100%; background: var(--green); }

/* ── Kanban ── */
.kanban { display: flex; gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-3); }
.kcol { flex: 0 0 280px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 280px); }
.kcol__head { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; background: var(--surface-2); }
.kcol__head .name { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-dim); }
.kcol__head .num  { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.kcol__body { padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); overflow-y: auto; flex: 1; }
.kcard { background: var(--surface-2); border: 1px solid var(--border); border-radius: 2px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.kcard:hover { border-color: var(--border-active); }
.kcard.p1 { border-color: var(--red-border); }
.kcard.p2 { border-color: var(--amber-border); }
.kcard.p3 { border-color: var(--gold-border); }
.kcard .ktitle { font-size: 12.5px; color: var(--bone); font-weight: 500; line-height: 1.4; }
.kcard .kmeta  { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.kcard .kfoot  { display: flex; justify-content: space-between; align-items: center; }
.kcard .kfoot .due { font-family: var(--font-mono); font-size: 10.5px; color: var(--bone-dim); }
.kcard .kfoot .due.overdue { color: var(--red-bright); }
.avatar-sm { width: 20px; height: 20px; border-radius: 2px; background: var(--oxblood); color: var(--bone); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 9px; }

/* ── Dashboard widget grid ── */
.widget-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--space-4); }
.widget { grid-column: span 12; }
.w-6  { grid-column: span 6; }
.w-4  { grid-column: span 4; }
.w-8  { grid-column: span 8; }
.w-12 { grid-column: span 12; }
@media (max-width: 1280px) { .w-4, .w-6, .w-8 { grid-column: span 12; } }
.kpi-tile { padding: var(--space-4) var(--space-5); }
.kpi-tile .label { font-size: 9px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--subtle); margin-bottom: 6px; }
.kpi-tile .value { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--gold); line-height: 1; }
.kpi-tile .delta { font-family: var(--font-mono); font-size: 11px; color: var(--bone-dim); margin-top: 4px; }

/* ── Quadrant (Eisenhower) ── */
.quadrant { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1px; background: var(--border); min-height: 300px; }
.qcell { background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: hidden; }
.qcell .qhead { font-size: 9px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--subtle); display: flex; justify-content: space-between; }
.qcell .qhead b { color: var(--bone-dim); font-weight: 600; }
.qcell .qlist { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.qrow { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 11.5px; color: var(--bone-dim); }
.qrow .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.qcell.do       { background: linear-gradient(135deg, var(--red-pale)   0%, var(--surface) 60%); }
.qcell.schedule { background: linear-gradient(135deg, var(--amber-pale) 0%, var(--surface) 60%); }
.qcell.delegate { background: linear-gradient(135deg, var(--blue-pale)  0%, var(--surface) 60%); }
.qcell.eliminate { background: var(--surface); }

/* ── 7-day calendar strip ── */
.cal-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; }
.cal-day { padding: 10px 12px; border-right: 1px solid var(--border); min-height: 110px; }
.cal-day:last-child { border-right: 0; }
.cal-day .dh   { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.cal-day .dow  { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--subtle); }
.cal-day .dnum { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--bone-dim); }
.cal-day.today .dnum { color: var(--gold); }
.cal-day.today { background: var(--oxblood-pale); }
.cal-day .ev   { font-size: 10.5px; color: var(--bone-dim); display: flex; align-items: center; gap: 5px; padding: 2px 0; line-height: 1.3; overflow: hidden; }
.cal-day .ev .prio { width: 6px; height: 6px; }
.cal-day .ev-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }

/* ── Recommended rows ── */
.rec-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; cursor: pointer; }
.rec-row:last-child { border-bottom: 0; }
.rec-row:hover { background: rgba(255,255,255,.022); }
.rec-row .num   { font-family: var(--font-mono); font-size: 10px; color: var(--subtle); width: 18px; flex-shrink: 0; }
.rec-row .body  { flex: 1; min-width: 0; }
.rec-row .rr-title { color: var(--bone); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-row .reasons { display: flex; gap: 5px; margin-top: 3px; flex-wrap: wrap; }
.reason { font-family: var(--font); font-size: 9px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; padding: 2px 6px; border-radius: 1px; background: var(--surface-3); color: var(--bone-dim); border: 1px solid var(--border); }
.reason--p1       { color: var(--red-bright);   border-color: var(--red-border);   background: var(--red-pale); }
.reason--blocking { color: var(--gold);          border-color: var(--gold-border);  background: var(--gold-pale); }
.reason--due      { color: var(--amber-bright);  border-color: var(--amber-border); background: var(--amber-pale); }

/* ── Meeting page ── */
.meeting-grid { display: grid; grid-template-columns: 1fr 320px; gap: var(--space-5); }
@media (max-width: 1280px) { .meeting-grid { grid-template-columns: 1fr; } }
.meeting-series-grid { display: grid; grid-template-columns: 1fr 340px; gap: var(--space-5); align-items: start; }
@media (max-width: 1120px) { .meeting-series-grid { grid-template-columns: 1fr; } }
.meeting-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.meeting-form-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
.meeting-form .sh,
.meeting-field .sh { display: block; margin-bottom: 4px; font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--subtle); }
.meeting-field { margin-bottom: var(--space-3); }
.meeting-field--wide { grid-column: 1 / -1; }
.meeting-help { color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; margin: var(--space-2) 0 0; }
.meeting-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); }
.meeting-strip,
.meeting-attendees { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); padding: 9px 12px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-lg); }
.meeting-avatar-row { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.meeting-instance-head { align-items: flex-start; }
.meeting-meta-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: var(--fs-sm); }
.meeting-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin: 0 0 var(--space-3); }
.meeting-section-title h2 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--bone); }
.agenda-item { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-lg); margin-bottom: var(--space-3); overflow: hidden; }
.agenda-item__head { width: 100%; padding: 12px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; background: var(--surface-2); border: 0; border-bottom: 1px solid transparent; text-align: left; font-family: var(--font); }
.agenda-item__head:hover { background: var(--surface-3); }
.agenda-item.open .agenda-item__head { border-bottom-color: var(--border); }
.agenda-item__head .num   { font-family: var(--font-mono); font-size: 11px; color: var(--subtle); width: 22px; }
.agenda-item__head .pname { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--bone); }
.agenda-item__head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; font-family: var(--font-mono); }
.agenda-caret { color: var(--subtle); font-size: 11px; transition: transform var(--t) var(--ease); }
.agenda-item.open .agenda-caret { transform: rotate(90deg); }
.agenda-project { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.agenda-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.agenda-item__body { padding: var(--space-5); display: none; }
.agenda-item.open .agenda-item__body { display: block; }
.prev-update { background: var(--surface-2); border: 1px solid var(--border); padding: 10px 14px; font-size: 12px; color: var(--bone-dim); margin-bottom: var(--space-4); font-style: italic; }
.prev-update .when { font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--subtle); display: block; margin-bottom: 4px; }
.prev-update--empty { color: var(--muted); font-style: normal; }
.prev-update--empty p { margin: 0; }
.editor { width: 100%; box-sizing: border-box; background: var(--surface-2); border: 1px solid var(--border-active); border-radius: 2px; padding: 10px 14px; font-size: 13px; color: var(--bone); min-height: 100px; outline: none; font-family: var(--font); line-height: 1.6; }
.editor:focus { border-color: var(--oxblood); }
.editor-toolbar { display: flex; gap: 4px; padding: 4px 8px; background: var(--surface-3); border: 1px solid var(--border-active); border-bottom: 0; border-radius: 2px 2px 0 0; }
.editor-toolbar + .editor { border-radius: 0 0 2px 2px; border-top: 0; }
.editor-toolbar button,
.editor-toolbar span { background: transparent; border: 0; color: var(--bone-dim); min-width: 24px; height: 24px; border-radius: 1px; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.editor-toolbar button:hover { background: rgba(255,255,255,.05); color: var(--bone); }
.toolbar-spacer { flex: 1; }
.meeting-editor { resize: vertical; min-height: 160px; }
.meeting-general-notes { resize: vertical; min-height: 120px; }
.meeting-update-form { margin-bottom: var(--space-4); }
.meeting-files { display: grid; grid-template-columns: 1fr auto; gap: var(--space-3); align-items: end; padding: 10px 0 0; }
.meeting-file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.meeting-file { display: inline-flex; align-items: center; gap: 6px; color: var(--bone-dim); border: 1px solid var(--border); background: var(--surface-2); padding: 3px 7px; border-radius: 2px; font-size: 11px; text-decoration: none; }
.meeting-file:hover { color: var(--bone); border-color: var(--border-strong); }
.meeting-file-upload { display: inline-flex; align-items: center; gap: 8px; color: var(--bone-dim); font-size: 11px; cursor: pointer; }
.meeting-file-upload input { max-width: 190px; color: var(--muted); font-size: 11px; }
.meeting-inline-actions { display: flex; justify-content: flex-end; margin-top: var(--space-3); }
.meeting-empty-inline { color: var(--muted); font-size: var(--fs-sm); }
.meeting-empty-inline--block { display: block; padding: 10px 14px; }
.actionables { margin-top: var(--space-4); border: 1px solid var(--gold-border); background: var(--gold-pale); border-radius: 2px; }
.actionables__head { padding: 8px 14px; border-bottom: 1px solid var(--gold-border); display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.actionables__list { padding: 0; }
.actionable-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 7px 14px; border-bottom: 1px solid var(--gold-border); font-size: 12px; }
.actionable-row:last-child { border-bottom: 0; }
.actionable-row .title { color: var(--bone); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actionable-row .due   { font-family: var(--font-mono); font-size: 10.5px; color: var(--bone-dim); }
.actionable-assignees { display: inline-flex; gap: 2px; }
.action-add { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--gold-border); }
.action-add input,
.action-add select { height: 28px; background: rgba(0,0,0,.08); border: 1px dashed var(--gold-border); color: var(--bone); font-size: 12px; padding: 0 8px; border-radius: 1px; outline: none; font-family: var(--font); min-width: 0; }
.action-add input[name="title"] { flex: 1; min-width: 220px; padding: 0 10px; background: transparent; }
.action-add input[type="date"] { width: 136px; color-scheme: dark; }
.action-add select { width: 128px; }
.action-add input::placeholder { color: var(--gold-dim); }
.action-add input:focus,
.action-add select:focus { border-style: solid; border-color: var(--gold); }
.action-add .hint { font-family: var(--font-mono); font-size: 10px; color: var(--gold-dim); }
.recap-rail .card { position: static; }
.recap-rail .card:first-child { position: sticky; top: 76px; }
.recap-rail .card + .card { margin-top: var(--space-4); }
.recap-rail .total { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--gold); line-height: 1; }
.meeting-summary-card { margin-top: var(--space-5); }
.meeting-summary-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto auto; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 12px; }
.meeting-summary-row:last-child { border-bottom: 0; }
.meeting-summary-title { color: var(--bone); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meeting-summary-assignees { display: inline-flex; gap: 2px; }
.meeting-summary-actions { display: flex; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.meeting-rail-list { margin-top: var(--space-3); border-top: 1px solid var(--border); padding-top: var(--space-2); }
.meeting-rail-action { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 5px 0; color: var(--bone-dim); text-decoration: none; font-size: 12px; }
.meeting-rail-action span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meeting-rail-action:hover { color: var(--bone); }
.meeting-history-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--bone-dim); text-decoration: none; font-size: 12px; }
.meeting-history-row:hover { background: rgba(255,255,255,.022); color: var(--bone); }
@media (max-width: 760px) {
  .meeting-form-grid,
  .meeting-form-split { grid-template-columns: 1fr; }
  .meeting-strip,
  .meeting-attendees { align-items: flex-start; flex-direction: column; gap: var(--space-2); }
  .meeting-files,
  .meeting-summary-row { grid-template-columns: 1fr; }
  .action-add { align-items: stretch; flex-direction: column; }
  .action-add input[name="title"],
  .action-add input[type="date"],
  .action-add select { width: 100%; min-width: 0; }
}

/* ── Project brief panel (inside open agenda-item body) ── */
.project-brief {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  overflow: hidden;
}
.project-brief__row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}
.project-brief__row:last-child { border-bottom: 0; }
.project-brief__label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--subtle);
  white-space: nowrap;
  min-width: 48px;
  flex-shrink: 0;
}
.project-brief__value {
  font-size: 12px;
  color: var(--bone-dim);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
}
.project-brief__value .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.project-brief__sep { color: var(--subtle); font-size: 10px; }
.project-brief__date { font-family: var(--font-mono); font-size: 11px; color: var(--bone-dim); }
.chip__sku-name { font-family: var(--font); font-weight: 400; font-size: 11px; }
@media (max-width: 760px) { .project-brief { grid-template-columns: 1fr; } }

/* ── Multi-picker pill widget (mpw-) ── */
.mpw-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  padding: 6px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-active);
  border-radius: 2px;
  min-height: 36px;
  cursor: text;
}
.mpw-wrap:focus-within { border-color: var(--oxblood); }
.mpw-input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--bone);
  font-family: var(--font);
  font-size: 12px;
  flex: 1;
  min-width: 120px;
  height: 22px;
  padding: 0;
}
.mpw-input::placeholder { color: var(--subtle); }
.mpw-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--surface-4);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0 6px 0 8px;
  height: 24px;
  font-size: 11px;
  color: var(--bone);
  white-space: nowrap;
}
.mpw-dd {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--surface-3);
  border: 1px solid var(--border-active);
  border-radius: 2px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}
.mpw-opt {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--bone);
}
.mpw-opt-main { font-weight: 500; }
.mpw-opt-sub  { color: var(--muted); font-size: 11px; margin-top: 1px; }

/* ── Quick-add modal (ta- prefix avoids Bootstrap .modal conflict) ── */
@keyframes ta-fadein  { from { opacity: 0; } to { opacity: 1; } }
@keyframes ta-slidein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.ta-backdrop {
  position: fixed; inset: 0; background: oklch(0% 0 0 / 60%);
  z-index: var(--z-modal-backdrop);
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 14vh; animation: ta-fadein var(--t) var(--ease);
}
.ta-backdrop.open { display: flex; }
.ta-modal {
  background: var(--surface); border: 1px solid var(--border-active);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 640px; max-width: 92vw;
  z-index: var(--z-modal);
  animation: ta-slidein var(--t-slow) var(--ease); overflow: hidden;
}
.qa-input-wrap { display: flex; align-items: center; padding: 14px 18px; gap: 10px; }
.qa-input-wrap .lead { color: var(--oxblood-hover); font-size: 18px; }
.qa-input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--bone); font-size: 16px; font-family: var(--font); }
.qa-input::placeholder { color: var(--subtle); }
.qa-chips { display: flex; gap: 6px; padding: 0 18px 12px; flex-wrap: wrap; min-height: 30px; }
.qa-parsed-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 600; border: 1px solid; background: var(--surface-2); }
.qa-parsed-chip .pkey { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--subtle); }
.qa-parsed-chip.q-prio     { border-color: var(--red-border);     color: var(--red-bright);   background: var(--red-pale); }
.qa-parsed-chip.q-date     { border-color: var(--amber-border);   color: var(--amber-bright); background: var(--amber-pale); }
.qa-parsed-chip.q-project  { border-color: var(--gold-border);    color: var(--gold);         background: var(--gold-pale); }
.qa-parsed-chip.q-tag      { border-color: var(--blue-border);    color: var(--blue-bright);  background: var(--blue-pale); }
.qa-parsed-chip.q-assignee { border-color: var(--oxblood-border); color: var(--blue-bright);  background: var(--oxblood-pale); }
.qa-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.qa-hints { display: flex; gap: 14px; font-size: 10px; color: var(--muted); }
.qa-hints span { display: inline-flex; align-items: center; gap: 5px; }
.qa-foot .actions { display: flex; gap: 8px; }
.qa-suggest { border-top: 1px solid var(--border); max-height: 220px; overflow-y: auto; }
.qa-sugg { display: flex; align-items: center; gap: 10px; padding: 8px 18px; cursor: pointer; font-size: 12.5px; color: var(--bone-dim); }
.qa-sugg:hover { background: var(--oxblood-pale); color: var(--bone); }
.qa-sugg .glyph { color: var(--subtle); width: 16px; }

/* ── Calendar month grid ── */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); background: var(--border); gap: 1px; }
.cal-grid .ch { background: var(--surface-2); padding: 8px 10px; font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--subtle); }
.cal-grid .cd { background: var(--surface); min-height: 110px; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; }
.cal-grid .cd .num { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--bone-dim); margin-bottom: 4px; }
.cal-grid .cd.other .num { color: var(--subtle); }
.cal-grid .cd.today { background: var(--oxblood-pale); }
.cal-grid .cd.today .num { color: var(--gold); }
.cal-task { font-size: 10.5px; padding: 2px 6px; background: var(--surface-3); color: var(--bone-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-task.p1 { background: var(--red-pale); color: var(--bone); }
.cal-task.p2 { background: var(--amber-pale); }
.cal-task.p3 { background: var(--gold-pale); }

/* ── Project detail layout ── */
.proj-grid { display: grid; grid-template-columns: 1fr 280px; gap: var(--space-5); }
@media (max-width: 1200px) { .proj-grid { grid-template-columns: 1fr; } }
.tab-strip { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: var(--space-5); }
.tab-strip a { padding: 12px 20px; font-size: 11px; font-weight: 500; letter-spacing: 0.10em; text-transform: uppercase; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-block; white-space: nowrap; }
.tab-strip a.active { color: var(--bone); border-bottom-color: var(--oxblood); }
.tab-strip a:hover  { color: var(--bone); }
.metalist { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; font-size: 12px; }
.metalist dt { font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--subtle); padding-top: 3px; }
.metalist dd { margin: 0; color: var(--bone); word-break: break-word; overflow-wrap: anywhere; }
.proj-meta-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: var(--space-5); }
.proj-progress-bar { height: 4px; background: var(--surface-3); width: 120px; flex-shrink: 0; }
.proj-progress-bar b { display: block; height: 100%; background: var(--green); }

/* ── Wiki links in notes ── */
.wikilink { background: var(--oxblood-pale); color: var(--blue-bright); border: 1px solid var(--oxblood-border); padding: 1px 6px; border-radius: 1px; font-size: 12px; cursor: pointer; }
.wikilink:hover { background: var(--oxblood); color: var(--bone); }

/* ── Empty state ── */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .glyph { font-size: 32px; color: var(--subtle); margin-bottom: 12px; display: block; }
.empty .ttl   { font-family: var(--font-display); font-size: 18px; color: var(--bone-dim); margin-bottom: 6px; }
.empty .desc  { font-size: 12px; margin-bottom: 16px; }

/* ── Pivot bar ── */
.pivot-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: var(--space-4); flex-wrap: wrap; }
.pivot-bar .label { font-size: 9px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--subtle); margin-right: 4px; }
.pivot-step { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--surface); border: 1px solid var(--border-active); border-radius: 2px; font-size: 11px; cursor: pointer; color: var(--bone-dim); }
.pivot-step:hover { color: var(--bone); border-color: var(--border-strong); }
.pivot-step .skey { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--subtle); }
.pivot-step .x { color: var(--subtle); margin-left: 2px; cursor: pointer; }
.pivot-step .x:hover { color: var(--red-bright); }
.pivot-step.active { background: var(--oxblood-pale); border-color: var(--oxblood-border); color: var(--gold); }
.pivot-arrow { color: var(--subtle); font-size: 10px; }
.pivot-add { border: 1px dashed var(--border-active); background: transparent; color: var(--subtle); font-size: 11px; padding: 4px 10px; border-radius: 2px; cursor: pointer; }
.pivot-add:hover { color: var(--bone-dim); border-color: var(--border-strong); }

/* ── Right rail ── */
.rail .card + .card { margin-top: var(--space-4); }
.rail .stat { display: flex; justify-content: space-between; padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--border); }
.rail .stat:last-child { border-bottom: 0; }
.rail .stat .k { color: var(--muted); font-size: 11px; }
.rail .stat .v { font-family: var(--font-mono); color: var(--bone); }

/* ── Template manager ── */
.tpl-grid { display: grid; grid-template-columns: 280px 1fr; gap: var(--space-5); }
.tpl-list .item { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.tpl-list .item:hover { background: rgba(255,255,255,.022); }
.tpl-list .item.active { background: var(--oxblood-pale); border-left: 2px solid var(--oxblood); padding-left: 12px; }
.tpl-list .item .tn   { font-size: 13px; color: var(--bone); font-weight: 500; }
.tpl-list .item .desc { font-size: 11px; color: var(--muted); margin-top: 3px; }
.field-row { display: grid; grid-template-columns: 200px 140px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
.field-row .tn    { color: var(--bone); }
.field-row .ttype { font-family: var(--font-mono); font-size: 10px; color: var(--gold); }
.field-row .opts  { color: var(--muted); font-size: 11px; }

/* ── Details pane ── */
.details { position: fixed; right: 0; top: var(--nav-h); bottom: 0; width: 460px; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: var(--z-sticky); display: flex; flex-direction: column; overflow-y: auto; }
.details__head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
.details__head .x { margin-left: auto; }
.details__body { padding: 20px; overflow-y: auto; flex: 1; }
.details__section { margin-bottom: var(--space-5); }
.details__section .sh { font-size: 9px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--subtle); margin-bottom: 8px; }

/* ── Toast ── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--green-border); box-shadow: var(--shadow-lg); padding: 10px 18px; font-size: 12px; z-index: var(--z-toast); border-radius: 2px; font-family: var(--font-mono); color: var(--bone); }

/* ── Activity feed ── */
.activity-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.activity-item:last-child { border: 0; }
.activity-item .av { width: 22px; height: 22px; border-radius: 2px; background: var(--surface-3); color: var(--bone-dim); display: inline-flex; align-items: center; justify-content: center; font-size: 9px; flex-shrink: 0; }
.activity-item .av.gold { background: var(--gold-pale); color: var(--gold); }
.activity-item .when { font-family: var(--font-mono); font-size: 10px; color: var(--subtle); margin-left: auto; flex-shrink: 0; }


/* ── Project flat list (project_list view) ── */
.proj-list-row {
  display: grid;
  grid-template-columns: 1fr 140px 100px 90px 70px;
  gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; align-items: center;
  text-decoration: none; color: inherit;
}
.proj-list-row:hover { background: rgba(255,255,255,.022); }
.proj-list-row:last-child { border-bottom: 0; }
.proj-list-name { font-size: 13px; font-weight: 500; color: var(--bone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-list-meta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.proj-list-bar { height: 4px; background: var(--surface-3); }
.proj-list-bar b { display: block; height: 100%; background: var(--gold); }
.proj-list-pct { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 3px; text-align: right; }

/* ── KPI strip ── */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-5); }

/* ── Misc helpers ── */
.mono   { font-family: var(--font-mono); }
.gold   { color: var(--gold); }
.muted  { color: var(--muted); }
.overdue { color: var(--red-bright) !important; }
.today   { color: var(--amber-bright) !important; }
.tasks-list-layout { display: grid; grid-template-columns: 220px 1fr; gap: var(--space-5); }

/* ── Page head (Task OS pattern) ── */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-5);
}
.page-head h1 {
  font-family: var(--font-display); font-size: 28px; font-weight: 700;
  line-height: var(--lh-tight); color: var(--bone); margin: 0;
}
.page-head-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* ── Pivot close link ── */
.pivot-close { color: var(--subtle); text-decoration: none; margin-left: 4px; }
.pivot-close:hover { color: var(--red-bright); }

/* ── Vertical link list (card sidebars, e.g. saved views in task_list) ── */
.sn-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px var(--space-4); font-size: 12px;
  color: var(--bone-dim); text-decoration: none;
}
.sn-link:hover { color: var(--bone); background: rgba(255,255,255,.025); }
.sn-link.active { color: var(--bone); background: var(--oxblood-pale); font-weight: 500; }
[data-theme="light"] .sn-link:hover { background: rgba(9,30,66,.04); }

.glyph { font-size: 9px; color: var(--subtle); }
.count { font-family: var(--font-mono); font-size: 10px; color: var(--subtle); }

/* ── KPI tile semantic class names ── */
.kpi-label { font-size: 9px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--subtle); margin-bottom: 6px; display: block; }
.kpi-value { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--bone); line-height: 1; display: block; }
.kpi-delta { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 4px; display: block; }
.kpi-delta--pos { color: var(--green-bright); }
.kpi-delta--neg { color: var(--red-bright); }

/* ── Rail stat semantic class names ── */
.stat-label { color: var(--muted); font-size: 11px; }
.stat-value { font-family: var(--font-mono); color: var(--bone); }

/* ── Quadrant semantic class names ── */
.qcell--do-now   { background: linear-gradient(135deg, var(--red-pale)   0%, var(--surface) 60%); }
.qcell--schedule { background: linear-gradient(135deg, var(--amber-pale) 0%, var(--surface) 60%); }
.qcell--delegate { background: linear-gradient(135deg, var(--blue-pale)  0%, var(--surface) 60%); }
.qcell--defer    { background: var(--surface); }
.qlabel { font-size: 11px; font-weight: 600; color: var(--bone-dim); }
.qsub   { font-size: 9px; color: var(--subtle); }
.qcount { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--bone-dim); line-height: 1; margin-top: auto; }

/* ── Calendar strip semantic class names ── */
.cal-dow   { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--subtle); }
.cal-num   { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--bone-dim); }
.cal-day.today .cal-num { color: var(--gold); }
.cal-bars  { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
.cal-bar   { height: 3px; border-radius: 1px; background: var(--subtle); }
.cal-bar--p1 { background: var(--red-bright); }
.cal-bar--p2 { background: var(--amber-bright); }
.cal-bar--p3 { background: var(--gold); }
.cal-count { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 4px; }

/* ── Group head semantic class names ── */
.group-name  { color: var(--bone-dim); }
.group-count { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 0; text-transform: none; margin-left: auto; }

/* ── proj-list layout helpers ── */
.proj-list-info     { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.proj-list-progress { display: flex; align-items: center; gap: var(--space-2); }

/* ── Custom checkbox ── */
.tasks-check {
  appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--muted);
  background: transparent;
  cursor: pointer; flex-shrink: 0; display: block;
  outline: none;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.tasks-check:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-bright) 30%, transparent);
}
.tasks-check:hover:not(:checked) {
  border-color: var(--green-bright);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-bright) 15%, transparent);
}
.tasks-check:checked {
  background: var(--green-bright); border-color: var(--green-bright);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2l2.2 2.2 3.8-4.2' stroke='%23fff' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
.task-row.done .tasks-check { opacity: 0.55; }
.tasks-avatar--empty { opacity: .3; font-size: 10px; }
.chevron-icon { color: var(--subtle); font-size: 13px; }
.tr-check { display: flex; align-items: center; justify-content: center; }
.tr-chevron { display: flex; align-items: center; justify-content: flex-end; }

/* ── cpicker — custom status/priority dropdown ── */
.cpicker {
  position: relative; display: flex;
  align-items: center; justify-content: center;
}
.cpicker > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center;
}
.cpicker > summary::-webkit-details-marker { display: none; }
.cpicker > summary::marker { content: ''; }
/* Status pill hover — indicate it's interactive */
.cpicker--status > summary { gap: 4px; }
.cpicker--status > summary:hover { filter: brightness(1.2); }
/* Priority dot hover */
.cpicker--prio > summary { width: 100%; justify-content: center; padding: 2px; }
.cpicker--prio > summary:hover .prio { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }

/* Dropdown menu */
.cpicker__menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 300;
  background: var(--surface-2); border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px rgba(0,0,0,.55), 0 1px 4px rgba(0,0,0,.3);
  min-width: 168px; padding: var(--space-1);
  animation: cpicker-in 0.1s var(--ease) both;
}
.cpicker__menu--right { left: auto; right: 0; }
@keyframes cpicker-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cpicker__divider {
  height: 1px; background: var(--border); margin: var(--space-1) 0;
}

/* Dropdown items */
.cpicker__opt {
  display: flex; align-items: center; gap: var(--space-2);
  width: 100%; padding: 5px var(--space-2);
  border: none; background: transparent;
  color: var(--bone-dim); font-size: var(--fs-base);
  cursor: pointer; border-radius: var(--radius-md);
  text-align: left; font-family: var(--font);
  transition: background 0.07s, color 0.07s;
}
.cpicker__opt:hover { background: var(--surface-3); color: var(--bone); }
.cpicker__opt--on { color: var(--bone); font-weight: 500; }
.cpicker__opt--on::after {
  content: '✓'; margin-left: auto;
  color: var(--muted); font-size: 9px; font-weight: 700;
}
.cpicker__lbl { font-weight: 600; font-size: var(--fs-base); }
.cpicker__desc { color: var(--subtle); font-size: var(--fs-xs); margin-left: auto; }
.cpicker__caret { font-size: 8px; opacity: 0.55; line-height: 1; }

/* ── sdot — colored status dot for cpicker items ── */
.sdot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}
.sdot--todo        { border: 1.5px solid var(--muted); }
.sdot--in_progress { background: var(--blue-bright); }
.sdot--standby     { background: var(--muted); }
.sdot--blocked     { background: var(--red-bright); }
.sdot--in_review   { background: var(--amber-bright); }
.sdot--done        { background: var(--green-bright); }
.sdot--cancelled   { background: var(--subtle); opacity: 0.5; }

/* ── Kanban personal task indicator ── */
.kcard--personal { border-color: var(--gold-border) !important; }
.kcard--personal .ktitle::before { content: "🔒 "; font-size: 9px; opacity: .6; }

/* ── Tasks list 2-col layout ── */
.tasks-list-layout { display: grid; grid-template-columns: 220px 1fr; gap: var(--space-5); align-items: start; }
@media (max-width: 1000px) { .tasks-list-layout { grid-template-columns: 1fr; } }
.tasks-list-layout .saved-views { position: sticky; top: 64px; }

/* ── Pivot bar ── */
.pivot-bar { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-3); }
.pivot-bar .filter-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: var(--oxblood-pale); border: 1px solid var(--oxblood); border-radius: 99px; font-size: 11px; color: var(--bone); }
.pivot-bar .filter-chip a { color: var(--muted); text-decoration: none; font-size: 10px; }
.pivot-bar .filter-chip a:hover { color: var(--bone); }

/* ── Filter bar ── */
.filterbar { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--space-3); }
.filterbar input, .filterbar select { height: 28px; padding: 0 8px; background: var(--surface); border: 1px solid var(--border-active); border-radius: 2px; color: var(--bone); font-size: 11px; }
.filterbar .divider { width: 1px; height: 16px; background: var(--border); flex-shrink: 0; }
.segmented { display: flex; background: var(--surface); border: 1px solid var(--border-active); border-radius: 2px; overflow: hidden; }
.segmented button { padding: 4px 10px; font-size: 11px; font-weight: 500; background: none; border: none; color: var(--muted); cursor: pointer; }
.segmented button.active { background: var(--oxblood-pale); color: var(--bone); }

/* ── Rail (right sidebar generic) ── */
.rail { display: flex; flex-direction: column; gap: var(--space-4); }

/* ── Empty state ── */
.empty { text-align: center; padding: var(--space-8); color: var(--subtle); font-size: var(--fs-sm); }
.empty p { margin: 0; }

/* ── KPI strip ── */
.kpi-strip { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-5); }
.kpi-tile { flex: 1; min-width: 120px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4); }

/* ── Stat row ── */
.stat { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); }
.stat:last-child { border-bottom: 0; }

/* ── Project list flat row ── */
.proj-list-row { display: grid; grid-template-columns: 1fr auto auto auto auto; align-items: center; gap: var(--space-4); padding: 10px var(--space-4); border-bottom: 1px solid var(--border); text-decoration: none; }
.proj-list-row:hover { background: rgba(255,255,255,.018); }
.proj-list-row .proj-name { font-size: 13px; font-weight: 600; color: var(--bone); }

/* ── Template detail ── */
.tpl-list-item.active { background: var(--oxblood-pale); border-color: var(--oxblood); }

/* ── Task details slide-in panel ── */
.details { position:fixed; right:0; top:var(--task-panel-top, var(--nav-h)); bottom:auto; width:min(460px, calc(100vw - var(--space-4))); height:calc(100dvh - var(--task-panel-top, var(--nav-h))); max-height:calc(100dvh - var(--task-panel-top, var(--nav-h))); background:var(--surface); border-left:1px solid var(--border); box-shadow:-4px 0 24px rgba(0,0,0,.35); z-index:var(--z-modal); display:flex; flex-direction:column; overflow:hidden; transform:translateX(100%); transition:transform var(--t-slow) var(--ease); pointer-events:none; will-change:transform; }
.details.open { transform:translateX(0); pointer-events:all; }
.details__overlay { position:fixed; top:var(--task-panel-top, var(--nav-h)); right:0; bottom:0; left:0; z-index:var(--z-modal-backdrop); background:rgba(0,0,0,.25); opacity:0; pointer-events:none; transition:opacity var(--t-slow) var(--ease); }
.details__overlay.open { opacity:1; pointer-events:all; }
body.task-details-open { overflow:hidden; }
.details__head { padding:16px 20px; border-bottom:1px solid var(--border); display:flex; align-items:flex-start; gap:12px; flex-shrink:0; }
.details__head .dtitle { font-size:15px; font-weight:500; color:var(--bone); line-height:1.4; flex:1; }
.details__head .dlabel { font-size:10px; font-weight:600; letter-spacing:.14em; text-transform:uppercase; color:var(--subtle); margin-bottom:4px; }
.details__head .x { margin-left:auto; flex-shrink:0; }
.details__body { padding:20px; overflow-y:auto; flex:1; }
.details__section { margin-bottom:var(--space-5); }
.details__section .sh { font-size:9px; font-weight:700; letter-spacing:.18em; text-transform:uppercase; color:var(--subtle); margin-bottom:8px; }
.details__foot { padding:14px 20px; border-top:1px solid var(--border); display:flex; gap:var(--space-2); flex-shrink:0; }
.details__foot a { flex:1; text-align:center; }
@supports not (height: 100dvh) {
  .details { height:calc(100vh - var(--task-panel-top, var(--nav-h))); max-height:calc(100vh - var(--task-panel-top, var(--nav-h))); }
}
@media (max-width: 600px) {
  .details { left:0; width:100vw; border-left:0; }
}

/* ── Activity feed ── */
.activity-item { display:flex; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); font-size:12px; color:var(--bone-dim); align-items:flex-start; }
.activity-item:last-child { border:0; }
.activity-item .av { width:22px; height:22px; border-radius:2px; background:var(--surface-3); color:var(--bone-dim); display:inline-flex; align-items:center; justify-content:center; font-size:9px; flex-shrink:0; font-weight:700; letter-spacing:0; }
.activity-item .av.gold { background:var(--gold-pale); color:var(--gold); }
.activity-item .when { font-family:var(--font-mono); font-size:10px; color:var(--subtle); margin-left:auto; white-space:nowrap; padding-left:8px; }

/* ── Quick-add NLP modal ── */
.qa-input-wrap { display:flex; align-items:center; padding:14px 18px; gap:10px; border-bottom:1px solid var(--border); }
.qa-input-wrap .lead { color:var(--oxblood-hover); font-size:18px; flex-shrink:0; }
.qa-input { flex:1; background:transparent; border:0; outline:0; color:var(--bone); font-size:16px; font-family:var(--font); min-width:0; }
.qa-input::placeholder { color:var(--subtle); }
.qa-chips { display:flex; gap:6px; flex-wrap:wrap; padding:10px 18px; min-height:0; }
.qa-chips:empty { display:none; }
.qa-parsed-chip { display:inline-flex; flex-direction:column; padding:3px 10px; border-radius:99px; border:1px solid var(--border-active); font-size:12px; font-weight:500; line-height:1.4; }
.qa-parsed-chip .pkey { font-size:9px; letter-spacing:.12em; text-transform:uppercase; color:var(--subtle); }
.qa-parsed-chip.q-prio     { border-color:var(--red-border);     color:var(--red-bright);    background:var(--red-pale); }
.qa-parsed-chip.q-date     { border-color:var(--amber-border);   color:var(--amber-bright);  background:var(--amber-pale); }
.qa-parsed-chip.q-project  { border-color:var(--gold-border);    color:var(--gold);          background:var(--gold-pale); }
.qa-parsed-chip.q-tag      { border-color:var(--blue-border);    color:var(--blue-bright);   background:var(--blue-pale); }
.qa-parsed-chip.q-assignee { border-color:var(--oxblood-border); color:var(--blue-bright);   background:var(--oxblood-pale); }
.qa-suggest { border-top:1px solid var(--border); }
.qa-sugg { display:flex; align-items:center; gap:10px; padding:9px 18px; cursor:pointer; color:var(--muted); }
.qa-sugg:hover { background:rgba(255,255,255,.025); color:var(--bone-dim); }
.qa-sugg .glyph { color:var(--subtle); font-size:11px; }
.qa-sugg code { font-family:var(--font-mono); font-size:11px; }
.qa-foot { display:flex; align-items:center; justify-content:space-between; padding:10px 18px; border-top:1px solid var(--border); }
.qa-hints { display:flex; gap:var(--space-3); flex-wrap:wrap; }
.qa-hints span { font-size:10px; color:var(--subtle); display:flex; align-items:center; gap:4px; }

/* ── Toast ── */
.toast-msg { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:var(--surface); border:1px solid var(--green-border); box-shadow:0 4px 24px oklch(0% 0 0 / 40%); padding:10px 18px; font-size:12px; z-index:999; border-radius:2px; font-family:var(--font-mono); color:var(--bone); animation:toast-in .2s ease; white-space:nowrap; }
@keyframes toast-in { from { opacity:0; transform:translateX(-50%) translateY(8px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* ── Task edit form in panel ── */
.form-error { color:var(--red-bright); font-size:11px; margin-top:4px; }
.details__section label.sh { display:block; margin-bottom:4px; }

/* ═══════════════════════════════════════════════════════════════
   TASK ROW OVERLAP FIX
   ─────────────────────────────────────────────────────────────
   Remove the conflicting width:12px from .task-row .tr-chevron
   (it was constraining the cell but content overflowed it).
   The 7th grid column is `auto` — let content size it naturally.
   Action buttons only appear on row hover to keep rows clean.
   ═══════════════════════════════════════════════════════════════ */

/* Override the width:12px from the earlier rule */
.task-row .tr-chevron {
  width: auto;
  min-width: 28px;
}

/* Hide action forms by default; show on row hover */
.task-row .tr-chevron { display: flex; align-items: center; gap: var(--space-1); }
.task-row .tr-chevron .chevron-icon { color: var(--faint); transition: color 0.1s; }
.task-row:hover .tr-chevron .chevron-icon { color: var(--subtle); }

/* Visibility chip-buttons in tr-meta — always visible, clickable */
.tr-vis-chip {
  cursor: pointer; background: transparent;
  font-family: var(--font); font-size: var(--fs-xs);
  transition: opacity 0.1s, filter 0.1s;
}
.tr-vis-chip:hover { filter: brightness(1.25); }
.tr-vis-chip--shared { color: var(--subtle); border-color: var(--border); }

/* Compact action button style — no border, icon-only */
.tr-action-btn {
  background: transparent;
  border: 1px solid var(--border-active);
  color: var(--muted);
  border-radius: 2px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.tr-action-btn:hover { color: var(--bone); border-color: var(--border-strong); background: var(--surface-2); }
[data-theme="light"] .tr-action-btn:hover { background: var(--surface-3); }
.tr-action-btn--danger { color: var(--red-bright); border-color: var(--red-border); }
.tr-action-btn--danger:hover { color: var(--bone); background: var(--red-pale); border-color: var(--red-bright); }


/* ═══════════════════════════════════════════════════════════════
   LIGHT MODE HOVER / INTERACTION FIXES
   All rgba(255,255,255,...) hover overlays are invisible on a
   white background. Add [data-theme="light"] overrides that use
   dark navy rgba instead.
   ═══════════════════════════════════════════════════════════════ */

[data-theme="light"] .btn--ghost:hover:not(:disabled) { background: rgba(9,30,66,.05); }
[data-theme="light"] .btn--secondary:hover { background: rgba(9,30,66,.04); }
[data-theme="light"] .editor-toolbar button:hover { background: rgba(9,30,66,.06); }

/* Task OS list rows */
[data-theme="light"] .rec-row:hover        { background: rgba(9,30,66,.03); }
[data-theme="light"] .tpl-list .item:hover { background: rgba(9,30,66,.03); }
[data-theme="light"] .proj-list-row:hover  { background: rgba(9,30,66,.03); }
[data-theme="light"] .qa-sugg:hover        { background: rgba(9,30,66,.04); }

/* Sub-nav active tab — ensure readable in light mode */
[data-theme="light"] .tasks-subnav-item.active { color: var(--bone); border-bottom-color: var(--oxblood); }

/* Card surface — ensure cards use correct bg token in light mode */
[data-theme="light"] .card { background: var(--surface); }
[data-theme="light"] .card__head { background: var(--surface-2); }

/* Filter bar inputs — select option text must be dark */
[data-theme="light"] .filterbar select option { color: var(--bone); background: var(--surface); }
[data-theme="light"] .filterbar input, [data-theme="light"] .filterbar select { background: var(--surface); color: var(--bone); }

/* Segmented control — text readable on light */
[data-theme="light"] .segmented button { color: var(--bone-dim); }
[data-theme="light"] .segmented button:hover:not(.active) { background: rgba(9,30,66,.04); }
[data-theme="light"] .segmented button.active { background: var(--oxblood-pale); color: var(--gold); }

/* Group head */
[data-theme="light"] .group-head { background: var(--surface-2); }

/* Pivot bar */
[data-theme="light"] .pivot-step { background: var(--surface); }

/* Details pane overlay */
[data-theme="light"] .details__overlay { background: rgba(9,30,66,.20); }

/* Avatar initials — dark-on-dark fix: override bone (dark charcoal) to near-white on dark oxblood bg */
[data-theme="light"] .avatar-sm,
[data-theme="light"] .tasks-avatar { color: oklch(97% 0.004 264); }

/* P2/P3 priority dots — dark mode: pull P2 toward orange, P3 toward yellow so they read as distinct at 8px */
html:not([data-theme="light"]) .prio--p2 { background: oklch(65% 0.18 48); }
html:not([data-theme="light"]) .prio--p3 { background: oklch(80% 0.14 90); }

/* P3 priority dot — restore vibrant amber in light mode (matches dark mode --gold hue/chroma) */
[data-theme="light"] .prio--p3 { background: oklch(72% 0.12 78); }

/* ── Sort builder ──────────────────────────────────────────────── */

.sort-builder {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.sort-label,
.sort-then {
  font-size: 10px;
  color: var(--subtle);
  white-space: nowrap;
}

.sort-pair {
  display: flex;
  align-items: center;
  gap: 2px;
}

.sort-select {
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--bone-dim);
  font-size: 11px;
  padding: 3px 6px;
  cursor: pointer;
  height: 26px;
  min-width: 80px;
  transition: border-color var(--t) var(--ease), color var(--t) var(--ease);
}

.sort-select:hover,
.sort-select:focus { border-color: var(--border-active); color: var(--bone); outline: none; }

.dir-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}

.dir-btn:hover { color: var(--bone); border-color: var(--border-active); background: var(--surface-3); }
.dir-btn.dir-desc { color: var(--gold); border-color: var(--gold-border); }

[data-theme="light"] .sort-select { background: var(--surface); color: var(--bone-dim); }
[data-theme="light"] .sort-select:hover,
[data-theme="light"] .sort-select:focus { color: var(--bone); }
[data-theme="light"] .dir-btn { background: var(--surface); }
[data-theme="light"] .dir-btn:hover { background: rgba(9,30,66,.05); }

/* ── Tasks app — mobile ───────────────────────────────── */
@media (max-width: 860px) {
  .tasks-main { padding: var(--space-4); }
}

/* ── Dashboard chip styles ───────────────────────────────────────── */
.chip-priority,
.chip-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
}
.chip-priority { font-weight: 500; }

.chip-p1 { background: var(--p1-bg); color: var(--p1-fg); }
.chip-p2 { background: var(--p2-bg); color: var(--p2-fg); }
.chip-p3 { background: var(--p3-bg); color: var(--p3-fg); }
.chip-p4 { background: var(--p4-bg); color: var(--p4-fg); }

.chip-client   { background: var(--tag-client-bg);   color: var(--tag-client-fg); }
.chip-dept-mkt { background: var(--tag-dept-mkt-bg); color: var(--tag-dept-mkt-fg); }
.chip-dept-npd { background: var(--tag-dept-npd-bg); color: var(--tag-dept-npd-fg); }
.chip-sku      { background: var(--tag-sku-bg);      color: var(--tag-sku-fg); }

/* Dashboard skeleton loading placeholder */
.dash-skeleton {
  background: var(--surface-2);
  border-radius: var(--dash-radius-md);
  animation: none;
}

/* ════════════════════════════════════════════════════════════════════
   Junta HTMX redesign — actualizaciones, accionables, mode banners
   ═══════════════════════════════════════════════════════════════════ */

/* ── Mode banner ───────────────────────────────────────────────────── */
.junta-mode-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-4);
  border: 1px solid;
}
.junta-mode-banner--prep {
  background: var(--blue-pale);
  color: var(--blue-bright);
  border-color: var(--blue-border);
}
.junta-mode-banner--live {
  background: var(--green-pale);
  color: var(--green-bright);
  border-color: var(--green-border);
}
.junta-mode-banner .glyph { font-size: 10px; }

/* ── Status region with progress ────────────────────────────────────── */
.junta-status-region {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.junta-progress {
  height: 4px;
  width: 80px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.junta-progress__bar {
  height: 100%;
  background: var(--green-bright);
  transition: width 0.3s ease;
}
.junta-progress__label { color: var(--muted); font-size: var(--fs-xs); }
.junta-state-btns { display: flex; gap: var(--space-2); }

/* ── Reviewed state on agenda header ────────────────────────────────── */
.agenda-item__head.reviewed { border-left: 3px solid var(--green-bright); }
.agenda-item--focused { outline: 2px solid var(--focus-color); outline-offset: 2px; }
.reviewed-toggle {
  font-size: var(--fs-xs);
  padding: 2px 8px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.reviewed-toggle:hover { color: var(--green-bright); border-color: var(--green-border); }
.chip--reviewed {
  background: var(--green-pale);
  color: var(--green-bright);
  border-color: var(--green-border);
  font-size: var(--fs-xs);
  padding: 2px 8px;
  border-radius: var(--radius);
  border: 1px solid;
}

/* ── Previous update as collapsible ─────────────────────────────────── */
details.prev-update {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
}
details.prev-update summary { cursor: pointer; color: var(--muted); font-size: var(--fs-sm); list-style: none; }
details.prev-update summary::before { content: "▸ "; }
details.prev-update[open] summary::before { content: "▾ "; }

/* ── Actualizaciones section ────────────────────────────────────────── */
.actualizacion-section {
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}
.actualizacion-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.actualizacion {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}
.actualizacion__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.actualizacion__autor { color: var(--bone-dim); font-weight: 500; }
.actualizacion__time  { font-size: var(--fs-xs); }
.actualizacion__edit-btn {
  margin-left: auto;
  font-size: var(--fs-xs);
  opacity: 0;
  transition: opacity 0.15s;
}
.actualizacion:hover .actualizacion__edit-btn { opacity: 1; }
.actualizacion__body p { margin: 0 0 var(--space-1); font-size: var(--fs-base); line-height: 1.55; }
.actualizacion__edit-form { margin-top: var(--space-2); }
.actualizacion__edit-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* ── Actualizacion composer ──────────────────────────────────────────── */
.actualizacion-composer {
  margin-top: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.actualizacion-composer__textarea {
  width: 100%;
  resize: vertical;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-base);
  box-sizing: border-box;
}
.actualizacion-composer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  flex-wrap: wrap;
}
.actualizacion-composer__junta-select {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.actualizacion-composer__actions { display: flex; gap: var(--space-2); }

/* ── Draft status indicator ──────────────────────────────────────────── */
.draft-status {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-style: italic;
  transition: opacity 0.5s;
}

/* ── Accionable rows (new style) ─────────────────────────────────────── */
.accionable-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: var(--space-2);
  align-items: start;
  padding: var(--space-3) 14px;
  border-bottom: 1px solid var(--gold-border);
}
.accionable-row:last-child { border-bottom: none; }
.accionable-row__main { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.accionable-row__title-line { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.accionable-row__title-line .title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.accionable-row__desc { font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
.accionable-row__desc p { margin: 0; }
.accionable-row__controls { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.accionable-row__desc-form { margin-top: var(--space-2); }
.accionable-row__desc-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); justify-content: flex-end; }
.accionable-row__meta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); white-space: nowrap; }
/* Inline edit form */
.accionable-row__edit-form { margin-top: var(--space-2); background: var(--surface-2); border: 1px solid var(--border-active); border-radius: var(--radius-md); padding: var(--space-3); }
.accionable-edit-grid { display: grid; grid-template-columns: 80px 1fr; gap: var(--space-1) var(--space-3); align-items: center; }
.accionable-edit-label { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; letter-spacing: 0.04em; }
/* Notes footer */
.notes-footer { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-2); min-height: 20px; }
/* cpicker inside junta stays in flow until JS fixes it */
.cpicker--junta .cpicker__menu { min-width: 180px; }

/* ── Small input variants ────────────────────────────────────────────── */
.input-sm {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--bone);
  font-size: var(--fs-sm);
  padding: 3px 8px;
}
.input-xs {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--bone);
  font-size: var(--fs-xs);
  padding: 2px 6px;
}
.btn--xs { padding: 2px 8px; font-size: var(--fs-xs); }

/* ── Keyboard help overlay ───────────────────────────────────────────── */
.kbd-help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kbd-help-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  min-width: 340px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.kbd-help-dialog__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  font-weight: 600;
  color: var(--bone);
}
.kbd-help-table { width: 100%; border-collapse: collapse; }
.kbd-help-table td { padding: var(--space-1) var(--space-2); font-size: var(--fs-sm); color: var(--bone-dim); }
.kbd-help-table td:first-child { text-align: right; white-space: nowrap; }
kbd {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--bone);
}

/* ── Junta mobile ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .actualizacion-composer__footer { flex-direction: column; align-items: stretch; }
  .accionable-row { grid-template-columns: 12px 1fr; }
  .accionable-row__meta { flex-direction: row; align-items: center; }
}

/* ── Proyecto descripción (collapsible inline edit) ──────────────────── */
.proyecto-desc { margin-bottom: var(--space-3); }
.proyecto-desc__details { border: 1px solid var(--border); border-radius: var(--radius); }
.proyecto-desc__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.proyecto-desc__summary::-webkit-details-marker { display: none; }
.proyecto-desc__summary .chevron-icon { color: var(--subtle); font-size: 18px; transition: transform 0.15s; }
.proyecto-desc__details[open] .chevron-icon { transform: rotate(90deg); }
.proyecto-desc__body { padding: var(--space-3); border-top: 1px solid var(--border); }
.proyecto-desc__text { font-size: var(--fs-sm); color: var(--bone-dim); white-space: pre-wrap; }
.proyecto-desc__empty { font-size: var(--fs-sm); color: var(--muted); }
.proyecto-desc__form textarea { width: 100%; margin-top: var(--space-2); }

/* ── Historial (cross-session) ───────────────────────────────────────── */
.junta-historia { margin-bottom: var(--space-3); }
.junta-historia__details { border: 1px solid var(--border); border-radius: var(--radius); }
.junta-historia__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  list-style: none;
  user-select: none;
  gap: var(--space-2);
}
.junta-historia__summary::-webkit-details-marker { display: none; }
.junta-historia__summary .chevron-icon { color: var(--subtle); font-size: 18px; transition: transform 0.15s; margin-left: auto; }
.junta-historia__details[open] .chevron-icon { transform: rotate(90deg); }
.junta-historia__body { padding: var(--space-3); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--space-4); }
.junta-historia__section { display: flex; flex-direction: column; gap: var(--space-2); }
.junta-historia__label { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.junta-historia__session { border: 1px solid var(--border); border-radius: var(--radius); }
.junta-historia__session-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: var(--fs-sm);
  color: var(--bone-dim);
}
.junta-historia__session-head::-webkit-details-marker { display: none; }
.junta-historia__session-body { padding: var(--space-3); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--space-3); }

.junta-historia__act { display: flex; gap: var(--space-2); align-items: flex-start; }
.junta-historia__act-content { flex: 1; min-width: 0; }
.junta-historia__act-meta { display: flex; gap: var(--space-2); align-items: baseline; margin-bottom: 2px; font-size: var(--fs-xs); }
.junta-historia__act-body { font-size: var(--fs-sm); color: var(--bone-dim); }

/* ── Pending accionable rows ─────────────────────────────────────────── */
.junta-pending-ac {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.junta-pending-ac__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.junta-pending-ac__title { font-size: var(--fs-sm); color: var(--bone); text-decoration: none; }
.junta-pending-ac__title:hover { text-decoration: underline; }
.actionable-assignees { display: flex; gap: 2px; }

/* ── Actualizacion attachments ───────────────────────────────────────── */
.act-attachments-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.act-attachment {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  text-decoration: none;
  font-size: var(--fs-xs);
  color: var(--bone-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.act-attachment--image { width: 80px; height: 60px; }
.act-attachment--image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.act-attachment--file { padding: 3px 8px; background: var(--surface-2); }
.act-attachment--file:hover { border-color: var(--bone-dim); }

/* ── Actualizacion linked notes ──────────────────────────────────────── */
.act-linked-notes-row { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.act-linked-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: var(--fs-xs);
}
.act-linked-note a { color: var(--bone-dim); text-decoration: none; }
.act-linked-note a:hover { color: var(--bone); text-decoration: underline; }
.act-linked-note__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  font-size: 10px;
  line-height: 1;
}
.act-linked-note__remove:hover { color: var(--bone); }

/* ── Actualizacion action row (attach + note-link) ───────────────────── */
.actualizacion__actions { display: flex; gap: var(--space-2); align-items: center; margin-top: var(--space-2); flex-wrap: wrap; }
.actualizacion__attach-label { cursor: pointer; }
.actualizacion__note-picker { position: relative; }
.actualizacion__note-picker > summary { list-style: none; }
.actualizacion__note-picker > summary::-webkit-details-marker { display: none; }
.actualizacion__note-picker-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 400;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 220px;
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: var(--space-1);
}
.actualizacion__note-picker-item {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
  color: var(--bone-dim);
  cursor: pointer;
  border-radius: var(--radius);
}
.actualizacion__note-picker-item:hover { background: var(--surface-2); color: var(--bone); }
.actualizacion__note-picker-item--linked { color: var(--primary); }
.actualizacion__note-picker-item--linked::before { content: "✓ "; }

/* ── Meeting notas (sequential general notes) ────────────────────────── */
.meeting-nota-list { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3); }
.meeting-nota { display: flex; flex-direction: column; gap: var(--space-1); }
.meeting-nota--legacy { opacity: 0.7; border-bottom: 1px solid var(--border); padding-bottom: var(--space-3); }
.meeting-nota__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
}
.meeting-nota__author { color: var(--bone-dim); font-size: var(--fs-xs); }
.meeting-nota__time { color: var(--muted); font-size: var(--fs-xs); }
.meeting-nota__body { font-size: var(--fs-sm); color: var(--bone-dim); padding-left: calc(var(--space-6) + var(--space-2)); }
.meeting-nota__edit-form { padding-left: calc(var(--space-6) + var(--space-2)); }
.meeting-nota__edit-form textarea { width: 100%; }
.meeting-nota__composer { margin-top: var(--space-2); border-top: 1px solid var(--border); padding-top: var(--space-3); }
.meeting-nota__input {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  overflow: hidden;
}
.meeting-nota__composer-footer { display: flex; justify-content: flex-end; margin-top: var(--space-2); }
.meeting-empty-inline--block { padding: var(--space-2) 0; font-size: var(--fs-sm); color: var(--muted); }
