﻿:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #5b6878;
  --line: #dbe3ef;
  --tenant-brand-color: #0E586E;
  --tenant-brand-contrast: #ffffff;
  --tenant-brand-soft: rgba(15, 118, 110, 0.12);
  --tenant-brand-strong: #115e59;
  --accent: #0E586E;
  --gantt-accent: #173056;
  --planifab-status-banner-offset: 0px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-width: 320px;
}

.planifab-status-banner {
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  border-bottom: 1px solid transparent;
}

.planifab-status-banner[data-state="ok"] {
  color: #0f5132;
  background: #e8f7ee;
  border-bottom-color: #b7e2c4;
}

.planifab-status-banner[data-state="readonly"] {
  color: #664d03;
  background: #fff8e1;
  border-bottom-color: #eed38c;
}

.planifab-status-banner[data-state="error"] {
  color: #842029;
  background: #fdecef;
  border-bottom-color: #efb7bf;
}

.planifab-status-banner[data-state="danger"] {
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(255, 47, 47, 0.96) 0%, rgba(217, 12, 12, 0.96) 50%, rgba(255, 47, 47, 0.96) 100%);
  border-bottom-color: #ffd1d1;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.24);
  animation: planifab-danger-pulse 1.2s ease-in-out infinite;
}

@keyframes planifab-danger-pulse {
  0%, 100% {
    filter: saturate(1);
  }
  50% {
    filter: saturate(1.35) brightness(1.06);
  }
}

.planifab-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(224, 136, 42, 0.16), transparent 22%),
    radial-gradient(circle at top right, rgba(15, 98, 254, 0.16), transparent 22%),
    rgba(16, 25, 41, 0.64);
  backdrop-filter: blur(8px);
}

.planifab-auth-card {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid #d8e1ee;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.24);
}

.planifab-auth-kicker {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5673a6;
}

.planifab-auth-title {
  margin: 0;
  font-size: 1.45rem;
  color: #173056;
}

.planifab-auth-copy {
  margin: 10px 0 18px;
  color: #51647f;
  line-height: 1.45;
}

.planifab-auth-switch {
  margin: 14px 0 0;
  text-align: center;
  color: #51647f;
  font-size: 0.9rem;
}

.planifab-auth-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent, #2563eb);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.planifab-auth-form {
  display: grid;
  gap: 4px;
}

.app-shell {
  border-top: 3px solid #e0882a;
  position: relative;
}

.topbar {
  background: var(--tenant-brand-color);
  color: var(--tenant-brand-contrast);
  padding: 10px 16px 12px;
}

.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
}

.topbar-branding {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-tenant-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 1px rgba(197, 213, 234, 0.9);
  overflow: hidden;
}

.topbar-tenant-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.topbar-tenant-fallback {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--tenant-brand-strong);
}

.topbar-text {
  min-width: 0;
}

.topbar-brand-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-brand-lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-brand {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.topbar-brand-signature {
  font-size: 0.82rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--tenant-brand-contrast) 76%, transparent);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.topbar-tenant-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tenant-brand-contrast) 14%, transparent);
  color: color-mix(in srgb, var(--tenant-brand-contrast) 88%, transparent);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Demo mode: keep the industrial blue while making the local demo context unmistakable. */
body[data-demo-mode="true"] .topbar {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 3px,
      transparent 3px,
      transparent 10px
    ),
    linear-gradient(135deg, #194874 0%, #225f95 54%, #194874 100%);
  background-blend-mode: soft-light, normal;
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -4px 0 rgba(255, 255, 255, 0.22),
    0 2px 10px rgba(25, 72, 116, 0.28);
}

body[data-demo-mode="true"] .topbar-tenant-label {
  position: relative;
  gap: 7px;
  background: rgba(255, 255, 255, 0.9);
  color: #194874;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  letter-spacing: 0.06em;
}

body[data-demo-mode="true"] .topbar-tenant-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #e0882a;
  box-shadow: 0 0 0 3px rgba(224, 136, 42, 0.18);
}

.topbar-sub {
  margin-top: 2px;
  color: color-mix(in srgb, var(--tenant-brand-contrast) 84%, transparent);
  font-size: 1rem;
  font-weight: 500;
}

.topbar-runtime-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-backend-target {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.topbar-backend-target[hidden] {
  display: none !important;
}

body.planifab-remote-backend-warning .app-shell {
  border-top-color: #ff2f2f;
}

body.planifab-remote-backend-warning .topbar {
  background:
    linear-gradient(135deg, #a10000 0%, #d10f0f 48%, #ff3b30 100%);
}

body.planifab-remote-backend-warning .topbar-backend-target {
  background: rgba(255, 255, 255, 0.92);
  color: #8c0000;
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.topbar-session {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-profile-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.topbar-profile-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--tenant-brand-contrast) 50%, transparent);
  border-radius: 999px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--tenant-brand-contrast) 34%, transparent), color-mix(in srgb, var(--tenant-brand-contrast) 10%, transparent)),
    var(--tenant-brand-color);
  color: var(--tenant-brand-contrast);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--tenant-brand-contrast) 12%, transparent),
    0 8px 20px color-mix(in srgb, #0f172a 24%, transparent);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.topbar-profile-button:hover,
.topbar-profile-button:focus-visible,
.topbar-profile-button[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--tenant-brand-contrast) 72%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--tenant-brand-contrast) 20%, transparent),
    0 10px 26px color-mix(in srgb, #0f172a 30%, transparent);
  outline: none;
  transform: translateY(-1px);
}

.topbar-profile-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  width: min(320px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow:
    0 24px 56px rgba(15, 23, 42, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.86) inset;
  color: #172033;
}

.topbar-profile-panel::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 15px;
  width: 14px;
  height: 14px;
  border-left: 1px solid rgba(148, 163, 184, 0.38);
  border-top: 1px solid rgba(148, 163, 184, 0.38);
  background: #ffffff;
  transform: rotate(45deg);
}

.topbar-profile-panel[hidden] {
  display: none !important;
}

.topbar-profile-header {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 7px;
  margin-bottom: 8px;
  background:
    linear-gradient(135deg, #eef6ff 0%, #ffffff 58%);
}

.topbar-user-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--tenant-brand-contrast) 64%, transparent);
}

.topbar-profile-header .topbar-user-kicker {
  color: #64748b;
}

.topbar-user-email {
  font-size: 0.94rem;
  font-weight: 700;
  color: #172033;
  word-break: break-word;
  text-align: left;
}

.topbar-admin-actions,
.topbar-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-platform-signature {
  width: 150px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.50);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  text-decoration: none;
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.topbar-platform-signature:hover,
.topbar-platform-signature:focus-visible {
  background: rgba(255, 255, 255, 0.70);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.topbar-platform-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.92;
  display: block;
}

.topbar-admin-actions[hidden] {
  display: none !important;
}

.topbar-profile-panel .topbar-admin-actions,
.topbar-profile-panel .topbar-user-actions {
  align-items: stretch;
  flex-direction: column;
  gap: 3px;
  padding: 5px 0;
}

.topbar-profile-panel .topbar-admin-actions {
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 5px;
  padding-bottom: 8px;
}

.profile-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 38px;
  padding: 9px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #172033;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  text-align: left;
  transition: background-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.profile-menu-item[hidden] {
  display: none !important;
}

.profile-menu-item:hover,
.profile-menu-item:focus-visible {
  background: #eef6ff;
  color: #173056;
  outline: none;
  transform: translateX(2px);
}

.profile-menu-item:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.profile-menu-item-danger {
  color: #991b1b;
}

.profile-menu-item-danger:hover,
.profile-menu-item-danger:focus-visible {
  background: #fef2f2;
}

.profile-menu-maintenance {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 7px;
  padding-top: 9px;
  border-top: 1px solid #e2e8f0;
}

.profile-menu-maintenance-status {
  font-size: 0.78rem;
  font-weight: 800;
  color: #334155;
}

.profile-menu-maintenance-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 750;
  color: #475569;
}

.profile-menu-maintenance-field input,
.profile-menu-maintenance-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 7px 8px;
  color: #172033;
  font: inherit;
  font-size: 0.82rem;
  resize: vertical;
}

.profile-menu-maintenance-actions,
.profile-menu-maintenance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}

.profile-menu-maintenance-feedback {
  min-height: 17px;
  font-size: 0.76rem;
  color: #475569;
}

.profile-menu-maintenance-feedback.is-error {
  color: #991b1b;
}

.planifab-planned-maintenance-overlay {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2500;
  max-width: min(760px, calc(100vw - 24px));
  width: max-content;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
}

.planifab-planned-maintenance-overlay[hidden] {
  display: none !important;
}

.planifab-planned-maintenance-overlay-message {
  font-size: 0.85rem;
  font-weight: 650;
  color: #7c2d12;
}

#planifabMaintenanceOverlayCloseBtn {
  pointer-events: auto;
}

.admin-maintenance-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-maintenance-block {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.admin-maintenance-block h4 {
  margin: 0 0 10px;
  font-size: 0.96rem;
  color: #1e293b;
}

.admin-maintenance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.maintenance-status-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 10px;
}

.admin-maintenance-feedback {
  min-height: 18px;
  font-size: 0.82rem;
  color: #475569;
}

.admin-maintenance-feedback.is-error {
  color: #991b1b;
}

.maintenance-notice-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.maintenance-notice-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  font-size: 0.82rem;
  color: #334155;
}

.maintenance-notice-list li span {
  flex: 1;
  min-width: 0;
}

.topbar-admin-actions .btn,
.topbar-user-actions .btn,
.topbar-signout-btn {
  white-space: nowrap;
}

.reset-db-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.reset-db-modal-card {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.22);
}

.reset-db-modal-card h3 {
  margin: 0 0 10px;
  color: #7f1d1d;
  font-size: 1.08rem;
  line-height: 1.25;
}

.reset-db-modal-message,
.reset-db-modal-status {
  margin: 0;
  color: #334155;
  font-size: 0.94rem;
  line-height: 1.45;
}

.reset-db-modal-status {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f8fafc;
  font-weight: 650;
}

.reset-db-modal-status[data-state="pending"] {
  color: #334155;
}

.reset-db-modal-status[data-state="success"] {
  background: #ecfdf5;
  color: #047857;
}

.reset-db-modal-status[data-state="error"] {
  background: #fef2f2;
  color: #b91c1c;
}

.reset-db-modal-status[data-state="idle"] {
  background: #f8fafc;
  color: #475569;
}

.reset-db-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.topbar-admin-actions .btn-ghost,
.topbar-user-actions .btn-ghost,
.topbar-signout-btn.btn-ghost {
  background: color-mix(in srgb, var(--tenant-brand-contrast) 14%, transparent);
  color: var(--tenant-brand-contrast);
  border: 1px solid color-mix(in srgb, var(--tenant-brand-contrast) 28%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tenant-brand-contrast) 6%, transparent);
}

.topbar-admin-actions .btn-ghost:hover,
.topbar-admin-actions .btn-ghost:focus-visible,
.topbar-user-actions .btn-ghost:hover,
.topbar-user-actions .btn-ghost:focus-visible,
.topbar-signout-btn.btn-ghost:hover,
.topbar-signout-btn.btn-ghost:focus-visible {
  background: color-mix(in srgb, var(--tenant-brand-contrast) 22%, transparent);
  border-color: color-mix(in srgb, var(--tenant-brand-contrast) 38%, transparent);
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 18px;
  border-bottom: 1px solid #cfd7e6;
  background: #fff;
  overflow-x: auto;
}

.tab {
  display: inline-block;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #3b4f70;
  padding: 13px 18px 11px;
  font-size: 0.98rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.tab.active {
  color: #21395f;
  border-bottom-color: #21395f;
  font-weight: 600;
}

.container {
  width: 100%;
  max-width: none;
  margin: 16px 0 0;
  padding: 0 10px 24px;
}

.hero { margin-bottom: 16px; }
.hero h1 { margin: 0; font-size: 2rem; }
.subtitle { margin: 6px 0 10px; color: var(--muted); }
.badge {
  display: inline-block;
  background: var(--tenant-brand-soft);
  color: var(--tenant-brand-strong);
  border: 1px solid color-mix(in srgb, var(--tenant-brand-color) 28%, #c7d8ff);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

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

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.checklist li {
  display: flex;
  gap: 8px;
  margin: 8px 0;
  color: var(--muted);
}

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.field.field-autocomplete {
  position: relative;
}

.field.field-autocomplete input[type="text"] {
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, #5b6980 50%),
    linear-gradient(135deg, #5b6980 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 2px),
    calc(100% - 14px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.field.field-autocomplete.is-suggestions-open input[type="text"] {
  border-color: #7aa2ff;
  box-shadow: 0 0 0 4px rgba(71, 122, 255, 0.12);
}

.field-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d6dfef;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  box-shadow: 0 18px 36px rgba(22, 34, 62, 0.16);
  max-height: 320px;
  overflow: auto;
}

.field-suggestions[hidden] {
  display: none;
}

.field-suggestion {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  color: #1f2f49;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.field-suggestion:hover,
.field-suggestion.is-active {
  background: #edf4ff;
  border-color: #c6d7fb;
  transform: translateY(-1px);
}

.field-suggestion-value {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.field-suggestion-meta {
  font-size: 0.79rem;
  color: #63738c;
}

input[type="number"],
input[type="text"],
input[type="date"],
select {
  width: 110px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
input[type="text"],
input[type="date"],
select {
  width: 100%;
}

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

.muted {
  color: var(--muted);
  margin: 0;
}

.form-feedback {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.35;
}

.form-feedback-error {
  color: #9c1d1d;
  background: #fff2f2;
  border: 1px solid #f1b5b5;
}

.step-checklist {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fcfdff;
  max-height: 420px;
  min-height: 320px;
  overflow: auto;
}

.step-check-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  font-size: 0.84rem;
  color: var(--text);
}

.step-check-group + .step-check-group {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.step-check-group-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1f3d73;
  margin-bottom: 4px;
}

.step-check-group-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.step-check-family {
  color: var(--muted);
  font-size: 0.76rem;
}

.step-check-phase {
  font-weight: 700;
  color: #30415d;
}

.step-check-hours {
  font-weight: 700;
  color: #0f62fe;
}

.referentiel-shell {
  --ref-bg: linear-gradient(180deg, #f9fbff 0%, #f3f7fd 100%);
  --ref-accent: #1546b2;
  --ref-accent-soft: #e8f0ff;
  --ref-success: #0d7a5f;
  background: var(--ref-bg);
}

.resources-shell {
  background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
}

.referentiel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.resources-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.resources-context {
  min-width: min(360px, 100%);
  padding: 14px 16px;
  border: 1px solid #d7e2f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5673a6;
}

.referentiel-head h3,
.referentiel-column h4 {
  margin: 0;
}

.referentiel-context {
  min-width: min(360px, 100%);
  padding: 14px 16px;
  border: 1px solid #dbe5fb;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(28, 42, 69, 0.06);
}

.referentiel-breadcrumb {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #1f355d;
}

.referentiel-selection-summary {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.referentiel-columns {
  display: grid;
  grid-template-columns: minmax(240px, 0.95fr) minmax(320px, 1.15fr) minmax(360px, 1.35fr);
  gap: 14px;
  align-items: start;
}

.resources-columns {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(420px, 1.45fr);
  gap: 14px;
  align-items: start;
}

.resources-detail-column {
  gap: 14px;
}

.resource-detail-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d5dfef;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.resource-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.resource-detail-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1c2f4f;
}

.resource-detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.resource-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.resource-stat {
  padding: 10px 12px;
  border: 1px solid #dce5f3;
  border-radius: 12px;
  background: #ffffff;
}

.resource-stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.76rem;
  color: var(--muted);
}

.resource-stat-value {
  font-size: 1rem;
  font-weight: 800;
  color: #1f355d;
}

.resource-info-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #c9d5e7;
  border-radius: 50%;
  background: #f8fbff;
  color: #30415d;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.resource-info-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 220px;
  transform: translateX(-50%);
  padding: 7px 9px;
  border: 1px solid #d6e1f4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 42, 72, 0.16);
  color: #30415d;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.resource-info-btn:hover .resource-info-tooltip,
.resource-info-btn:focus-visible .resource-info-tooltip {
  opacity: 1;
  visibility: visible;
}

.resources-subsection {
  display: grid;
  gap: 10px;
}

.referentiel-column {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d6e1f4;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.referentiel-column-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.referentiel-search {
  margin-bottom: 0;
}

.referentiel-list {
  display: grid;
  gap: 10px;
}

.referentiel-item {
  width: 100%;
  border: 1px solid #d5dfef;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
  text-align: left;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.referentiel-item:hover {
  border-color: #b3c8ee;
  box-shadow: 0 10px 20px rgba(26, 46, 81, 0.08);
  transform: translateY(-1px);
}

.referentiel-item:focus-visible {
  outline: 2px solid #2f67d8;
  outline-offset: 2px;
}

.referentiel-item.is-selected {
  border-color: #2f67d8;
  box-shadow: 0 0 0 3px rgba(47, 103, 216, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f1f6ff 100%);
}

.referentiel-item-head,
.referentiel-item-meta,
.referentiel-item-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.referentiel-item-head {
  margin-bottom: 6px;
}

.referentiel-item-id { 
  font-size: 0.98rem; 
  font-weight: 800; 
  color: #1c2f4f; 
} 

.referentiel-item-pills {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
 
.referentiel-item-title { 
  display: none;
  font-size: 0.98rem;
  font-weight: 700;
  color: #1c2f4f;
}

.referentiel-item-meta {
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.referentiel-item-footer {
  align-items: flex-end;
}

.referentiel-item-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ref-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff4fd;
  color: #385788;
  font-size: 0.76rem;
  font-weight: 700;
}

.ref-pill-zone {
  border: 1px solid #d6dfef;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.ref-pill.active { 
  background: #e4f6ee; 
  color: var(--ref-success); 
} 

.ref-pill.warning {
  background: #fff7df;
  color: #92400e;
}
 
.referentiel-item-actions { 
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.referentiel-item-actions[hidden] {
  display: none !important;
}

.task-catalog-groups {
  display: grid;
  gap: 10px;
}

.task-catalog-group {
  border: 1px solid #d5dfef;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.task-catalog-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f3;
  font-weight: 700;
  color: #1f3d73;
  background: #f5f8fe;
}

.task-catalog-group-head-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.task-catalog-zone-pill {
  flex-shrink: 0;
}

.task-catalog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px dashed #dbe3ef;
}

.task-catalog-row:last-child {
  border-bottom: none;
}

.task-catalog-row-main {
  display: grid;
  gap: 2px;
}

.task-competency-editor {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 4px 6px;
}

.task-competency-editor summary {
  cursor: pointer;
  color: #24406d;
  font-size: 0.74rem;
  font-weight: 600;
}

.task-competency-grid {
  margin-top: 6px;
  display: grid;
  gap: 4px;
}

.task-competency-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
}

.task-competency-resource {
  min-width: 0;
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid #d7e1ee;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.task-competency-row select {
  width: 180px;
  max-width: 100%;
  font-size: 0.72rem;
  padding: 3px 4px;
}

.task-catalog-row-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.task-catalog-row-side {
  display: grid;
  gap: 10px;
  justify-items: end;
  min-width: 140px;
}

.task-catalog-hours {
  font-weight: 800;
  color: #1b4cb5;
}

.referentiel-empty {
  padding: 18px;
  border: 1px dashed #c7d5eb;
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.92);
}

.referentiel-drawer {
  position: fixed;
  inset: 0;
  z-index: 110;
}

.referentiel-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 29, 43, 0.38);
  backdrop-filter: blur(2px);
}

.referentiel-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100%;
  padding: 22px 18px 24px;
  background: #f9fbff;
  border-left: 1px solid #d7e1f4;
  box-shadow: -16px 0 40px rgba(19, 31, 52, 0.18);
  overflow-y: auto;
}

.referentiel-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.referentiel-drawer-section {
  padding: 14px;
  border: 1px solid #d8e1f0;
  border-radius: 16px;
  background: #ffffff;
}

body.drawer-open {
  overflow: hidden;
}

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

@media (max-width: 900px) {
  .referentiel-head,
  .resources-head,
  .referentiel-column-head {
    flex-direction: column;
  }

  .referentiel-context {
    min-width: 0;
  }

  .referentiel-columns {
    grid-template-columns: 1fr;
  }

  .resources-columns {
    grid-template-columns: 1fr;
  }

  .task-catalog-row {
    grid-template-columns: 1fr;
  }

  .task-catalog-row-side {
    justify-items: start;
    min-width: 0;
  }

  .resource-detail-grid {
    grid-template-columns: 1fr;
  }
}

.task-catalog-row-meta {
  color: var(--muted);
  font-size: 0.76rem;
}

.task-catalog-hours {
  font-weight: 700;
  color: #0f62fe;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.btn-ghost {
  background: var(--tenant-brand-soft);
  color: var(--tenant-brand-strong);
  border: 1px solid color-mix(in srgb, var(--tenant-brand-color) 28%, #c7d8ff);
}
.btn-danger {
  background: #b91c1c;
  color: #fff;
  border: 1px solid #991b1b;
}
.btn-mini {
  padding: 4px 8px;
  font-size: 0.78rem;
  border-radius: 6px;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.order-management-layout {
  margin-bottom: 12px;
}

.orders-shell-card {
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(224, 136, 42, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(15, 98, 254, 0.08), transparent 20%),
    linear-gradient(180deg, #fbfcff 0%, #f4f7fc 100%);
  border-color: #d4dfef;
  box-shadow: 0 14px 34px rgba(19, 35, 63, 0.06);
}

.orders-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(420px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.orders-main-column,
.orders-side-column {
  min-width: 0;
}

.orders-main-column {
  display: grid;
  gap: 14px;
}

.orders-hero,
.orders-list-card,
.orders-side-card {
  border: 1px solid #d8e1ee;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(21, 38, 68, 0.05);
}

.orders-hero {
  padding: 18px 20px;
}

.orders-hero .toolbar-title {
  margin-bottom: 6px;
}

.orders-list-card {
  overflow: hidden;
}

.orders-list-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e2e8f3;
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.96) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.orders-list-head h3,
.orders-side-head h3 {
  margin: 0;
  color: #173056;
}

.orders-list-head #ordersFiltersSummary {
  max-width: 320px;
  text-align: right;
  font-size: 0.84rem;
  line-height: 1.45;
}

.orders-list-actions {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: flex-end;
}

.orders-list-actions #ordersFiltersSummary {
  margin: 0;
}

.orders-filter-row {
  padding: 14px 20px;
  border-bottom: 1px solid #e8edf6;
  background: rgba(248, 250, 255, 0.72);
}

.orders-filter-input {
  flex: 1 1 320px;
  min-width: 260px;
  max-width: none;
}

.orders-status-filter {
  position: relative;
  min-width: 220px;
}

.orders-status-trigger {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.orders-status-trigger::after {
  content: "▾";
  font-size: 0.78rem;
  opacity: 0.72;
}

.orders-status-filter.is-open .orders-status-trigger::after {
  content: "▴";
}

.orders-status-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  min-width: 240px;
  padding: 10px;
  border: 1px solid #d5dfef;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 28px rgba(21, 38, 68, 0.12);
}

.orders-status-shortcuts {
  display: flex;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e2e8f3;
}

.orders-status-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 10px;
  cursor: pointer;
}

.orders-status-option:hover {
  background: #f5f8ff;
}

.orders-status-option input { 
  margin: 0; 
} 

.weekly-person-option {
  min-width: 220px;
}

.orders-list-body {
  padding: 16px 20px 20px;
  min-height: clamp(800px, 70vh, 1240px);
}

.orders-empty-state {
  padding: 18px;
  border: 1px dashed #cfd8e8;
  border-radius: 14px;
  background: #fbfcff;
}

.orders-table-wrap {
  border: 1px solid #d9e2ef;
  border-radius: 16px;
  background: #ffffff;
}

.orders-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7faff;
}

.orders-side-column {
  position: sticky;
  top: 18px;
}

.orders-side-card {
  margin-bottom: 0;
  padding: 18px;
}

.orders-side-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.orders-form-mode {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf3ff;
  color: #173056;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.order-detail-panel {
  min-height: 360px;
}

.orders-detail-empty {
  padding: 16px;
  border: 1px dashed #cfd8e8;
  border-radius: 14px;
  background: #fbfcff;
}

.order-detail-card {
  display: grid;
  gap: 16px;
}

.order-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f3;
}

.order-detail-id {
  margin: 0;
  color: #173056;
  font-size: 1.05rem;
  font-weight: 800;
}

.order-detail-title {
  margin: 3px 0;
  font-weight: 700;
  color: #0f172a;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.order-detail-grid > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #e2e8f3;
  border-radius: 12px;
  background: #fbfcff;
}

.order-detail-grid span {
  color: var(--muted);
  font-size: 0.75rem;
}

.order-detail-grid strong {
  color: #173056;
  font-size: 0.92rem;
}

.order-detail-risk {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.order-detail-section {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.order-detail-section h4 {
  margin: 0;
  color: #173056;
}

.order-detail-actions-section {
  padding: 12px;
  border: 1px solid #e2e8f3;
  border-radius: 12px;
  background: #fbfcff;
}

.order-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-detail-steps {
  display: grid;
  gap: 8px;
  max-height: 280px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.order-detail-steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #e2e8f3;
  border-radius: 10px;
  background: #ffffff;
}

.order-detail-step-swatch {
  width: 8px;
  height: 36px;
  border-radius: 999px;
  background: var(--zone-color, #7d8ca3);
}

.order-detail-step-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.order-detail-step-title {
  overflow: hidden;
  color: #0f172a;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-detail-step-zone {
  color: var(--muted);
  font-size: 0.76rem;
}

.order-detail-step-hours {
  display: grid;
  gap: 3px;
  justify-items: end;
  white-space: nowrap;
}

.order-detail-step-hours span {
  color: var(--muted);
  font-size: 0.72rem;
}

.order-detail-step-hours strong {
  color: #173056;
  font-size: 0.82rem;
}

.orders-drawer {
  position: fixed;
  inset: 0;
  z-index: 110;
}

.orders-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 29, 43, 0.38);
  backdrop-filter: blur(2px);
}

.orders-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, 100vw);
  height: 100%;
  padding: 22px 18px 24px;
  background: #f9fbff;
  border-left: 1px solid #d7e1f4;
  box-shadow: -16px 0 40px rgba(19, 31, 52, 0.18);
  overflow-y: auto;
}

.orders-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.orders-drawer-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.orders-drawer .order-form-split {
  grid-template-columns: 1fr;
  gap: 16px;
}

.orders-drawer .order-form-main,
.orders-drawer .order-form-side {
  padding: 16px;
  border: 1px solid #dce4f0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.orders-drawer .order-form-side .field {
  margin-bottom: 0;
}

.orders-drawer .order-form-side .step-checklist {
  max-height: 420px;
  min-height: 320px;
  margin-top: 8px;
}

@media (max-width: 1180px) {
  .orders-shell {
    grid-template-columns: 1fr;
  }

  .orders-side-column {
    position: static;
  }

  .orders-list-head,
  .orders-drawer-head {
    flex-direction: column;
  }

  .orders-list-actions,
  .orders-drawer-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  .orders-list-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .order-detail-grid {
    grid-template-columns: 1fr;
  }

  .orders-drawer-panel {
    width: 100vw;
  }
}

.orders-form-meta {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f3;
}

.order-form-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
}

.order-form-main,
.order-form-side {
  min-width: 0;
}

.order-form-side .step-checklist {
  max-height: 540px;
  min-height: 420px;
}

.order-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-color-row input[type="color"] {
  width: 58px;
  min-width: 58px;
  height: 34px;
  border-radius: 8px;
  padding: 2px;
  border: 1px solid var(--line);
  background: #fff;
}

.order-color-presets {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-color-preset {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(30, 41, 59, 0.2);
  cursor: pointer;
  padding: 0;
}

.order-color-preset.selected {
  outline: 2px solid #1f2937;
  outline-offset: 1px;
}

.table-wrap {
  overflow-x: auto;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table th,
.orders-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px 6px;
  font-size: 0.92rem;
}

.orders-table th {
  color: var(--muted);
  font-weight: 600;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.order-row.is-closed {
  background: linear-gradient(90deg, rgba(226, 232, 240, 0.5), rgba(248, 250, 252, 0.9));
}

.order-row {
  cursor: pointer;
}

.order-row.is-selected {
  background: linear-gradient(90deg, rgba(15, 98, 254, 0.1), rgba(248, 250, 255, 0.94));
  box-shadow: inset 3px 0 0 #0f62fe;
}

.order-row.is-closed td {
  color: #64748b;
}

.order-color-pill {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(30, 41, 59, 0.25);
  vertical-align: middle;
  margin-right: 6px;
}

.order-id-cell {
  white-space: nowrap;
}

.order-color-liseret {
  display: inline-block;
  width: 6px;
  height: 22px;
  border-radius: 999px;
  background: var(--order-color, #94a3b8);
  vertical-align: middle;
  margin-right: 8px;
}

#skillsTable .order-color-pill {
  width: 20px;
  height: 20px;
}

.risk-pill {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  vertical-align: middle;
}

.risk-green {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.risk-orange {
  color: #9a3412;
  background: #ffedd5;
  border-color: #fdba74;
}

.risk-red {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}

.risk-neutral {
  color: #334155;
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.status-badge,
.delivery-commit {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge-prospect {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.status-badge-planned {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #93c5fd;
}

.status-badge-production {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}

.status-badge-delivered {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.status-badge-closed {
  color: #475569;
  background: #e2e8f0;
  border-color: #94a3b8;
}

.delivery-commit-pending {
  color: #64748b;
  background: #f8fafc;
  border-color: #cbd5e1;
}

.delivery-commit-confirmed {
  color: #92400e;
  background: #fef3c7;
  border-color: #fbbf24;
}

.order-state-warning {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn-close-order {
  color: #475569;
  border-color: rgba(100, 116, 139, 0.35);
  background: rgba(241, 245, 249, 0.8);
}

.row-selected {
  background: #eef4ff;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.toolbar-title {
  margin: 0;
  font-size: 1.15rem;
  color: #173056;
}

.toolbar-indicator {
  cursor: default;
  pointer-events: none;
  font-weight: 700;
}

.toolbar-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-filter {
  width: auto;
  min-width: 170px;
  max-width: 240px;
  flex: 0 0 auto;
}

.gantt-shell {
  --gantt-surface: linear-gradient(180deg, #fcfdff 0%, #f4f7fc 100%);
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(224, 136, 42, 0.1), transparent 26%),
    radial-gradient(circle at top right, rgba(15, 98, 254, 0.1), transparent 24%),
    var(--gantt-surface);
  border-color: #d4dfef;
  box-shadow: 0 14px 34px rgba(19, 35, 63, 0.06);
}

.gantt-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) minmax(420px, 1fr);
  gap: 16px 18px;
  align-items: end;
  margin-bottom: 14px;
}

.gantt-toolbar-head {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.gantt-toolbar-summary {
  margin: 0;
  max-width: 66ch;
  color: #52627a;
  font-size: 0.88rem;
}

.gantt-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.gantt-control-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid #d5e0f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(22, 37, 66, 0.06);
}

.gantt-control-cluster .btn {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 11px;
  font-weight: 700;
}

.gantt-control-cluster .btn.active {
  background: var(--gantt-accent);
  color: #fff;
  border-color: var(--gantt-accent);
}

.gantt-control-cluster-compact .btn {
  min-width: 42px;
}

.gantt-control-cluster-secondary {
  background: rgba(23, 48, 86, 0.04);
}

.gantt-zoom-label {
  min-width: 68px;
  padding: 0 4px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--gantt-accent);
  font-weight: 800;
}

.workspace-nav-card {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #ffffffee;
  backdrop-filter: blur(3px);
}

.workspace-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-nav-btn {
  border: 1px solid #c7d8ff;
  background: #eef4ff;
  color: var(--accent);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.workspace-nav-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);;
}

.workspace-panel.is-hidden {
  display: none;
}

.main-view.is-hidden {
  display: none;
}

[data-admin-page].is-hidden {
  display: none;
}

.kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.gantt-kpi-bar {
  gap: 10px;
  margin-bottom: 14px;
}

.gantt-skill-legend {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #d6dfec;
  border-radius: 16px 16px 0 0;
  border-bottom: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(245, 248, 253, 0.98) 100%);
}

.solver-debug-panel {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #d1dae8;
  border-radius: 10px;
  background: #f8fbff;
}

.solver-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.solver-debug-head h3 {
  margin: 0;
  font-size: 14px;
  color: #223853;
}

.solver-debug-status {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.solver-debug-status.ok {
  color: #0f5132;
  background: #d1e7dd;
}

.solver-debug-status.ko {
  color: #842029;
  background: #f8d7da;
}

.solver-debug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px 16px;
  font-size: 12px;
  color: #334a64;
}

.solver-debug-warnings {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.solver-debug-chip {
  background: #eef3fa;
  border: 1px solid #d7e0ed;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  color: #3b4f67;
}

.constraint-check-panel {
  margin-bottom: 0;
  padding: 12px 14px;
  border: 1px solid #d5dfef;
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(224, 136, 42, 0.06), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 251, 255, 0.96) 100%);
  box-shadow: 0 8px 20px rgba(21, 38, 68, 0.05);
  width: min(320px, 100%);
  min-width: 260px;
  align-self: flex-start;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.constraint-check-panel.is-collapsed {
  position: absolute;
  top: 14px;
  right: 0;
  z-index: 12;
  width: 0;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  pointer-events: none;
}

.constraint-check-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.constraint-check-head.compact {
  align-items: center;
}

.constraint-check-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.constraint-check-head h3 {
  margin: 0;
  font-size: 0.98rem;
  color: #173056;
}

.constraint-check-title-wrap {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.constraint-check-caption {
  color: #5b6c84;
  font-size: 0.78rem;
}

.constraint-check-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.constraint-check-status.ok {
  color: #0f5132;
  background: #d1e7dd;
}

.constraint-check-status.ko {
  color: #842029;
  background: #f8d7da;
}

.constraint-check-status.error {
  background: #fff3f2;
  color: #b42318;
}

.constraint-check-status.info {
  color: #1d4ed8;
  background: #eff6ff;
}

.constraint-check-status.pending {
  color: #9a3412;
  background: #fff7ed;
}

.constraint-check-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
  flex-direction: column;
}

.constraint-check-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.constraint-check-kpi {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  color: #38506f;
}

.constraint-check-severity {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.constraint-check-severity-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid #d9e2ef;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.73rem;
  font-weight: 700;
}

.constraint-check-severity-pill.severity-blocking {
  border-color: rgba(185, 28, 28, 0.18);
  background: #fff7f7;
  color: #991b1b;
}

.constraint-check-severity-pill.severity-warning {
  border-color: rgba(180, 83, 9, 0.18);
  background: #fff8f1;
  color: #9a3412;
}

.constraint-check-severity-pill.severity-info {
  border-color: rgba(37, 99, 235, 0.14);
  background: #f5f9ff;
  color: #1d4ed8;
}

.constraint-check-severity-empty {
  color: #64748b;
  font-size: 0.75rem;
}

.constraint-check-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.constraint-check-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #d7e0ed;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 11px;
  color: #334a64;
  font-weight: 700;
}

.constraint-check-summary-chip.severity-blocking {
  background: #fff5f5;
  border-color: #f0c7c7;
  color: #8f1d1d;
}

.constraint-check-summary-chip.severity-warning {
  background: #fff8ef;
  border-color: #f3d0aa;
  color: #9a4b00;
}

.constraint-check-details {
  border-top: 1px solid #e2e8f3;
  padding-top: 8px;
}

.constraint-check-details-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: #173056;
}

.constraint-check-details-summary::-webkit-details-marker {
  display: none;
}

.constraint-check-details-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
  color: #607189;
  font-size: 0.72rem;
}

.constraint-check-list {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.constraint-check-group {
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.constraint-check-group-summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.constraint-check-group-summary::-webkit-details-marker {
  display: none;
}

.constraint-check-group-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.constraint-check-group-badge.severity-blocking {
  background: #fee2e2;
  color: #991b1b;
}

.constraint-check-group-badge.severity-warning {
  background: #ffedd5;
  color: #9a3412;
}

.constraint-check-group-badge.severity-info {
  background: #dbeafe;
  color: #1d4ed8;
}

.constraint-check-group-code {
  font-size: 0.76rem;
  font-weight: 800;
  color: #496280;
}

.constraint-check-group-label {
  min-width: 0;
  font-weight: 700;
  color: #173056;
}

.constraint-check-group-count {
  min-width: 28px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf3ff;
  color: #173056;
  font-size: 0.76rem;
  font-weight: 800;
}

.constraint-check-group-help {
  padding: 0 14px 10px;
  color: #607189;
  font-size: 0.75rem;
}

.constraint-check-group-list {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.constraint-check-item {
  padding: 10px;
  border: 1px solid #dee5f0;
  border-radius: 12px;
  background: #ffffff;
}

.constraint-check-item.is-primary {
  border-color: #c9d8f4;
  box-shadow: 0 10px 18px rgba(30, 58, 108, 0.05);
}

.constraint-check-item.is-focused {
  border-color: #1d4ed8;
  box-shadow:
    0 0 0 2px rgba(29, 78, 216, 0.16),
    0 12px 24px rgba(29, 78, 216, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
}

.constraint-check-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.constraint-check-item-message {
  color: #24364f;
  font-size: 0.8rem;
  line-height: 1.45;
  font-weight: 600;
}

.constraint-check-item-code {
  white-space: nowrap;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 800;
}

.constraint-check-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.constraint-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 700;
}

.constraint-check-pill-swatch {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: var(--constraint-pill-color, #94a3b8);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 0 0 1px rgba(15, 23, 42, 0.18);
}

.constraint-check-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.constraint-check-action {
  min-height: 30px;
  font-size: 0.72rem;
  font-weight: 800;
}

.constraint-check-empty {
  padding: 16px 18px;
  border: 1px dashed #c8d4e6;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: #51627b;
}

.constraint-check-inline-message {
  font-size: 0.8rem;
}

.constraint-check-body.is-collapsed {
  display: none;
}

.constraint-check-toggle {
  white-space: nowrap;
}

.constraint-check-collapsed-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(190, 203, 226, 0.92);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(224, 136, 42, 0.15), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 248, 255, 0.96) 100%);
  box-shadow: 0 18px 38px rgba(18, 32, 58, 0.16);
  backdrop-filter: blur(10px);
}

.constraint-check-collapsed-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #61738e;
}

.constraint-check-collapsed-main {
  display: grid;
  gap: 10px;
}

.constraint-check-collapsed-actions {
  display: grid;
  gap: 8px;
}

.constraint-check-toggle-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c7d5eb;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #173056;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.constraint-check-toggle-compact:disabled {
  cursor: wait;
  opacity: 0.74;
}

.constraint-check-toggle-secondary {
  background: rgba(247, 250, 255, 0.92);
}

.constraint-check-toggle-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.constraint-check-toggle-copy strong {
  font-size: 0.86rem;
}

.constraint-check-toggle-copy span {
  font-size: 0.72rem;
  color: #5b6c84;
}

.constraint-check-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #173056;
  color: #ffffff;
  font-size: 1.1rem;
  line-height: 1;
  flex: 0 0 auto;
}

.constraint-check-collapsed-summary {
  font-size: 0.78rem;
  line-height: 1.45;
  color: #314764;
}

.constraint-check-collapsed-meta,
.constraint-check-collapsed-severity,
.constraint-check-collapsed-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.constraint-check-collapsed-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #d7e0ed;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.7rem;
  color: #48607f;
}

.constraint-check-collapsed-top .constraint-check-summary-chip {
  background: rgba(255, 255, 255, 0.92);
}

@media (max-width: 900px) {
  .constraint-check-panel {
    width: 100%;
    min-width: 0;
    position: static;
    max-height: none;
  }

  .constraint-check-panel.is-collapsed {
    position: static;
    width: 0;
  }

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

  .constraint-check-kpis {
    justify-content: flex-start;
  }

  .constraint-check-group-summary {
    grid-template-columns: 1fr;
  }

  .constraint-check-details-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .constraint-check-details-meta {
    justify-content: flex-start;
  }

  .gantt-layout {
    grid-template-columns: 1fr;
  }
}

.skill-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.74rem;
  color: #1f2937;
}

.skill-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.skill-legend-count {
  font-weight: 700;
  opacity: 0.78;
}

.gantt-planned-orders-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #30415d;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.gantt-backlog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 2px dashed transparent;
  border-radius: 14px;
  padding: 10px 12px;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.gantt-backlog-subtitle {
  margin-top: 3px;
  font-size: 0.76rem;
  color: #5d6e86;
}

.gantt-backlog-filters {
  justify-content: flex-end;
}

.gantt-planned-orders-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gantt-backlog-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 6px;
  border: 2px dashed transparent;
  border-radius: 14px;
  padding: 10px;
  padding-bottom: 2px;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.gantt-backlog-list.is-drop-target {
  border-color: #54708f;
  background: linear-gradient(135deg, rgba(84, 112, 143, 0.08), rgba(84, 112, 143, 0.02));
  box-shadow: inset 0 0 0 1px rgba(84, 112, 143, 0.08);
}

.gantt-backlog-list.is-disabled {
  border-color: rgba(93, 110, 134, 0.18);
  background: linear-gradient(135deg, rgba(93, 110, 134, 0.08), rgba(93, 110, 134, 0.03));
}

.gantt-backlog-disabled-note {
  margin-top: 6px;
  padding: 9px 12px;
  border: 1px solid rgba(93, 110, 134, 0.2);
  border-radius: 12px;
  background: rgba(93, 110, 134, 0.06);
  color: #4b5f7b;
  font-size: 0.74rem;
  font-weight: 600;
}

.gantt-planned-order-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--planned-order-color, #0f62fe) 30%, #dbe3ef);
  background: color-mix(in srgb, var(--planned-order-color, #0f62fe) 10%, #ffffff);
  color: #1f2937;
  font-size: 0.75rem;
  font-weight: 600;
}

.gantt-planned-order-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--planned-order-color, #0f62fe);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.gantt-planned-order-text {
  min-width: 0;
}

.gantt-backlog-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--planned-order-color, #0f62fe) 18%, #dbe3ef);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--planned-order-color, #0f62fe) 12%, #ffffff),
    #f8fbff
  );
  color: #1f2937;
  text-align: left;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: 0 8px 16px rgba(17, 24, 39, 0.04);
}

.gantt-backlog-item:active {
  cursor: grabbing;
}

.gantt-backlog-item.is-dragging {
  opacity: 0.96;
  transform: translateY(-2px) scale(1.02) rotate(-1deg);
  border-color: #173056;
  background:
    linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
  box-shadow:
    0 0 0 3px rgba(23, 48, 86, 0.16),
    0 18px 32px rgba(15, 35, 70, 0.22);
  z-index: 4;
}

.gantt-backlog-item.is-disabled {
  cursor: not-allowed;
  opacity: 0.72;
  box-shadow: none;
}

.gantt-backlog-item.is-disabled:active {
  cursor: not-allowed;
}

.gantt-backlog-item-main {
  display: grid;
  gap: 1px;
  min-width: 0;
  flex: 1;
  user-select: none;
  -webkit-user-select: none;
}

.gantt-backlog-item-meta {
  font-size: 0.68rem;
  color: #5a6d87;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-backlog-item .gantt-planned-order-text {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.72rem;
  font-weight: 700;
}

.kpi-card {
  border: 1px solid #d8e1ee;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 14px;
  box-shadow: 0 12px 22px rgba(19, 35, 63, 0.05);
}

.kpi-card.alert {
  border-color: #f1b1b1;
  background: linear-gradient(180deg, #fff8f8 0%, #fff1f1 100%);
}

.kpi-card.is-hidden {
  display: none;
}

.constraint-check-kpi-card {
  min-width: min(280px, 100%);
}

.constraint-check-kpi-card .constraint-check-collapsed-card {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.constraint-check-kpi-card .constraint-check-collapsed-main {
  gap: 8px;
}

.constraint-check-kpi-card .constraint-check-toggle-compact {
  padding: 8px 10px;
}

.constraint-check-kpi-card .constraint-check-collapsed-summary {
  font-size: 0.74rem;
}

.constraint-check-kpi-card .constraint-check-collapsed-meta-pill {
  font-size: 0.68rem;
}

.kpi-label {
  color: #5a6c86;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  margin-top: 6px;
  color: #132543;
}

.kpi-sub {
  margin-top: 4px;
  color: #6a788a;
  font-size: 0.74rem;
}

.gantt-wrap {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #d4dfef;
  border-radius: 18px;
  overflow-x: hidden;
  overflow-y: visible;
  width: 100%;
  position: relative;
  box-shadow: 0 18px 38px rgba(18, 32, 58, 0.08);
}

.gantt-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: start;
}

.gantt-layout.constraint-panel-collapsed {
  grid-template-columns: minmax(0, 1fr) 0;
  gap: 0;
}

.gantt-sticky-header {
  position: sticky;
  top: 0;
  z-index: 8;
  background: rgba(248, 250, 254, 0.96);
  padding-right: var(--gantt-scrollbar-width, 0px);
  backdrop-filter: blur(8px);
}

.gantt-header {
  display: flex;
  border-bottom: 1px solid #dce4f0;
  background: rgba(255, 255, 255, 0.84);
}

.gantt-scroll-body {
  background: rgba(255, 255, 255, 0);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 800px;
  max-height: clamp(800px, 74vh, 1240px);
  scrollbar-gutter: stable;
}

.gantt-op-col {
  width: 146px;
  flex-shrink: 0;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #4c5d77;
  border-right: 1px solid var(--line);
  background: #edf3ff;
}

.gantt-op-col-sub {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  text-transform: none;
}

.gantt-weeks {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--gantt-day-columns, 1), minmax(0, 1fr));
  grid-template-rows: auto auto;
  min-width: 0;
}

.gantt-week {
  grid-row: 1;
  text-align: center;
  padding: 6px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #30415d;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(237, 243, 255, 0.85), rgba(255, 255, 255, 0.7));
}

.gantt-week-number {
  font-size: 0.73rem;
  font-weight: 800;
}

.gantt-week-label {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--muted);
}

.gantt-day {
  grid-row: 2;
  min-width: 0;
  padding: 5px 2px 6px;
  text-align: center;
  border-top: 1px solid rgba(220, 228, 240, 0.9);
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.gantt-day.is-week-start {
  box-shadow: inset 1px 0 0 rgba(76, 93, 119, 0.18);
}

.gantt-day.is-today {
  background: rgba(219, 234, 254, 0.95);
}

.gantt-day-name {
  overflow: hidden;
  font-size: 0.66rem;
  font-weight: 700;
  color: #41536f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-day-date {
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 700;
  color: #17325c;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-day-capacity {
  overflow: hidden;
  margin-top: 1px;
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-row {
  display: flex;
  border-bottom: 1px solid var(--line);
  min-height: 56px;
  background: linear-gradient(to right, var(--skill-tint, transparent) 0%, var(--skill-tint, transparent) 60%, transparent 100%);
}

.gantt-zone-row {
  display: flex;
  min-height: 32px;
  border-bottom: 1px solid var(--line);
  background: #eef3fb;
}

.gantt-zone-label {
  width: 146px;
  flex-shrink: 0;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #2a3f61;
  border-right: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gantt-zone-fill {
  flex: 1;
  min-width: 0;
}

.gantt-row:last-child {
  border-bottom: none;
}

.gantt-op {
  width: 146px;
  flex-shrink: 0;
  padding: 8px 10px;
  font-size: 0.84rem;
  font-weight: 700;
  border-right: 1px solid var(--skill-border, var(--line));
  border-left: 3px solid var(--skill-color, #7d8ca3);
  background: #f6f9ff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gantt-op-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-op-sub {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
}

.gantt-op-capacity {
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #30415d;
}

.gantt-op-competency-btn {
  margin-top: 4px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  padding: 0;
  font-size: 0.62rem;
  font-weight: 700;
  border: 1px solid rgba(31, 41, 55, 0.25);
  background: rgba(255, 255, 255, 0.78);
  color: #1f2937;
  line-height: 1;
  cursor: pointer;
}

.gantt-op-competency-btn:hover {
  background: rgba(255, 255, 255, 0.95);
}

.gantt-timeline {
  position: relative;
  flex: 1;
  min-height: 56px;
  min-width: 0;
  overflow: hidden;
}

.gantt-skill-band {
  position: absolute;
  inset: 0;
  background: var(--skill-tint);
  pointer-events: none;
}

.gantt-bar {
  position: absolute;
  top: 11px;
  height: 34px;
  z-index: 4;
  border-radius: 5px;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.gantt-bar[data-mode='task'] {
  cursor: grab;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  min-width: 18px;
  touch-action: none;
}

.gantt-bar[data-mode='task']:active {
  cursor: grabbing;
}

.gantt-bar[data-mode='task'].is-locked,
.gantt-bar[data-mode='task'].is-locked:active {
  cursor: pointer;
}

.gantt-bar[data-mode='task'].is-locked-denied {
  cursor: not-allowed;
  animation: gantt-locked-denied-shake 0.3s ease;
}

.gantt-bar[data-mode='task'].is-locked-denied::after {
  content: '\1F512';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  background: rgba(220, 38, 38, 0.32);
  pointer-events: none;
}

@keyframes gantt-locked-denied-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.gantt-bar[data-mode='task'].is-resizing {
  cursor: ew-resize;
}

.gantt-bar[data-mode='task'].has-resize-handle {
  padding-left: 16px;
  padding-right: 16px;
}

.gantt-bar[data-mode='task'].has-resize-handle .bar-label {
  padding-left: 6px;
  padding-right: 6px;
}

.gantt-bar[data-mode='task'].is-skill-mismatch {
  border: 2px solid rgba(220, 38, 38, 0.85);
  box-shadow: inset 0 0 0 1px rgba(127, 29, 29, 0.35);
}

.gantt-bar[data-mode='task'].is-split-fragment {
  border-style: dashed;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 1px 2px rgba(0, 0, 0, 0.18);
}

.gantt-bar[data-mode='task'].is-split-fragment::before,
.gantt-bar[data-mode='task'].is-split-fragment::after {
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.96);
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

.gantt-bar[data-mode='task'].is-split-fragment.continues-before {
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
}

.gantt-bar[data-mode='task'].is-split-fragment.continues-before::before {
  content: '<';
  left: 2px;
  display: flex;
  border-radius: 3px 0 0 3px;
}

.gantt-bar[data-mode='task'].is-split-fragment.continues-after {
  border-top-right-radius: 2px;
  border-bottom-right-radius: 2px;
}

.gantt-bar[data-mode='task'].is-split-fragment.continues-after::after {
  content: '>';
  right: 2px;
  display: flex;
  border-radius: 0 3px 3px 0;
}

.gantt-bar .bar-warning {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #b91c1c;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.gantt-bar .bar-linked-badge {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.bar-resize-handle {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 10px;
  border-radius: 0 4px 4px 0;
  cursor: ew-resize;
  background: linear-gradient(to right, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.22));
  border-left: 1px solid rgba(15, 23, 42, 0.24);
  opacity: 0.7;
  z-index: 3;
}

.bar-resize-handle:hover {
  opacity: 1;
}

.bar-resize-handle-start {
  left: 1px;
  right: auto;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(to left, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.22));
  border-left: 0;
  border-right: 1px solid rgba(15, 23, 42, 0.24);
}

.bar-resize-handle-end {
  right: 1px;
  left: auto;
}

body.is-task-resizing,
body.is-task-resizing * {
  cursor: ew-resize !important;
  user-select: none;
}

body.is-gantt-panning,
body.is-gantt-panning * {
  cursor: grabbing !important;
  user-select: none;
}

.gantt-bar[data-mode='task'][data-label-mode='compact'] .bar-label {
  font-size: 0.7rem;
}

.gantt-bar[data-mode='task'][data-label-mode='code'] {
  padding: 0 5px;
}

.gantt-bar[data-mode='task'][data-label-mode='code'] .bar-label {
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 800;
}

.gantt-bar[data-mode='task'][data-label-mode='dot'] {
  padding: 0;
  justify-content: center;
}

.gantt-bar[data-mode='task'][data-label-mode='dot'] .bar-label {
  font-size: 0.9rem;
  line-height: 1;
}

.gantt-bar.is-dragging {
  opacity: 1;
  transform: translateY(-2px) scale(1.03);
  outline: 2px solid rgba(255, 255, 255, 0.96);
  outline-offset: 1px;
  border-color: rgba(15, 23, 42, 0.42);
  filter: saturate(1.18) brightness(1.04);
  box-shadow:
    0 0 0 4px rgba(23, 48, 86, 0.14),
    0 18px 30px rgba(15, 35, 70, 0.30);
  z-index: 10;
}

body.is-gantt-task-dragging .gantt-bar[data-mode='task']:not(.is-dragging),
body.is-gantt-task-dragging .gantt-backlog-item:not(.is-dragging) {
  opacity: 0.5;
  filter: saturate(0.82);
}

body.is-gantt-task-dragging,
body.is-gantt-task-dragging * {
  cursor: grabbing !important;
}

body.is-gantt-task-dragging .gantt-bar[data-mode='task'].is-locked {
  cursor: not-allowed !important;
}

body.is-gantt-task-dragging .gantt-timeline {
  transition: box-shadow 120ms ease, background-color 120ms ease;
}

.gantt-drag-ghost {
  position: fixed !important;
  inset: auto auto auto auto;
  margin: 0;
  pointer-events: none;
  z-index: 1200;
  opacity: 0.96;
  transform: translate3d(0, 0, 0) rotate(-2deg);
  transform-origin: center center;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.92),
    0 22px 42px rgba(15, 23, 42, 0.28) !important;
  filter: saturate(1.08);
}

.gantt-drag-ghost.gantt-bar {
  top: 0;
  left: 0;
}

.gantt-drag-ghost.gantt-backlog-item {
  width: 210px;
  min-width: 210px;
  max-width: 210px;
}

.gantt-bar.is-order-committed {
  box-shadow:
    inset 0 0 0 2px rgba(251, 191, 36, 0.82),
    0 1px 2px rgba(0, 0, 0, 0.2);
}

.gantt-bar.is-order-closed {
  opacity: 0.48;
  filter: saturate(0.2) grayscale(0.3);
  border: 1px dashed rgba(51, 65, 85, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.42),
    0 1px 2px rgba(15, 23, 42, 0.14);
}

.gantt-bar.is-deemphasized {
  opacity: 0.28;
  filter: saturate(0.35) brightness(1.04);
}

.gantt-bar.is-locked {
  box-shadow:
    inset 0 0 0 2px rgba(15, 23, 42, 0.5),
    inset 0 4px 0 rgba(15, 23, 42, 0.2),
    0 2px 5px rgba(0, 0, 0, 0.26);
}

.gantt-bar.selected {
  outline: 3px solid #0f172a;
  outline-offset: 2px;
  z-index: 8;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.82),
    0 12px 22px rgba(15, 23, 42, 0.28);
}

.gantt-bar .bar-non-working-gap {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(0, 0, 0, 0.24) 0 5px,
    rgba(255, 255, 255, 0.22) 5px 10px
  );
  pointer-events: none;
  z-index: 1;
}

.gantt-bar.is-diagnostic-highlight,
.gantt-timeline.is-diagnostic-highlight,
.gantt-row.is-diagnostic-highlight {
  animation: gantt-diagnostic-pulse 2s ease-out;
}

.gantt-bar.is-diagnostic-focus-target {
  z-index: 9;
  outline: 3px solid rgba(245, 158, 11, 0.95);
  outline-offset: 2px;
  border-color: rgba(146, 64, 14, 0.85);
  filter: saturate(1.2) brightness(1.08);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.02) 100%),
    linear-gradient(90deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0) 100%);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.94),
    0 0 0 8px rgba(15, 98, 254, 0.28),
    0 18px 28px rgba(15, 23, 42, 0.3);
  animation: gantt-diagnostic-target-pulse 2s ease-out;
}

.gantt-row.is-diagnostic-focus-target {
  background:
    linear-gradient(90deg, rgba(245, 158, 11, 0.14) 0%, rgba(245, 158, 11, 0.05) 24%, transparent 56%),
    linear-gradient(to right, var(--skill-tint, transparent) 0%, var(--skill-tint, transparent) 60%, transparent 100%);
}

.gantt-row.is-diagnostic-highlight .gantt-op {
  box-shadow:
    inset 0 0 0 2px rgba(15, 98, 254, 0.18),
    0 0 0 1px rgba(15, 98, 254, 0.08);
  background: linear-gradient(180deg, rgba(238, 244, 255, 0.96) 0%, rgba(249, 251, 255, 0.98) 100%);
}

@keyframes gantt-diagnostic-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 98, 254, 0.4);
    transform: scale(1);
  }
  24% {
    box-shadow:
      0 0 0 6px rgba(15, 98, 254, 0.18),
      0 8px 18px rgba(15, 23, 42, 0.24);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 98, 254, 0);
    transform: scale(1);
  }
}

@keyframes gantt-diagnostic-target-pulse {
  0% {
    transform: scale(1);
    outline-color: rgba(245, 158, 11, 0.95);
    filter: saturate(1.12) brightness(1.04);
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 0.94),
      0 0 0 8px rgba(15, 98, 254, 0.42),
      0 0 0 0 rgba(15, 98, 254, 0.32),
      0 18px 28px rgba(15, 23, 42, 0.3);
  }
  25% {
    transform: scale(1.05);
    outline-color: rgba(249, 115, 22, 1);
    filter: saturate(1.28) brightness(1.12);
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 0.98),
      0 0 0 10px rgba(15, 98, 254, 0.48),
      0 0 0 18px rgba(15, 98, 254, 0.18),
      0 22px 34px rgba(15, 23, 42, 0.34);
  }
  55% {
    transform: scale(1.02);
    outline-color: rgba(245, 158, 11, 0.92);
    filter: saturate(1.18) brightness(1.08);
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 0.96),
      0 0 0 9px rgba(15, 98, 254, 0.28),
      0 0 0 12px rgba(15, 98, 254, 0.12),
      0 18px 28px rgba(15, 23, 42, 0.28);
  }
  100% {
    transform: scale(1);
    outline-color: rgba(245, 158, 11, 0.3);
    filter: saturate(1) brightness(1);
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 0.94),
      0 0 0 8px rgba(15, 98, 254, 0.28),
      0 0 0 0 rgba(15, 98, 254, 0),
      0 18px 28px rgba(15, 23, 42, 0.3);
  }
}

.bar-progress-track {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.34);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    inset 0 -1px 1px rgba(15, 23, 42, 0.24);
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
}

.bar-progress-fill {
  display: block;
  width: var(--task-progress-pct, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fde68a 0%, #fbbf24 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 0 1px rgba(146, 64, 14, 0.08);
}

.bar-phase {
  display: inline-block;
  min-width: 16px;
  text-align: center;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
}

.bar-label {
  position: relative;
  z-index: 3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-lock {
  position: relative;
  z-index: 2;
  display: inline-block;
  margin-right: 0.28rem;
  line-height: 1;
  vertical-align: text-top;
}

.bar-a {
  background: #0f62fe;
}

.bar-b {
  background: #ff8c24;
}

.bar-c {
  background: #16a34a;
}

.absence {
  box-sizing: border-box;
  display: inline-block;
  width: 11px;
  height: 11px;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(185, 28, 28, 0.55);
  background:
    repeating-linear-gradient(
      -55deg,
      rgba(255, 255, 255, 0.36) 0 3px,
      rgba(255, 255, 255, 0.08) 3px 6px
    ),
    linear-gradient(180deg, rgba(239, 68, 68, 0.42) 0%, rgba(220, 38, 38, 0.54) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(185, 28, 28, 0.08);
}

.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
}

.gantt-day-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0.5px;
  background: rgba(20, 40, 80, 0.12);
  pointer-events: none;
}

.gantt-week-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(20, 40, 80, 0.24);
  pointer-events: none;
}

.gantt-slot-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0.14), rgba(59, 130, 246, 0.28), rgba(59, 130, 246, 0.14));
  pointer-events: none;
  z-index: 1;
}

.gantt-resize-slot-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, rgba(14, 165, 233, 0.18), rgba(14, 165, 233, 0.42), rgba(14, 165, 233, 0.18));
  pointer-events: none;
  z-index: 2;
}

.gantt-non-working-slot {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-left: 1px solid rgba(100, 116, 139, 0.14);
  border-right: 1px solid rgba(100, 116, 139, 0.08);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(100, 116, 139, 0.18) 0 6px,
      rgba(241, 245, 249, 0.34) 6px 12px
    ),
    rgba(226, 232, 240, 0.48);
  pointer-events: none;
  z-index: 1;
}

.gantt-absence-block {
  position: absolute;
  top: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(185, 28, 28, 0.55);
  background:
    repeating-linear-gradient(
      -55deg,
      rgba(255, 255, 255, 0.36) 0 8px,
      rgba(255, 255, 255, 0.08) 8px 16px
    ),
    linear-gradient(180deg, rgba(239, 68, 68, 0.42) 0%, rgba(220, 38, 38, 0.54) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(185, 28, 28, 0.08);
  pointer-events: none;
  z-index: 4;
}

.gantt-absence-label {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.82);
  color: #fff7f7;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.gantt-calendar-closure-block {
  position: absolute;
  top: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(71, 85, 105, 0.34);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(148, 163, 184, 0.2) 0 7px,
      rgba(241, 245, 249, 0.5) 7px 14px
    ),
    rgba(226, 232, 240, 0.72);
  pointer-events: none;
  z-index: 2;
}

.gantt-calendar-closure-block.is-holiday {
  border-color: rgba(14, 116, 144, 0.38);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(103, 232, 249, 0.22) 0 7px,
      rgba(236, 254, 255, 0.62) 7px 14px
    ),
    rgba(207, 250, 254, 0.72);
}

.gantt-calendar-closure-label {
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.66);
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.gantt-timeline.drop-target {
  background: linear-gradient(to right, rgba(34, 197, 94, 0.07), transparent 40%);
  outline: 1px dashed rgba(22, 163, 74, 0.45);
  outline-offset: -2px;
}

.gantt-timeline.drop-forbidden {
  background: linear-gradient(to right, rgba(239, 68, 68, 0.08), transparent 40%);
  outline: 1px dashed rgba(220, 38, 38, 0.45);
  outline-offset: -2px;
}

.gantt-drop-day {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
  background: transparent;
}

.gantt-timeline .gantt-drop-day[data-slot-index="0"] {
  background: transparent;
}

.gantt-drop-day.eligible {
  background: rgba(34, 197, 94, 0.14);
  outline: 1px solid rgba(22, 163, 74, 0.55);
  outline-offset: -1px;
}

.gantt-drop-day.forbidden {
  background: rgba(239, 68, 68, 0.14);
  outline: 1px solid rgba(220, 38, 38, 0.5);
  outline-offset: -1px;
}

.gantt-drop-preview {
  position: absolute;
  top: 8px;
  height: 40px;
  border-radius: 7px;
  border: 2px dashed rgba(15, 23, 42, 0.55);
  pointer-events: none;
  z-index: 5;
}

.gantt-drop-preview.eligible {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(22, 163, 74, 0.68);
}

.gantt-drop-preview.gantt-resize-preview {
  z-index: 11;
}

.gantt-drop-preview.forbidden {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(220, 38, 38, 0.68);
}

.gantt-inline-field {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #4a607f;
}

.gantt-inline-field input,
.gantt-inline-field select {
  min-width: 88px;
}

.gantt-chassis-row {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 6;
  min-height: 30px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

.gantt-delivery-row {
  display: flex;
  position: sticky;
  top: 30px;
  z-index: 5;
  min-height: 30px;
  border-bottom: 1px solid var(--line);
  background: #fffdf6;
}

.gantt-chassis-op-col {
  width: 146px;
  flex-shrink: 0;
  padding: 7px 10px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #4a607f;
  text-transform: uppercase;
  border-right: 1px solid var(--line);
  background: #edf3ff;
}

.gantt-delivery-op-col {
  width: 146px;
  flex-shrink: 0;
  padding: 7px 10px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #7c4a03;
  text-transform: uppercase;
  border-right: 1px solid var(--line);
  background: #fff7db;
}

.gantt-chassis-track {
  position: relative;
  flex: 1;
  min-width: 0;
}

.gantt-delivery-track {
  position: relative;
  flex: 1;
  min-width: 0;
}

.gantt-chassis-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
  background: rgba(20, 40, 80, 0.18);
  pointer-events: none;
}

.gantt-delivery-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
  background: rgba(146, 64, 14, 0.18);
  pointer-events: none;
}

.gantt-chassis-marker { 
  position: absolute; 
  top: 50%; 
  left: 0; 
  width: 12px;
  height: 12px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 2px;
  background: var(--chassis-marker-color, #0f62fe);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  cursor: help;
  pointer-events: auto; 
  z-index: 3; 
} 

.gantt-chassis-marker.is-unconfirmed {
  border-style: dashed;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0 28%, var(--chassis-marker-color, #0f62fe) 28% 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65), 0 1px 2px rgba(15, 23, 42, 0.18);
  opacity: 0.8;
}

.gantt-delivery-marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.22);
  border-radius: 999px;
  background: var(--delivery-marker-color, #f59e0b);
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 1px 3px rgba(15, 23, 42, 0.22);
  cursor: help;
  pointer-events: auto;
  z-index: 3;
}

.gantt-delivery-marker.is-closed {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 0 4px rgba(148, 163, 184, 0.48);
}
 
.planifab-about-modal,
.competency-modal { 
  position: fixed; 
  inset: 0; 
  z-index: 80;
}

.planifab-about-modal {
  z-index: 130;
}

.planifab-about-backdrop,
.competency-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(3px);
}

.planifab-about-card,
.competency-modal-card {
  position: relative;
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  margin: 18px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.28);
}

.planifab-about-card {
  width: min(820px, calc(100vw - 28px));
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow:
    0 28px 70px rgba(15, 23, 42, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.82) inset;
}

.planifab-about-head,
.competency-modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f6f9ff;
}

.planifab-about-head {
  padding: 18px 20px;
  border-bottom: 1px solid #dbe6f4;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--tenant-brand-color) 12%, #ffffff) 0%, #ffffff 62%);
}

.planifab-about-head h2,
.competency-modal-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #243f6b;
}

.planifab-about-head h2 {
  font-size: 1.35rem;
  letter-spacing: 0;
}

.planifab-about-head .panel-kicker {
  margin-bottom: 3px;
}

.planifab-about-body,
.competency-modal-body {
  padding: 12px 14px 14px;
  display: grid;
  gap: 10px;
}

.planifab-about-body {
  padding: 18px 20px 20px;
  gap: 16px;
}

.planifab-about-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.planifab-about-meta div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.planifab-about-meta dt {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.planifab-about-meta dd {
  margin: 0;
  color: #172033;
  font-weight: 650;
  word-break: break-word;
}

.planifab-about-body h3 {
  margin: 2px 0 -2px;
  font-size: 1rem;
  color: #334155;
}

.planifab-about-changes {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: #334155;
}

.planifab-about-changes.planifab-release-history {
  gap: 12px;
  padding-left: 0;
  list-style: none;
}

.planifab-release-entry {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.planifab-release-entry:first-child {
  border-top: 1px solid color-mix(in srgb, var(--tenant-brand-color) 38%, #dbeafe);
}

.planifab-release-entry.is-current {
  border-color: color-mix(in srgb, var(--tenant-brand-color) 42%, #bfdbfe);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--tenant-brand-color) 8%, #ffffff) 0%, #ffffff 52%);
  box-shadow:
    0 12px 26px rgba(15, 23, 42, 0.08),
    inset 4px 0 0 var(--tenant-brand-color);
}

.planifab-release-heading {
  color: #173056;
  font-size: 0.9rem;
  font-weight: 800;
}

.planifab-release-title {
  margin: 0;
  color: #172033;
  font-size: 0.92rem;
  font-weight: 750;
}

.planifab-release-changes {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: #334155;
}

.planifab-release-changes li::marker {
  color: var(--tenant-brand-color);
}

.competency-modal-group h4 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: #334155;
}

.competency-modal-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.competency-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.74rem;
  border: 1px solid #dbe3ef;
  background: #f8fbff;
  color: #1f2937;
}

.competency-pill.level-2 {
  border-color: rgba(39, 174, 96, 0.45);
  background: rgba(39, 174, 96, 0.12);
}

.competency-pill.level-1 {
  border-color: rgba(242, 153, 74, 0.45);
  background: rgba(242, 153, 74, 0.14);
}

.gantt-legend {
  border-top: 1px solid var(--line);
  background: #f9fbff;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 10px;
  font-size: 0.76rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}

.legend-dot.today {
  width: 3px;
  border-radius: 0;
  background: #ef4444;
}

.gantt-selection {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 24;
  width: min(380px, 38vw);
  max-height: none;
  border: 1px solid #d7e0ed;
  border-right: none;
  border-radius: 18px 0 0 18px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 253, 0.98) 100%);
  min-width: 0;
  overflow: auto;
  box-shadow: -18px 0 36px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
}

.gantt-selection.is-closed {
  display: none;
}

.gantt-selection.is-pinned {
  border-style: solid;
}

.gantt-selection-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.gantt-selection-header .selection-title {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: #173056;
}

.gantt-selection-controls {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.gantt-selection-body {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gantt-selection.is-collapsed .gantt-selection-body {
  display: none;
}

@media (min-width: 1024px) {
  .gantt-selection {
    position: fixed;
    top: var(--gantt-panel-fixed-top, 140px);
    right: var(--gantt-panel-fixed-right, 18px);
    bottom: var(--gantt-panel-fixed-bottom, 16px);
    width: min(380px, 34vw);
    max-width: calc(100vw - 32px);
  }
}

@media (max-width: 1080px) {
  .gantt-toolbar {
    grid-template-columns: 1fr;
  }

  .gantt-toolbar-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .gantt-shell {
    padding: 14px;
  }

  .gantt-control-cluster {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .gantt-control-cluster .btn {
    flex: 1 1 auto;
  }

  .gantt-zoom-label {
    flex: 0 0 64px;
  }
}

.selection-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #173056;
}

.selection-section {
  padding: 14px;
  border: 1px solid rgba(216, 225, 238, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.selection-section-warning {
  display: contents;
}

.selection-grid {
  display: grid;
  gap: 10px 12px;
  font-size: 0.84rem;
}

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

.selection-fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.selection-fact-wide {
  grid-column: 1 / -1;
}

.selection-fact-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}

.selection-fact-value {
  min-width: 0;
  color: #0f172a;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.selection-warning {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(185, 28, 28, 0.35);
  background: rgba(254, 242, 242, 0.9);
  color: #991b1b;
  font-weight: 600;
  font-size: 0.76rem;
}

.selection-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.selection-actions-toolbar {
  display: flex;
  justify-content: flex-start;
}

.selection-actions-grid {
  display: grid;
  gap: 12px;
}

.selection-progress-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.selection-progress-group-stacked {
  padding-top: 2px;
}

.selection-group-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.selection-group-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.selection-group-caption {
  font-size: 0.73rem;
  color: #64748b;
}

.selection-group-resource-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.selection-progress-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selection-progress-buttons-duration {
  align-items: center;
}

.selection-duration-input {
  width: 92px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.82rem;
  background: #fff;
}

.selection-multi-select {
  position: relative;
  min-width: 0;
}

.selection-multi-select[open] {
  z-index: 10;
}

.selection-multi-select-trigger {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 0.8rem;
  color: var(--text);
}

.selection-multi-select-trigger::-webkit-details-marker {
  display: none;
}

.selection-multi-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 100%;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.selection-group-resource-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 0.78rem;
}

.selection-group-resource-option:hover {
  background: #f8fafc;
}

.selection-resource-level {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef3fb;
  color: #244266;
  font-size: 0.7rem;
  font-weight: 700;
}

.selection-resource-incompatible {
  padding: 2px 6px;
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.7rem;
  font-weight: 700;
}

.selection-multi-select-summary {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
}

@media (max-width: 640px) {
  .selection-grid-facts {
    grid-template-columns: 1fr;
  }

  .selection-fact-wide {
    grid-column: auto;
  }
}

.quick-absence-card {
  border-color: #d8e1ee;
  background:
    radial-gradient(circle at top right, rgba(224, 136, 42, 0.08), transparent 28%),
    linear-gradient(180deg, #fbfcff 0%, #f5f8fd 100%);
}

.quick-absence-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.quick-absence-head h3 {
  margin: 0 0 6px;
  color: #173056;
}

.absence-form-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.absences-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.absences-head h3 {
  margin: 0;
  color: #173056;
}

.absences-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(clamp(380px, 34vw, 520px), 1.15fr);
  gap: 14px;
  align-items: start;
}

.absences-list-column {
  min-height: 520px;
}

.absences-filters {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(160px, 0.6fr) minmax(220px, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid #dce4f0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.absences-search-field {
  min-width: 0;
}

.absences-list {
  max-height: calc(100vh - 360px);
  min-height: 280px;
  overflow: auto;
  padding-right: 2px;
}

.absence-list-item {
  cursor: pointer;
}

.absence-list-item .referentiel-item-actions {
  cursor: default;
}

.absences-detail-column {
  position: sticky;
  top: 96px;
  min-width: clamp(380px, 34vw, 520px);
}

.absence-detail-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d5dfef;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 24px rgba(21, 38, 68, 0.05);
}

.absence-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.absence-detail-head h4 {
  margin: 0;
  font-size: 1.05rem;
  color: #1c2f4f;
}

.absence-detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.absence-detail-reason {
  padding: 12px;
  border: 1px solid #dce5f3;
  border-radius: 12px;
  background: #ffffff;
}

.absence-detail-reason p {
  margin: 4px 0 0;
  color: #1f355d;
  font-weight: 700;
}

.absence-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.calendar-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.calendar-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.calendar-tab {
  border: 1px solid #dce4f0;
  border-radius: 999px;
  background: #fff;
  color: #4a5c73;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 7px 12px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.calendar-tab:hover,
.calendar-tab:focus-visible {
  border-color: #b8c9df;
  color: #203756;
}

.calendar-tab.is-active {
  background: #203756;
  border-color: #203756;
  color: #fff;
}

.calendar-layout {
  display: block;
}

.calendar-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dce4f0;
  border-radius: 14px;
  background: #fff;
}

.calendar-panel-head {
  align-items: center;
}

.calendar-panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calendar-panel[hidden] {
  display: none;
}

.calendar-panel-wide {
  grid-row: auto;
}

.calendar-exception-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  gap: 14px;
  align-items: start;
}

.calendar-subsection {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.calendar-weekly-grid,
.calendar-list {
  display: grid;
  gap: 10px;
}

.calendar-weekday-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dce5f3;
  border-radius: 12px;
  background: #f8fbff;
}

.calendar-weekday-head,
.calendar-toggle,
.calendar-holiday-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.calendar-weekday-head {
  justify-content: space-between;
}

.calendar-toggle {
  font-weight: 700;
  color: #203756;
}

.calendar-time-ranges {
  display: grid;
  gap: 8px;
}

.calendar-time-range,
.calendar-inline-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.calendar-time-range input,
.calendar-holiday-actions input {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.calendar-time-range.is-invalid input {
  border-color: #d94b4b;
  background: #fff7f7;
}

.calendar-panel .form-feedback:not(.form-feedback-error) {
  color: #1f5f36;
  background: #f0fff4;
  border: 1px solid #a9e7bb;
}

.calendar-empty-line {
  margin: 0;
}

.calendar-list {
  max-height: 430px;
  overflow: auto;
}

.calendar-list-item {
  margin: 0;
}

.calendar-list-item .referentiel-item-pills {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calendar-holiday-actions {
  flex-wrap: wrap;
}

.calendar-holiday-actions input {
  flex: 1 1 220px;
}

@media (max-width: 920px) {
  .calendar-panel-head {
    align-items: stretch;
  }

  .calendar-panel-actions {
    justify-content: flex-start;
  }

  .calendar-exception-grid {
    grid-template-columns: 1fr;
  }

  .calendar-time-range,
  .calendar-inline-form {
    grid-template-columns: 1fr;
  }
}

.calendar-weekday-card.is-closed {
  background: #f5f7fa;
  border-color: #e8ecf3;
  opacity: 0.6;
}

.calendar-list-item.is-working {
  border-left: 3px solid #4a7fc1;
}

.quick-absence-mode {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf3ff;
  color: #173056;
  font-size: 0.74rem;
  font-weight: 800;
}

.quick-absence-summary {
  min-width: min(320px, 100%);
  max-width: 440px;
  padding: 14px 16px;
  border: 1px solid #d8e1ee;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  color: #28405f;
  font-size: 0.86rem;
  line-height: 1.45;
  box-shadow: 0 10px 24px rgba(21, 38, 68, 0.05);
}

.quick-absence-form {
  gap: 0;
}

.absence-form-summary {
  min-width: min(320px, 100%);
}

.quick-absence-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 16px;
}

.quick-absence-main {
  display: grid;
  gap: 14px;
}

.quick-absence-side {
  display: grid;
  align-content: start;
}

.quick-absence-resource-meta,
.quick-absence-list-card {
  border: 1px solid #d8e1ee;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(21, 38, 68, 0.05);
}

.quick-absence-resource-meta {
  padding: 12px 14px;
  color: #52627a;
  font-size: 0.82rem;
}

.quick-absence-list-card {
  margin-top: 14px;
  padding: 14px 16px;
}

.absence-resource-meta {
  margin-bottom: 4px;
}

.quick-absence-list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.quick-absence-list-head h4 {
  margin: 0;
  color: #173056;
}

.quick-absence-list-count {
  min-width: 32px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf3ff;
  color: #173056;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.quick-absence-list-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #dce4f0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.quick-absence-existing-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.quick-absence-existing-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid #dce4f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.quick-absence-existing-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-absence-existing-main {
  min-width: 0;
}

.quick-absence-existing-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: #173056;
}

.quick-absence-existing-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.quick-absence-existing-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf3ff;
  color: #28405f;
  font-size: 0.72rem;
  font-weight: 700;
}

.quick-absence-existing-meta {
  margin-top: 3px;
  font-size: 0.76rem;
  color: #61738e;
}

.quick-absence-existing-reason {
  margin-top: 5px;
  font-size: 0.78rem;
  color: #334b69;
}

.quick-absence-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-chip {
  border: 1px solid #cdd8ea;
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent);
  padding: 8px 12px;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.quick-chip:hover {
  border-color: #8ea8d7;
  transform: translateY(-1px);
}

.quick-chip.active {
  border-color: #173056;
  background: var(--accent);
  color: #ffffff;
}

.quick-absence-actions {
  margin-top: 16px;
}

.quick-absence-feedback {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #dbe3ef;
}

.quick-absence-feedback.is-error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

@media (max-width: 960px) {
  .absences-head,
  .absence-form-head,
  .quick-absence-head {
    flex-direction: column;
  }

  .absence-form-summary,
  .quick-absence-summary {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .quick-absence-layout {
    grid-template-columns: 1fr;
  }

  .absences-layout,
  .absences-filters {
    grid-template-columns: 1fr;
  }

  .absences-detail-column {
    position: static;
  }

  .absences-list {
    max-height: none;
  }
}

.weekly-vertical-board { 
  overflow: auto; 
  padding-bottom: 4px; 
  border: 1px solid var(--line); 
  border-radius: 14px; 
  background:
    linear-gradient(180deg, var(--tenant-brand-soft, #f6f4ed) 0%, #ffffff 100%);
} 

.weekly-vertical-board[hidden] {
  display: none !important;
}

#weeklyTableWrap[hidden] {
  display: none !important;
}

.weekly-toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.weekly-print-summary {  
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
  font-size: 0.75rem; 
  color: #475467; 
} 

.weekly-print-summary span {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--tenant-brand-soft, #d8ddd0);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tenant-brand-soft, #faf8f1) 70%, #ffffff);
}

.weekly-person-board {
  min-width: max-content;
  padding: 14px;
}

.weekly-person-day-card-name { 
  font-size: 0.92rem; 
  font-weight: 800; 
  color: #0f172a; 
} 
 
.weekly-person-day-card-date, 
.weekly-person-card-zone { 
  margin-top: 4px; 
  font-size: 0.73rem; 
  color: #475467; 
} 

.weekly-person-cards {
  display: grid;
  gap: 14px;
}

.weekly-person-cards-columns {
  display: grid;
  grid-template-columns: var(--weekly-person-columns, repeat(1, minmax(260px, 1fr)));
  align-items: start;
}

.weekly-person-print-pages {
  display: none;
}

.weekly-person-card-print-placeholder {
  visibility: hidden;
  min-height: 0;
  border-color: transparent;
  box-shadow: none;
}

.weekly-person-card { 
  border: 2px solid var(--tenant-brand-color, var(--accent)); 
  border-radius: 18px; 
  background: #ffffff; 
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1); 
  overflow: hidden; 
  break-inside: avoid; 
} 

.weekly-person-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between; 
  gap: 12px; 
  padding: 16px 18px; 
  color: var(--tenant-brand-contrast, #ffffff);
  border-bottom: 1px solid color-mix(in srgb, var(--tenant-brand-contrast, #ffffff) 18%, transparent); 
  background: var(--tenant-brand-color, var(--accent)); 
} 

.weekly-person-card-name { 
  font-size: 1rem; 
  font-weight: 800; 
  color: inherit; 
} 

.weekly-person-card-zone { 
  color: color-mix(in srgb, var(--tenant-brand-contrast, #ffffff) 82%, transparent); 
} 

.weekly-person-days-stack { 
  display: grid; 
  gap: 12px; 
  padding: 14px; 
  background: linear-gradient(180deg, #f3f6fb 0%, #eef3f8 100%); 
} 

.weekly-person-day-card { 
  display: grid; 
  align-content: start; 
  gap: 10px; 
  min-height: calc(96px + (var(--weekly-day-item-count, 1) * 176px)); 
  padding: 14px; 
  border: 1px solid #c5d1e0; 
  border-radius: 12px; 
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%); 
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05); 
  position: relative; 
} 

.weekly-person-day-card.is-empty { 
  background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%); 
} 

.weekly-person-day-card.is-closed {
  border-color: #9aa4b2;
  border-style: dashed;
  background:
    repeating-linear-gradient(135deg, rgba(100, 116, 139, 0.12) 0, rgba(100, 116, 139, 0.12) 8px, transparent 8px, transparent 16px),
    linear-gradient(180deg, #f7f8fa 0%, #e8edf3 100%);
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.12);
}

.weekly-person-day-card.is-closed::before {
  width: 6px;
  background: #64748b;
}

.weekly-person-day-card.is-holiday {
  border-color: #a66a98;
  background:
    repeating-linear-gradient(135deg, rgba(154, 95, 141, 0.14) 0, rgba(154, 95, 141, 0.14) 8px, transparent 8px, transparent 16px),
    linear-gradient(180deg, #fbf8fb 0%, #f0e6ef 100%);
}

.weekly-person-day-card.is-holiday::before {
  width: 6px;
  background: #9a5f8d;
}

.weekly-person-day-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, var(--tenant-brand-color, var(--accent)) 0%, var(--tenant-brand-strong, #1f4c78) 100%);
  opacity: 0.9;
}

.weekly-person-day-card-head { 
  padding: 0 0 12px 4px; 
  border-bottom: 1px solid #d2dbe7; 
} 

.weekly-person-day-card.is-closed .weekly-person-day-card-head {
  border-bottom-color: rgba(100, 116, 139, 0.35);
}

.weekly-person-day-card-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.weekly-person-day-closed-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #334155;
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.weekly-person-day-card.is-holiday .weekly-person-day-closed-badge {
  background: #7c3f70;
}

.weekly-person-day-items {
  display: grid;
  align-content: start;
  gap: 8px;
  grid-auto-rows: minmax(var(--weekly-person-item-min-height, 168px), auto);
  min-width: 0;
}

.weekly-person-closed-state {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(51, 65, 85, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #334155;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.weekly-person-closed-kicker {
  width: max-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.weekly-person-closed-label {
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.weekly-person-closed-reason {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.weekly-person-item {
  border-radius: 12px;
  padding: 10px;
  min-width: 0;
  min-height: var(--weekly-person-item-min-height, 168px);
  height: auto;
  overflow: visible;
  display: grid;
  align-content: start;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.weekly-person-item-task { 
  border: 1px solid #b8c7da; 
  border-left: 5px solid var(--order-color, #6ab4df); 
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%); 
  min-width: 0;
} 

.weekly-person-item-absence { 
  border: 1px solid #e6aa83; 
  background: linear-gradient(180deg, #fffaf6 0%, #fff1e8 100%); 
} 

.weekly-person-item-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.weekly-person-item-client { 
  font-size: 0.7rem; 
  font-weight: 700; 
  letter-spacing: 0.03em; 
  text-transform: uppercase; 
  color: #17406f; 
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
} 

.weekly-person-item-order {
  flex: 0 0 auto;
  max-width: 42%;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--order-color, #6ab4df) 50%, #ffffff);
  border-radius: 999px;
  background: color-mix(in srgb, var(--order-color, #6ab4df) 14%, #ffffff);
  color: #1f2937;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
} 

.weekly-person-item-title { 
  font-size: 0.86rem; 
  font-weight: 800; 
  color: #0f172a; 
  line-height: 1.25; 
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
} 

.weekly-person-item-facts {
  display: grid;
  gap: 3px;
  margin: 0;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid #d4deeb;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
}

.weekly-person-item-fact {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.weekly-person-item-fact dt {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  color: #64748b;
}

.weekly-person-item-fact dd {
  margin: 0;
  min-width: 0;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.weekly-person-item-meta { 
  font-size: 0.74rem; 
  line-height: 1.25; 
  color: #1f2937; 
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
} 

.weekly-person-empty-state { 
  min-height: 68px; 
  display: inline-flex; 
  align-items: center; 
  font-size: 0.76rem; 
  color: #475467; 
  padding-left: 4px; 
  border: 1px dashed #c9d4e3; 
  border-radius: 10px; 
  background: rgba(255, 255, 255, 0.92); 
  font-weight: 600;
} 

.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.kanban-col {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcff;
  display: flex;
  flex-direction: column;
}

.kanban-col.is-drop-target {
  border-color: #8cb8ff;
  box-shadow: inset 0 0 0 2px #8cb8ff;
  background: #f2f7ff;
}

.kanban-col-title {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
  color: #30415d;
}

.kanban-col-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 120px;
  align-items: stretch;
  justify-content: flex-start;
}

.kanban-card {
  border: 1px solid #d7e4ff;
  border-left: 6px solid #6ab4df;
  border-radius: 8px;
  background: #fff;
  padding: 7px 8px;
  cursor: grab;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

.kanban-card.is-selected {
  border-color: #2f6fb3;
  box-shadow: 0 0 0 3px rgba(47, 111, 179, 0.25), 0 10px 24px rgba(24, 52, 84, 0.16);
  background: linear-gradient(180deg, #f4f9ff 0%, #ffffff 100%);
  transform: translateY(-1px);
}

.kanban-card.is-dragging {
  opacity: 0.9;
  box-shadow: 0 16px 30px rgba(24, 52, 84, 0.22);
  transform: rotate(-1deg) scale(1.02);
}

.kanban-card.is-group-dragging {
  border-color: #1f4c78;
  background: linear-gradient(180deg, #eaf4ff 0%, #ffffff 100%);
}

.kanban-linked-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(47, 111, 179, 0.12);
  color: #1f4c78;
  font-size: 0.68rem;
  font-weight: 700;
}

.kanban-card-actions {
  margin-top: 6px;
}

.kanban-of {
  font-size: 0.8rem;
  font-weight: 700;
}

.kanban-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  .container {
    padding: 0 8px 20px;
    margin-top: 10px;
  }

  .topbar-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    min-height: 48px;
  }

  .topbar-branding {
    width: 100%;
    gap: 10px;
  }

  .topbar-tenant-mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 12px;
  }

  .topbar-brand {
    font-size: 1.45rem;
  }

  .topbar-brand-signature {
    font-size: 0.72rem;
  }

  .topbar-platform-signature {
    width: 36px;
    height: 36px;
    padding: 5px;
  }

  .topbar-tenant-label {
    font-size: 0.72rem;
    padding: 3px 8px;
  }

  .topbar-sub {
    font-size: 0.9rem;
  }

  .topbar-session {
    width: 100%;
    justify-content: space-between;
  }

  .topbar-profile-panel {
    left: 0;
    right: auto;
  }

  .topbar-profile-panel::before {
    left: 15px;
    right: auto;
  }

  .planifab-about-card {
    margin-top: 12px;
  }

  .planifab-about-head {
    align-items: flex-start;
    padding: 14px;
  }

  .planifab-about-body {
    padding: 14px;
  }

  .planifab-about-meta {
    grid-template-columns: 1fr;
  }

  .tab {
    padding-left: 12px;
    padding-right: 12px;
    font-size: 0.9rem;
  }

  .order-form-split {
    grid-template-columns: 1fr;
  }

  .toolbar-filter-row {
    width: 100%;
  }

  .toolbar-filter {
    min-width: 0;
    max-width: none;
    flex: 1 1 180px;
  }

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

  .weekly-person-board {
    min-width: auto;
    padding: 12px;
  }

  .weekly-person-cards-columns {
    grid-template-columns: 1fr;
  }

  .weekly-person-day-card {
    min-height: 0;
  }

  .gantt-selection { 
    left: 8px;
    right: 8px;
    top: 8px;
    bottom: auto;
    width: auto;
    max-height: min(60vh, calc(100% - 16px));
    border-right: 1px solid var(--line);
    border-radius: 12px;
  }

  .gantt-scroll-body {
    min-height: 320px;
    max-height: clamp(300px, 64vh, 840px);
  } 
} 

@media print {
  @page {
    size: landscape;
    margin: 10mm;
  }

  body[data-weekly-printing="true"] {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body[data-weekly-printing="true"] .topbar,
  body[data-weekly-printing="true"] .tabs,
  body[data-weekly-printing="true"] .workspace-nav-card,
  body[data-weekly-printing="true"] [data-main-view]:not([data-main-view="semaine"]),
  body[data-weekly-printing="true"] #btnSemPrev,
  body[data-weekly-printing="true"] #btnSemNext,
  body[data-weekly-printing="true"] #btnSemPrint,
  body[data-weekly-printing="true"] #semViewMode,
  body[data-weekly-printing="true"] #semZone,
  body[data-weekly-printing="true"] #semDaysCount,
  body[data-weekly-printing="true"] #semPersonFilter,
  body[data-weekly-printing="true"] #semPersonSummary {
    display: none !important;
  }

  body[data-weekly-printing="true"] .container,
  body[data-weekly-printing="true"] .card,
  body[data-weekly-printing="true"] .weekly-vertical-board {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  body[data-weekly-printing="true"] .weekly-toolbar-meta {
    margin: 0 0 12px;
  }

  body[data-weekly-printing="true"][data-weekly-print-mode="vertical"] #weeklyTableWrap,
  body[data-weekly-printing="true"][data-weekly-print-mode="table"] #weeklyVerticalBoard {
    display: none !important;
  }

  body[data-weekly-printing="true"][data-weekly-print-mode="table"] #weeklyTableWrap {
    display: block !important;
    overflow: visible !important;
  }

  body[data-weekly-printing="true"][data-weekly-print-mode="table"] #weeklyTableWrap .orders-table {
    width: 100% !important;
    border-collapse: collapse;
  }

  body[data-weekly-printing="true"][data-weekly-print-mode="table"] #weeklyTableWrap .orders-table thead th {
    position: static;
    background: #f7faff !important;
  }

  body[data-weekly-printing="true"][data-weekly-print-mode="table"] #weeklyTableWrap .orders-table th,
  body[data-weekly-printing="true"][data-weekly-print-mode="table"] #weeklyTableWrap .orders-table td {
    border-bottom: 1px solid #dbe3ef;
    padding: 8px 6px;
    font-size: 0.85rem;
    vertical-align: top;
  }

  body[data-weekly-printing="true"] .weekly-print-summary {
    display: flex !important;
  }

  body[data-weekly-printing="true"] .weekly-person-board {
    min-width: 0;
    padding: 0;
  }

  body[data-weekly-printing="true"] .weekly-person-print-pages {
    display: grid;
    gap: 12px;
  }

  body[data-weekly-printing="true"] .weekly-person-cards-columns[data-weekly-print-source="true"] {
    display: none !important;
  }

  body[data-weekly-printing="true"] .weekly-person-print-page {
    break-after: page;
    page-break-after: always;
  }

  body[data-weekly-printing="true"] .weekly-person-print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body[data-weekly-printing="true"] .weekly-person-cards-columns {
    grid-template-columns: var(--weekly-person-columns, repeat(2, minmax(0, 1fr)));
    gap: 10px;
  }

  body[data-weekly-printing="true"] .weekly-person-cards-columns-print {
    grid-template-columns: var(--weekly-person-columns, repeat(5, minmax(0, 1fr)));
  }

  body[data-weekly-printing="true"] .weekly-person-card-print-placeholder {
    background: transparent !important;
    border-color: transparent !important;
  }

  body[data-weekly-printing="true"] .weekly-person-card,
  body[data-weekly-printing="true"] .weekly-person-day-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body[data-weekly-printing="true"] .weekly-person-card {
    background: #ffffff !important;
    border: 2px solid var(--tenant-brand-color, #cfd6e2);
  }

  body[data-weekly-printing="true"] .weekly-person-card-head {
    color: var(--tenant-brand-contrast, #ffffff) !important;
    background: var(--tenant-brand-color, var(--accent)) !important;
    border-bottom: 1px solid color-mix(in srgb, var(--tenant-brand-contrast, #ffffff) 18%, transparent);
  }

  body[data-weekly-printing="true"] .weekly-person-card-name {
    color: inherit !important;
  }

  body[data-weekly-printing="true"] .weekly-person-card-zone {
    color: color-mix(in srgb, var(--tenant-brand-contrast, #ffffff) 82%, transparent) !important;
  }

  body[data-weekly-printing="true"] .weekly-person-item-client,
  body[data-weekly-printing="true"] .weekly-person-item-order,
  body[data-weekly-printing="true"] .weekly-person-item-title,
  body[data-weekly-printing="true"] .weekly-person-item-fact dd,
  body[data-weekly-printing="true"] .weekly-person-day-card-name {
    color: #1f2937 !important;
  }

  body[data-weekly-printing="true"] .weekly-person-item-meta,
  body[data-weekly-printing="true"] .weekly-person-item-fact dt,
  body[data-weekly-printing="true"] .weekly-person-empty-state,
  body[data-weekly-printing="true"] .weekly-person-day-card-date {
    color: #5b6574 !important;
  }

  body[data-weekly-printing="true"] .weekly-person-day-card,
  body[data-weekly-printing="true"] .weekly-person-item-task,
  body[data-weekly-printing="true"] .weekly-person-item-absence {
    border-color: inherit;
  }

  body[data-weekly-printing="true"] .weekly-person-day-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%) !important;
  }

  body[data-weekly-printing="true"] .weekly-person-item-task {
    background: linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%) !important;
    border-color: #b8c7da !important;
  }

  body[data-weekly-printing="true"] .weekly-person-item-absence {
    background: linear-gradient(180deg, #fffaf6 0%, #fff1e8 100%) !important;
    border-color: #e6aa83 !important;
  }

  body[data-weekly-printing="true"] .weekly-person-empty-state,
  body[data-weekly-printing="true"] .weekly-person-item-order,
  body[data-weekly-printing="true"] .weekly-person-item-fact,
  body[data-weekly-printing="true"] .weekly-print-summary span {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body[data-weekly-printing="true"] .weekly-person-day-card {
    min-height: calc(82px + (var(--weekly-day-item-count, 1) * 176px));
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 18px 28px;
    margin-top: 14px;
  }
}
