/* Ponticelli MOB PLAN — Interface v8 */
:root {
  --brand: #C8102E;
  --brand-dark: #9B0C24;
  --brand-soft: rgba(200, 16, 46, 0.08);
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6B7280;
  --line: #E5E7EB;
  --bg: #F4F5F7;
  --card: #FFFFFF;
  --sidebar: #16181D;
  --sidebar-text: #9CA3AF;
  --sidebar-active: #FFFFFF;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, 0.12);
  --sidebar-w: 260px;
  --sea: #1D5BA8;
  --ok: #059669;
  --warn: #D97706;
  --danger: #DC2626;
  /* Planning jours — palette sobre, contrastée (sans orange / violet) */
  --plan-travail: #1A5276;   /* En mer — bleu marine */
  --plan-voyage: #5D6D7E;    /* Voyage — gris bleuté */
  --plan-depart: #117A65;    /* Départ — vert */
  --plan-mob: #C8102E;       /* Mobilisation — rouge Ponticelli */
  --plan-repos: #F4F6F7;     /* Repos */
  --text: var(--ink);
  --text-muted: var(--muted);
  --surface: var(--card);
  --border: var(--line);
  --red: var(--brand);
  --red-dark: var(--brand-dark);
  --red-soft: var(--brand-soft);
  --gray-100: #F3F4F6;
  --gray-50: #F9FAFB;
  --gray-500: var(--muted);
  --gray-900: var(--ink);
  --white: #fff;
}

body.dark {
  --ink: #F9FAFB;
  --ink-2: #D1D5DB;
  --muted: #9CA3AF;
  --line: #2D3139;
  --bg: #0F1115;
  --card: #1A1D24;
  --sidebar: #0C0E12;
  --sidebar-text: #6B7280;
  --brand-soft: rgba(200, 16, 46, 0.15);
  --shadow: 0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.25);
  --gray-100: #252830;
  --gray-50: #1E2128;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* SHELL */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  background: var(--sidebar);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}
.brand { padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 20px; }
.brand-logo { width: 100%; max-width: 180px; height: auto; display: block; filter: brightness(0) invert(1); opacity: .95; }
.brand-meta { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.brand-tag { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.brand-sub { font-size: .8rem; color: var(--sidebar-text); }

.nav-label {
  font-size: .65rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.35); padding: 16px 12px 8px;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  border: none; background: transparent;
  padding: 12px 14px; border-radius: var(--radius-sm);
  font: inherit; font-size: .9rem; font-weight: 500;
  color: var(--sidebar-text); cursor: pointer; text-align: left; width: 100%;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #E5E7EB; }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(200,16,46,.35); }
.nav-ico { width: 20px; height: 20px; flex-shrink: 0; opacity: .85; }
.nav-item.active .nav-ico { opacity: 1; }

.sidebar-foot { padding: 16px 12px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: .75rem; color: var(--sidebar-text); }
.save-ind { display: block; margin-top: 4px; opacity: .7; }

/* MAIN */
.main-area { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px 36px 20px;
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.topbar-left h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.topbar-desc { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.topbar-actions { display: flex; gap: 8px; }
.content { padding: 0 36px 48px; flex: 1; }

.dup-banner {
  margin: 0 36px 16px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; font-size: .86rem;
}
body.dark .dup-banner { background: #3A1520; border-color: #7F1D1D; color: #FCA5A5; }

.nav-item { position: relative; }
.nav-badge {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--brand); color: #fff;
  font-size: .68rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.nav-badge.urgent { background: #B91C1C; box-shadow: 0 0 0 2px rgba(185, 28, 28, .25); }

.live-refresh-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: .8rem; color: var(--muted);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #0D7C4A;
  box-shadow: 0 0 0 4px rgba(13, 124, 74, .15);
  animation: livePulse 1.6s ease infinite;
}
@keyframes livePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: .7; }
}

.demob-banner {
  margin-bottom: 18px; padding: 16px 18px;
  background: #FFFBEB; border: 1px solid #FDE68A; border-radius: var(--radius);
}
body.dark .demob-banner { background: #3A2E10; border-color: #854D0E; }
.demob-banner-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px;
}
.demob-banner-head strong { color: #92400E; font-size: .95rem; }
body.dark .demob-banner-head strong { color: #FDE68A; }
.demob-banner-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.demob-banner-list li {
  display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px;
  background: #fff; border: 1px solid #FDE68A; cursor: pointer; font-size: .84rem;
}
.demob-banner-list li.danger { border-color: #FECACA; background: #FEF2F2; }
.demob-banner-list li span { color: var(--muted); font-size: .8rem; }
.demob-alert-panel { border-color: #FDE68A; }

.page { display: none; animation: fadeIn .25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* BUTTONS */
.btn {
  padding: 10px 18px; border-radius: var(--radius-sm); font: inherit; font-size: .86rem;
  font-weight: 600; cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:active { transform: scale(.98); }
.btn-primary, .btn-red { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(200,16,46,.25); }
.btn-primary:hover, .btn-red:hover { background: var(--brand-dark); }
.btn-ghost, .btn-outline { background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
.btn-ghost:hover, .btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 8px 14px; font-size: .8rem; }
.btn-icon {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; color: var(--muted);
}
.btn-text-danger { background: none; border: none; color: var(--brand); font: inherit; cursor: pointer; font-weight: 600; }
.full { width: 100%; }

/* DASHBOARD */
.dash-hero {
  background: linear-gradient(135deg, var(--card) 0%, var(--brand-soft) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 32px; margin-bottom: 24px; box-shadow: var(--shadow);
}
.dash-hero h2 { font-size: 1.1rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.dash-hero p { font-size: 1.5rem; font-weight: 700; color: var(--ink); }

.tentative-panel { padding: 0; overflow: hidden; }
.tentative-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.tentative-search { flex: 1; min-width: 220px; max-width: 420px; }
.tentative-count { font-size: .82rem; color: var(--muted); font-weight: 600; }
.tentative-table-wrap { max-height: calc(100vh - 280px); overflow: auto; }
.tentative-table {
  width: 100%; border-collapse: collapse; font-size: .9rem;
}
.tentative-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--gray-50); text-align: left;
  padding: 10px 18px; font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.tentative-table td { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.tentative-row { cursor: pointer; transition: background .12s; }
.tentative-row:hover { background: var(--brand-soft); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow);
}
.kpi-val { font-size: 2.25rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; color: var(--ink); }
.kpi-lbl { font-size: .72rem; color: var(--muted); margin-top: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi-card.accent .kpi-val { color: var(--brand); }
.kpi-card.warn .kpi-val { color: var(--warn); }
.kpi-card.sea .kpi-val { color: var(--sea); }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.chart-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-height: 260px; }
.chart-box h3 { font-size: .82rem; margin-bottom: 16px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.chart-box canvas { max-height: 200px; }
.chart-box.wide { grid-column: span 2; }

.panel-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel-box h3 { font-size: .95rem; margin-bottom: 16px; font-weight: 700; }
.muted { color: var(--muted); font-size: .88rem; }
.hint { color: var(--muted); font-size: .82rem; margin-bottom: 14px; }

/* PERSONNEL — CARTES */
.page-head {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 20px;
}
.search-field {
  flex: 1; min-width: 220px; position: relative;
}
.search-field input {
  width: 100%; padding: 12px 16px 12px 42px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; background: var(--card); color: var(--text);
  box-shadow: var(--shadow);
}
.search-field svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-items: center; }
.filter-chips select {
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  font: inherit; font-size: .82rem; background: var(--card); color: var(--ink-2);
  cursor: pointer; min-width: 0;
}
.filter-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.filter-panel-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.filter-field label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.filter-field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .82rem;
  background: var(--bg);
  color: var(--ink-2);
}
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.filter-active-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(29, 91, 168, .1);
  color: var(--brand);
  font-size: .78rem;
  font-weight: 600;
}

.result-count { font-size: .82rem; color: var(--muted); margin-bottom: 16px; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.team-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.team-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.team-card-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.team-card-info { flex: 1; min-width: 0; }
.team-card-info strong { display: block; font-size: .95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-card-info small { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.team-card-dates {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.team-card-dates div small { display: block; font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.team-card-dates div span { font-size: .84rem; font-weight: 600; }
.team-card-dates .hist-dates { grid-column: 1 / -1; }
.team-card-dates .hist-dates span { color: var(--muted); font-size: .78rem; }
.history-dates {
  margin: 12px 0 16px; padding: 12px 14px;
  background: var(--gray-50); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.history-dates .sec { color: var(--sea); }
.plan-from-dates {
  margin: 8px 0 16px;
  padding: 12px 14px;
  background: var(--gray-50);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}
.plan-from-dates .check-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .84rem; margin-bottom: 10px; cursor: pointer;
}
.plan-from-dates .check-row input { margin-top: 3px; }
.panel-inset { }
.plan-rotation-box {
  margin-top: 18px; padding: 16px;
  background: var(--brand-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.plan-rotation-box h3 { margin: 0 0 6px; font-size: 1rem; color: var(--brand); }
.team-card-foot-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px;
}
.btn-plan-quick { flex-shrink: 0; margin-left: auto; }
.team-card-selected { border-color: var(--brand); box-shadow: 0 0 0 1px rgba(200,16,46,.15); }
.sea-days { font-weight: 700; color: var(--sea); }
.btn-compare-add {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg); color: var(--brand); font-weight: 700; font-size: 1rem;
  cursor: pointer; flex-shrink: 0; line-height: 1;
}
.btn-compare-add:hover, .btn-compare-add.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.compare-panel {
  background: linear-gradient(135deg, rgba(29,91,168,.06), rgba(200,16,46,.04));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.compare-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.compare-sub { font-size: .82rem; color: var(--muted); margin: 4px 0 0; }
.compare-picker { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.compare-search-wrap { flex: 1; min-width: 220px; }
.compare-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 28px; margin-bottom: 12px; }
.compare-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: .82rem; font-weight: 600;
}
.compare-chip-x {
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: var(--gray-100); color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1;
}
.compare-chip-x:hover { background: var(--brand); color: #fff; }
.compare-empty { font-size: .82rem; color: var(--muted); }
.compare-hint { font-size: .85rem; color: var(--muted); margin: 0; }
.compare-results { display: grid; gap: 16px; }
.compare-bars { display: grid; gap: 10px; }
.compare-bar-row { display: grid; grid-template-columns: 90px 1fr 56px; gap: 10px; align-items: center; }
.compare-bar-name { font-size: .78rem; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-bar-track { height: 12px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.compare-bar-fill { height: 100%; border-radius: 999px; min-width: 4px; }
.compare-bar-val { font-size: .78rem; font-weight: 700; color: var(--sea); text-align: right; }
.compare-table-wrap { overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; font-size: .84rem; background: var(--card); border-radius: var(--radius-sm); overflow: hidden; }
.compare-table th, .compare-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare-table th { background: var(--bg); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.compare-table td.num { text-align: center; font-weight: 600; }
.compare-table td.highlight { color: var(--sea); font-size: 1rem; }

/* TAGS */
.tag {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.tag-in { background: rgba(200,16,46,.12); color: var(--brand); }
.tag-off { background: var(--gray-100); color: var(--muted); }
.tag-mobilized, .tag-in { background: rgba(200,16,46,.12); color: var(--brand); }
.tag-offshore { background: rgba(29,91,168,.12); color: var(--sea); }
.tag-demobilized, .tag-demob { background: var(--gray-100); color: var(--muted); }
.tag-standby { background: var(--gray-100); color: var(--muted); }
.tag-mobilized { background: rgba(200,16,46,.12); color: var(--brand); }
.warn-text { color: var(--warn); font-weight: 700; }

/* AVATAR */
.avatar {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white; display: grid; place-items: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.avatar.lg { width: 72px; height: 72px; font-size: 1.2rem; border-radius: 16px; }
.avatar.sm { width: 40px; height: 40px; font-size: .78rem; }
.photo-img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; border: 2px solid var(--line); }
.photo-img.lg { width: 72px; height: 72px; border-radius: 16px; border-color: var(--brand); }
.photo-img.sm { width: 40px; height: 40px; border-radius: 10px; }

/* Point vert clignotant — personne actuellement en mobilisation */
.avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
}
.active-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #16A34A;
  border: 2px solid var(--card);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, .55);
  animation: active-pulse 1.4s ease-out infinite;
  z-index: 2;
  pointer-events: none;
}
.avatar-wrap.lg .active-dot { width: 14px; height: 14px; right: 1px; bottom: 1px; }
.avatar-wrap.sm .active-dot { width: 10px; height: 10px; }
.active-dot-inline {
  position: static;
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  vertical-align: middle;
  border: none;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, .55);
}
.tag .active-dot-inline { margin-right: 6px; }
@keyframes active-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(22, 163, 74, .55); }
  60% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .active-dot, .active-dot-inline { animation: none; }
}

/* TABLE (fallback) */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; background: var(--card); font-size: .84rem; }
.data-table th {
  text-align: left; padding: 14px 16px; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 700;
  border-bottom: 1px solid var(--line); background: var(--gray-50);
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.data-table tr:hover td { background: var(--brand-soft); }
.data-table tr { cursor: pointer; }
.name-cell { display: flex; align-items: center; gap: 10px; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; font-size: .84rem; color: var(--muted); padding: 8px 0; }
.pagination button {
  padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer; font: inherit; color: var(--text);
}
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* PLANNING */
.cal-select-panel { margin-bottom: 16px; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.cal-range-panel { margin-bottom: 16px; }
.cal-range-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.cal-range-inputs {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
  margin-bottom: 16px;
}
.cal-range-field {
  display: flex; flex-direction: column; gap: 6px;
  font-size: .78rem; font-weight: 600; color: var(--muted);
}
.cal-range-field input[type="date"] {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px; font: inherit; background: var(--card); color: var(--ink);
  min-width: 150px;
}
.cal-picker {
  max-width: 340px;
  background: var(--gray-50);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.cal-picker-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 10px;
}
.cal-picker-title {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
  flex: 1;
}
.cal-picker-select, .cal-jump-select {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px; font: inherit; font-size: .84rem; font-weight: 600;
  background: var(--card); color: var(--ink);
}
.cal-toolbar-period {
  display: flex; align-items: center; gap: 6px;
}
.cal-picker-bounds {
  margin-top: 6px; font-size: .72rem; color: var(--muted);
}
.cal-picker-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin-bottom: 6px;
}
.cal-picker-weekdays span {
  text-align: center; font-size: .65rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
}
.cal-picker-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal-day {
  aspect-ratio: 1;
  border: none; border-radius: 8px;
  background: var(--card); color: var(--ink);
  font: inherit; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: background .12s, color .12s;
}
.cal-day:hover { background: var(--brand-soft); color: var(--brand); }
.cal-day-empty { background: transparent; pointer-events: none; }
.cal-day-in-range { background: rgba(29, 91, 168, .12); color: var(--sea); }
.cal-day-start, .cal-day-end { background: var(--sea); color: #fff; }
.cal-day-start.cal-day-end { border-radius: 8px; }
.cal-picker-hint {
  margin-top: 10px; font-size: .78rem; color: var(--muted);
}
.cal-compare-strip {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.cal-compare-strip-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.cal-date-cards { display: grid; gap: 10px; }
.cal-date-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.cal-date-card strong { display: block; font-size: .88rem; margin-bottom: 8px; }
.cal-date-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: .82rem; }
.cal-date-row small { display: block; font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-date-arrow { color: var(--muted); }
.phase-banner {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.phase-banner.phase-offshore { background: rgba(29,91,168,.1); color: var(--sea); }
.phase-banner.phase-rest, .phase-banner.phase-upcoming { background: var(--gray-100); color: var(--ink-2); }
.travel-sec-label {
  grid-column: 1 / -1;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 8px 0 2px;
}
.contract-dates { font-size: .78rem; margin: 0 0 12px; }
.cal-title { flex: 1; text-align: center; font-size: 1.25rem; font-weight: 700; min-width: 160px; }
.cal-summary { font-size: .86rem; color: var(--muted); margin-top: 16px; }
.cal-summary strong { color: var(--brand); }

.plan-legend {
  display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px;
  padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.plan-legend-item { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ink-2); font-weight: 600; }
.plan-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.plan-dot.cat-travail { background: var(--plan-travail); }
.plan-dot.cat-voyage { background: var(--plan-voyage); }
.plan-dot.cat-depart { background: var(--plan-depart); }
.plan-dot.cat-mob { background: var(--plan-mob); }
.plan-dot.cat-repos { background: var(--plan-repos); border: 1px dashed var(--muted); box-shadow: none; }

.plan-board { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.plan-board-head { display: flex; border-bottom: 1px solid var(--line); background: var(--gray-50); }
.plan-head-label { width: 280px; flex-shrink: 0; padding: 14px 18px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-right: 1px solid var(--line); }
.plan-weeks-ruler { flex: 1; display: flex; overflow-x: auto; }
.plan-week-mark { flex: 1; min-width: 72px; padding: 10px; text-align: center; border-right: 1px solid var(--line); }
.pwm-label { display: block; font-size: .75rem; font-weight: 700; color: var(--brand); }
.pwm-dates { display: block; font-size: .65rem; color: var(--muted); }
.plan-board-body { max-height: 65vh; overflow: auto; }

/* Planning journalier — scroll vertical + horizontal (semaines) */
.plan-board-daily { overflow: hidden; display: flex; flex-direction: column; }
.plan-scroll-hint {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--gray-50); font-size: .78rem; color: var(--muted);
}
.plan-scroll-btns { display: flex; gap: 8px; }
.plan-daily-scroll {
  max-height: 68vh;
  overflow: auto;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.plan-daily-scroll::-webkit-scrollbar { height: 12px; width: 12px; }
.plan-daily-scroll::-webkit-scrollbar-thumb {
  background: #9CA3AF; border-radius: 8px; border: 2px solid var(--card);
}
.plan-daily-scroll::-webkit-scrollbar-track { background: var(--gray-100); }
.plan-daily-inner {
  width: max-content;
  min-width: 100%;
  --day-w: 32px;
  --name-w: 300px;
}
.plan-daily-ruler {
  display: flex;
  width: max-content;
  min-width: 100%;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--gray-50);
  border-bottom: 2px solid var(--line);
}
.plan-ruler-names {
  flex: 0 0 var(--name-w);
  width: var(--name-w);
  position: sticky;
  left: 0;
  z-index: 12;
  background: var(--gray-50);
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 12px -6px rgba(0, 0, 0, .18);
}
.plan-ruler-names .plan-head-sticky,
.plan-head-sticky {
  position: relative;
  left: auto;
  z-index: 1;
  flex: none;
  width: 100%;
  box-sizing: border-box;
  background: var(--gray-50);
  border-right: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  font-size: .68rem;
  min-height: 68px;
}
.plan-ruler-days {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}
.plan-months-ruler {
  display: grid;
  grid-template-columns: repeat(var(--days), var(--day-w));
  border-bottom: 1px solid var(--line);
  background: #EEF2F7;
}
.plan-month-band {
  grid-column: span var(--span);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 4px;
  border-right: 1px solid var(--line);
  font-size: .72rem;
  font-weight: 800;
  color: var(--sea);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-month-band:nth-child(even) { background: rgba(29, 91, 168, .1); }
.plan-month-band:nth-child(odd) { background: rgba(29, 91, 168, .05); }
.plan-days-ruler {
  display: grid;
  grid-template-columns: repeat(var(--days), var(--day-w));
  flex: 0 0 auto;
}
.plan-daily-row {
  display: flex;
  width: max-content;
  min-width: 100%;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.plan-day-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  border-right: 1px solid var(--line);
  min-height: 44px;
  min-width: var(--day-w);
  background: var(--gray-50);
  position: relative;
  z-index: 0;
}
.plan-day-mark.weekend { background: rgba(0, 0, 0, .04); }
.plan-day-mark.today { background: var(--brand-soft); }
.plan-day-mark.today .pdm-num { color: var(--brand); font-weight: 800; }
.plan-day-mark.month-start {
  border-left: 2px solid var(--sea);
  background: rgba(29, 91, 168, .08);
}
.pdm-month {
  font-size: .52rem;
  font-weight: 800;
  color: var(--sea);
  text-transform: uppercase;
  line-height: 1;
}
.pdm-dow { font-size: .58rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.pdm-num { font-size: .78rem; font-weight: 700; color: var(--ink); }
.plan-daily-body { }
.plan-daily-row:hover { background: #FFF8F9; }
.plan-daily-cells {
  display: grid;
  grid-template-columns: repeat(var(--days), var(--day-w));
  flex: 0 0 auto;
  position: relative;
  z-index: 0;
}
.plan-day-cell {
  position: relative;
  z-index: 0;
  height: 52px;
  min-width: var(--day-w);
  border-right: 1px solid rgba(0, 0, 0, .06);
  border-bottom: 1px solid transparent;
  cursor: default;
  transition: opacity .12s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plan-day-emoji {
  font-size: .92rem;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18));
}
.plan-day-cell.phase-flight .plan-day-emoji,
.plan-day-cell.phase-boat .plan-day-emoji { font-size: 1rem; }
.plan-options {
  margin-bottom: 14px;
  padding: 12px 16px;
}
.plan-options-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.plan-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}
.plan-opt {
  font-size: .82rem;
  color: var(--ink-2);
  font-weight: 500;
}
.plan-day-cell:hover { opacity: .85; filter: brightness(1.05); }
.plan-day-cell.empty { background: var(--gray-50); opacity: .45; }
.plan-day-cell.cat-travail { background: var(--plan-travail); }
.plan-day-cell.cat-voyage { background: var(--plan-voyage); }
.plan-day-cell.cat-depart { background: var(--plan-depart); }
.plan-day-cell.cat-mob { background: var(--plan-mob); }
.plan-day-cell.cat-repos { background: var(--plan-repos); }
.plan-site-head-sticky {
  position: sticky;
  left: 0;
  z-index: 4;
  width: max(100%, calc(var(--name-w) + var(--days) * var(--day-w)));
  box-sizing: border-box;
  background: #FCE8EB;
}
.plan-site-head { display: flex; justify-content: space-between; padding: 12px 18px; background: var(--brand-soft); border-bottom: 1px solid var(--line); }
.plan-site-name { font-weight: 700; color: var(--brand); }
.plan-person-row { display: flex; border-bottom: 1px solid var(--line); }
.plan-person-row:hover { background: var(--brand-soft); }
.plan-person {
  width: 320px; flex-shrink: 0; display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 18px; border: none; border-right: 1px solid var(--line);
  background: transparent; cursor: pointer; text-align: left; font: inherit;
}
/* Colonne noms : opaque + au-dessus des barres quand on scroll horizontalement */
.plan-person.plan-person-sticky {
  position: sticky;
  left: 0;
  z-index: 8;
  flex: 0 0 var(--name-w);
  width: var(--name-w);
  max-width: var(--name-w);
  box-sizing: border-box;
  align-self: stretch;
  background: var(--card) !important;
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 12px -6px rgba(0, 0, 0, .18);
  isolation: isolate;
}
.plan-daily-row:hover .plan-person.plan-person-sticky {
  background: #FFF5F6 !important;
}

.plan-person-info { flex: 1; min-width: 0; }
.plan-person-info strong { display: block; font-size: .92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-person-info > small { display: block; font-size: .76rem; color: var(--muted); margin-top: 2px; }
.plan-person-dates {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  margin-top: 6px; font-size: .72rem; color: var(--ink-2);
}
.plan-person-dates b { font-weight: 700; }
.plan-date-mob b { color: var(--brand); }
.plan-date-demob b { color: var(--sea); }
.plan-date-sep { color: var(--muted); }
.plan-date-fr b { color: #0D7C4A; }
.plan-date-days { font-weight: 700; color: var(--sea); }
.plan-track { flex: 1; display: flex; align-items: center; gap: 4px; padding: 10px 14px; overflow-x: auto; }
.plan-bar { height: 34px; border-radius: 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 48px; padding: 0 8px; }
.plan-bar.cat-travail { background: var(--plan-travail); color: #fff; }
.plan-bar.cat-voyage { background: var(--plan-voyage); color: #fff; }
.plan-bar.cat-depart { background: var(--plan-depart); color: #fff; }
.plan-bar.cat-mob { background: var(--plan-mob); color: #fff; }
.plan-bar.cat-repos { background: var(--plan-repos); color: var(--muted); border: 1px dashed var(--line); }
.plan-bar-empty { background: var(--gray-100); opacity: .4; }

/* GANTT */
.gantt-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.gantt-toolbar select, .gantt-search { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: var(--card); }
.gantt-search { flex: 1; min-width: 180px; }
.gantt-scroller { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); max-height: 65vh; }
.gantt-pill { display: inline-block; padding: 4px 8px; border-radius: 6px; font-size: .68rem; font-weight: 700; }
.cat-travail { background: rgba(26, 82, 118, .14); color: var(--plan-travail); }
.cat-voyage { background: rgba(93, 109, 126, .16); color: #34495E; }
.cat-depart { background: rgba(17, 122, 101, .14); color: var(--plan-depart); }
.cat-mob { background: rgba(200, 16, 46, .14); color: var(--plan-mob); }
.cat-repos { color: var(--muted); border: 1px dashed var(--line); }
.gantt-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .8rem; }
.gantt-week-th { min-width: 84px; padding: 10px 6px !important; text-align: center; background: var(--gray-50); position: sticky; top: 0; }
.gw-label { display: block; font-size: .75rem; color: var(--brand); font-weight: 700; }
.gw-dates { display: block; font-size: .65rem; color: var(--muted); }
.gantt-sticky { position: sticky; left: 0; z-index: 3; background: var(--card); min-width: 200px; padding: 10px 14px !important; border-right: 1px solid var(--line); }
.gantt-td { min-width: 84px; height: 42px; text-align: center; padding: 6px !important; }
.gantt-td.empty { background: var(--gray-50); }

/* TIMELINE / ROTATIONS */
.tl-page { display: flex; flex-direction: column; gap: 18px; }
.tl-hero {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(26, 82, 118, .08), transparent 55%),
    linear-gradient(180deg, #fff, var(--gray-50));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.tl-kicker {
  font-size: .68rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sea); margin-bottom: 6px;
}
.tl-hero-copy h2 {
  font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em;
  color: var(--ink); margin: 0 0 6px;
}
.tl-hero-copy p { margin: 0; color: var(--muted); font-size: .92rem; max-width: 42ch; }
.tl-hero-stats {
  display: grid; grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 10px; align-self: center;
}
.tl-hstat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 10px; text-align: center;
}
.tl-hstat b { display: block; font-size: 1.35rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.tl-hstat span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.tl-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  justify-content: space-between;
}
.tl-search { flex: 1; min-width: 220px; max-width: 360px; }
.tl-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-filter {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 8px 12px; font: inherit; font-size: .8rem;
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.tl-filter em {
  font-style: normal; font-size: .72rem; color: var(--muted);
  background: var(--gray-100); border-radius: 999px; padding: 1px 7px;
}
.tl-filter.is-active {
  border-color: var(--sea); background: rgba(29, 91, 168, .08); color: var(--sea);
}
.tl-filter.is-active em { background: rgba(29, 91, 168, .12); color: var(--sea); }

.tl-list { display: flex; flex-direction: column; gap: 14px; }
.tl-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.tl-card:hover { border-color: rgba(29, 91, 168, .35); transform: translateY(-1px); }
.tl-card-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  align-items: flex-start; margin-bottom: 12px;
}
.tl-identity { display: flex; gap: 12px; align-items: center; min-width: 0; }
.tl-identity h3 {
  margin: 0; font-size: 1.02rem; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-identity p { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.tl-card-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tl-phase-pill {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 5px 10px; border-radius: 999px;
}
.tl-phase-sea { background: rgba(26, 82, 118, .12); color: var(--plan-travail); }
.tl-phase-rest { background: var(--gray-100); color: var(--ink-2); }
.tl-phase-next { background: rgba(17, 122, 101, .1); color: var(--plan-depart); }
.tl-phase-none { background: var(--gray-50); color: var(--muted); }

.tl-ribbon {
  margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: .84rem; font-weight: 600; line-height: 1.35;
}
.tl-ribbon.tl-phase-sea { background: rgba(26, 82, 118, .08); color: var(--plan-travail); }
.tl-ribbon.tl-phase-rest { background: var(--gray-50); color: var(--ink-2); }
.tl-ribbon.tl-phase-next { background: rgba(17, 122, 101, .08); color: var(--plan-depart); }

.tl-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 16px;
}
.tl-metric {
  background: var(--gray-50); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.tl-metric span {
  display: block; font-size: .65rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.tl-metric strong { font-size: .95rem; color: var(--ink); }
.tl-metric.is-warn { border-color: rgba(217, 119, 6, .35); background: rgba(217, 119, 6, .08); }
.tl-metric.is-warn strong { color: #B45309; }

.tl-cycle {
  border-top: 1px solid var(--line); padding-top: 14px;
}
.tl-cycle-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.tl-cycle-head small { font-weight: 600; text-transform: none; letter-spacing: 0; }
.tl-cycle-bar {
  display: flex; gap: 3px; height: 42px; border-radius: 10px; overflow: hidden;
  background: var(--gray-100); margin-bottom: 12px;
}
.tl-seg {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 44px; gap: 1px; color: #fff; font-size: .68rem; font-weight: 700;
}
.tl-seg small { font-size: .62rem; opacity: .85; font-weight: 600; }
.tl-seg-offshore { background: linear-gradient(180deg, #2A6FA8, var(--plan-travail)); }
.tl-seg-rest { background: linear-gradient(180deg, #9AA5B1, #6B7785); }
.tl-cycle-empty {
  padding: 14px; text-align: center; color: var(--muted); font-size: .84rem;
  background: var(--gray-50); border-radius: var(--radius-sm);
}
.tl-cycle-list {
  list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0;
}
.tl-cycle-item {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center;
  font-size: .82rem;
}
.tl-cycle-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--muted);
}
.tl-cycle-offshore .tl-cycle-dot { background: var(--plan-travail); }
.tl-cycle-rest .tl-cycle-dot { background: #7B8794; }
.tl-cycle-item strong { display: block; font-size: .84rem; color: var(--ink); }
.tl-cycle-item span { color: var(--muted); font-size: .78rem; }
.tl-cycle-item em { font-style: normal; font-weight: 700; color: var(--ink-2); font-size: .78rem; }
.profile-cycle { margin-bottom: 12px; }
.tl-empty { margin-top: 8px; }

.tl-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.tl-dates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
.tl-dates small { display: block; font-size: .65rem; color: var(--muted); text-transform: uppercase; }

/* Planning day click + menu */
.plan-day-cell {
  appearance: none; -webkit-appearance: none;
  border: none; border-right: 1px solid rgba(0, 0, 0, .06);
  background: transparent; padding: 0; font: inherit; color: inherit;
  cursor: pointer;
}
.plan-day-cell.is-overridden::after {
  content: "";
  position: absolute; top: 4px; right: 4px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--warn); box-shadow: 0 0 0 1px #fff;
}
.plan-day-cell.phase-hotel { background: #D6DBDF; }
.plan-options-hint {
  margin: 10px 0 0; font-size: .78rem; color: var(--muted);
}
.plan-day-menu {
  position: fixed; z-index: 320;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 10px; max-height: min(70vh, 420px); overflow: auto;
}
.plan-day-menu-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 4px;
}
.plan-day-menu-head strong { font-size: .9rem; }
.plan-day-menu-x {
  width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); cursor: pointer; color: var(--muted); font-size: 1rem;
}
.plan-day-menu-sub {
  margin: 0 0 8px; font-size: .72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
.plan-day-menu-list { display: flex; flex-direction: column; gap: 4px; }
.plan-day-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: 1px solid transparent; background: transparent;
  border-radius: 8px; padding: 8px 10px; text-align: left;
  font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink);
  cursor: pointer;
}
.plan-day-menu-item:hover { background: var(--gray-50); }
.plan-day-menu-item.is-active {
  border-color: rgba(29, 91, 168, .3); background: rgba(29, 91, 168, .08); color: var(--sea);
}
.plan-day-menu-ico { width: 1.4em; text-align: center; }
.plan-day-menu-reset { color: var(--muted); font-weight: 500; border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0 0 8px 8px; }

/* ALERTS */
.alert-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.alert-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 8px;
  font-size: .86rem; border: 1px solid var(--line); cursor: pointer; background: var(--card);
}
.alert-line.danger { border-color: #FECACA; background: #FEF2F2; }
.alert-line.warning { border-color: #FDE68A; background: #FFFBEB; }
.alert-line.info { border-color: #BFDBFE; background: #EFF6FF; }

/* DRAWER / PROFILE */
.overlay { position: fixed; inset: 0; z-index: 200; }
.overlay[hidden] { display: none; }
.overlay:not([hidden]) { display: block; }
.overlay-bg { position: absolute; inset: 0; background: rgba(17,24,39,.5); backdrop-filter: blur(4px); }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  background: var(--card); box-shadow: -8px 0 40px rgba(0,0,0,.12);
  overflow-y: auto; padding: 28px 24px;
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
.drawer-x {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  cursor: pointer; font-size: 1rem; color: var(--muted); z-index: 5;
}

.profile-photo-block {
  display: flex; gap: 16px; align-items: center; margin-bottom: 24px;
  padding: 16px; background: var(--gray-50); border-radius: var(--radius);
}
.profile-apt-badges {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.profile-aptitude {
  margin: 16px 0 8px; padding: 14px 16px;
  background: var(--gray-50); border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.apt-badge {
  display: inline-flex; flex-direction: column; gap: 1px;
  padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card);
  font-size: .72rem; line-height: 1.2; max-width: 100%;
}
.apt-badge-lbl {
  font-size: .58rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.apt-badge strong {
  font-size: .78rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px;
}
.apt-badge.apt-ok { border-color: rgba(22, 163, 74, .35); background: rgba(22, 163, 74, .08); }
.apt-badge.apt-ok strong { color: #15803D; }
.apt-badge.apt-warn { border-color: rgba(217, 119, 6, .35); background: rgba(217, 119, 6, .08); }
.apt-badge.apt-warn strong { color: #B45309; }
.apt-badge.apt-bad { border-color: rgba(200, 16, 46, .35); background: rgba(200, 16, 46, .08); }
.apt-badge.apt-bad strong { color: var(--brand); }
.apt-badge.apt-missing { border-style: dashed; opacity: .85; }
.apt-badge.apt-missing strong { color: var(--muted); font-weight: 600; }
.apt-badge.apt-neutral strong { color: var(--ink-2); }
.apt-text.apt-ok { color: #15803D; }
.apt-text.apt-warn { color: #B45309; }
.apt-text.apt-bad { color: var(--brand); }
.apt-text.apt-missing { color: var(--muted); font-style: italic; font-weight: 600; }
.field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; background: var(--card);
  resize: vertical; min-height: 64px;
}
.profile-hero { margin-bottom: 20px; padding-right: 40px; }
.profile-hero h2 { font-size: 1.35rem; font-weight: 800; margin: 10px 0 4px; letter-spacing: -.02em; }
.sub { font-size: .86rem; color: var(--muted); }
.date-highlight {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-bottom: 20px; padding: 16px; background: var(--brand-soft); border-radius: var(--radius-sm);
}
.date-highlight small { display: block; font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.date-highlight strong { font-size: .95rem; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.info-item { padding: 12px; background: var(--gray-50); border-radius: var(--radius-sm); font-size: .84rem; }
.info-item small { display: block; color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.sec { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin: 18px 0 10px; }

/* FORM */
.panel { position: relative; background: var(--card); border-radius: var(--radius); width: min(560px, 94vw); max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); margin: auto; top: 50%; transform: translateY(-50%); }
.overlay#formOverlay:not([hidden]) { display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.form-panel { padding: 0; display: flex; flex-direction: column; top: auto; transform: none; }
.form-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; background: var(--sidebar); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.form-body { padding: 22px; overflow-y: auto; flex: 1; max-height: 65vh; }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--line); }
.panel-x, .form-head .panel-x { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.form-head .panel-x { border-color: rgba(255,255,255,.25); background: transparent; color: #fff; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: .68rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.field input, .field select { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: var(--card); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-field { display: flex; gap: 18px; padding: 16px; margin-bottom: 18px; background: var(--gray-50); border-radius: var(--radius-sm); }
.field-hint { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.plan-line { display: grid; grid-template-columns: 1fr 90px 32px; gap: 8px; margin-bottom: 8px; }
.plan-add { width: 100%; padding: 10px; border: 1px dashed var(--line); background: none; border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; font: inherit; }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--sidebar); color: #fff; padding: 14px 24px; border-radius: var(--radius-sm);
  font-size: .88rem; z-index: 300; box-shadow: var(--shadow-lg);
}
.toast[hidden] { display: none; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: var(--card); }
.filters-panel { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.filters-panel select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: .8rem; background: var(--card); }
.check { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: .82rem; }
.fav-btn { background: none; border: none; cursor: pointer; font-size: 1.1rem; opacity: .3; }
.fav-btn.on { opacity: 1; color: var(--brand); }

.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.admin-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

/* ── Org / Hiérarchie ─────────────────────────────────────── */
.org-toolbar {
  display: flex; flex-wrap: wrap; gap: 14px 20px;
  align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.org-toolbar-actions {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.org-site-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.org-site-tab {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink-2); font: inherit; font-size: .8rem;
  font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.org-site-tab:hover { border-color: var(--ink-2); }
.org-site-tab.active {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
body.dark .org-site-tab.active { background: #F9FAFB; color: #111827; border-color: #F9FAFB; }
.org-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin: 0;
  font-size: .78rem; color: var(--muted); font-weight: 500;
}
.org-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.org-legend-b2b {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 18px; padding: 0 6px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: .62rem; font-weight: 700; letter-spacing: .06em; color: var(--ink-2);
}

.org-tree {
  display: flex; flex-direction: column; gap: 0;
  margin-top: 8px; padding: 8px 0 24px;
}
.org-level {
  position: relative;
  padding: 20px 0 8px;
}
.org-level-chef .org-level-title { color: var(--brand); }
.org-level-chef .org-level-head {
  justify-content: center;
  text-align: center;
}
.org-level-chef .org-level-rank { display: none; }
.org-level-unclassified .org-level-title { color: var(--muted); font-weight: 600; }
.org-spine {
  width: 1px; height: 18px; margin: 0 auto 8px;
  background: var(--line);
}
.org-level-head {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 14px;
}
.org-level-titles { flex: 1; min-width: 0; }
.org-level-actions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-left: auto; flex-shrink: 0;
}
.org-level-actions .btn[disabled] { opacity: .35; cursor: not-allowed; }
.org-level-rank {
  flex: 0 0 auto;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  color: var(--muted); padding-top: 4px;
}
.org-level-title {
  margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink);
}
.org-level-count {
  margin: 2px 0 0; font-size: .78rem; color: var(--muted);
}

.org-row {
  display: flex; flex-wrap: wrap; gap: 12px 14px;
  justify-content: center; align-items: stretch;
  min-height: 64px; padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
.org-pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  min-height: 64px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 70%, var(--bg));
  transition: border-color .15s, background .15s;
}
.org-level-chef .org-pool {
  display: flex;
  justify-content: center;
  align-items: center;
  border-style: solid;
  background: var(--card);
  max-width: 420px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.org-level-chef .org-node {
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 14px 16px 10px;
  border-color: rgba(200, 16, 46, 0.35);
  box-shadow: var(--shadow-lg);
}
.org-drop.is-over {
  border-color: var(--brand) !important;
  background: var(--brand-soft);
}
.org-drop-hint {
  margin: 0; padding: 18px; text-align: center;
  font-size: .8rem; color: var(--muted); grid-column: 1 / -1; width: 100%;
}
.org-node {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-width: 200px; max-width: 280px;
  padding: 12px 12px 12px 8px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); box-shadow: var(--shadow);
  cursor: grab; font: inherit; color: inherit;
  transition: border-color .15s, transform .15s, opacity .15s;
  position: relative;
  user-select: none;
}
.org-node:hover { border-color: var(--brand); transform: translateY(-1px); }
.org-node:active { cursor: grabbing; }
.org-node.is-dragging { opacity: .45; transform: scale(.98); }
.org-node.is-drop-before {
  box-shadow: inset 3px 0 0 var(--brand);
}
.org-node .avatar-wrap,
.org-node .photo-img,
.org-node .avatar {
  flex-shrink: 0;
  pointer-events: none;
}
.org-node .photo-img.sm,
.org-node .avatar.sm {
  width: 44px;
  height: 44px;
}
.org-node-chef .photo-img,
.org-node-chef .avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
}
.org-drag-handle {
  flex: 0 0 auto;
  font-size: .7rem; letter-spacing: -.05em; color: var(--muted);
  cursor: grab; padding: 4px 2px; line-height: 1;
}
.org-node-body {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1;
}
.org-node-name {
  font-size: .84rem; font-weight: 700; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-node-chef .org-node-name { font-size: .95rem; }
.org-node-role {
  font-size: .72rem; font-weight: 600; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-node-meta {
  font-size: .68rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-node-apt {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px;
}
.org-node-apt .apt-badge {
  padding: 3px 6px;
}
.org-node-apt .apt-badge strong { font-size: .68rem; max-width: 90px; }
.org-b2b-badge {
  flex: 0 0 auto;
  padding: 2px 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg);
  font-size: .58rem; font-weight: 700; letter-spacing: .06em; color: var(--muted);
}

.org-inactive {
  margin-top: 28px; padding-top: 24px;
  border-top: 1px solid var(--line);
}
.org-inactive-head h3 {
  margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink);
}
.org-inactive-head p {
  margin: 4px 0 14px; font-size: .82rem; color: var(--muted);
}
.org-inactive-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.org-inactive-chip {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer; font: inherit; color: inherit;
  opacity: .85; transition: opacity .15s, border-color .15s;
}
.org-inactive-chip:hover { opacity: 1; border-color: var(--ink-2); }
.org-inactive-info {
  display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1;
}
.org-inactive-info strong {
  font-size: .82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-inactive-info small {
  font-size: .7rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .org-node, .org-level-chef .org-node { max-width: none; }
  .org-level-chef .org-pool { max-width: none; margin: 0; }
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-box.wide { grid-column: span 1; }
}
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar, .content { padding-left: 20px; padding-right: 20px; }
  .team-grid { grid-template-columns: 1fr; }
  .kpi-grid, .alert-summary, .tl-dates, .tl-metrics, .tl-hero-stats { grid-template-columns: 1fr 1fr; }
  .tl-hero { padding: 18px; }
  .tl-card-top { flex-direction: column; }
}
