    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: system-ui, -apple-system, sans-serif;
      font-size: 13px;
      background: #f5f5f5;
      color: #222;
    }

    /* ── Sidebar ── */
    #sidebar {
      position: fixed;
      top: 0; left: 0;
      width: 300px; height: 100vh;
      background: #fff;
      border-right: 1px solid #ddd;
      display: flex;
      flex-direction: column;
      padding: 16px;
      gap: 12px;
      overflow-y: auto;
      z-index: 10;
    }

    #sidebar h1 { font-size: 15px; font-weight: 700; color: #1a1a2e; }

    label { font-weight: 600; font-size: 12px; color: #555; display: block; margin-bottom: 4px; }

    textarea {
      width: 100%;
      height: 200px;
      font-family: monospace;
      font-size: 11px;
      border: 1px solid #ccc;
      border-radius: 6px;
      padding: 8px;
      resize: vertical;
      background: #fafafa;
    }

    select, button {
      width: 100%;
      padding: 8px 10px;
      border-radius: 6px;
      border: 1px solid #ccc;
      font-size: 13px;
      cursor: pointer;
    }

    select { background: #fff; }

    button {
      background: #1a1a2e;
      color: #fff;
      border-color: transparent;
      font-weight: 600;
      transition: background .15s;
    }
    button:hover { background: #2d2d5e; }
    button.secondary {
      background: #fff;
      color: #1a1a2e;
      border-color: #ccc;
    }
    button.secondary:hover { background: #f0f0f0; }
    button.accent {
      background: #2563eb;
    }
    button.accent:hover { background: #1d4ed8; }

    #error {
      color: #c0392b;
      font-size: 11px;
      background: #fef2f2;
      border: 1px solid #fecaca;
      border-radius: 4px;
      padding: 6px 8px;
      display: none;
    }

    .sep { border: none; border-top: 1px solid #eee; }

    /* ── Main ── */
    #main {
      margin-left: 300px;
      padding: 24px;
      min-height: 100vh;
    }

    #export-info { font-size: 12px; color: #888; margin-bottom: 14px; }
    #month-title {
      font-size: 18px;
      font-weight: 700;
      margin-bottom: 2px;
      color: #1a1a2e;
      text-transform: capitalize;
    }

    /* ── Colour legend ── */
    .legend {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 16px;
      margin-bottom: 12px;
      font-size: 12px;
      color: #444;
    }
    .legend-item { display: inline-flex; align-items: center; gap: 6px; }
    .legend-swatch {
      flex: none;
      width: 22px;
      height: 12px;
      border-radius: 3px;
    }

    /* ── Calendar table ── */
    #calendar-wrap { overflow-x: auto; }

    table {
      border-collapse: collapse;
      min-width: 100%;
      background: #fff;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 1px 4px rgba(0,0,0,.08);
    }

    th, td {
      border: 1px solid #e5e7eb;
      padding: 0;
      text-align: center;
      white-space: nowrap;
    }

    /* Agent name column */
    th:first-child, td:first-child {
      text-align: left;
      padding: 6px 10px;
      min-width: 130px;
      font-weight: 600;
      background: #f9fafb;
      position: sticky;
      left: 0;
      z-index: 2;
    }

    /* Day header */
    thead th {
      background: #1a1a2e;
      color: #fff;
      font-weight: 600;
      font-size: 11px;
      padding: 6px 4px;
      min-width: 44px;
    }
    thead th:first-child { min-width: 130px; background: #12122a; }

    /* Weekend highlight in header */
    thead th.weekend { background: #2d2d5e; }

    /* Day cells */
    td.day-cell {
      min-width: 44px;
      height: 40px;
      vertical-align: middle;
      padding: 2px 3px;
    }

    td.weekend-col { background: #f8f8fd; }

    /* Astreinte chip */
    .chip {
      display: inline-block;
      position: relative;
      overflow: hidden;
      background: #2563eb;
      color: #fff;
      border-radius: 4px;
      padding: 2px 5px;
      font-size: 10px;
      font-weight: 600;
      line-height: 1.4;
      white-space: nowrap;
    }

    /* Split-day shifts: orange base (inline) + this blue overlay for the
       roster-day fraction. Solid layers so html2canvas renders them cleanly. */
    .chip-fill {
      position: absolute;
      left: 0; top: 0; bottom: 0;
      background: #2563eb;
      z-index: 0;
    }
    .chip-label { position: relative; z-index: 1; }

    tr:hover td { background: #f0f4ff; }
    tr:hover td:first-child { background: #e8eeff; }
    tr:hover td.weekend-col { background: #edeeff; }

    /* ── Today highlight ── */
    th.today-col { background: #0f9d58 !important; }
    td.today-col { background: #f0fdf4 !important; }

    /* ── Category group header row ── */
    tr.group-header td {
      background: #e8eeff;
      color: #1a1a2e;
      font-weight: 700;
      font-size: 11px;
      padding: 4px 10px;
      border-top: 2px solid #c7d0f8;
      letter-spacing: .04em;
      text-transform: uppercase;
    }
    tr.group-header:hover td { background: #e8eeff; }

    /* ── Monthly grid view (single-agent) ── */
    .monthly-agent-title {
      font-size: 15px;
      font-weight: 700;
      color: #1a1a2e;
      margin-bottom: 12px;
    }
    .monthly-grid {
      width: 100%;
      border-collapse: collapse;
      background: #fff;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 1px 4px rgba(0,0,0,.08);
    }
    .monthly-grid th {
      background: #1a1a2e;
      color: #fff;
      font-size: 11px;
      font-weight: 600;
      padding: 6px;
      text-align: center;
    }
    .monthly-grid th.we { background: #2d2d5e; }
    .monthly-grid td {
      border: 1px solid #e5e7eb;
      vertical-align: top;
      width: calc(100% / 7);
      height: 90px;
      padding: 4px;
    }
    .monthly-grid td.other-month { background: #f9fafb; }
    .monthly-grid td.today-day { background: #f0fdf4; }
    .monthly-grid td.weekend-day { background: #f8f8fd; }
    .day-num {
      font-size: 11px;
      font-weight: 700;
      color: #555;
      display: block;
      margin-bottom: 4px;
    }
    .monthly-grid td.today-day .day-num { color: #0f9d58; }
    .monthly-event {
      position: relative;
      overflow: hidden;
      background: #2563eb;
      color: #fff;
      border-radius: 4px;
      padding: 3px 6px;
      font-size: 11px;
      font-weight: 600;
      margin-top: 2px;
      line-height: 1.4;
    }

    /* ── Per-agent stats (main view only, not print/PDF) ── */
    #stats-section { margin-top: 24px; }
    #stats-section h2 {
      font-size: 14px;
      font-weight: 700;
      color: #1a1a2e;
      margin-bottom: 8px;
    }
    .stats-table {
      width: 100%;
      max-width: 760px;
      table-layout: fixed;
      border-collapse: collapse;
      background: #fff;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 1px 4px rgba(0,0,0,.08);
    }
    .stats-table th {
      background: #1a1a2e;
      color: #fff;
      font-size: 11px;
      font-weight: 600;
      padding: 6px 10px;
      text-align: left;
    }
    .stats-table th:first-child { width: 170px; }
    .stats-table th:not(:first-child), .stats-table td:not(:first-child) { text-align: right; }
    .stats-table th.balance, .stats-table td.balance { text-align: center; font-weight: 600; }
    .stats-table thead tr:first-child th:not(:first-child) { text-align: center; }
    /* a border in the colour of the page makes the space between the groups of columns */
    .stats-table th.gap, .stats-table td.gap { border-left: 6px solid #f5f5f5; }
    .stats-table td {
      border-bottom: 1px solid #e5e7eb;
      padding: 5px 10px;
      font-size: 12px;
    }

    body.pdf-export #stats-section { display: none !important; }

    @media print {
      #stats-section { display: none !important; }
      .monthly-grid td { height: 60px !important; }
      .monthly-event { font-size: 8px !important; padding: 2px 4px !important; }
      .day-num { font-size: 8px !important; }
      .monthly-agent-title { font-size: 10px !important; }
    }

    /* ── html2pdf full-calendar export (mirror @media print so all days fit) ── */
    body.pdf-export #calendar-wrap { overflow: visible !important; }
    body.pdf-export table:not(.monthly-grid) {
      width: 100% !important;
      table-layout: fixed !important;
      box-shadow: none;
    }
    body.pdf-export table:not(.monthly-grid) th,
    body.pdf-export table:not(.monthly-grid) td {
      font-size: 7px !important;
      min-width: 0 !important;
      width: auto !important;
      height: auto !important;
      line-height: 1 !important;
      padding: 2px !important;
      overflow: hidden;
      white-space: nowrap;
    }
    body.pdf-export table:not(.monthly-grid) th:first-child,
    body.pdf-export table:not(.monthly-grid) td:first-child {
      width: 80px !important;
      min-width: 0 !important;
      padding-left: 4px !important;
    }
    body.pdf-export table:not(.monthly-grid) .chip {
      font-size: 6px !important;
      padding: 1px 2px !important;
      border-radius: 2px !important;
      display: block;
      line-height: 1.2 !important;
    }
    body.pdf-export table:not(.monthly-grid) tr.group-header td {
      font-size: 7px !important;
      padding: 2px 4px !important;
      line-height: 1 !important;
    }
    body.pdf-export table:not(.monthly-grid) thead th {
      padding: 2px !important;
      line-height: 1.2 !important;
    }
    body.pdf-export .legend { font-size: 7px !important; gap: 8px !important; margin-bottom: 4px !important; }
    body.pdf-export .legend-swatch { width: 14px !important; height: 8px !important; }

    /* ── Empty state ── */
    #empty {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 300px;
      color: #888;
      font-size: 14px;
      flex-direction: column;
      gap: 8px;
    }
    #empty svg { opacity: .3; }

    /* ── Print styles ── */
    @page { size: landscape; margin: 8mm; }
    @media print {
      * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
      #sidebar { display: none !important; }
      #main { margin-left: 0 !important; padding: 0 !important; min-height: 0 !important; }
      body { background: #fff; font-size: 7px; line-height: 1; }
      #calendar-wrap { overflow: visible !important; }
      #month-title { font-size: 10px; margin-bottom: 4px; font-weight: 700; }
      .legend { font-size: 7px !important; gap: 8px !important; margin-bottom: 4px !important; }
      .legend-swatch { width: 14px !important; height: 8px !important; }
      table {
        box-shadow: none;
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse;
      }
      th, td {
        font-size: 7px !important;
        min-width: 0 !important;
        width: auto !important;
        height: auto !important;
        line-height: 1 !important;
        padding: 2px 2px !important;
        overflow: hidden;
        white-space: nowrap;
        vertical-align: middle;
        border: 1px solid #e5e7eb;
      }
      td.day-cell {
        height: auto !important;
        padding: 2px !important;
      }
      th:first-child, td:first-child {
        width: 80px !important;
        min-width: 0 !important;
        font-size: 7px !important;
        padding-left: 4px !important;
      }
      .chip {
        font-size: 6px !important;
        padding: 1px 2px !important;
        border-radius: 2px !important;
        display: block;
        line-height: 1.2 !important;
      }
      tr.group-header td {
        font-size: 7px !important;
        padding: 2px 4px !important;
        line-height: 1 !important;
        border-top: 1px solid #9aa5e0 !important;
      }
      thead th { padding: 2px 2px !important; line-height: 1.2 !important; font-size: 7px !important; }
      tr:hover td { background: unset; }
    }

/* ── View tabs (par agent / par jour) ── */
#view-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid #ddd; }
#view-tabs .tab {
  width: auto;
  padding: 8px 16px;
  background: transparent;
  color: #555;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
}
#view-tabs .tab:hover { background: #eceefa; }
#view-tabs .tab.active { color: #1a1a2e; border-bottom-color: #2563eb; }
body.pdf-export #view-tabs { display: none !important; }
body.pdf-export .week { margin-bottom: 0; }
/* html2pdf's page-break spacer stops a little short of the page edge: push the next week past it */
body.pdf-export .html2pdf__page-break ~ .week { padding-top: 40px; }
body.pdf-export .week-days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
body.pdf-export .week-pad { display: block; }
body.pdf-export .day-agent { flex-direction: column; align-items: flex-start; }

/* ── Day view: one card per day ── */
.week { margin-bottom: 16px; }
.week-head {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 6px;
}
.week-head span { font-weight: 400; color: #666; margin-left: 6px; }
/* Monday-first: seven columns, padding cells fill the days before the 1st */
.week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}
.day-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  overflow: hidden;
}
.day-head {
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  color: #fff;
  background: #1a1a2e;
  padding: 6px 10px;
}
.day-card.weekend-day .day-head { background: #2d2d5e; }
.day-card.today-day .day-head { background: #0f9d58; }
.day-body { padding: 4px 0; }
.day-group {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #1a1a2e;
  background: #e8eeff;
  padding: 2px 10px;
  margin-top: 2px;
}
.day-agent {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 4px 10px;
  border-bottom: 1px solid #f0f0f0;
}
.day-agent:last-child { border-bottom: none; }
.day-agent-name { font-weight: 600; font-size: 12px; overflow-wrap: anywhere; }

/* Too narrow for seven columns: one day per row, still grouped by week */
@media screen and (max-width: 1200px) {
  .week-days { grid-template-columns: 1fr; }
  .week-pad { display: none; }
  .day-agent { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
  .day-agent-chips { justify-content: flex-end; }
}
.day-agent-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.day-empty { color: #999; font-style: italic; padding: 6px 10px; }

@media print {
  #view-tabs { display: none !important; }
  /* Day view: a week's heading and its cards never get split across pages */
  .week { break-inside: avoid; page-break-inside: avoid; margin-bottom: 6px; }
  .day-card { break-inside: avoid; box-shadow: none; border: 1px solid #e5e7eb; }
  .week-days { gap: 4px; }
  .week-head { font-size: 9px !important; margin-bottom: 2px; }
  .day-head { font-size: 7px !important; padding: 2px 4px !important; }
  .day-group { font-size: 6px !important; padding: 1px 4px !important; }
  .day-agent { padding: 2px 4px !important; gap: 1px !important; }
  .day-agent-name { font-size: 7px !important; }
  .day-empty { font-size: 7px !important; padding: 2px 4px !important; }
}

/* ── Small screens ── */
@media screen and (max-width: 768px) {
  body { font-size: 14px; }

  /* Sidebar becomes a compact header: selects side by side, buttons in two columns */
  #sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #ddd;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    overflow: visible;
  }
  #sidebar > h1,
  #sidebar > .side-title,
  #sidebar > .sep { grid-column: 1 / -1; }
  #sidebar > .sep { display: none; }
  /* each section is a row of the grid; its own content flows on two columns */
  #sidebar > .side-section { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .side-section > #month-row, .side-section > #error, .side-section > #me-name, .side-actions > #btn-export-all { grid-column: 1 / -1; }

  select, button { min-height: 40px; font-size: 14px; }
  button { padding: 8px 6px; }

  #main { margin-left: 0; padding: 12px; min-height: 0; }
  #month-title { font-size: 16px; }

  .legend { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* Agent table: narrower sticky name column, scroll horizontally */
  #calendar-wrap, #stats-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th:first-child, td:first-child { min-width: 96px; max-width: 120px; padding: 6px; white-space: normal; font-size: 12px; }
  thead th:first-child { min-width: 96px; }
  tr.group-header td:first-child { max-width: none; }
  td.day-cell { height: 36px; }

  /* Single-agent month grid */
  .monthly-grid td { height: 64px; padding: 2px; }
  .monthly-grid th { padding: 4px 2px; font-size: 10px; }
  .monthly-event { font-size: 9px; padding: 2px 3px; }
  .day-num { font-size: 10px; margin-bottom: 2px; }
  .monthly-agent-title { font-size: 14px; }

  /* Stats */
  .stats-table { max-width: none; min-width: 560px; }
  .stats-table th:first-child { width: 120px; }
  .stats-table th, .stats-table td { padding: 5px 6px; white-space: nowrap; }
}

@media screen and (max-width: 480px) {
  .monthly-grid td { height: 52px; }
  .monthly-event { font-size: 8px; padding: 1px 2px; }
}

/* ── Skill coverage: day badge, issues, skills editor, modal (screen only, never in exports) ── */
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.day-check {
  width: auto;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  color: #fff;
}
.day-check.ok { background: #16a34a; }
.day-check.ko { background: #dc2626; }
.tab-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
body.pdf-export .day-check { display: none !important; }
@media print { .day-check { display: none !important; } }

.tab-hint { color: #555; margin-bottom: 10px; }
.muted { color: #888; }
.check-ok { color: #15803d; font-weight: 600; }
.check-ko { color: #b91c1c; font-weight: 600; margin-bottom: 8px; }

.issues { display: flex; flex-direction: column; gap: 6px; }
.issue-day {
  display: flex;
  gap: 16px;
  align-items: baseline;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 6px;
  cursor: pointer;
}
.issue-day:hover { background: #fef2f2; }
.issue-date { min-width: 150px; font-weight: 700; text-transform: capitalize; }
.issue-lines { display: flex; flex-direction: column; gap: 2px; }

.skills-table { border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); min-width: 560px; }
.skills-table th, .skills-table td { padding: 6px 14px; border-bottom: 1px solid #f0f0f0; text-align: left; }
.skills-table thead th { background: #1a1a2e; color: #fff; }
.skills-table tr.no-skill td:first-child { color: #b45309; font-style: italic; }
.skill-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.skill-chip { background: #e8eeff; color: #1a1a2e; border-radius: 10px; padding: 1px 9px; font-weight: 600; font-size: 12px; }
.skill-edit { width: auto; padding: 3px 12px; }
#skills-status { min-height: 18px; margin-bottom: 6px; }

.modal-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
.modal { width: min(640px, 92vw); max-height: 86vh; overflow-y: auto; padding: 18px 20px; background: #fff; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; text-transform: capitalize; }
.modal-close { width: auto; padding: 2px 8px; background: transparent; border: none; font-size: 16px; cursor: pointer; }
.modal-sub { color: #555; margin: 4px 0 12px; }
.issue-list { padding-left: 18px; color: #b91c1c; font-weight: 600; }
.issue-list .muted { font-weight: 400; }
.day-check.ok:hover { background: #15803d; }
.day-check.ko:hover { background: #b91c1c; }
.issue-day { color: #222; font-weight: 400; }
.modal-close { color: #222; }
.modal-close:hover { background: #eee; }
.skill-form { display: flex; flex-direction: column; gap: 6px; }
.skill-form-row { display: flex; align-items: center; gap: 14px; }
.skill-form-row label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.skill-form-row .skill-name { width: 80px; font-weight: 700; color: #222; font-size: 13px; }
.skill-form-row input[data-bound] { width: 100px; font-size: 12px; padding: 3px 6px; border: 1px solid #ccc; border-radius: 4px; }
.skill-form-row input[data-bound]:disabled { background: #f3f3f3; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.modal-actions button { width: auto; padding: 6px 18px; }

/* ── Public home: login, user box, own name highlighted ── */
#login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #f5f5f5; z-index: 50; }
#login-form { width: min(380px, 92vw); padding: 24px; background: #fff; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.12); display: flex; flex-direction: column; gap: 10px; }
#login-form h1 { font-size: 18px; color: #1a1a2e; }
#login-form input { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
#login-error { min-height: 18px; margin: 0; }
.day-agent-name.me { color: #0891b2; }
.access-add { display: flex; gap: 8px; margin-top: 12px; max-width: 640px; }
.access-add input { flex: 1; padding: 6px 8px; border: 1px solid #ccc; border-radius: 6px; }
.access-add select, .access-add button { width: auto; }

/* link styled as a sidebar button (switch between the admin and the agent space) */
a.button { display: block; width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid #ccc; font-size: 13px; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; }
a.button.secondary { background: #fff; color: #1a1a2e; }
a.button.secondary:hover { background: #f0f0f0; }
body.pdf-export a.button { display: none !important; }
.login-admin { align-self: center; font-size: 12px; color: #555; }
.login-admin:hover { color: #2563eb; }

/* days without astreinte fade out (screen only: the PDF exports and the print stay plain) */
@media screen {
  body:not(.pdf-export) .monthly-grid td.off-day { opacity: .7; }
  body:not(.pdf-export) .day-card.off-day { opacity: .7; }
}

/* ── Sidebar sections: account, then month and filters, then exports ── */
.side-section { display: flex; flex-direction: column; gap: 12px; }
#me-name { margin-top: 2px; font-size: 13px; font-weight: 600; color: #2563eb; }
.month-nav { display: flex; gap: 6px; }
.month-nav select { flex: 1; min-width: 0; }
.month-nav button { width: 38px; padding: 8px 0; font-size: 16px; line-height: 1; flex: none; }
.month-nav button:disabled { opacity: .4; cursor: default; }

/* ── Timeline of an astreinte (day dialog) ── */
.modal.wide { width: min(920px, 94vw); }
.tl { margin: 12px 0 4px; }
.tl-row { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.tl-label { width: 150px; flex: none; font-size: 11px; font-weight: 600; color: #1a1a2e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-track { position: relative; flex: 1; height: 16px; background: #f3f4f6; border-radius: 4px; }
.tl-axis .tl-track { height: 16px; background: none; border-bottom: 1px solid #ddd; }
.tl-tick { position: absolute; top: 0; transform: translateX(-50%); font-size: 10px; color: #666; }
.tl-group { margin: 10px 0 2px; padding: 1px 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: #1a1a2e; background: #e8eeff; border-radius: 3px; }
.tl-group.tl-gap { margin-top: 26px; } /* COD0 is another kind of list: some air before it */
.tl-bar { position: absolute; top: 1px; bottom: 1px; box-sizing: border-box; border-radius: 3px; background: #2563eb; border-right: 1px solid #fff; }
.tl-bar.miss { background: repeating-linear-gradient(45deg, #fecaca, #fecaca 5px, #fee2e2 5px, #fee2e2 10px); }

/* a click on a day opens its astreinte dialog */
.day-head, .monthly-grid td:not(.other-month), thead th[onclick] { cursor: pointer; }
.tl-bar.cover { background: #0d9488; color: #fff; font-size: 9px; font-weight: 700; line-height: 14px; padding-left: 4px; overflow: hidden; white-space: nowrap; }
.tl-bar.warn { background: #fde68a; box-shadow: inset 0 0 0 1px #f59e0b; }
.tl-bar.me { background: #06b6d4; }                      /* the logged-in agent: cyan, no border */
.tl-bar.me.cover { background: #0e7490; }              /* … covering an INC position */
.tl-label.me { color: #0891b2; font-weight: 700; }
.tl-label.miss { color: #b91c1c; font-weight: 700; }

.skills-table tr.spacer td { height: 14px; padding: 0; background: #f5f5f5; border-bottom: none; }

/* ── Password: login hint, first-use banner, change form ── */
.login-hint { font-size: 12px; color: #555; margin: 0; }
#login-form label { margin-top: 2px; }
.pw-form { display: flex; flex-direction: column; gap: 6px; }
.pw-form input { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.pw-form .muted { font-size: 12px; margin: 0; }
.access-title { margin: 26px 0 6px; font-size: 14px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; padding: 8px 16px; border-radius: 6px; background: #166534; color: #fff; font-weight: 600; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
a.button.accent { background: #2563eb; color: #fff; border-color: transparent; }
a.button.accent:hover { background: #1d4ed8; }
.login-or { text-align: center; font-size: 12px; color: #888; }
.skills-table tr.no-account td { background: #fffbeb; }
.user-new { width: 220px; padding: 4px 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 12px; }
.skills-table tr.dirty td { background: #eff6ff; }
.skill-edit:disabled { opacity: .4; cursor: default; }
.access-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.access-actions button { width: auto; padding: 6px 18px; }
.access-actions button:disabled { opacity: .4; cursor: default; }
.user-new { width: 100%; max-width: 280px; }

/* ── Préparation (admin): the planning of the next month ── */
.pp-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 8px 12px; margin-bottom: 8px; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); position: sticky; top: 0; z-index: 5; }
.pp-summary .check-ko, .pp-summary .check-ok { margin: 0; }
.pp-sum-actions { margin-left: auto; display: flex; gap: 6px; }
.pp-sum-actions button, .pp-delta > button { width: auto; padding: 4px 10px; font-size: 12px; }
.pp-delta { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 6px 12px; margin-bottom: 10px; }
.pp-delta summary { cursor: pointer; font-weight: 600; }
#calendar-wrap .pp-delta-table { width: auto; min-width: 0; background: transparent; border-collapse: collapse; margin: 6px 0 8px; font-size: 12px; box-shadow: none; }
.pp-delta-table td { border: 0; padding: 2px 16px 2px 0; text-align: left; }
.pp-act-Ajouter td:first-child { color: #15803d; font-weight: 700; }
.pp-act-Retirer td:first-child { color: #b91c1c; font-weight: 700; }
.pp-act-Modifier td:first-child { color: #b45309; font-weight: 700; }
.pp-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; align-items: start; }
.pp-head { display: flex; justify-content: space-between; align-items: center; }
.pp-head > span:last-child { display: flex; align-items: center; gap: 6px; }
.pp-check { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: #fff; }
.pp-check.ok { color: #15803d; }
.pp-check.ko { color: #b91c1c; }
.pp-add { width: auto; padding: 0 7px; line-height: 20px; font-size: 14px; background: #fff; color: #1a1a2e; border: 0; border-radius: 4px; cursor: pointer; }
.pp-issues { padding: 4px 10px; font-size: 11px; color: #b91c1c; background: #fef2f2; }
.pp-agent { padding: 4px 10px; border-bottom: 1px solid #f0f0f0; }
.pp-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pp-name { font-weight: 600; font-size: 12px; }
.pp-bal { font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 8px; border: 1px solid #e5e7eb; }
.pp-month { font-size: 10.5px; color: #6b7280; }
.pp-items { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.pp-dispo, .pp-shift, .pp-block { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; border-radius: 4px; padding: 1px 5px; }
.pp-dispo { background: #ecfdf5; color: #065f46; border: 1px dashed #34d399; }
.pp-dispo.pp-d-part { background: #fffbeb; color: #92400e; border-color: #fbbf24; }
.pp-dispo.pp-d-full { opacity: .55; text-decoration: line-through; }
.pp-dispo.pp-d-partial { border-style: solid; }
.pp-shift { color: #fff; font-weight: 600; background: #2563eb; }
.pp-shift.pp-src-dispo { background: #059669; }
.pp-shift.pp-src-manual { background: #7c3aed; }
.pp-btn { width: auto; padding: 0 3px; margin: 0; font-size: 11px; line-height: 16px; background: rgba(255,255,255,.7); color: #1a1a2e; border: 0; border-radius: 3px; cursor: pointer; }
.pp-block { background: #f3f4f6; color: #4b5563; }
.pp-block.pp-b-contrainte_forte { background: #fee2e2; color: #991b1b; font-weight: 600; }
.pp-block.pp-b-contrainte_faible { background: #ffedd5; color: #9a3412; }
.pp-block.pp-b-autre_centre { background: #ede9fe; color: #5b21b6; font-weight: 600; }
.pp-off { padding: 4px 10px; font-size: 11px; color: #6b7280; display: flex; flex-wrap: wrap; gap: 4px 10px; background: #fafafa; }
.pp-off i { color: #9ca3af; }
.pp-card { cursor: pointer; }
.pp-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.pp-h { margin: 12px 0 4px; font-size: 13px; }
.pp-legend { font-size: 11px; margin-bottom: 6px; }
.pp-legend .pp-shift, .pp-legend .pp-dispo { margin-right: 4px; }
.modal .pp-agent { padding: 5px 4px; }
.modal .pp-items { gap: 6px; }
/* drag and drop of a dispo onto the timeline of the day */
.pp-dispo[draggable="true"] { cursor: grab; }
.pp-dragging .tl-miss.pp-drop-ok { outline: 2px dashed #059669; outline-offset: -2px; background: #ecfdf5; }
.pp-dragging .tl-miss.pp-drop-no { opacity: .35; }
.pp-dragging .tl-miss.pp-drop-hover { outline-style: solid; background: #d1fae5; }
.pp-dragging .tl.pp-drop-hover { outline: 2px solid #059669; outline-offset: 2px; }
.pp-warn { margin: 0 0 8px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: #92400e; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; }
.pp-auto-table { width: 100%; font-size: 12px; margin-top: 8px; }
.pp-auto-table th, .pp-auto-table td { text-align: left; padding: 3px 8px; border: 0; border-bottom: 1px solid #f0f0f0; }
.pp-auto-table tr.pp-over td:first-child { color: #92400e; font-weight: 700; }
/* the cards are one seventh of the width: names and chips wrap */
.pp-weeks .pp-card .pp-name { font-size: 11px; }
.pp-weeks .pp-card .pp-agent { padding: 3px 6px; }
.pp-weeks .pp-card .pp-bal, .pp-weeks .pp-card .pp-month { font-size: 10px; }
.pp-weeks .pp-card .day-head { font-size: 11px; padding: 5px 8px; }
.pp-weeks .pp-card .pp-shift { font-size: 10.5px; }
.pp-weeks .pp-card .pp-issues { font-size: 10px; }
.pp-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 4px; }
.pp-seg-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; text-align: left; background: #fff; color: #1a1a2e; border: 1px solid #d1d5db; border-radius: 8px; cursor: pointer; }
.pp-seg-btn span { font-size: 11px; font-weight: 400; color: #6b7280; }
.pp-seg-btn.on { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 1px #2563eb inset; }

/* where the month stands in its planning cycle: on screen only */
#month-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.month-status { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 12px; text-transform: none; white-space: nowrap; cursor: help; }
.month-status:empty { display: none; }
.ms-open { background: #dbeafe; color: #1e40af; }
.ms-planning { background: #ffedd5; color: #9a3412; }
.ms-frozen { background: #dcfce7; color: #166534; }
.ms-complete { background: #fef3c7; color: #92400e; }
.ms-current, .ms-past { background: #e5e7eb; color: #4b5563; }
@media print { .month-status { display: none !important; } }
body.pdf-export .month-status { display: none !important; }

/* CE: chef d'équipe incendie, a skill (same blue as the skill chips), next to the names of the agents who hold CE INC */
.ce-badge { display: inline-block; margin-left: 5px; padding: 0 4px; font-size: 9px; font-weight: 700; line-height: 14px; letter-spacing: .03em; vertical-align: middle; color: #3b4a7a; background: #e8eeff; border: 1px solid #d3dcf5; border-radius: 3px; }

/* the agent × day table: every day column as wide as the longest chip of the month */
body:not(.pdf-export) table.agent-grid { table-layout: fixed; min-width: 100%; }
table.agent-grid thead th:first-child, table.agent-grid td:first-child { width: var(--name-col); min-width: var(--name-col); max-width: var(--name-col); overflow: hidden; text-overflow: ellipsis; }
table.agent-grid thead th:not(:first-child), table.agent-grid td.day-cell { width: var(--day-col); min-width: 0; }

/* the agent space, on a month that is not frozen: what they declared */
.my-dispos-note { margin: 0 0 12px; padding: 8px 12px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; color: #1e3a8a; }
.monthly-event.my-ev { color: #fff; }
.my-ev.my-dispo_totale { background: #059669; }
.my-ev.my-dispo_partielle { background: #0d9488; }
.my-ev.my-contrainte_forte { background: #b91c1c; }
.my-ev.my-contrainte_faible { background: #d97706; }
.my-ev.my-autre_centre { background: #6d28d9; }
.my-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 10px; font-size: 12px; color: #555; }
.my-legend span { display: inline-flex; align-items: center; gap: 6px; }
.my-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }

/* the agents over their limits: one line, a list when opened */
details.pp-warn { padding: 0; }
details.pp-warn summary { cursor: pointer; padding: 6px 12px; list-style-position: inside; }
.pp-warn-list { margin: 0; padding: 2px 12px 8px 30px; font-weight: 400; columns: 2; column-gap: 28px; }
.pp-warn-list li { break-inside: avoid; margin: 1px 0; }
.pp-warn-list li.hard { color: #991b1b; }
@media (max-width: 900px) { .pp-warn-list { columns: 1; } }

/* the balance of the end of the previous month, next to the current one in the statistics of the preparation */
.bal-prev { font-weight: 400; font-size: 11px; color: #6b7280; }

.day-card { scroll-margin-top: 8px; }

.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; max-width: 900px; }
.link-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.link-head { display: flex; align-items: center; gap: 8px; }
.link-head .muted { flex: 1; font-size: 12px; }
.link-members { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; align-items: center; }
.link-chip { display: inline-flex; align-items: center; gap: 4px; background: #e8eeff; color: #1a1a2e; border-radius: 12px; padding: 2px 4px 2px 10px; font-weight: 600; font-size: 12px; }
.link-card button.link-x, .link-card button.link-del { width: auto; min-height: 0; padding: 0 6px; line-height: 1.4; background: none; color: #6b7280; border: 0; border-radius: 10px; font-weight: 400; }
.link-card button.link-x:hover, .link-card button.link-del:hover { background: #fee2e2; color: #b91c1c; }
.link-card button.link-del { font-size: 14px; padding: 2px 6px; }
.link-card select.link-add { width: 100%; }
button.link-new { width: auto; padding: 8px 14px; }
