:root {
  /* ── Palette site public ─────────────────────────────────────────────────── */
  --brand-bleu:   #002395;
  --brand-navy:   #1e2a4a;
  --brand-rouge:  #c8302a;
  --brand-cream:  #faf6f0;
  --brand-oak:    #a67c52;
  --brand-slate:  #4a5568;
  --brand-linen:  #f0ebe3;
  --brand-gold:   #c8a55a;
  --brand-forest: #2d5a3d;

  /* ── Tokens fonctionnels ────────────────────────────────────────────────── */
  --bg:           #f2ede7;          /* crème légèrement foncée pour le fond back-office */
  --card:         #ffffff;
  --border:       rgba(30, 42, 74, 0.13);
  --text:         #1e2a4a;          /* brand-navy */
  --muted:        #4a5568;          /* brand-slate */
  --blue:         #002395;          /* brand-bleu */
  --green:        #2d5a3d;          /* brand-forest */
  --danger:       #c8302a;          /* brand-rouge */

  /* Legacy aliases */
  --brand-primary:  #002395;
  --brand-dark:     #1e2a4a;
  --brand-muted:    #4a5568;
  --brand-accent:   #c8302a;
  --brand-red:      #c8302a;
  --brand-teal:     #002395;

  /* ── Ombres (base navy comme site public) ───────────────────────────────── */
  --shadow-sm: 0 2px 8px  rgba(30, 42, 74, 0.07);
  --shadow-md: 0 8px 24px rgba(30, 42, 74, 0.10);
  --shadow-lg: 0 16px 48px rgba(30, 42, 74, 0.14);
  --ring:      0 0 0 3px rgba(0, 35, 149, 0.16);

  /* ── Gradients ──────────────────────────────────────────────────────────── */
  --gradient-cta: linear-gradient(135deg, #c8302a 0%, #d94a43 100%);

  /* ── Compat glass (certains composants référencent encore ces vars) ──────── */
  --glass-bg:           #ffffff;
  --glass-bg-strong:    #ffffff;
  --glass-border:       rgba(30, 42, 74, 0.13);
  --glass-border-strong:rgba(30, 42, 74, 0.22);

  --topbar-offset: 64px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: var(--bg);
  padding-top: var(--topbar-offset);
}

a { color: inherit; }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgba(30, 42, 74, 0.96);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 16px rgba(30, 42, 74, 0.18);
  color: #fff;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-rouge), var(--brand-rouge), transparent);
  opacity: 0.52;
  pointer-events: none;
}
.topbar__inner {
  max-width: 2320px;
  margin: 0 auto;
  padding: 9px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 460px) auto;
  grid-template-areas: "left search utility";
  align-items: center;
  gap: 12px;
}
.topbar__left {
  grid-area: left;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  text-decoration: none;
}
.brand__logo {
  flex: 0 0 auto;
  display: block;
  height: 38px;
  width: auto;
  filter: drop-shadow(0 5px 12px rgba(15, 23, 42, 0.16));
  transition: filter 0.2s ease;
}
.brand__name {
  height: 18px;
  width: auto;
  transform: translateY(-6px) rotate(6deg);
  transform-origin: left center;
}
.brand__badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #fff;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.26rem 0.5rem;
  border-radius: 999px;
}
@media (max-width: 720px) {
  :root { --topbar-offset: 64px; }
  .brand__name { display: none; }
}
@media (hover: hover) and (pointer: fine) {
  .brand:hover .brand__logo { filter: drop-shadow(0 7px 14px rgba(15, 23, 42, 0.24)); }
  .brand:hover .brand__name { transform: translateY(-8px) rotate(7deg) scale(1.02); }
}

.nav {
  display: flex;
  gap: 5px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.86);
  min-width: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: visible;
}
.nav a {
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  position: relative;
  flex: 0 0 auto;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.06rem;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-red);
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}
.nav a:hover { background: transparent; color: #fff; opacity: 1; }
.nav a:hover::after,
.nav a:focus-visible::after { transform: scaleX(1); opacity: 1; }
.nav a.is-active { color: #fff; opacity: 1; }
.nav a.is-active::after { transform: scaleX(1); opacity: 1; }
.nav-dropdown__summary.is-active { opacity: 1; color: rgba(255,255,255,0.95); }
.nav-dropdown__summary.is-active::before {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 10px;
  right: 10px;
  height: 2px;
  background: rgba(255,255,255,0.75);
  border-radius: 1px;
}
.nav-dropdown__summary { position: relative; }
.nav--left { justify-content: flex-start; }
.nav--right {
  justify-self: auto;
  justify-content: flex-end;
}
.topbar__utility {
  grid-area: utility;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-dropdown { position: relative; flex: 0 0 auto; }
.nav-dropdown summary { list-style: none; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown__summary {
  appearance: none;
  text-decoration: none;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  width: 34px;
  height: 34px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.nav-dropdown__summary:hover { background: rgba(255, 255, 255, 0.10); }
.nav-dropdown__summary:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14); }
.nav-dropdown[open] .nav-dropdown__summary { background: rgba(255, 255, 255, 0.14); color: #fff; }
.nav-dropdown__icon {
  width: 17px;
  height: 17px;
  display: block;
}
.nav-dropdown--gestion {
  display: inline-flex;
}
.nav-dropdown--gestion .nav-dropdown__summary--text {
  width: auto;
  height: auto;
  padding: 5px 10px;
  color: rgba(255, 255, 255, 0.86);
  position: relative;
}
.nav-dropdown--gestion .nav-dropdown__summary--text::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.06rem;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-red);
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}
.nav-dropdown--gestion .nav-dropdown__summary--text:hover,
.nav-dropdown--gestion .nav-dropdown__summary--text:focus-visible {
  color: #fff;
}
.nav-dropdown--gestion .nav-dropdown__summary--text:hover::after,
.nav-dropdown--gestion .nav-dropdown__summary--text:focus-visible::after,
.nav-dropdown--gestion[open] .nav-dropdown__summary--text::after {
  transform: scaleX(1);
  opacity: 1;
}
.nav-dropdown--gestion .nav-dropdown__menu {
  left: 0;
  right: auto;
}
.nav-dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 30;
}
.nav-dropdown__menu a,
.nav-dropdown__menu .nav-dropdown__menu-btn {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #0f172a;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.nav-dropdown__menu .nav-dropdown__menu-btn {
  appearance: none;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  font-weight: 600;
}
.nav-dropdown__menu a:hover,
.nav-dropdown__menu a:focus-visible,
.nav-dropdown__menu .nav-dropdown__menu-btn:hover,
.nav-dropdown__menu .nav-dropdown__menu-btn:focus-visible {
  background: var(--brand-linen);
  border-color: var(--border);
  outline: none;
}
.nav-dropdown__menu .nav-dropdown__menu-btn.btn--primary {
  background: rgba(200, 48, 42, 0.07);
  border-color: rgba(200, 48, 42, 0.22);
  color: #9a1c1c;
}

.topbar__search {
  --search-w: clamp(180px, 28vw, 460px);
  grid-area: search;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: var(--search-w);
  transition: opacity 0.2s ease;
}

.search-toggle {
  display: none;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.92);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-toggle:hover { background: rgba(255, 255, 255, 0.14); }
.search-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.28); }
.search-toggle__icon { width: 18px; height: 18px; fill: currentColor; }

.search-box {
  width: 100%;
  opacity: 1;
  pointer-events: auto;
  overflow: visible;
  transform: translateY(0) scale(1);
  transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.search-box .input--search { width: 100%; }
.input.input--search {
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 6px 16px rgba(2, 6, 23, 0.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  caret-color: rgba(255, 255, 255, 0.96);
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.input.input--search:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 18px rgba(2, 6, 23, 0.14);
}
.input.input--search::placeholder {
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}
.input.input--search:focus::placeholder {
  color: transparent;
}
.input.input--search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  margin-left: 8px;
  border-radius: 999px;
  opacity: 0.9;
  background:
    linear-gradient(45deg, transparent 44%, rgba(255, 255, 255, 0.96) 44%, rgba(255, 255, 255, 0.96) 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, rgba(255, 255, 255, 0.96) 44%, rgba(255, 255, 255, 0.96) 56%, transparent 56%);
  cursor: pointer;
}
.input.input--search::-webkit-search-cancel-button:hover {
  opacity: 1;
}
.topbar__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: 0;
}

.topbar .btn {
  border-color: rgba(255, 255, 255, 0.20);
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.topbar .btn:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.30); }
.topbar .btn--ghost { background: transparent; }

.search-suggest[hidden] { display: none !important; }
.search-suggest {
  position: absolute;
  left: auto;
  right: 0;
  width: var(--search-w);
  top: calc(100% + 8px);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
  max-height: min(360px, 55vh);
  overflow: auto;
}

/* Hamburger nav — hidden on desktop, shown at ≤ 980px */
.nav-hamburger {
  display: none;
  position: relative;
  flex: 0 0 auto;
}
.nav-hamburger summary { list-style: none; cursor: pointer; }
.nav-hamburger summary::-webkit-details-marker { display: none; }
.nav-hamburger__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-hamburger__toggle:hover,
.nav-hamburger[open] .nav-hamburger__toggle {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.nav-hamburger__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: rgba(30, 42, 74, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-hamburger__panel a,
.nav-hamburger__panel .nav-hamburger__sep {
  display: block;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-hamburger__panel a:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }
.nav-hamburger__panel a.is-active { color: #fff; font-weight: 700; background: rgba(255, 255, 255, 0.08); }
.nav-hamburger__sep {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  padding: 8px 12px 4px;
  pointer-events: none;
  cursor: default;
}
.nav-hamburger__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.10);
  margin: 4px 6px;
}

@media (max-width: 1280px) {
  .topbar__inner {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 260px) auto;
    gap: 9px;
  }
  .nav { gap: 4px; font-size: 12px; }
  .nav a { padding: 5px 8px; }
  .nav--right a:nth-child(3) { display: none; }
}

@media (max-width: 980px) {
  .topbar__inner {
    grid-template-columns: auto minmax(120px, 1fr) auto;
    grid-template-areas: "left search utility";
    gap: 8px;
  }
  .topbar__left {
    gap: 8px;
    min-width: 0;
  }
  .topbar__utility {
    justify-self: end;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
  }
  /* Hide regular nav links — hamburger takes over */
  .nav--left { display: none; }
  .nav--right { display: none; }
  .nav-hamburger { display: block; }
  .topbar__search {
    --search-w: min(100%, 240px);
    justify-self: center;
    max-width: var(--search-w);
  }
  .topbar .btn {
    padding: 7px 9px;
    font-size: 12px;
  }
}

/* On small screens, collapse the search by default to avoid stealing space. */
@media (max-width: 720px) {
  .topbar__inner {
    grid-template-columns: auto auto auto;
  }
  .nav--left a:nth-child(n+4) { display: none; }
  .nav--right { display: none; }
  .topbar__search {
    --search-w: min(72vw, 280px);
    gap: 0;
    justify-self: end;
    width: auto;
    max-width: var(--search-w);
  }
  .search-toggle { display: inline-flex; }
  .search-box {
    width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-2px) scale(0.985);
    transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .topbar__search.is-open { gap: 6px; }
  .topbar__search.is-open .search-box {
    width: var(--search-w);
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
}

.search-suggest__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.search-suggest__item:hover,
.search-suggest__item.is-active {
  background: var(--brand-linen);
  border-color: var(--border);
}

.search-suggest__title {
  font-size: 13px;
  font-weight: 700;
}

.search-suggest__sub {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggest__meta {
  font-size: 12px;
  color: var(--muted);
}

.search-suggest__line-status {
  display: inline-block;
  font-weight: 700;
}

.search-suggest__line-status--todo {
  color: #b91c1c;
}

.search-suggest__line-status--partial {
  color: #b45309;
}

.search-suggest__line-status--printed {
  color: #166534;
}

.search-suggest__progress-pct {
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums;
}

.search-suggest__empty {
  padding: 10px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .topbar__inner { padding: 8px 10px; }
  .brand__logo { height: 33px; }
  .nav { font-size: 11px; }
  .nav a { padding: 5px 6px; }
}

@media (min-width: 1400px) {
  :root { --topbar-offset: 78px; }
  .topbar__inner {
    padding: 10px 20px;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 620px) minmax(0, 1fr);
  }
  .topbar__left { gap: 16px; }
  .brand__logo { height: 42px; }
  .nav { gap: 8px; font-size: 14px; }
  .nav a { padding: 6px 11px; }
  .nav-dropdown__summary { width: 38px; height: 38px; }
  .nav-dropdown--gestion .nav-dropdown__summary--text {
    width: auto;
    height: auto;
    padding: 6px 11px;
  }
  .nav-dropdown__icon { width: 20px; height: 20px; }
  .search-toggle { width: 38px; height: 38px; }
  .search-toggle__icon { width: 20px; height: 20px; }
  .input.input--search { padding: 10px 14px; font-size: 14px; }
  .topbar .btn { padding: 9px 13px; }
}

.container {
  max-width: 2200px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.2,0,0,1), box-shadow 0.25s cubic-bezier(0.2,0,0,1), border-color 0.25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 35, 149, 0.20);
  }
}

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row--space { justify-content: space-between; }

.detail-screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.detail-screen__fixed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 0;
}
.detail-screen__table {
  flex: 1 1 auto;
  min-height: 0;
}
.detail-screen__table.table-wrap--sticky-head {
  max-height: min(68vh, 760px);
  height: auto;
}
.detail-screen .sticky-actions {
  margin-top: 8px;
  position: static;
  bottom: auto;
}

@media (min-width: 981px) {
  .detail-screen {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: calc(100vh - var(--topbar-offset) - 32px);
    min-height: 0;
    overflow: hidden;
  }
  @supports (height: 100dvh) {
    .detail-screen {
      height: calc(100dvh - var(--topbar-offset) - 32px);
    }
  }
  .detail-screen__fixed {
    min-height: 0;
  }
  .detail-screen__table {
    min-height: 0;
  }
  .detail-screen__table.table-wrap--sticky-head {
    max-height: none;
    height: auto;
  }
  .detail-screen .sticky-actions {
    margin-top: 0;
  }
}

@media (max-width: 980px) {
  .detail-screen {
    height: auto;
    overflow: visible;
  }
  .detail-screen__table.table-wrap--sticky-head {
    max-height: 62vh;
  }
}

.order-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: flex-start;
  gap: 10px;
}
.order-head__title {
  min-width: 0;
}
.order-actions {
  display: flex;
  flex-wrap: nowrap;
  align-content: flex-start;
  gap: 6px;
  justify-content: flex-start;
  flex: 1 1 auto;
  overflow: visible;
  padding-bottom: 0;
}
.order-actions--under-title {
  margin-top: 0;
  width: auto;
  grid-column: auto;
  justify-self: end;
  align-items: flex-start;
}
.order-actions--workflow-line {
  margin-top: 4px;
  width: 100%;
  grid-column: 1 / -1;
  justify-self: stretch;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.order-action-cluster {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  gap: 6px;
}
.order-action-cluster::before { display: none; }
.order-action-cluster__title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-right: 6px;
  font-weight: 600;
}

/* BAT stepper — pill group */
.bat-steps {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  background: var(--brand-linen);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  overflow: hidden;
}
.bat-steps .order-action-btn--bat {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  box-shadow: none;
  white-space: nowrap;
  min-height: 28px;
  transition: background 0.18s ease, color 0.18s ease;
}
.bat-steps .order-action-btn--bat:hover:not(:disabled) {
  background: rgba(30, 42, 74, 0.09);
  color: var(--text);
  transform: none;
  box-shadow: none;
}
.bat-steps .order-action-btn--bat[data-bat-role="TODO"].is-active {
  background: #0f766e;
  color: #fff;
  border: none;
  box-shadow: none;
}
.bat-steps .order-action-btn--bat[data-bat-role="SENT"].is-active {
  background: #b45309;
  color: #fff;
  border: none;
  box-shadow: none;
}
.bat-steps .order-action-btn--bat[data-bat-role="VALIDATED"].is-active {
  background: var(--green);
  color: #fff;
  border: none;
  box-shadow: none;
}

.order-actions--under-title .order-action-cluster {
  padding: 0;
  gap: 6px;
}
.order-action-btn {
  white-space: nowrap;
}
.order-action-btn--pdf {
  background: #fff;
  border-color: rgba(30, 64, 175, 0.28);
  color: #1e40af;
}
.order-action-btn--client {
  background: #fff;
  border-color: var(--border);
}
.order-action-btn--intake {
  background: rgba(236, 253, 245, 0.92);
  border-color: rgba(16, 185, 129, 0.36);
  color: #065f46;
}
.order-bat-status-badge {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}
.order-intake-pending-badge {
  background: #fefce8;
  border: 1px solid #fde68a;
  color: #92400e;
}
.order-completed-badge {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-weight: 700;
}
.order-action-cluster--lifecycle,
.order-action-cluster--danger {
  padding: 0;
  border: 0;
}

/* Delete / danger text button */
.btn--text-danger {
  appearance: none;
  background: none;
  border: 1.5px solid transparent;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 999px;
  opacity: 0.65;
  transition: opacity 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  line-height: 1;
}
.btn--text-danger:hover {
  opacity: 1;
  background: rgba(200, 48, 42, 0.06);
  border-color: rgba(200, 48, 42, 0.28);
  transform: none;
  box-shadow: none;
}
.btn--text-danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 48, 42, 0.20);
  opacity: 1;
}

@media (max-width: 1500px) and (min-width: 821px) {
  .order-actions {
    gap: 5px;
  }
  .order-action-cluster__title {
    display: none;
  }
  .order-action-cluster--bat .order-action-cluster__title {
    display: inline-block;
    font-size: 10px;
  }
  .order-actions .btn:not(.bat-steps .btn) {
    padding: 5px 8px;
    font-size: 11px;
    gap: 5px;
  }
  .order-due-compact .input {
    width: 128px;
    padding: 4px 6px;
    font-size: 11px;
  }
  .order-due-compact__hint {
    display: none;
  }
  .order-due-compact__hint--reference {
    display: none;
  }
}
.order-due-compact {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.order-due-compact .label {
  font-size: 12px;
  color: var(--muted);
}
.order-due-compact .input {
  width: 170px;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 8px;
  font-family: inherit;
}
.order-due-compact__hint {
  margin-left: 2px;
  font-size: 12px;
  color: var(--muted);
}
.order-due-compact__hint--reference {
  width: 100%;
  margin-left: 0;
  color: #b91c1c;
  font-weight: 700;
}
/* Disable card lift in fixed header area */
.detail-screen__fixed .card {
  transition: none;
}
.detail-screen__fixed .card:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

/* Filter toggle chips */
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  background: transparent;
  white-space: nowrap;
}
.filter-toggle input[type="checkbox"] {
  /* Small dot indicator — overrides global checkbox style */
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50% !important;
  border: 1.5px solid rgba(30, 42, 74, 0.45) !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.6;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.filter-toggle input[type="checkbox"]:checked {
  background: rgba(30, 42, 74, 0.7) !important;
  border-color: rgba(30, 42, 74, 0.7) !important;
  background-image: none !important;
  opacity: 1;
}
.filter-toggle:has(input:checked) input[type="checkbox"] {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.9) !important;
}
.filter-toggle:hover {
  background: var(--brand-linen);
  border-color: rgba(30, 42, 74, 0.26);
  color: var(--text);
}
.filter-toggle:has(input:checked) {
  background: var(--brand-navy);
  color: #fff;
  border-color: var(--brand-navy);
}
.filter-toggle:has(input:checked):hover {
  background: #162240;
  border-color: #162240;
}

.order-notes {
  padding: 10px 12px;
}
.order-notes__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.order-notes__hint {
  font-size: 12px;
  color: var(--muted);
}
.order-notes__textarea {
  width: 100%;
  min-height: 36px;
  resize: none;
  overflow-y: hidden;
  font-family: inherit;
}
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 18px; }
.mt-6 { margin-top: 28px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 12px;
}
@media (min-width: 820px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}
.kpi {
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, rgba(200, 48, 42, 0.04), rgba(0, 35, 149, 0.03));
  opacity: 0.8;
  pointer-events: none;
}
.kpi > * { position: relative; }
.kpi__label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18px;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi__value {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 6px;
}
.kpi__meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.kpi__meta b { color: var(--text); font-weight: 900; }
.kpi__spark { margin-top: 10px; }
.spark { width: 100%; height: 30px; display: block; }
.spark__bar { fill: rgba(0, 35, 149, 0.22); }
.spark__bar.is-today { fill: rgba(200, 48, 42, 0.40); }

.dash-kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}
@media (min-width: 640px) {
  .dash-kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 980px) {
  .dash-kpi-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
}

.kpi-delta {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
  vertical-align: middle;
}
.kpi-delta--up {
  background: rgba(21, 128, 61, 0.12);
  color: #15803d;
}
.kpi-delta--down {
  background: rgba(185, 28, 28, 0.10);
  color: #b91c1c;
}
.kpi-delta__vs {
  font-size: 10px;
  color: var(--muted);
  margin-left: 4px;
  vertical-align: middle;
}

.dash-family-wrap {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.dash-family-chart {
  flex: 0 0 auto;
  width: 160px;
  height: 160px;
}
.family-legend {
  flex: 1 1 160px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.family-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.3;
}
.family-legend__dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.family-legend__name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}
.family-legend__pct {
  flex: 0 0 30px;
  text-align: right;
  font-weight: 900;
  color: var(--text);
}
.family-legend__ca {
  flex: 0 0 70px;
  text-align: right;
  color: var(--muted);
}
.family-legend__qty {
  flex: 0 0 50px;
  text-align: right;
  color: var(--muted);
  font-size: 11px;
}
.dash-controls { justify-content: flex-end; }

/* ── Period bar ──────────────────────────────────────────────────────────── */
.dash-period-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  padding: 10px 14px;
}
.dash-period-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.dash-period-shortcuts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.dash-period-custom {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-period-hist {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
@media (max-width: 720px) {
  .dash-period-hist { margin-left: 0; }
}

/* ── Small button variant ────────────────────────────────────────────────── */
.btn--sm {
  font-size: 11px;
  padding: 3px 10px;
  min-height: unset;
  line-height: 1.4;
}
.btn--sm.is-active {
  background: var(--brand-rouge);
  color: #fff;
  border-color: var(--brand-rouge);
  box-shadow: 0 2px 8px rgba(200, 48, 42, 0.28);
}

/* ── Filter chip ─────────────────────────────────────────────────────────── */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(200, 48, 42, 0.08);
  border: 1px solid rgba(200, 48, 42, 0.28);
  border-radius: 999px;
  padding: 3px 10px 3px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-rouge);
}
.filter-chip__clear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--brand-rouge);
  padding: 0 2px;
  line-height: 1;
  opacity: 0.7;
}
.filter-chip__clear:hover { opacity: 1; }

/* ── Legend active filter state ─────────────────────────────────────────── */
.family-legend__item.is-filter-active {
  background: rgba(200, 48, 42, 0.07);
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
}
.family-legend__item:hover {
  background: rgba(30, 42, 74, 0.05);
  border-radius: 4px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 980px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 180px;
}
@media (min-width: 820px) {
  .chart-wrap { height: 200px; }
}
.chart-wrap.is-empty {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}
.chart { width: 100%; height: 100%; display: block; }
.chart__grid { stroke: rgba(100, 116, 139, 0.18); stroke-width: 1; }
.chart__grid--base { stroke: rgba(100, 116, 139, 0.28); }
.chart__bar { fill: rgba(0, 35, 149, 0.28); }
.chart__bar.is-zero { fill: rgba(30, 42, 74, 0.08); }
.chart__bar.is-hover { fill: rgba(200, 48, 42, 0.36); }
.chart__axis { fill: var(--muted); font-size: 10px; }
.chart__axis-y { font-size: 9px; }
.chart__axis-line { stroke: rgba(100, 116, 139, 0.40); stroke-width: 1; }
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: var(--shadow-md);
  font-size: 12px;
  color: var(--text);
  transform: translate(-50%, -110%);
  white-space: nowrap;
}
.chart-tooltip b { font-weight: 900; }

.h1 { font-size: 20px; font-weight: 700; margin: 0; }
.p { font-size: 14px; color: var(--muted); margin: 6px 0 0; }

.btn {
  appearance: none;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  min-height: 34px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.25s cubic-bezier(0.2,0,0,1), box-shadow 0.25s cubic-bezier(0.2,0,0,1), background 0.2s ease, border-color 0.2s ease;
}
.btn:hover {
  background: var(--brand-linen);
  border-color: rgba(30, 42, 74, 0.26);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-color: rgba(0, 35, 149, 0.40);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }
.btn--primary {
  background: var(--gradient-cta);
  color: #fff;
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 6px 18px rgba(200, 48, 42, 0.30);
  text-shadow: 0 1px 2px rgba(0,0,0,0.14);
}
.btn--primary:hover {
  background: linear-gradient(135deg, #b82a24 0%, #c8302a 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 10px 24px rgba(200, 48, 42, 0.36);
  transform: translateY(-2px);
}
.btn--danger {
  background: linear-gradient(135deg, #c8302a 0%, #b82a24 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(200, 48, 42, 0.24);
  text-shadow: 0 1px 2px rgba(0,0,0,0.14);
}
.btn--danger:hover {
  box-shadow: 0 10px 24px rgba(200, 48, 42, 0.32);
  transform: translateY(-2px);
}
.btn--ghost {
  background: transparent;
  border-color: rgba(30, 42, 74, 0.22);
  box-shadow: none;
}
.btn--ghost:hover {
  background: rgba(30, 42, 74, 0.05);
  border-color: rgba(30, 42, 74, 0.32);
  transform: translateY(-1px);
}
.btn--sm {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 28px;
}

.skeleton {
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(148,163,184,0.10) 25%,
    rgba(148,163,184,0.22) 50%,
    rgba(148,163,184,0.10) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  min-height: 1em;
}
span.skeleton { display: inline-block; }
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.input {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus {
  outline: none;
  border-color: rgba(0, 35, 149, 0.42);
  box-shadow: var(--ring);
}
.input[type="date"] {
  font-family: inherit;
  letter-spacing: normal;
}
.input[type="date"]::-webkit-datetime-edit,
.input[type="date"]::-webkit-datetime-edit-year-field,
.input[type="date"]::-webkit-datetime-edit-month-field,
.input[type="date"]::-webkit-datetime-edit-day-field {
  font-family: inherit;
}
.label { font-size: 13px; font-weight: 600; }
.help { font-size: 12px; color: var(--muted); margin-top: 6px; }

.alert {
  border: 1px solid rgba(185, 28, 28, 0.26);
  background: rgba(254, 242, 242, 0.72);
  color: #7f1d1d;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}
.alert--warn {
  border-color: rgba(180, 120, 0, 0.26);
  background: rgba(255, 251, 235, 0.80);
  color: #78350f;
}

/* Kanban (style “Notion” + sous-groupes alignés) */
.kb-board { overflow-x: auto; }
.kb-board--sticky-head {
  max-height: min(74vh, 980px);
  overflow: auto;
  overscroll-behavior: contain;
}
.kb-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 12px;
  align-items: stretch;
  min-width: 980px; /* évite de “tasser” les colonnes sur petits écrans */
}

.bat-board .bat-grid {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  min-width: 840px;
}

.kb-col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 12px;
  background: var(--brand-linen);
  border: 1px solid var(--border);
}
.kb-board--sticky-head .kb-col-head {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(240, 235, 227, 0.96);
  box-shadow: inset 0 -1px 0 rgba(30, 42, 74, 0.08);
}
.kb-col-head__title { font-size: 13px; font-weight: 800; color: #0f172a; }
.kb-col-head__count {
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.10);
  padding: 2px 8px;
  border-radius: 999px;
}

.kb-col-head[data-status="REFUSED"] {
  background: rgba(254, 226, 226, 0.65);
  border-color: rgba(220, 38, 38, 0.18);
}

.kb-col-head--bat-validated {
  background: rgba(220, 252, 231, 0.7);
  border-color: rgba(22, 163, 74, 0.24);
}

.kb-group-head {
  grid-column: 1 / -1;
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 6px 6px;
  margin-top: 6px;
  cursor: pointer;
  text-align: left;
  border-top: 1px solid rgba(148, 163, 184, 0.36);
  color: #334155;
}
.kb-group-head:hover { background: rgba(255, 255, 255, 0.52); border-radius: 10px; }
.kb-group-head:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }
.kb-group-head__chev { font-size: 12px; color: var(--muted); transition: transform 120ms ease; }
.kb-group-head--collapsed .kb-group-head__chev { transform: rotate(-90deg); }
.kb-group-head__icon {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
}
.kb-group-head__icon--nodate { background: #fee2e2; border: 1px solid #fecaca; color: var(--danger); }
.kb-group-head__icon--overdue { background: #ffedd5; border: 1px solid #fed7aa; color: #9a3412; }
.kb-group-head__icon--intake { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.kb-group-head__title { font-size: 12px; font-weight: 900; letter-spacing: 0.2px; }
.kb-group-head__count { margin-left: auto; font-size: 12px; color: var(--muted); }

.kb-cell {
  min-height: 92px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
}
.kb-cell--over {
  background: rgba(0, 35, 149, 0.06);
  outline: 2px solid rgba(0, 35, 149, 0.20);
  outline-offset: -2px;
}
.kb-cell[data-status="REFUSED"].kb-cell--over {
  background: rgba(220, 38, 38, 0.06);
  outline-color: rgba(220, 38, 38, 0.18);
}
.kb-cell--empty { opacity: 0.98; }

.kb-cell--bat-validated {
  background: rgba(220, 252, 231, 0.24);
  border: 1px dashed rgba(22, 163, 74, 0.35);
}

.bat-dropzone-hint {
  margin-top: 4px;
  border: 1px dashed rgba(22, 163, 74, 0.35);
  border-radius: 10px;
  background: rgba(240, 253, 244, 0.85);
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 10px 8px;
}

.order-card--refuse-pending {
  opacity: 0.82;
  filter: saturate(0.9);
}

.grid-kanban {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 12px;
}
@media (min-width: 820px) {
  .grid-kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .grid-kanban { grid-template-columns: repeat(4, 1fr); }
}

.column {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.column__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.column__title { font-size: 13px; font-weight: 700; margin: 0; }
.column__count { font-size: 12px; color: var(--muted); }
.column__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 180px;
}
.column__body:empty::before {
  content: "Déposer ici";
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 22px 10px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.column--over { outline: 2px solid #0f172a; outline-offset: -2px; background: #f1f5f9; }

.due-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  padding: 10px;
}
.due-group__head {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 10px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: transform 0.25s cubic-bezier(0.2,0,0,1), box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}
.due-group__head:hover { background: var(--brand-linen); border-color: rgba(0, 35, 149, 0.18); }
.due-group__head:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-color: rgba(0, 35, 149, 0.35);
}
.due-group__left { display:flex; align-items:center; gap: 8px; flex: 1; min-width: 0; }
.due-group__left::after {
  content: "";
  display: block;
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  margin-left: 10px;
  opacity: 0.85;
}
.due-group__chev { font-size: 12px; color: var(--muted); transition: transform 120ms ease; }
.due-group__icon {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
}
.due-group__icon--nodate {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: var(--danger);
}
.due-group__title {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  letter-spacing: 0.2px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.due-group__count {
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border);
  padding: 2px 8px;
  border-radius: 999px;
}
.due-group__body { display: flex; flex-direction: column; gap: 10px; padding: 0 2px 2px; }
.due-group--collapsed .due-group__chev { transform: rotate(-90deg); }
.due-group--collapsed .due-group__body { display: none; }

.due-group[data-bucket="nodate"] { border-color: rgba(185, 28, 28, 0.2); background: rgba(254, 242, 242, 0.4); }
.due-group[data-bucket="nodate"] .due-group__head { border-color: rgba(185, 28, 28, 0.22); }
.due-group[data-bucket="overdue"] { border-color: rgba(180, 83, 9, 0.18); background: rgba(255, 251, 235, 0.4); }
.due-group[data-bucket="overdue"] .due-group__head { border-color: rgba(180, 83, 9, 0.20); }

.order-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
}
.order-card.dragging { opacity: 0.7; }
.order-card:not(.dragging) { transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s cubic-bezier(0.2,0,0,1); }
.order-card:not(.dragging):hover { background: var(--brand-cream); border-color: rgba(0, 35, 149, 0.22); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.order-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.order-card__due-col { flex-shrink: 0; text-align: right; }
.order-card__due-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(148,163,184,0.10);
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}
.order-card__due-badge--nodate { color: var(--danger); border-color: rgba(185,28,28,0.20); background: rgba(185,28,28,0.06); }
.stats-compact { display: flex; align-items: center; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.stats-compact__chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.20);
  background: rgba(148, 163, 184, 0.10);
  line-height: 1.5;
  letter-spacing: 0.01em;
}
/* Chips techniques restantes sur cartes Kanban */
.tech-chips {
  display: flex;
  gap: 4px;
  margin-left: auto;        /* pousse le bloc à droite dans .stats-compact */
  flex-wrap: wrap;
}

.tech-chip {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  border-radius: 4px;
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
}

.tech-chip--uv   { background: #1d4ed8; }
.tech-chip--grav { background: #78350f; }
.tech-chip--dtf  { background: #8b5cf6; }
.tech-chip--quad { background: #10b981; }
.order-card__client { font-weight: 700; font-size: 13px; }
.order-card__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.order-card__sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.order-card__due {
  margin-top: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.order-card__due b { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 12px; margin-top: 2px; }
.order-card__due--nodate b { color: var(--danger); }
.due-icon {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: var(--danger);
}
.late-due-icon {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
  background: #ef4444;
  border: 1px solid #dc2626;
  color: #fff;
}
.order-card__due-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 0; }
.stat {
  background: var(--stat-bg, rgba(255, 255, 255, 0.58));
  border: 1px solid var(--stat-border, var(--glass-border));
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
}
.stat__k { color: var(--muted); font-size: 11px; }
.stat__v { font-weight: 700; margin-top: 2px; color: var(--stat-color, var(--text)); }
.order-card__links {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
  margin-top: 10px;
  font-size: 12px;
}
.order-card__links a {
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
}
.order-card__links a:hover { text-decoration: underline; }
.order-card__intake-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.order-card__intake-btn {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.bat-card {
  cursor: grab;
}

.bat-card--robin {
  background: rgba(219, 234, 254, 0.84);
  border-color: rgba(37, 99, 235, 0.34);
}
.bat-card--robin:not(.dragging):hover {
  background: rgba(219, 234, 254, 0.84);
  border-color: rgba(37, 99, 235, 0.34);
}

.bat-card--thomas {
  background: rgba(254, 226, 226, 0.84);
  border-color: rgba(220, 38, 38, 0.34);
}
.bat-card--thomas:not(.dragging):hover {
  background: rgba(254, 226, 226, 0.84);
  border-color: rgba(220, 38, 38, 0.34);
}

.bat-card__assignee-wrap {
  margin-top: 8px;
}

.bat-card__assignee-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.bat-card__assignee-input {
  width: 100%;
  font-size: 13px;
  padding: 7px 9px;
  border-radius: 10px;
}

.bat-history__title {
  font-size: 18px;
}

.bat-history__count {
  font-size: 13px;
  color: var(--muted);
}

.bat-history {
  overflow: auto;
}

.bat-assignee {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
}

.bat-assignee--robin {
  background: rgba(219, 234, 254, 0.84);
  border-color: rgba(37, 99, 235, 0.32);
  color: #1d4ed8;
}

.bat-assignee--thomas {
  background: rgba(254, 226, 226, 0.84);
  border-color: rgba(220, 38, 38, 0.32);
  color: #991b1b;
}

.table-wrap {
  overflow: auto;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
table { width: 100%; border-collapse: collapse; }
th, td { border-top: 1px solid rgba(148, 163, 184, 0.24); padding: 10px 10px; vertical-align: top; }
thead th {
  background: rgba(255, 255, 255, 0.78);
  border-top: none;
  font-size: 12px;
  text-align: left;
}
.table-wrap--sticky-head {
  max-height: min(68vh, 760px);
}
.table-wrap--sticky-head thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.table-wrap--sticky-head thead th:first-child {
  z-index: 3;
}

input[type="checkbox"] {
  --cb-size: 20px;
  --cb-radius: 6px;
  appearance: none;
  -webkit-appearance: none;
  width: var(--cb-size);
  height: var(--cb-size);
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.52);
  border-radius: var(--cb-radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    background-color 0.12s ease,
    box-shadow 0.12s ease,
    opacity 0.12s ease;
}

input[type="checkbox"]:hover {
  border-color: rgba(100, 116, 139, 0.62);
  background: rgba(255, 255, 255, 0.96);
}

input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

input[type="checkbox"]:checked {
  border-color: rgba(37, 99, 235, 0.58);
  background-color: rgba(37, 99, 235, 0.14);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.4 4.7 9 10 3.6' fill='none' stroke='%231d4ed8' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 11px;
}

input[type="checkbox"]:indeterminate {
  border-color: rgba(37, 99, 235, 0.58);
  background-color: rgba(37, 99, 235, 0.14);
  background-image: linear-gradient(#1d4ed8, #1d4ed8);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 2px;
}

input[type="checkbox"]:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.td-right { text-align: right; }
.td-center { text-align: center; }
.sku {
  display: inline-block;
  background: var(--brand-linen);
  border: 1px solid rgba(30, 42, 74, 0.18);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-navy);
  letter-spacing: 0.02em;
}
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.6);
}
.badge--amber { background: rgba(255, 251, 235, 0.78); color: #92400e; border-color: rgba(217, 119, 6, 0.3); }
.badge--sample {
  background: rgba(254, 226, 226, 0.92) !important;
  color: #991b1b !important;
  border-color: rgba(239, 68, 68, 0.48) !important;
}

.detail-screen--order.is-sample-order #orderLinesTable th:nth-child(1),
.detail-screen--order.is-sample-order #orderLinesTable th:nth-child(3),
.detail-screen--order.is-sample-order #orderLinesTable th:nth-child(4),
.detail-screen--order.is-sample-order #orderLinesTable th:nth-child(5),
.detail-screen--order.is-sample-order #orderLinesTable td:nth-child(1),
.detail-screen--order.is-sample-order #orderLinesTable td:nth-child(3),
.detail-screen--order.is-sample-order #orderLinesTable td:nth-child(4),
.detail-screen--order.is-sample-order #orderLinesTable td:nth-child(5) {
  display: none;
}

.detail-screen--order.is-sample-order #bulkBar {
  display: none !important;
}

/* ── Order lines table — polish ─────────────────────────────────────────── */

/* Row hover */
#orderLinesTable tr:not(thead tr):hover > td {
  background: rgba(30, 42, 74, 0.03);
}

/* "Modifier" button — hidden by default, reveal on row hover or focus */
button[data-edit-line="1"] {
  opacity: 0;
  transition: opacity 0.18s ease;
}
tr:hover button[data-edit-line="1"],
tr:focus-within button[data-edit-line="1"] {
  opacity: 1;
}

/* Thead — column dots for Maquette / Impression / Finition */
.th-mockup::before,
.th-print::before,
.th-finish::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.th-mockup::before { background: #b45309; }
.th-print::before  { background: #1d4ed8; }
.th-finish::before { background: #166534; }

/* Color-coded progress checkboxes */
td:nth-child(3) input[type="checkbox"]:checked {
  background-color: rgba(180, 83, 9, 0.13);
  border-color: rgba(180, 83, 9, 0.52);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' width='11' height='11'%3E%3Cpath d='M2 6.4 4.7 9 10 3.6' fill='none' stroke='%23b45309' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
td:nth-child(3) input[type="checkbox"]:indeterminate {
  background-color: rgba(180, 83, 9, 0.13);
  border-color: rgba(180, 83, 9, 0.52);
  background-image: linear-gradient(currentColor, currentColor);
  background-color: rgba(180, 83, 9, 0.13);
}
td:nth-child(5) input[type="checkbox"]:checked {
  background-color: rgba(22, 101, 52, 0.12);
  border-color: rgba(22, 101, 52, 0.50);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' width='11' height='11'%3E%3Cpath d='M2 6.4 4.7 9 10 3.6' fill='none' stroke='%23166534' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
td:nth-child(5) input[type="checkbox"]:indeterminate {
  background-color: rgba(22, 101, 52, 0.12);
  border-color: rgba(22, 101, 52, 0.50);
}

/* Sublines — no separate bg, left accent on reference cell */
.subline-row td {
  padding-top: 6px;
  padding-bottom: 6px;
  background: transparent;
  border-top: none;
}
.subline-row td:last-child {
  padding-left: 14px;
  border-left: 2px solid var(--border);
}
.subline-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.subline-prefix {
  font-weight: 900;
  opacity: 0.5;
}
.subline-row input[type="checkbox"] {
  --cb-size: 17px;
}

.line-text.done-print { color: var(--blue); text-decoration: line-through; }
.line-text.done-finish { color: var(--green); text-decoration: line-through; }

tr.is-saving { opacity: 0.65; }
tr.is-saving input[type="checkbox"][data-toggle] { cursor: wait; }

.sticky-actions {
  position: sticky;
  bottom: 12px;
  margin-top: 16px;
}
.actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
}
.actions-bar .spacer { flex: 1; }
.actions-bar .count { font-size: 13px; color: var(--muted); font-weight: 600; }
.actions-bar__group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.actions-bar__group .btn--sm:first-child {
  border-radius: 999px 6px 6px 999px;
}
.actions-bar__group .btn--sm:last-child {
  border-radius: 6px 999px 999px 6px;
  padding-left: 8px;
  padding-right: 8px;
}
.actions-bar__sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

.order-sample-badge {
  margin-left: 10px;
  transform: translateY(-2px);
}

.sample-create-card {
  padding: 14px;
}

.sample-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sample-lines {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.sample-line-row {
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.44);
  padding: 12px;
}

.sample-line-row__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 120px;
  gap: 10px;
}

.sample-line-row__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

@media (max-width: 860px) {
  .sample-create-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .sample-line-row__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.debug-checks {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: min(760px, calc(100vw - 28px));
  max-height: min(72vh, 760px);
  overflow: auto;
  z-index: 60;
  border: 1px solid var(--glass-border-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px;
}

.debug-checks__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: -12px;
  padding: 2px 2px 10px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--glass-border);
}

.debug-checks__title {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}

.debug-checks__meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.debug-checks__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.debug-checks__actions .btn {
  padding: 6px 9px;
  font-size: 12px;
}

.debug-checks__list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.debug-checks__item {
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.62);
}

.debug-checks__item.is-ok {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(240, 253, 244, 0.72);
}

.debug-checks__item.is-warn {
  border-color: rgba(217, 119, 6, 0.30);
  background: rgba(255, 251, 235, 0.78);
}

.debug-checks__item.is-fail {
  border-color: rgba(220, 38, 38, 0.30);
  background: rgba(254, 242, 242, 0.82);
}

.debug-checks__item-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: baseline;
}

.debug-checks__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18px;
  padding: 2px 8px;
}

.debug-checks__name {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  min-width: 0;
}

.debug-checks__time {
  font-size: 11px;
  color: var(--muted);
}

.debug-checks__msg {
  margin-top: 4px;
  font-size: 12px;
  color: #0f172a;
  word-break: break-word;
}

.debug-checks__details {
  margin-top: 4px;
  font-size: 11px;
  color: #334155;
  word-break: break-word;
}

.debug-checks__details code {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 6px;
  padding: 1px 5px;
}

/* Planificateur production */
.planner-controls {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.planner-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planner-mode__btn {
  appearance: none;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.56);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.planner-mode__btn:hover {
  border-color: rgba(14, 165, 168, 0.32);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08);
}

.planner-mode__btn.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--gradient-cta);
  box-shadow: 0 10px 22px rgba(30, 64, 175, 0.24);
}

.planner-controls__row {
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.planner-controls__meta {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.planner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.planner-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 1160px) {
  .planner-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr);
  }
}

.planner-table-card td {
  vertical-align: middle;
}

.planner-score {
  display: inline-flex;
  min-width: 56px;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(14, 165, 168, 0.28);
  color: #0f172a;
  font-weight: 900;
  font-size: 14px;
}

.planner-due {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.25);
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
}

.planner-due--overdue {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(254, 226, 226, 0.55);
  color: #991b1b;
}

.planner-due--today {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(254, 243, 199, 0.62);
  color: #92400e;
}

.planner-due--tomorrow {
  border-color: rgba(2, 132, 199, 0.35);
  background: rgba(224, 242, 254, 0.7);
  color: #0c4a6e;
}

.planner-due--week {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(219, 234, 254, 0.65);
  color: #1d4ed8;
}

.planner-due--nodate {
  border-color: rgba(100, 116, 139, 0.28);
  background: rgba(241, 245, 249, 0.85);
  color: #475569;
}

.planner-row-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.planner-row-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.planner-row-flags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.planner-row-reasons {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.planner-row-reasons span {
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.25);
  background: rgba(241, 245, 249, 0.75);
  color: #334155;
  font-size: 11px;
  padding: 2px 8px;
}

.planner-chip {
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
}

.planner-chip--core {
  border-color: rgba(14, 165, 168, 0.30);
  background: rgba(204, 251, 241, 0.74);
  color: #0f766e;
}

.planner-chip--bonus {
  border-color: rgba(37, 99, 235, 0.30);
  background: rgba(219, 234, 254, 0.72);
  color: #1d4ed8;
}

.planner-chip--ok {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(220, 252, 231, 0.75);
  color: #166534;
}

.planner-chip--todo {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(254, 243, 199, 0.68);
  color: #92400e;
}

.planner-chip--ready {
  border-color: rgba(2, 132, 199, 0.35);
  background: rgba(224, 242, 254, 0.75);
  color: #0c4a6e;
}

.planner-chip--warn {
  border-color: rgba(185, 28, 28, 0.30);
  background: rgba(254, 226, 226, 0.72);
  color: #991b1b;
}

.planner-tech {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.planner-family {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.planner-list-card {
  padding: 12px;
}

.planner-list-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.planner-list-card__head h2 {
  margin: 0;
  font-size: 13px;
}

.planner-list-card__meta {
  font-size: 12px;
  color: var(--muted);
}

.planner-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.planner-list li {
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.6);
}

.planner-list__title {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.planner-list__sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.planner-list__link {
  margin-top: 6px;
  display: inline-flex;
  font-size: 12px;
  color: #1d4ed8;
  text-decoration: none;
}

.planner-list__link:hover {
  text-decoration: underline;
}

.planner-list__empty {
  color: var(--muted);
  font-size: 12px;
}

.planner-notes {
  padding: 12px 14px;
}

.planner-notes h2 {
  margin: 0;
  font-size: 13px;
}

.planner-notes ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.planner-controls__top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.planner-views {
  display: block;
}

.planner-view {
  display: block;
}

.planner-view__card {
  padding: 14px;
}

.planner-view__card--narrow {
  width: min(100%, 560px);
}

.planner-view__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.planner-view__head h2 {
  margin: 0;
  font-size: 14px;
}

.planner-view__meta {
  font-size: 12px;
  color: var(--muted);
}

.planner-inline-link {
  color: #1d4ed8;
  text-decoration: none;
}

.planner-inline-link:hover {
  text-decoration: underline;
}

.planner-gravure-layout {
  display: block;
}

.planner-combo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.planner-combo-grid--queue {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.planner-combo-card {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
  padding: 10px;
}

.planner-combo-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.planner-combo-card__head h3 {
  margin: 0;
  font-size: 13px;
}

.planner-combo-card__meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

.planner-combo-card__orders {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planner-progress {
  margin-bottom: 12px;
}

.planner-progress__bar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.58);
  overflow: hidden;
}

.planner-progress__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.9), rgba(14, 165, 168, 0.88));
  transition: width 0.18s ease;
}

.planner-progress__meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.planner-tomorrow-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.planner-tomorrow-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.planner-subcard {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  padding: 10px;
}

.planner-subcard__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.planner-subcard__head h3 {
  margin: 0;
  font-size: 13px;
}

.planner-empty {
  border: 1px dashed rgba(148, 163, 184, 0.42);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  padding: 14px;
  font-size: 12px;
  color: var(--muted);
}

@media (min-width: 1080px) {
  .planner-tomorrow-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}


/* Apple-like premium minimal pass */
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.003em;
}

.h1 {
  font-size: 24px;
  font-weight: 620;
  letter-spacing: -0.015em;
}

.p,
.help,
.label,
.planner-row-sub,
.planner-family,
.order-card__meta,
.order-card__sub,
.planner-list__sub {
  color: #607087;
}

.card {
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
}

.card.table-wrap,
.table-wrap {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: none;
}

th,
td {
  padding: 9px 10px;
}

thead th {
  background: rgba(255, 255, 255, 0.7);
  color: #334155;
  font-weight: 620;
  letter-spacing: 0.01em;
}

.btn {
  border-radius: 11px;
  padding: 7px 11px;
  font-weight: 560;
  letter-spacing: 0.004em;
}

.btn--primary {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.94), rgba(29, 78, 216, 0.94));
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.24);
}

.btn--primary:hover {
  background: linear-gradient(180deg, rgba(37, 99, 235, 1), rgba(29, 78, 216, 1));
  box-shadow: 0 10px 22px rgba(30, 64, 175, 0.26);
}

.btn--danger {
  background: linear-gradient(180deg, rgba(185, 28, 28, 0.92), rgba(153, 27, 27, 0.92));
  box-shadow: 0 7px 16px rgba(153, 27, 27, 0.2);
}

.nav a {
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 520;
}

.nav a::after {
  left: 8px;
  right: 8px;
  bottom: 1px;
  height: 1px;
}

.nav-dropdown__summary,
.search-toggle {
  border-radius: 10px;
}

.kpi__label {
  font-weight: 700;
  letter-spacing: 0.14px;
}

.kpi__value {
  font-weight: 620;
  letter-spacing: -0.01em;
}

.order-card__client {
  font-weight: 620;
}

.stat {
  border-radius: 8px;
  border: 1px solid var(--stat-border, rgba(148, 163, 184, 0.24));
  background: var(--stat-bg, rgba(255, 255, 255, 0.50));
}

.sku,
.badge,
.kb-col-head__count,
.due-group__count,
.planner-due,
.planner-chip,
.planner-row-reasons span {
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.002em;
  padding-top: 2px;
  padding-bottom: 2px;
}

.sku,
.badge,
.kb-col-head__count,
.due-group__count,
.planner-chip,
.planner-row-reasons span {
  background: rgba(255, 255, 255, 0.56);
  border-color: rgba(148, 163, 184, 0.26);
  color: #475569;
}

.planner-chip--core,
.planner-chip--bonus,
.planner-chip--ok,
.planner-chip--todo,
.planner-chip--ready,
.planner-chip--warn {
  background: rgba(255, 255, 255, 0.56);
  border-color: rgba(148, 163, 184, 0.26);
  color: #475569;
}

.planner-mode__btn {
  border-radius: 10px;
  font-weight: 580;
}

.planner-mode__btn.is-active {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.93), rgba(29, 78, 216, 0.93));
}

.order-card,
.due-group,
.planner-list li,
.debug-checks__item {
  border-color: rgba(148, 163, 184, 0.22);
}

@media (max-width: 1200px) {
  .order-head {
    grid-template-columns: 1fr;
  }
  .order-actions {
    justify-content: flex-start;
  }
  .order-actions--under-title {
    margin-top: 6px;
    width: 100%;
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}

@media (max-width: 820px) {
  .order-actions {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }
  .order-actions--under-title {
    margin-top: 8px;
    width: 100%;
  }
  .order-action-cluster {
    width: 100%;
    flex-wrap: wrap;
  }
  .order-action-cluster__title {
    width: 100%;
    border-right: 0;
    margin-right: 0;
    padding-right: 0;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.26);
  }
  .order-due-compact {
    width: 100%;
    justify-content: flex-start;
  }
  .order-due-compact .input {
    width: 100%;
    max-width: 280px;
  }
  .order-notes__head {
    flex-direction: column;
    align-items: flex-start;
  }
  .kb-board--sticky-head {
    max-height: 68vh;
  }
  .table-wrap--sticky-head {
    max-height: 62vh;
  }
  .debug-checks {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 8px;
    max-height: 70vh;
  }
  .debug-checks__head {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand__logo,
  .brand__name {
    transition: none !important;
  }
  .card,
  .btn,
  .nav a,
  .input,
  .order-card:not(.dragging) {
    transition: none !important;
  }
}

/* Typography contract: one regular weight + one light emphasis weight */
body,
body * {
  font-weight: 400 !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
b,
strong,
.h1,
.label,
.btn,
.nav a,
.nav-dropdown__menu .nav-dropdown__menu-btn,
.kpi__label,
.kpi__value,
.kpi__meta b,
.chart-tooltip b,
.kb-col-head__title,
.kb-group-head__title,
.column__title,
.order-card__client,
.stat__v,
.sku,
.badge,
.debug-checks__title,
.debug-checks__name,
.planner-row-title,
.planner-tech,
.planner-list__title,
.planner-mode__btn,
thead th {
  font-weight: 500 !important;
}

/* Planificateur: passe UI plus plate et lisible */
.planner-controls--flat {
  gap: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.planner-controls--flat .planner-controls__top {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(180px, 220px) minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.planner-control--wide {
  min-width: 260px;
}

.planner-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.planner-control__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.planner-control__line--compact {
  align-items: center;
  justify-content: flex-start;
}

.planner-control__line--compact .input {
  width: 130px;
}

.planner-control__hint {
  font-size: 12px;
  color: var(--muted);
}

.planner-control__value {
  font-size: 12px;
  color: #1e40af;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 999px;
  padding: 2px 8px;
}

.planner-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(14, 165, 168, 0.22));
  outline: none;
}

.planner-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(30, 64, 175, 0.45);
  background: #fff;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.26);
  cursor: pointer;
}

.planner-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(30, 64, 175, 0.45);
  background: #fff;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.26);
  cursor: pointer;
}

.planner-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planner-kpi {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.68);
}

.planner-kpi__label {
  font-size: 12px;
  color: var(--muted);
}

.planner-kpi__value {
  margin-top: 6px;
  font-size: 21px;
  line-height: 1;
  color: #0f172a;
}

.planner-row--ready {
  background: rgba(220, 252, 231, 0.28);
}

.planner-row--blocked {
  background: rgba(254, 226, 226, 0.28);
}

.planner-row--ready td,
.planner-row--blocked td {
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

.planner-row--blocked td:nth-child(2) a,
.planner-row--blocked td:nth-child(3) {
  color: #7f1d1d;
}

.planner-row--ready td:nth-child(2) a {
  color: #065f46;
}

.planner-chip--ok {
  border-color: rgba(16, 185, 129, 0.34) !important;
  background: rgba(220, 252, 231, 0.8) !important;
  color: #166534 !important;
}

.planner-chip--warn {
  border-color: rgba(239, 68, 68, 0.34) !important;
  background: rgba(254, 226, 226, 0.8) !important;
  color: #991b1b !important;
}

.planner-chip--core {
  border-color: rgba(37, 99, 235, 0.34) !important;
  background: rgba(219, 234, 254, 0.8) !important;
  color: #1d4ed8 !important;
}

.planner-chip--bonus {
  border-color: rgba(148, 163, 184, 0.34) !important;
  background: rgba(241, 245, 249, 0.86) !important;
  color: #475569 !important;
}

.planner-notes {
  padding: 12px 14px;
}

.planner-notes ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1200px) {
  .planner-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .planner-controls--flat .planner-controls__top {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .planner-kpis {
    grid-template-columns: 1fr;
  }
}

.charge-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid #dbe5f3;
  background: #ffffff;
  border-radius: 14px;
}

.charge-toolbar--header {
  margin-left: auto;
  width: auto;
  max-width: 100%;
  padding: 10px;
}

.charge-toolbar .btn,
.charge-toolbar .input {
  height: 40px;
  border-radius: 12px;
}

.charge-toolbar .btn {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}

.charge-toolbar .btn--ghost {
  background: #f8fafc;
  border-color: #dbe5f3;
}

.charge-toolbar #monthPrev,
.charge-toolbar #monthNext {
  width: 40px;
  padding: 0;
  justify-content: center;
}

.charge-toolbar__left,
.charge-toolbar__right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}
.charge-toolbar__right {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.charge-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.charge-page-header__title {
  min-width: 0;
  flex: 1 1 auto;
}

.charge-limit-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.charge-limit-control .label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.charge-limit-control .input {
  width: 116px;
}

.charge-month-input {
  min-width: 180px;
  font-size: 16px;
  font-family: inherit;
  letter-spacing: 0;
}

.charge-toolbar__hint {
  font-size: 11px;
  color: var(--muted);
  white-space: normal;
  line-height: 1.25;
}

.charge-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.charge-kpi {
  padding: 10px 12px;
  border: 1px solid #dbe5f3;
  background: #fff;
  box-shadow: none;
  border-radius: 12px;
}

.charge-kpi__label {
  font-size: 12px;
  color: #475569;
  margin-bottom: 6px;
  font-weight: 600;
}

.charge-kpi__value {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}

.charge-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.charge-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}

.charge-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.charge-legend__item::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.charge-legend__item--light::before {
  background: #34d399;
}

.charge-legend__item--medium::before {
  background: #f59e0b;
}

.charge-legend__item--high::before {
  background: #f97316;
}

.charge-legend__item--critical::before {
  background: #ef4444;
}

.charge-unscheduled-compact {
  padding: 12px 14px;
  border: 1px solid #dbe5f3;
  background: #fff;
}

.charge-unscheduled-mini {
  min-height: 44px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
}

.charge-chip {
  flex: 0 0 auto;
  min-width: 180px;
  max-width: 260px;
  border: 1px solid #d8e3f2;
  border-radius: 8px;
  background: #f8fbff;
  padding: 6px 9px;
  text-align: left;
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font: inherit;
  box-shadow: none;
}

.charge-chip.dragging {
  opacity: 0.6;
}

.charge-chip__ref {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.charge-chip__due {
  font-size: 11px;
  color: #0f172a;
  font-weight: 800;
}

.charge-chip__amount {
  font-size: 12px;
  font-weight: 700;
  color: #0c4a6e;
}

.charge-empty {
  font-size: 11px;
  color: var(--muted);
}

.charge-unscheduled-mini.drag-over,
.charge-unscheduled-mini.drop-target {
  outline: 2px dashed rgba(14, 116, 144, 0.5);
  outline-offset: -2px;
  border-radius: 10px;
}

.charge-calendar--month {
  --calendar-border: #dbe5f3;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--calendar-border);
  background: #ffffff;
  color: #0f172a;
  box-shadow: none;
}

.charge-month-header {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #eef4fb;
  border-bottom: 1px solid var(--calendar-border);
}

.charge-month-header__day {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  padding: 9px 4px;
  border-right: 1px solid var(--calendar-border);
}

.charge-month-header__day:last-child {
  border-right: 0;
}

.charge-month-week {
  position: relative;
  border-bottom: 1px solid var(--calendar-border);
}

.charge-month-week:last-child {
  border-bottom: 0;
}

.charge-month-week__days {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.charge-month-day {
  min-height: 82px;
  padding: 8px 8px 4px;
  border-right: 1px solid var(--calendar-border);
  background: #ffffff;
  transition: background 0.15s ease;
}

.charge-month-day:last-child {
  border-right: 0;
}

.charge-month-day__top {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.charge-month-day__num {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.charge-month-day__load {
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.charge-month-day__realized {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
}

.charge-month-day--outside {
  background: #f8fafc;
  box-shadow: none;
}

.charge-month-day--outside .charge-month-day__num,
.charge-month-day--outside .charge-month-day__load {
  color: #94a3b8;
}

.charge-month-day--light {
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.32);
  background: #f0fdf4;
}

.charge-month-day--medium {
  box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.36);
  background: #fefce8;
}

.charge-month-day--high {
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.36);
  background: #fff7ed;
}

.charge-month-day--critical {
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.4);
  background: #fef2f2;
}

.charge-month-day--past-disabled {
  box-shadow: none !important;
  background: #e2e8f0;
  opacity: 0.85;
  cursor: not-allowed;
}

.charge-month-day--past-disabled .charge-month-day__num,
.charge-month-day--past-disabled .charge-month-day__load {
  color: #94a3b8;
}

.charge-month-day--past-disabled .charge-month-day__realized {
  color: #334155;
}

.charge-month-day.drag-over,
.charge-month-day.drop-target {
  outline: 2px dashed rgba(14, 116, 144, 0.52);
  outline-offset: -2px;
}

.charge-month-day--selected {
  outline: 2px solid #1d4ed8;
  outline-offset: -2px;
  z-index: 1;
}

.charge-month-week__events {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 20px;
  grid-template-rows: repeat(var(--lane-count, 1), 20px);
  gap: 3px 0;
  padding: 2px 0 6px;
}

.charge-span-bar {
  height: 18px;
  margin: 0 2px;
  border: 2px solid hsl(var(--bar-hue) 62% 46% / 0.92);
  border-radius: 7px;
  background: transparent;
  color: hsl(var(--bar-hue) 62% 34%);
  text-align: left;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: none;
}

.charge-span-bar.dragging {
  opacity: 0.65;
}

.charge-span-bar--late {
  border-color: rgba(220, 38, 38, 0.92);
  box-shadow: none;
}

.charge-span-bar__title {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.charge-span-bar__alert {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  flex: 0 0 auto;
}

.charge-span-bar__due {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  color: #1e293b;
  background: rgba(148, 163, 184, 0.14);
  border-radius: 6px;
  padding: 1px 6px;
}

.charge-span-bar__refdue {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  color: #7f1d1d;
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.26);
  border-radius: 6px;
  padding: 1px 6px;
}

.charge-span-bar__value {
  flex: 0 0 auto;
  font-weight: 700;
  color: #1e293b;
  opacity: 1;
}

.charge-day-detail {
  padding: 12px;
  border: 1px solid #dbe5f3;
  border-radius: 12px;
  background: #fff;
}

.charge-day-detail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.charge-day-detail__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: #0f172a;
}

.charge-day-detail__total {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.charge-day-detail__list {
  display: grid;
  gap: 8px;
}

.charge-day-order {
  border: 1px solid #dbe5f3;
  border-radius: 10px;
  background: #f8fbff;
  padding: 8px 10px;
}

.charge-day-order__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.charge-day-order__open {
  appearance: none;
  border: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.charge-day-order__open:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.charge-day-order__due {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 2px 8px;
}

.charge-day-order__sum {
  margin-left: auto;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.charge-day-order__lines {
  margin-top: 6px;
  display: grid;
  gap: 3px;
}

.charge-day-order__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #334155;
}

.charge-day-order__line-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.charge-day-order__line-value {
  font-weight: 700;
  color: #0f172a;
}

.charge-day-order__late {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  margin-left: 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

@media (max-width: 980px) {
  .charge-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .charge-toolbar--header {
    margin-left: 0;
    width: 100%;
  }

  .charge-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .charge-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .charge-toolbar__left,
  .charge-toolbar__right {
    width: 100%;
    flex-wrap: wrap;
  }

  .charge-month-day {
    min-height: 74px;
    padding: 6px 6px 4px;
  }

  .charge-month-day__num {
    font-size: 17px;
  }

  .charge-month-day__load {
    font-size: 10px;
  }

  .charge-span-bar {
    font-size: 10px;
    padding: 0 8px;
    height: 18px;
    border-radius: 7px;
  }

  .charge-day-detail__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .charge-kpi__value {
    font-size: 24px;
  }
}

@media (max-width: 680px) {
  .charge-kpis {
    grid-template-columns: 1fr;
  }

  .charge-toolbar {
    gap: 8px;
    padding: 9px 10px;
  }

  .charge-toolbar__hint {
    display: none;
  }
}

@media (min-width: 1080px) {
  .charge-month-day {
    min-height: clamp(62px, calc((100vh - 470px) / 6), 82px);
    padding: 6px 8px 4px;
  }

  .charge-month-day__num {
    font-size: 30px;
  }

  .charge-month-day__load,
  .charge-month-day__realized {
    font-size: 11px;
  }
}

.charge-product-toolbar {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.charge-product-toolbar__import {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.charge-product-toolbar__title {
  font-weight: 800;
  color: var(--text);
}

.charge-product-toolbar__hint {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.charge-product-toolbar__meta {
  font-size: 12px;
  color: var(--muted);
}

.charge-product-table-toolbar {
  padding: 12px 14px;
}

.charge-product-table-toolbar__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#chargeProductSearch {
  width: min(380px, 100%);
}

.charge-product-table-toolbar__meta {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.charge-product-import-form {
  gap: 8px;
  align-items: center;
}

.charge-product-import-form .input[type="file"] {
  min-width: min(380px, 76vw);
}

.charge-product-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.charge-product-kpi {
  padding: 14px;
  border: 1px solid #dbe5f3;
  border-radius: 12px;
  background: #fff;
}

.charge-product-kpi__label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.charge-product-kpi__value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 900;
  color: #0f172a;
}

.charge-product-sort {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

th.td-right .charge-product-sort {
  width: 100%;
  justify-content: flex-end;
}

.charge-product-sort__icon {
  font-size: 11px;
  color: var(--muted);
  line-height: 1;
}

.charge-product-sort[data-active="1"] .charge-product-sort__icon {
  color: #1d4ed8;
}

.charge-product-row--critical {
  background: #fff2f2;
}

.charge-product-row--warning {
  background: #fff8ec;
}

.charge-product-toggle {
  min-width: 130px;
  justify-content: flex-start;
}

.charge-product-toggle__hint {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.charge-product-adjust {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.charge-product-adjust__input {
  width: 90px;
  min-height: 34px;
  text-align: right;
}

.charge-product-adjust__btn {
  min-height: 34px;
  padding: 7px 10px;
}

.charge-product-adjust__current {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.charge-product-subrow > td {
  padding: 10px 14px !important;
  background: #f8fbff;
  border-top: 0;
}

.charge-product-empty {
  font-size: 12px;
  color: var(--muted);
}

.charge-product-detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.charge-product-detail-item {
  border: 1px solid #dbe5f3;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
}

.charge-product-detail-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.charge-product-detail-order {
  font-weight: 800;
  color: #0f172a;
  text-decoration: none;
}

a.charge-product-detail-order:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.charge-product-detail-client {
  color: #334155;
  font-size: 12px;
}

.charge-product-detail-due {
  margin-left: auto;
  color: #334155;
  font-size: 11px;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 2px 8px;
}

.charge-product-detail-sub {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #334155;
}

@media (max-width: 980px) {
  .charge-product-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .charge-product-import-form .input[type="file"] {
    min-width: 0;
    width: 100%;
  }

  .charge-product-table-toolbar__meta {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .charge-product-kpis {
    grid-template-columns: 1fr;
  }

  #chargeProductSearch {
    width: 100%;
  }

  .charge-product-adjust {
    width: 100%;
    justify-content: flex-end;
  }

  .charge-product-detail-due {
    margin-left: 0;
  }
}

body.ink-check-open {
  overflow: hidden;
}

.ink-check-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ink-check-card {
  width: min(520px, 100%);
  border-radius: 16px;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.35));
  background: var(--panel, #ffffff);
  color: var(--text, #0f172a);
  box-shadow: 0 24px 56px rgba(2, 6, 23, 0.35);
  padding: 18px;
}

.ink-check-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.ink-check-desc {
  margin: 8px 0 0 0;
  color: var(--muted, #64748b);
  font-size: 14px;
  line-height: 1.5;
}

.ink-check-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #334155;
  font-size: 12px;
}

.ink-check-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
}

.ink-check-error {
  margin-top: 12px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 12px;
  font-size: 13px;
}

.ink-check-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.ink-check-confirm {
  min-width: 240px;
}

@media (max-width: 720px) {
  .ink-check-overlay {
    padding: 14px;
  }

  .ink-check-card {
    border-radius: 14px;
    padding: 14px;
  }

  .ink-check-title {
    font-size: 19px;
  }

  .ink-check-actions {
    justify-content: stretch;
  }

  .ink-check-confirm {
    width: 100%;
    min-width: 0;
  }
}

/* ============================================================
   SCHEDULER — Production Planning
   ============================================================ */

.sched-header { margin-bottom: 0; }
.sched-header__title { margin-bottom: 12px; }

.sched-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}
.sched-controls__dates {
  display: flex;
  gap: 8px;
  align-items: center;
}
.sched-horizon-select { width: 120px; }

.sched-controls__techniques {
  display: flex;
  gap: 6px;
}
.sched-tech-btn {
  padding: 6px 14px;
  border: 2px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.4;
  transition: all 0.2s cubic-bezier(0.2,0,0,1);
}
.sched-tech-btn.is-active { opacity: 1; }
.sched-tech-btn--uv { color: var(--brand-navy, #002b5c); border-color: var(--brand-navy, #002b5c); }
.sched-tech-btn--uv.is-active { background: #e8edf4; }
.sched-tech-btn--laser { color: var(--brand-red, #c8302a); border-color: var(--brand-red, #c8302a); }
.sched-tech-btn--laser.is-active { background: #fce8e8; }
.sched-tech-btn--dtf { color: #2d5a3d; border-color: #2d5a3d; }
.sched-tech-btn--dtf.is-active { background: #e4f0e8; }
.sched-tech-btn--quadri { color: #c8a55a; border-color: #c8a55a; }
.sched-tech-btn--quadri.is-active { background: #faf3e0; }

.sched-controls__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* KPIs */
.sched-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.sched-kpi {
  padding: 16px;
  position: relative;
}
.sched-kpi__tech {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.sched-kpi__value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text, #1a1a2e);
  margin-bottom: 8px;
}
.sched-kpi__bar {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.sched-kpi__bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.2,0,0,1);
}
.sched-kpi__meta {
  font-size: 12px;
  color: var(--muted, #888);
}

/* Alerts */
.sched-alerts-card { padding: 16px; }
.sched-alerts__title {
  margin: 0 0 10px 0;
  font-size: 15px;
  color: var(--brand-red, #c8302a);
}
.sched-alerts__list { display: flex; flex-direction: column; gap: 6px; }
.sched-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.sched-alert--mockup { background: #fff3cd; }
.sched-alert--bottleneck { background: #fce8e8; }
.sched-alert__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-red, #c8302a);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.sched-alert__text { flex: 1; line-height: 1.4; }

/* View tabs */
.sched-views {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #eee;
  padding-bottom: 0;
}
.sched-view-tab {
  padding: 8px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted, #888);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2,0,0,1);
  margin-bottom: -2px;
}
.sched-view-tab.is-active {
  color: var(--brand-navy, #002b5c);
  border-bottom-color: var(--brand-navy, #002b5c);
}
.sched-view-tab:hover { color: var(--text, #1a1a2e); }

/* Day sections (list view) */
.sched-day-section {
  margin-bottom: 20px;
  border-radius: 8px;
  transition: box-shadow 0.2s;
}
.sched-day-section--today {
  box-shadow: inset 0 0 0 2px var(--brand-navy, #002b5c);
  border-radius: 8px;
  padding: 2px;
}
.sched-day-section--drop-target {
  box-shadow: 0 0 0 3px #4a90d9;
  border-radius: 8px;
}
.sched-day-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px 4px;
  padding-top: 8px;
}
.sched-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}
.sched-badge--today {
  background: var(--brand-navy, #002b5c);
  color: #fff;
}

/* Technique group card */
.sched-tech-group {
  margin-bottom: 10px;
  padding: 14px 16px;
}
.sched-tech-group__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.sched-tech-group__name {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
}
.sched-tech-group__stats {
  font-size: 13px;
  color: var(--muted, #888);
}

/* Task sections */
.sched-task-section { margin-bottom: 8px; }
.sched-task-section__label {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 0;
  margin-bottom: 4px;
}
.sched-task-section__label--ready { color: #2d5a3d; }
.sched-task-section__label--blocked { color: var(--brand-red, #c8302a); }

/* Task cards */
.sched-task {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
  cursor: grab;
  transition: box-shadow 0.15s cubic-bezier(0.2,0,0,1), transform 0.15s cubic-bezier(0.2,0,0,1);
  border: 1px solid #e0e0e0;
}
.sched-task:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.sched-task--ready { background: #f0faf0; border-color: #c3e6cb; }
.sched-task--blocked { background: #fffbf0; border-color: #ffeaa7; }
.sched-task--bat { background: #fef0f0; border-color: #f5c6cb; }
.sched-task--dragging { opacity: 0.4; }

.sched-task__main {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.sched-task__ref {
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-navy, #002b5c);
}
.sched-task__client {
  font-size: 12px;
  color: var(--muted, #888);
}
.sched-task__details {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text, #1a1a2e);
}
.sched-task__sku {
  font-family: monospace;
  font-size: 11px;
  background: #f0f0f0;
  padding: 1px 4px;
  border-radius: 3px;
}
.sched-task__label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sched-task__meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--muted, #888);
  align-items: center;
}
.sched-task__qty { font-weight: 600; }
.sched-task__value { font-weight: 600; color: var(--text, #1a1a2e); }
.sched-task__status {
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
}
.sched-task__status--ready { background: #d4edda; color: #155724; }
.sched-task__status--blocked { background: #fff3cd; color: #856404; }
.sched-task__status--bat { background: #f8d7da; color: #721c24; }

/* Timeline view */
.sched-timeline {
  display: grid;
  gap: 1px;
  background: #ddd;
  border-radius: 8px;
  overflow: hidden;
}
.sched-timeline__corner {
  background: #f8f8f8;
  padding: 10px;
  font-weight: 600;
  font-size: 12px;
}
.sched-timeline__day-header {
  background: #f8f8f8;
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
}
.sched-timeline__day-header--today {
  background: var(--brand-navy, #002b5c);
  color: #fff;
}
.sched-timeline__tech-label {
  background: #fff;
  padding: 10px 8px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
}
.sched-timeline__cell {
  background: #fff;
  padding: 6px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  transition: background 0.15s cubic-bezier(0.2,0,0,1);
}
.sched-timeline__cell--drop-target { background: #e8f4ff; }
.sched-timeline__cell--full { background: #f0faf0; }
.sched-timeline__cell--good { background: #f5fcf5; }
.sched-timeline__cell--medium { background: #fefef5; }

.sched-timeline__capacity {
  position: relative;
  height: 4px;
  background: #eee;
  border-radius: 2px;
  margin-bottom: 4px;
}
.sched-timeline__capacity-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 2px;
  overflow: hidden;
}
.sched-timeline__capacity-label {
  position: absolute;
  right: 0;
  top: -14px;
  font-size: 10px;
  color: var(--muted, #888);
  font-weight: 600;
}

.sched-timeline__task {
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 11px;
  cursor: grab;
  border: 1px solid rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  gap: 4px;
  transition: box-shadow 0.15s cubic-bezier(0.2,0,0,1);
}
.sched-timeline__task:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.sched-timeline__task--dragging { opacity: 0.4; }
.sched-timeline__task-ref { font-weight: 600; }
.sched-timeline__task-value { color: var(--muted, #888); }

/* Settings panel */
.sched-settings-panel { padding: 20px; }
.sched-settings-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sched-settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sched-settings-row label { min-width: 70px; }
.sched-settings-row span { font-size: 13px; color: var(--muted, #888); }

/* KPI status classes */
.sched-kpi--full { background: #f0faf0; }
.sched-kpi--good { background: #f5fcf5; }
.sched-kpi--medium { background: #fffbf0; }
.sched-kpi--low { background: #fef0f0; }

/* Task due label */
.sched-task__due {
  font-size: 10px;
  color: var(--muted, #888);
  white-space: nowrap;
}

/* Batch indicator */
.sched-task__batch {
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: #e8edf4;
  color: var(--brand-navy, #002b5c);
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 980px) {
  .sched-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .sched-controls__actions { margin-left: 0; }
  .sched-kpis { grid-template-columns: repeat(2, 1fr); }
  #schedTimelineView { overflow-x: auto; }
  .sched-timeline { min-width: 600px; }
}

@media (max-width: 720px) {
  .sched-kpis { grid-template-columns: 1fr; }
  .sched-task__details { flex-wrap: wrap; }
  .sched-task__meta { flex-wrap: wrap; }
  .sched-controls__techniques { flex-wrap: wrap; }
  .sched-timeline { min-width: 500px; }
  .sched-timeline__cell { min-height: 60px; padding: 4px; }
  .sched-timeline__task { font-size: 10px; }
}

@media print {
  .sched-controls__actions,
  .sched-view-tab,
  .sched-settings-panel,
  #schedSettingsBtn { display: none !important; }
  .sched-task { cursor: default; break-inside: avoid; }
  .sched-day-section { break-inside: avoid; }
  .sched-kpis { grid-template-columns: repeat(4, 1fr); }
}
