/* Calendari de producció (#calendari, sections/calendar.js; N18): the filters, the timeline by phases (one row per
   phase, each date with the colour of its kind) and the list of Venciments (N23). Wider than the page on a phone: the
   timeline scrolls inside its panel. */
.cal-actions {
  flex-wrap: wrap;
}
/* «Què hi surt ▾»: a drop-down, each kind with its icon (Daniel, 2026-11-21) */
.cal-filters {
  position: relative;
  display: inline-block;
  margin: 0 0 14px;
}
.cal-filters > summary {
  list-style: none;
  cursor: pointer;
}
.cal-filters > summary::-webkit-details-marker {
  display: none;
}
.cal-filters > summary small {
  color: var(--muted);
  font-weight: 500;
}
.cal-filter-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  min-width: 280px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px #1c292b2e;
}
.cal-filter {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
}
.cal-filter:hover {
  background: #f1f5f2;
}
.cal-filter input {
  margin: 0;
}
.cal-filter-name {
  flex: 1;
}
.cal-filter small {
  color: var(--muted);
}
/* a kind's icon, white on its colour */
.cal-badge {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  vertical-align: middle;
}
.cal-ico {
  flex: none;
  width: 13px;
  height: 13px;
}
.cal-badge .cal-ico {
  width: 12px;
  height: 12px;
}
.cal-print-types .cal-badge {
  margin-right: 4px;
}
/* «Treure el bloc», asked first on yellow, as «Tens canvis sense desar» */
.cal-confirm {
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff4cf;
  border: 1px solid #f2d27a;
}
.cal-confirm > span {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}
.cal-print-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px 12px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.cal-print-types .cal-panel {
  margin: 0 0 16px;
}
.cal-scroll {
  overflow-x: auto;
}
.cal-grid {
  --name: 150px;
  --row: 24px;
  position: relative;
  min-width: 760px;
  padding: 0 12px 8px 0;
}
.cal-lane {
  display: grid;
  grid-template-columns: var(--name) 1fr;
  border-top: 1px solid var(--line);
}
.cal-head {
  position: sticky;
  top: 0;
  border-top: 0;
}
.cal-lane-name {
  padding: 8px 10px 8px 14px;
  font-size: 13px;
  font-weight: 650;
}
.cal-track {
  position: relative;
  min-height: calc(var(--lines, 1) * var(--row) + 12px);
}
.cal-months {
  min-height: 28px;
}
.cal-month {
  position: absolute;
  top: 0;
  bottom: 0;
  padding: 7px 0 0 5px;
  border-left: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.cal-today {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 2px solid #c0392b;
}
.cal-today span {
  position: absolute;
  top: 7px;
  left: 4px;
  font-size: 11px;
  font-weight: 650;
  color: #c0392b;
}
.cal-rule {
  position: absolute;
  top: 28px;
  bottom: 0;
  left: calc(var(--name) + (100% - var(--name) - 12px) * var(--at) / 100);
  border-left: 1px solid var(--line);
  pointer-events: none;
}
.cal-today-line {
  position: absolute;
  top: 28px;
  bottom: 0;
  left: calc(var(--name) + (100% - var(--name) - 12px) * var(--at) / 100);
  border-left: 1px dashed #c0392b;
  pointer-events: none;
}
.cal-item {
  position: absolute;
  top: calc(var(--l) * var(--row) + 6px);
  height: calc(var(--row) - 4px);
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  color: inherit;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.cal-range {
  gap: 5px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--c);
  color: #fff;
  font-weight: 600;
  overflow: hidden;
}
.cal-range .cal-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-point {
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px #fff;
}
.cal-milestone {
  gap: 5px;
  font-weight: 600;
  transform: translateX(-10px);
}
.cal-milestone.is-end {
  flex-direction: row-reverse;
  transform: translateX(calc(-100% + 10px));
}
.cal-item.is-soon {
  outline: 2px solid #d97706;
  outline-offset: 2px;
}
.cal-item.is-past {
  outline: 2px solid #b91c1c;
  outline-offset: 2px;
}
.cal-item.is-done {
  opacity: 0.5;
}
.cal-item:hover,
.cal-item:focus-visible {
  z-index: 2;
  filter: brightness(1.08);
}
.cal-list {
  margin: 0 0 16px;
}
.cal-list .panel-head small {
  color: var(--muted);
}
.cal-row .document-title a {
  color: inherit;
}
.cal-row.is-soon {
  background: #fff8eb;
}
.cal-row.is-past {
  background: #fdf0ef;
}
@media (max-width: 720px) {
  .cal-grid {
    --name: 104px;
  }
  .cal-lane-name {
    padding-left: 10px;
    font-size: 12px;
  }
}
html.dark .cal-filter-menu {
  background: #1e293b;
  border-color: #334155;
}
html.dark .cal-filter:hover {
  background: #263244;
}
html.dark .cal-confirm {
  background: #3a2f10;
  border-color: #6b5520;
}
html.dark .cal-point {
  box-shadow: 0 0 0 2px #1e293b;
}
html.dark .cal-row.is-soon {
  background: #3a2e12;
}
html.dark .cal-row.is-past {
  background: #3b1d1d;
}
