    :root {
      --bg: #f5f7fb;
      --panel: #ffffff;
      --ink: #2a2e3b;
      --muted: #6b7280;
      --border: #e1e5ef;
      --etat-direct: #ffffff;
      --etat-reprise: #f59e0b;
      --etat-bloque: #ef4444;
      --etat-urgent: #d63384;
    }
    body {
      padding: 0;
      font-size: 0.95rem;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      color: var(--ink);
      background: var(--bg);
      min-height: 100vh;
    }
    .portal-layout {
      display: grid;
      grid-template-columns: 240px minmax(0, 1fr);
      min-height: 100vh;
    }
    .portal-sidebar {
      position: sticky;
      top: 0;
      align-self: start;
      height: 100vh;
      background: #0b0f14;
      color: #e2e8f0;
      padding: 24px 18px;
      border-right: 1px solid rgba(148, 163, 184, 0.2);
      display: flex;
      flex-direction: column;
    }
    .portal-main {
      min-width: 0;
    }
    .sidebar-brand {
      margin-bottom: 24px;
    }
    .sidebar-brand-row {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .sidebar-brand-stack {
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }
    .sidebar-brand-stack .sidebar-title {
      text-align: center;
      width: 100%;
    }
    .sidebar-logo {
      width: 28px;
      height: 28px;
      object-fit: contain;
    }
    .sidebar-logo-full {
      width: 50%;
      height: auto;
      max-width: 100%;
    }
    .sidebar-title {
      font-size: 1.05rem;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .sidebar-subtitle {
      font-size: 0.85rem;
      color: #94a3b8;
      margin-top: 4px;
    }
    .sidebar-nav {
      display: grid;
      gap: 10px;
    }
    .sidebar-footer {
      margin-top: 0;
      padding-top: 16px;
      border-top: 1px solid rgba(148, 163, 184, 0.2);
    }
    .sidebar-spacer {
      flex: 1 1 auto;
    }
    .sidebar-admin {
      margin-bottom: 10px;
    }
    .sidebar-footer-text {
      margin-top: 12px;
      font-size: 0.75rem;
      color: #94a3b8;
      line-height: 1.4;
    }
    .sidebar-logout {
      justify-content: center;
      background: rgba(239, 68, 68, 0.1);
      border-color: rgba(239, 68, 68, 0.3);
      color: #fecaca;
      font-weight: 600;
    }
    .sidebar-logout:hover {
      background: rgba(239, 68, 68, 0.2);
      border-color: rgba(239, 68, 68, 0.45);
      color: #fff;
    }
    .sidebar-link {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      border-radius: 10px;
      color: inherit;
      background: transparent;
      border: 1px solid transparent;
      text-decoration: none;
      text-align: left;
      width: 100%;
    }
    .sidebar-link:hover {
      background: rgba(148, 163, 184, 0.18);
      border-color: rgba(148, 163, 184, 0.2);
      color: #fff;
    }
    .sidebar-link.is-active {
      background: rgba(37, 99, 235, 0.25);
      border-color: rgba(37, 99, 235, 0.5);
      color: #fff;
      font-weight: 600;
    }
    .sidebar-link.is-disabled {
      color: #64748b;
      cursor: not-allowed;
    }
    .sidebar-link.is-disabled:hover {
      background: transparent;
      border-color: transparent;
      color: #64748b;
    }
    .sidebar-divider {
      height: 1px;
      margin: 6px 8px 2px;
      background: rgba(148, 163, 184, 0.28);
    }
    .sidebar-badge {
      margin-left: auto;
      min-width: 20px;
      height: 20px;
      border-radius: 999px;
      background: #dc2626;
      color: #fff;
      font-size: 0.72rem;
      font-weight: 700;
      line-height: 20px;
      text-align: center;
      padding: 0 6px;
    }
    .auth-layout {
      min-height: 100vh;
    }
    .auth-shell {
      max-width: 1100px;
      margin: 0 auto;
      padding: 24px;
    }
    .auth-hero {
      margin: 18px 0;
      padding: 32px;
      background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
      border: 1px solid var(--border);
      border-radius: 18px;
      box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
      display: grid;
      gap: 20px;
      max-width: 760px;
    }
    .auth-kicker {
      text-transform: uppercase;
      font-size: 0.78rem;
      letter-spacing: 0.16em;
      color: var(--muted);
      margin-bottom: -8px;
    }
    .auth-title {
      font-size: clamp(2rem, 3vw, 2.8rem);
      font-weight: 700;
      margin: 0;
    }
    .auth-subtitle {
      font-size: 1rem;
      color: #4b5563;
      max-width: 640px;
      margin: 0;
    }
    .auth-card {
      max-width: 420px;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 22px;
      box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    }
    .auth-card-title {
      font-size: 1.05rem;
      font-weight: 700;
      margin-bottom: 16px;
    }
    .auth-card .admin-pill {
      background: #1d4ed8;
      border-color: #1d4ed8;
      color: #fff;
      font-weight: 600;
      padding-top: 0.5rem;
      padding-bottom: 0.5rem;
    }
    .auth-card .admin-pill:hover {
      background: #1e40af;
      border-color: #1e40af;
      color: #fff;
    }
    .auth-card .admin-pill:focus {
      box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
    }
    .page-shell {
      max-width: 1400px;
      margin: 0 auto;
      padding: 24px;
    }
    .landing {
      margin: 12px 0 28px;
    }
    .landing-hero {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 24px;
      padding: 28px;
      background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
      border: 1px solid var(--border);
      border-radius: 16px;
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    }
    .landing-kicker {
      text-transform: uppercase;
      font-size: 0.75rem;
      letter-spacing: 0.2em;
      color: var(--muted);
      margin-bottom: 12px;
    }
    .landing-title {
      font-size: clamp(2rem, 2.6vw, 2.8rem);
      font-weight: 700;
      margin-bottom: 12px;
    }
    .landing-subtitle {
      font-size: 1.05rem;
      color: #4b5563;
      max-width: 560px;
      margin-bottom: 20px;
    }
    .landing-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 36px;
      min-width: 36px;
      width: 36px;
      height: 36px;
      line-height: 1;
      border-radius: 10px;
      background: #e0f2fe;
      font-size: 1.15rem;
      box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
    }
    @media (max-width: 992px) {
      .portal-layout {
        grid-template-columns: 1fr;
      }
      .portal-sidebar {
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.2);
      }
      .landing-hero {
        grid-template-columns: 1fr;
      }
    }
    @media (max-width: 640px) {
      .sidebar-link {
        justify-content: flex-start;
      }
    }
    .admin-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 16px 20px;
      margin-bottom: 12px;
    }
    .admin-kicker {
      text-transform: uppercase;
      font-size: 0.72rem;
      letter-spacing: 0.08em;
      color: var(--muted);
      margin-bottom: 4px;
    }
    .admin-actions {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }
    .brand-logo { height: 44px; }
    .admin-toolbar {
      position: sticky;
      top: 0;
      z-index: 1000;
      display: grid;
      grid-template-columns: minmax(200px, 240px) minmax(420px, 1fr) minmax(180px, 220px) auto;
      gap: 12px;
      background: #0b0f14;
      color: #e2e8f0;
      border-radius: 0;
      padding: 10px 20px;
      margin: 0 0 12px;
      align-items: end;
      width: 100%;
      box-sizing: border-box;
    }
    .admin-toolbar-field {
      min-width: 0;
    }
    .admin-toolbar .form-label {
      color: #cbd5f5;
      font-size: 0.78rem;
      margin-bottom: 4px;
    }
    .admin-toolbar .form-control {
      background: #ffffff;
      border: 1px solid #d1d5db;
      color: #111827;
      font-size: 0.9rem;
      padding: 0.35rem 0.6rem;
    }
    .admin-toolbar .form-control:focus {
      border-color: #93c5fd;
      box-shadow: 0 0 0 0.2rem rgba(147, 197, 253, 0.35);
    }
    .admin-toolbar-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .module-loader {
      min-height: 220px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      color: #64748b;
      font-size: 0.95rem;
    }
    .planning-toolbar {
      position: sticky;
      top: 0;
      z-index: 1000;
      display: grid;
      grid-template-columns: minmax(200px, 240px) minmax(420px, 1fr) minmax(180px, 220px) auto;
      gap: 12px;
      background: #0b0f14;
      color: #e2e8f0;
      border: none;
      border-radius: 0;
      padding: 10px 20px;
      margin: 0 0 12px;
      box-shadow: none;
    }
    .planning-toolbar .form-label {
      color: #cbd5f5;
      font-size: 0.78rem;
      margin-bottom: 4px;
    }
    .planning-toolbar .form-select,
    .planning-toolbar .form-control {
      background: #ffffff;
      border: 1px solid #d1d5db;
      color: #111827;
      font-size: 0.9rem;
      padding: 0.35rem 0.6rem;
    }
    .planning-toolbar #machineSelect {
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M1 0l4 4 4-4 1 1-5 5L0 1z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 10px center;
      background-size: 10px 6px;
      padding-right: 28px;
    }
    .planning-toolbar .form-select:focus,
    .planning-toolbar .form-control:focus {
      border-color: #93c5fd;
      box-shadow: 0 0 0 0.2rem rgba(147, 197, 253, 0.35);
    }
    .planning-toolbar-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 10px;
      align-items: center;
    }
    .planning-toolbar-row-inline {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .planning-toolbar-actions {
      justify-self: end;
    }
    .planning-toolbar-actions .planning-toolbar-row-inline {
      justify-content: flex-end;
    }
    .planning-toolbar-field--tabs {
      min-width: 260px;
    }
    .toolbar-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 6px 10px;
      align-items: center;
      margin-top: 8px;
      white-space: normal;
      max-width: 100%;
    }
    .planning-toolbar .legend-item {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 0.73rem;
      color: #e2e8f0;
      margin: 0;
      white-space: nowrap;
    }
    .planning-toolbar .legend-color {
      border: 1px solid rgba(255, 255, 255, 0.7);
    }
    .legend-direct {
      background-color: #ffffff;
    }
    .legend-validation-icon {
      width: 16px;
      height: 16px;
      font-size: 11px;
      margin-right: 0;
    }
    .planning-toolbar-tabs .nav-tabs {
      border-bottom: none;
      gap: 6px;
    }
    .planning-toolbar-tabs .nav-link {
      padding: 3px 8px;
      font-size: 0.8rem;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, 0.4);
      color: #e2e8f0;
    }
    .planning-toolbar-tabs .nav-link.active {
      background: rgba(59, 130, 246, 0.35);
      border-color: rgba(59, 130, 246, 0.6);
      color: #fff;
    }
    .admin-pill {
      padding: 3px 8px;
      font-size: 0.8rem;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, 0.4);
      color: #e2e8f0;
      background: transparent;
    }
    .admin-pill-light {
      background: #f8fafc;
      border-color: #cbd5e1;
      color: #1f2937;
    }
    .admin-pill:hover {
      background: rgba(59, 130, 246, 0.35);
      border-color: rgba(59, 130, 246, 0.6);
      color: #fff;
    }
    .admin-pill-light:hover {
      background: #e2e8f0;
      border-color: #94a3b8;
      color: #0f3d4c;
    }
    .modal .admin-pill {
      background: #f8fafc;
      border-color: #cbd5e1;
      color: #1f2937;
    }
    .modal .admin-pill:hover {
      background: #e2e8f0;
      border-color: #94a3b8;
      color: #1f2937;
    }
    .late-ofs-alt td {
      background: #e2e8f0;
    }
    .tool-icon {
      font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
      margin-right: 6px;
    }
    .tool-card .card-body {
      gap: 16px;
    }
    .tool-open-btn {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      border: 1px solid rgba(148, 163, 184, 0.5);
      background: #f8fafc;
      color: #0f172a;
      font-size: 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .tool-open-btn:hover {
      background: #e2e8f0;
      border-color: rgba(148, 163, 184, 0.8);
    }
    .tool-fav-btn {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      border: 1px solid rgba(148, 163, 184, 0.5);
      background: #f8fafc;
      color: #cbd5e1;
      font-size: 18px;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
.tool-fav-btn.is-active {
  color: #facc15;
  border-color: #facc15;
  background: #fffbea;
}
.tool-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 6px;
}
    #matiereOrdersPageIndex .admin-pill {
      background: #f8fafc;
      border-color: #cbd5e1;
      color: #0b0f14;
    }
    #matiereOrdersPageIndex .admin-pill:hover {
      background: #e2e8f0;
      border-color: #94a3b8;
      color: #0b0f14;
    }
    .table-zebra tbody tr:nth-child(even) td {
      background-color: #eef2f7;
    }
    .card-header .admin-pill {
      background: #f8fafc;
      border-color: #cbd5e1;
      color: #1f2937;
    }
    .card-header .admin-pill:hover {
      background: #e2e8f0;
      border-color: #94a3b8;
      color: #0f3d4c;
    }
    .nc-toolbar {
      background: #0b0f14;
      color: #e2e8f0;
      border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    }
    .nc-toolbar .form-label {
      color: #cbd5f5;
      font-size: 0.78rem;
      margin-bottom: 4px;
    }
    .nc-toolbar .form-control {
      background: #ffffff;
      border: 1px solid #d1d5db;
      color: #111827;
      font-size: 0.9rem;
      padding: 0.35rem 0.6rem;
    }
    .nc-toolbar .form-control:focus {
      border-color: #93c5fd;
      box-shadow: 0 0 0 0.2rem rgba(147, 197, 253, 0.35);
    }
    .nc-filter-row .form-control,
    .nc-filter-row .form-select {
      background: #fff;
      border-color: #e2e8f0;
      font-size: 0.75rem;
      padding: 4px 6px;
    }
    .nc-actions {
      display: flex;
      gap: 6px;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
    }
    .planning-machine-tabs {
      overflow-x: auto;
      padding-bottom: 2px;
      scrollbar-width: thin;
      scrollbar-color: rgba(148, 163, 184, 0.6) transparent;
    }
    .planning-machine-tabs::-webkit-scrollbar {
      height: 6px;
    }
    .planning-machine-tabs::-webkit-scrollbar-thumb {
      background: rgba(148, 163, 184, 0.6);
      border-radius: 999px;
    }
    .planning-machine-tabs::-webkit-scrollbar-track {
      background: transparent;
    }
    .planning-tablist {
      display: flex;
      gap: 6px;
      flex-wrap: nowrap;
      width: max-content;
    }
    .planning-machine-btn {
      padding: 3px 8px;
      font-size: 0.8rem;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, 0.4);
      color: #e2e8f0;
      white-space: nowrap;
      background: transparent;
      box-shadow: none;
    }
    .planning-machine-btn.active {
      background: rgba(59, 130, 246, 0.35);
      border-color: rgba(59, 130, 246, 0.6);
      color: #fff;
    }
    .matiere-live-cell.matiere-stock-shortage {
      color: inherit !important;
      font-weight: inherit;
    }
    tr td.matiere-live-cell.matiere-stock-shortage {
      color: inherit !important;
      font-weight: inherit !important;
    }
    .matiere-live-cell .matiere-code-shortage {
      color: #dc2626 !important;
      font-weight: 700;
    }
    tr.etat-reprise td.matiere-live-cell,
    tr.etat-reprise td.matiere-live-cell.matiere-stock-shortage {
      color: #fff !important;
    }
    .machine-of-count-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 18px;
      height: 18px;
      padding: 0 6px;
      margin-left: 6px;
      border-radius: 999px;
      font-size: 0.7rem;
      font-weight: 700;
      line-height: 1;
      background: rgba(15, 23, 42, 0.35);
      color: #ffffff;
      border: 1px solid rgba(255, 255, 255, 0.25);
    }
    .nc-actions .admin-pill {
      background: #f8fafc;
      border-color: #cbd5e1;
      color: #0b0f14;
    }
    .nc-table-fixed th:last-child,
    .nc-table-fixed td:last-child {
      width: 220px;
    }
    .nc-actions .admin-pill:hover {
      background: #e2e8f0;
      border-color: #94a3b8;
      color: #0b0f14;
    }
    .nc-table-fixed {
      table-layout: fixed;
      width: 100%;
    }
    .nc-table-fixed th,
    .nc-table-fixed td {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .nc-table-layout th {
      white-space: nowrap;
    }
    .nc-table-fixed tbody tr:nth-child(even) {
      background: #f8fafc;
    }
    .nc-eye-btn {
      background: #f8fafc;
      border-color: #cbd5e1;
      color: #0b0f14;
    }
    .nc-eye-btn:hover {
      background: #e2e8f0;
      border-color: #94a3b8;
      color: #0b0f14;
    }
    @media (max-width: 900px) {
      .planning-toolbar {
        grid-template-columns: 1fr;
      }
    }
    .table { font-size: 0.9rem; }
    th {
      background: #f3f4f6;
      color: #4b5563;
      font-weight: 600;
      border-bottom: 1px solid var(--border);
    }
    .table, .table-bordered { border-color: var(--border); }
    .table td, .table th { border-color: var(--border); text-align: center; vertical-align: middle; line-height: 1.2; white-space: nowrap; }
    .maintenance-book-toolbar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 14px;
    }
    .maintenance-page-indicator {
      font-size: 0.9rem;
      font-weight: 700;
      color: #475569;
      min-width: 120px;
      text-align: center;
    }
    .maintenance-book {
      position: relative;
      background: linear-gradient(135deg, #caa46b 0%, #a16207 100%);
      border-radius: 18px;
      padding: 18px 18px 18px 26px;
      box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
      min-height: 620px;
    }
    .maintenance-book-spine {
      position: absolute;
      left: 10px;
      top: 12px;
      bottom: 12px;
      width: 12px;
      border-radius: 999px;
      background:
        radial-gradient(circle at center, rgba(255,255,255,0.28) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, #7c2d12 0%, #5b210d 100%);
      background-size: 100% 18px, 100% 100%;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
    }
    .maintenance-book-page {
      min-height: 584px;
      background:
        linear-gradient(90deg, rgba(220, 38, 38, 0.14) 0, rgba(220, 38, 38, 0.14) 2px, transparent 2px) 56px 0 / 100% 100% no-repeat,
        repeating-linear-gradient(180deg, #fffdf6 0, #fffdf6 28px, #e6f0fb 28px, #d6e6f7 30px);
      border-radius: 12px;
      border: 1px solid rgba(148, 163, 184, 0.35);
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
      padding: 26px 24px 24px 74px;
    }
    .maintenance-page-content {
      display: grid;
      gap: 14px;
    }
    .maintenance-note-entry {
      display: grid;
      grid-template-columns: 108px minmax(130px, 170px) minmax(160px, 220px) minmax(0, 1fr) auto;
      gap: 12px;
      align-items: start;
      padding: 6px 0 16px;
      border-bottom: 2px dashed rgba(71, 85, 105, 0.58);
      position: relative;
    }
    .maintenance-note-entry::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: -4px;
      border-bottom: 2px solid rgba(255, 255, 255, 0.9);
      pointer-events: none;
    }
    .maintenance-note-meta {
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #64748b;
      margin-bottom: 4px;
    }
    .maintenance-note-value {
      font-size: 0.96rem;
      color: #0f172a;
      line-height: 1.35;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .maintenance-note-value.is-title {
      font-weight: 700;
      color: #1e3a8a;
    }
    .maintenance-note-actions {
      display: flex;
      gap: 6px;
      justify-content: flex-end;
      align-items: flex-start;
    }
    .maintenance-book-empty {
      color: #64748b;
      font-style: italic;
      padding-top: 6px;
    }
    @media (max-width: 900px) {
      .maintenance-note-entry {
        grid-template-columns: 1fr;
      }
      .maintenance-book-page {
        padding: 22px 18px 22px 44px;
      }
      .maintenance-book-page {
        background:
          linear-gradient(90deg, rgba(220, 38, 38, 0.14) 0, rgba(220, 38, 38, 0.14) 2px, transparent 2px) 28px 0 / 100% 100% no-repeat,
          repeating-linear-gradient(180deg, #fffdf6 0, #fffdf6 28px, #e6f0fb 28px, #d6e6f7 30px);
      }
      .maintenance-note-actions {
        justify-content: flex-start;
      }
    }
    .table-fixed { table-layout: fixed; width: 100%; }
    .table-fixed td { overflow: hidden; text-overflow: ellipsis; max-width: 0; }
    #planningContent {
      content-visibility: auto;
      contain-intrinsic-size: 1px 900px;
    }
    #planningContent .machine-block,
    #planningContent .jour-wrapper,
    #planningContent .holiday-day-block,
    #planningContent .week-separator {
      content-visibility: auto;
      contain-intrinsic-size: 1px 260px;
    }
    #planningContent .jour-wrapper {
      contain: layout paint style;
    }
    .table-fixed thead th {
      white-space: nowrap !important;
      overflow-wrap: normal;
      word-break: normal;
      line-height: 1.15;
    }
    .archive-table-wrap {
      overflow-x: auto;
      max-width: 100%;
    }
    .table-fixed th:nth-child(2),
    .table-fixed td:nth-child(2) {
      width: 40px;
      max-width: 40px;
    }
    .table-fixed th:nth-child(3),
    .table-fixed td:nth-child(3) { width: 70px; max-width: 70px; }
    .table-fixed th:nth-child(4),
    .table-fixed td:nth-child(4) { width: 80px; max-width: 80px; }
    .table-fixed th:nth-child(5),
    .table-fixed td:nth-child(5) { width: 70px; max-width: 70px; }
    .table-fixed th:nth-child(6),
    .table-fixed td:nth-child(6) { width: 80px; max-width: 80px; }
    .table-fixed th:nth-child(7),
    .table-fixed td:nth-child(7) { width: 65px; max-width: 65px; }
    .table-fixed th:nth-child(8),
    .table-fixed td:nth-child(8) { width: 60px; max-width: 60px; }
    .table-fixed th:nth-child(9),
    .table-fixed td:nth-child(9) { width: 80px; max-width: 80px; }
    .planning-row-actions {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 6px;
      width: 100%;
    }
    .planning-fab-toggle-btn {
      width: 28px;
      height: 24px;
      padding: 0;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 600;
      border-radius: 999px;
    }
    .planning-fab-toggle-btn.is-open {
      background: #22c55e !important;
      border-color: #16a34a !important;
      color: #ffffff !important;
    }
    .planning-fab-toggle-btn.is-open:hover {
      background: #16a34a !important;
      border-color: #15803d !important;
      color: #ffffff !important;
    }
    .planning-fab-toggle-btn.is-barred {
      background: #ef4444 !important;
      border-color: #dc2626 !important;
      color: #ffffff !important;
    }
    .planning-fab-toggle-btn.is-barred:hover {
      background: #dc2626 !important;
      border-color: #b91c1c !important;
      color: #ffffff !important;
    }
    .planning-label-preview-btn {
      width: 28px;
      height: 24px;
      padding: 0;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    }
    .planning-product-info-btn {
      width: 28px;
      height: 24px;
      padding: 0;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: 700;
      background: #ef4444 !important;
      border-color: #dc2626 !important;
      color: #ffffff !important;
    }
    .planning-product-info-btn:hover,
    .planning-product-info-btn:focus {
      background: #dc2626 !important;
      border-color: #b91c1c !important;
      color: #ffffff !important;
    }
    .planning-product-info-btn:focus-visible {
      box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.35) !important;
    }
    .table-fixed th:nth-child(10),
    .table-fixed td:nth-child(10) {
      width: 100px;
      max-width: 100px;
      white-space: nowrap;
    }
    .table-fixed th:nth-child(11),
    .table-fixed td:nth-child(11) {
      width: 95px;
      max-width: 95px;
      white-space: nowrap;
    }
    .table-fixed th:nth-child(12),
    .table-fixed td:nth-child(12) {
      width: 130px;
      max-width: 130px;
      white-space: nowrap;
    }
    .table-fixed td:nth-child(12) {
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .table-fixed th:nth-child(13),
    .table-fixed td:nth-child(13) {
      width: 110px;
      max-width: 110px;
      white-space: nowrap;
    }
    .table-fixed th:nth-child(14),
    .table-fixed td:nth-child(14) {
      width: 120px;
      max-width: 120px;
      white-space: nowrap;
    }
    .table-fixed thead th {
      font-size: 0.82rem;
      padding: 4px 5px;
    }
    .table-fixed td {
      padding: 4px 5px;
      font-size: 0.9rem;
    }
    .validation-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: #3b82f6;
      color: #ffffff;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      margin-right: 6px;
      vertical-align: middle;
    }
    .etat-dot {
      display: inline-block;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      border: 1px solid #0f172a;
    }
    .etat-dot--ok {
      background: #22c55e;
    }
    .etat-dot--ko {
      background: #ef4444;
    }
    .etat-dot--none {
      background: #ffffff;
      border-color: #cbd5e1;
    }
    .etiquettes-preview {
      border: 1px dashed #94a3b8;
      background: #ffffff;
      color: #0f172a;
      padding: 0;
      min-height: 0;
      width: 100%;
      max-width: none;
      height: auto;
      white-space: pre-wrap;
      overflow: visible;
      font-size: 0.85rem;
      box-sizing: border-box;
    }
    .etiquettes-preview[data-format="100x15"] {
      aspect-ratio: 100 / 15;
    }
    .etiquettes-preview[data-format="100x150"] {
      aspect-ratio: 2 / 3;
      min-height: 120px;
      height: min(45vh, 420px);
      width: auto;
      max-width: 100%;
    }
    .etiquettes-canvas {
      position: relative;
    }
    .etiquettes-preview[data-format="100x15"]::after {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      left: 60%;
      width: 1px;
      background: rgba(15, 23, 42, 0.35);
      pointer-events: none;
    }
    .etiquettes-preview::before {
      content: "";
      position: absolute;
      inset: 0;
      border: 1px dashed #94a3b8;
      pointer-events: none;
    }
    .etiquettes-block {
      position: absolute;
      cursor: move;
      padding: 1px 2px;
      background: rgba(255, 255, 255, 0.85);
      border: 1px solid #cbd5e1;
      border-radius: 4px;
      font-size: 12px;
      line-height: 1.1;
      white-space: pre-wrap;
      user-select: none;
      transform-origin: center;
      overflow: visible;
    }
    .etiquettes-block-inner {
      display: inline-block;
      transform-origin: center;
      white-space: pre-wrap;
    }
    .etiquettes-block.is-vertical {
      writing-mode: vertical-rl;
      text-orientation: mixed;
    }
    .etiquettes-block.is-locked {
      cursor: not-allowed;
      border-style: dashed;
      opacity: 0.7;
    }
    .etiquettes-block.is-locked::after {
      content: "\1F512";
      position: absolute;
      top: -8px;
      right: -8px;
      font-size: 12px;
      background: #fff;
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      padding: 1px 3px;
    }
    .etiquettes-rotate-handle {
      position: absolute;
      top: -14px;
      left: 50%;
      transform: translateX(-50%);
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #2563eb;
      border: 2px solid #fff;
      box-shadow: 0 0 0 1px #1e3a8a;
      cursor: grab;
      z-index: 2;
    }
    .etiquettes-block.is-selected {
      outline: 2px solid #2563eb;
    }
    .etiquettes-block.is-editing {
      outline: 2px dashed #2563eb;
      cursor: text;
    }
    .etiquettes-toolbar {
      display: flex;
      gap: 4px;
      align-items: center;
      margin-bottom: 6px;
    }
    .etiquettes-toolbar .form-control-sm,
    .etiquettes-toolbar .form-select-sm {
      width: 90px;
    }
    .etiquettes-toolbar .btn.is-active {
      background: #2563eb;
      border-color: #2563eb;
      color: #fff;
    }
    .cell-tooltip {
      position: fixed;
      z-index: 3000;
      max-width: 360px;
      padding: 8px 10px;
      background: #111827;
      color: #f9fafb;
      border-radius: 8px;
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
      font-size: 0.85rem;
      line-height: 1.3;
      pointer-events: none;
      opacity: 0;
      transform: translate3d(0, 4px, 0);
      transition: opacity 90ms ease, transform 90ms ease;
      will-change: transform, opacity;
    }
    .cell-tooltip.is-visible {
      opacity: 1;
      transform: translate3d(0, 0, 0);
    }
    .commande-color-cell {
      background-image: linear-gradient(90deg, var(--commande-color) 0, var(--commande-color) 4px, transparent 4px);
      background-repeat: no-repeat;
      background-size: 4px 100%;
      background-position: left center;
    }
    .table .barre td {
      color: #9ca3af !important;
      background-color: #f3f4f6 !important;
    }
    .postit {
      background: #fff6cc;
      border: 1px solid #f0e2a5;
      border-radius: 8px;
      padding: 10px;
      font-family: inherit;
      font-size: 16px;
      box-shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
      white-space: pre-wrap;
    }
    .note-home {
      margin-top: 16px;
    }
    .note-title {
      font-weight: 600;
      margin-bottom: 8px;
    }
    .operator-note-bubble {
      position: fixed;
      right: 18px;
      bottom: 18px;
      z-index: 1080;
      width: min(360px, calc(100vw - 32px));
      max-height: 45vh;
      overflow: auto;
      background: #fff6cc;
      border: 1px solid #f0d978;
      border-left: 5px solid #d97706;
      border-radius: 8px;
      box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
      padding: 12px 14px;
      color: #422006;
    }
    .operator-note-bubble.is-minimized {
      width: auto;
      min-width: 190px;
      max-height: none;
      overflow: visible;
      padding: 8px 10px;
    }
    .operator-note-bubble-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .operator-note-bubble-title {
      font-weight: 700;
      font-size: 13px;
      text-transform: uppercase;
      margin-bottom: 6px;
    }
    .operator-note-bubble-header .operator-note-bubble-title {
      margin-bottom: 0;
    }
    .operator-note-bubble-toggle {
      appearance: none;
      border: 1px solid #e6c765;
      background: rgba(255, 255, 255, 0.55);
      color: #422006;
      border-radius: 6px;
      width: 26px;
      height: 24px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
    }
    .operator-note-bubble-toggle:hover {
      background: rgba(255, 255, 255, 0.85);
    }
    .operator-note-bubble-text {
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      font-size: 15px;
      line-height: 1.35;
      margin-top: 6px;
    }
    .operator-note-bubble.is-minimized .operator-note-bubble-text {
      display: none;
    }
    footer {
      margin-top: 32px;
      font-size: 13px;
      color: var(--muted);
      text-align: center;
      border-top: 1px solid var(--border);
      padding-top: 10px;
    }
    .legend-color { border: 1px solid #d1d5db; }

	.week-separator {
	  font-size: 0.95rem;
	}
	.week-separator hr {
	  margin-bottom: 0.3rem;
	}
    .holiday-day-title {
      margin: 12px 0 8px;
      color: #111827;
      font-size: 1.5rem;
      font-weight: 500;
      line-height: 1.15;
    }
    .holiday-separator {
      margin: 8px 0 14px;
      padding: 8px 12px;
      border: 1px dashed #f59e0b;
      border-radius: 8px;
      background: #fff7ed;
      color: #92400e;
      font-size: 0.9rem;
      font-weight: 500;
    }
    .holiday-separator-label {
      display: inline-block;
      margin-right: 8px;
      padding: 2px 8px;
      border-radius: 999px;
      background: #f59e0b;
      color: #fff;
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-transform: uppercase;
    }
    .holiday-separator-desc {
      font-weight: 600;
    }
	tr.etat-urgent td {
	  background-color: var(--etat-urgent) !important;
	  color: white;
	  font-weight: 600;
	}
	tr.etat-reprise td {
	  background-color: var(--etat-reprise) !important;
	  color: white;
	}
	tr.etat-bloque td {
	  background-color: var(--etat-bloque) !important;
	  color: white;
	}
	.legend {
	  display: flex;
	  flex-wrap: wrap;
	  gap: 15px;
	  margin-bottom: 15px;
	  font-size: 14px;
	}

	.legend-item {
	  display: flex;
	  align-items: center;
	  gap: 6px;
	}

	.legend-color {
	  width: 18px;
	  height: 18px;
	  border-radius: 4px;
	  border: 1px solid #ccc;
	}
	.legend-direct { background-color: var(--etat-direct); border: 1px solid #666; }
	.legend-reprise { background-color: var(--etat-reprise); }
	.legend-bloque  { background-color: var(--etat-bloque); }
	.legend-urgent  { background-color: var(--etat-urgent); }
    .legend-validation { background-color: #3b82f6; }
	.jour-today {
	  border: 2px solid #0d6efd !important; /* bleu bootstrap */
	  background-color: #e7f1ff; /* léger bleu clair */
	  border-radius: 6px;
	  padding: 5px;
	}
	.jour-today-block {
	  background-color: #e7f1ff !important;  /* bleu clair */
	  border-radius: 8px;
	  border: 3px solid #0d6efd !important;  /* contour bleu vif */
	  padding: 8px;
	}
    .today-badge {
      font-size: 1rem;
      font-weight: 700;
      padding: 0.35rem 0.7rem;
      line-height: 1;
      border-radius: 0.5rem;
      vertical-align: middle;
      margin-left: 0.45rem;
      margin-top: 0.1rem;
      margin-bottom: 0.1rem;
    }
    tr.etat-direct td {
      background-color: #fff !important; /* toujours blanc */
      color: inherit;
    }
    .table .barre td {
      color: #9ca3af !important;
      opacity: 0.55;
    }
    tr.barre.etat-reprise td,
    tr.barre.etat-bloque td,
    tr.barre.etat-urgent td {
      color: #fff !important;
      opacity: 0.55;
    }
    tr.barre.etat-reprise td { background-color: var(--etat-reprise) !important; }
    tr.barre.etat-bloque td { background-color: var(--etat-bloque) !important; }
    tr.barre.etat-urgent td { background-color: var(--etat-urgent) !important; }

    /* =========================
       ========================= */
}


.label-editor {
  gap: 16px;
}

.cartons-dimension-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cartons-dimension-cell .form-select {
  min-width: 180px;
}

.carton-format-preview {
  min-width: 150px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 11px;
  line-height: 1.2;
}

.cartons-dimension-cell .carton-format-preview {
  min-width: 132px;
}

.carton-format-preview svg {
  width: 132px;
  height: 74px;
  flex: 0 0 auto;
}

.cartons-dimension-cell .carton-format-preview svg {
  width: 96px;
  height: 54px;
}

.cartons-dimension-cell .carton-format-preview span {
  display: none;
}

.carton-format-preview.is-empty {
  min-height: 40px;
  color: #94a3b8;
  font-style: italic;
}

.carton-preview-front {
  fill: #f8fafc;
  stroke: #0f172a;
  stroke-width: 1.2;
}

.carton-preview-top {
  fill: #dbeafe;
  stroke: #0f172a;
  stroke-width: 1.2;
}

.carton-preview-side {
  fill: #bfdbfe;
  stroke: #0f172a;
  stroke-width: 1.2;
}

.carton-preview-edge {
  fill: none;
  stroke: #0f172a;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.label-editor-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.label-editor-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.label-editor-right {
  display: flex;
  flex-direction: column;
}
.etiquettes-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
}
.etiquettes-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  margin-bottom: 8px;
}
.etiquettes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.etiquettes-btn {
  width: 34px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.etiquettes-help {
  font-size: 12px;
  color: #64748b;
}
.etiquettes-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.etiquettes-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.etiquettes-status {
  font-size: 12px;
  color: #475569;
  display: flex;
  gap: 8px;
  align-items: center;
}
.etiquettes-status .badge {
  font-size: 11px;
}

.etiquettes-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 10px;
}
.etiquettes-toolbar-divider {
  width: 1px;
  height: 26px;
  background: #dbe2ea;
  margin: 0 2px;
}
.etiquettes-toolbar-input {
  max-width: 90px;
}
.etiquettes-toolbar-text {
  min-width: 180px;
  flex: 1;
}
.etiquettes-row-split {
  align-items: flex-start;
}
.etiquettes-split {
  flex: 1;
  min-width: 0;
}
.etiquettes-split .form-select,
.etiquettes-split .form-control {
  width: 100%;
}

.etiquettes-modal .modal-content {
  height: 100%;
}
.etiquettes-modal .modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px;
}
.etiquettes-modal .label-editor {
  flex: 1;
  min-height: 0;
  gap: 12px;
}
.etiquettes-modal .label-editor-left {
  gap: 10px;
}
.etiquettes-modal .label-editor-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.etiquettes-modal .etiquettes-section {
  padding: 8px;
}
.etiquettes-modal .etiquettes-section-title {
  font-size: 11px;
  margin-bottom: 6px;
}
.etiquettes-modal .etiquettes-preview {
  flex: 1;
  min-height: 0;
  max-height: 100%;
}

#modalPreparationMatieresToolIndex .modal-body {
  max-height: 75vh;
  overflow: hidden;
}

#prepMatieresResultsIndex {
  max-height: calc(75vh - 120px);
  overflow: auto;
}

.nc-week-panel {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px;
  background: #eef2f7;
}

.nc-week-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 8px;
}

.nc-week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
}

.nc-week-btn {
  border: 1px solid #b7c5db;
  border-radius: 999px;
  background: #ffffff;
  color: #1f2937;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1;
}

.nc-week-btn.is-active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.nc-export-separator {
  margin: 14px 0 10px;
}

.nc-images-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.nc-image-item {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px;
  background: #fff;
}

.nc-image-thumb {
  display: block;
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
}

.nc-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  border: none;
  border-radius: 999px;
  width: 20px;
  height: 20px;
  font-size: 12px;
  line-height: 18px;
  background: #ef4444;
  color: #fff;
  cursor: pointer;
}
.matiere-orders-table {
  table-layout: auto;
  width: 100%;
}
.matiere-orders-table td,
.matiere-orders-table th {
  vertical-align: middle;
}
.matiere-orders-table tbody tr.matiere-order-group-even td {
  background-color: #fff;
}
.matiere-orders-table tbody tr.matiere-order-group-odd td {
  background-color: #eef2f7;
}
.matiere-orders-table td:nth-child(8) .d-flex {
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.matiere-orders-table td:nth-child(8) .admin-pill {
  min-width: 128px;
  max-width: 128px;
  width: 128px;
  text-align: center;
}
.matiere-orders-table td:nth-child(3),
.matiere-orders-table th:nth-child(3) {
  text-align: center;
}
.matiere-orders-table td:nth-child(6),
.matiere-orders-table th:nth-child(6) {
  text-align: left;
}
