/* Gestió + Direcció only. No global tokens or course styles are changed. */
:is(.pt-gestio, .pt-direccio) {
  width: min(1280px, calc(100% - 64px)); max-width: 1280px;
  padding: 24px 0 40px; margin-inline: auto;
  display: block;
}
/* This selector applies the calmer canvas/navigation only to these two views. */
body:has(:is(.pt-gestio, .pt-direccio)) { background: #eff5f2; }
#pantalla:has(:is(.pt-gestio, .pt-direccio)) .pt-pestanyes-marc { width: min(1280px, calc(100% - 64px)); max-width: 1280px; padding: 0; }
#pantalla:has(:is(.pt-gestio, .pt-direccio)) .pt-pestanyes { border: 0; border-bottom: 1px solid var(--linia); border-radius: 0; background: none; padding: 0; gap: 16px; }
#pantalla:has(:is(.pt-gestio, .pt-direccio)) .pt-pestanya { background: none; color: var(--pissarra); border-radius: 0; padding: 16px 4px 12px; border-bottom: 3px solid transparent; }
#pantalla:has(:is(.pt-gestio, .pt-direccio)) .pt-pestanya[aria-pressed=true] { color: var(--profund); border-bottom-color: var(--verd); }
.pt-centre-cap { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.pt-centre-cap h1 { margin: 0 0 8px; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; letter-spacing: -.035em; color: var(--tinta); }
.pt-centre-cap p { margin: 0; font-size: 15px; color: var(--pissarra); max-width: 62ch; }
.pt-centre-accions { display: flex; gap: 12px; flex-wrap: wrap; }
:is(.pt-gestio, .pt-direccio) .ui-btn { border-radius: 10px; min-height: 40px; font-size: 13px; }
:is(.pt-gestio, .pt-direccio) :is(button, input, select, textarea):focus-visible { outline: 3px solid var(--verd); outline-offset: 3px; }
:is(.pt-gestio, .pt-direccio) [hidden] { display: none !important; }
.pt-centre-resum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.pt-centre-total { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border: 1px solid var(--linia); border-radius: 16px; box-shadow: 0 2px 4px #102d2210; }
.pt-centre-total > div { display: grid; gap: 2px; }
.pt-centre-total strong { font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--tinta); }
.pt-centre-total span { font-size: 13px; }
.pt-centre-icona { display: grid; place-items: center; flex: 0 0 54px; height: 54px; border-radius: 12px; background: #e9f3ed; color: #174d3e; }
.pt-centre-total:nth-child(2) .pt-centre-icona { background: #e7f3fb; color: #245574; }
.pt-centre-total:nth-child(3) .pt-centre-icona { background: #fff6e5; color: #66532f; }
.pt-gestio-tauler { padding: 0 20px; border: 1px solid var(--linia); border-radius: 16px; box-shadow: 0 2px 4px #102d2210; }
.pt-gestio-tabs { display: flex; gap: 12px; border-bottom: 1px solid var(--linia); }
.pt-gestio-tabs button { font: inherit; font-size: 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--pissarra); padding: 19px 14px 16px; cursor: pointer; }
.pt-gestio-tabs button[aria-pressed=true] { color: var(--profund); border-bottom-color: var(--verd); font-weight: 600; }
.pt-gestio-eines { display: flex; align-items: center; gap: 14px; padding: 18px 0 6px; flex-wrap: wrap; }
.pt-gestio-eines > button { margin-left: auto; }
.pt-gestio-eines label { margin: 0; }
.pt-gestio-camp-cerca { display: grid; gap: 6px; color: var(--pissarra); font-size: 12px; }
.pt-gestio-eines :is(input, select), .pt-gestio-membres input[type=search] { width: 100%; min-height: 42px; font: inherit; font-size: 13px; color: var(--tinta); background: var(--blanc); border: 1px solid var(--linia); border-radius: 8px; padding: 10px 12px; box-sizing: border-box; }
.pt-gestio-eines input { min-width: 245px; }
.pt-gestio-tauler .pt-gestio-previa { position: relative; border: 1px solid var(--linia); border-radius: 10px; }
.pt-gestio-tauler .pt-gestio-previa :is(th, td) { padding: 8px 16px; font-size: 13px; }
.pt-gestio-tauler .pt-gestio-previa th { background: #f7faf8; font-size: 10px; letter-spacing: .055em; border-bottom-width: 1px; }
.pt-gestio-tauler .pt-gestio-previa td { vertical-align: middle; }
.pt-gestio-tauler .pt-gestio-previa tr:last-child td { border-bottom: 0; }
.pt-gestio-tauler td small { display: block; color: var(--pissarra); font-size: 11px; margin-top: 3px; }
.pt-gestio-tauler td:last-child { white-space: nowrap; }
.pt-gestio-tauler .ui-chip { border-radius: 6px; font-size: 11px; font-weight: 400; white-space: nowrap; }
.pt-gestio-tauler .pt-gestio-optativa { background: #fff7e9; border-color: #efdfb9; }
.pt-gestio-paginacio { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 0; font-size: 12px; color: var(--pissarra); }
.pt-gestio-paginacio > div { display: flex; align-items: center; gap: 14px; }
.pt-gestio-paginacio button { width: 38px; height: 38px; background: var(--blanc); border: 1px solid var(--linia); border-radius: 7px; font: inherit; color: var(--profund); cursor: pointer; }
.pt-gestio-paginacio button:disabled { opacity: .4; cursor: default; }
.pt-gestio-buit { padding: 36px 12px; text-align: center; color: var(--pissarra); }
.pt-gestio-buit h2 { font-size: 18px; color: var(--tinta); }
.pt-gestio-buit p { font-size: 13px; }
.pt-gestio-nota { font-size: 12px; color: var(--pissarra); margin: 20px 0 0; }
.pt-gestio-accio { padding: 22px; margin: 0 0 24px; border: 1px solid var(--linia); border-top: 3px solid var(--verd); border-radius: 16px; }
.pt-gestio-accio > header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.pt-gestio-accio h2 { font-size: 20px; margin: 0; color: var(--tinta); }
.pt-gestio-accio fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pt-gestio-accio .pt-gestio-nou-grup { border: 0; padding-top: 0; }
.pt-gestio-accio .pt-gestio-persona-camps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pt-gestio-accio .pt-gestio-persona-camps label[data-persona-cataleg] { grid-column: auto; }
.pt-gestio-accio .pt-gestio-membres-llista { max-height: 300px; overflow-y: auto; margin-top: 10px; padding: 0 4px; }
.pt-gestio-accio .pt-check--linia { min-height: 38px; border-bottom: 1px solid var(--linia); }
.pt-gestio-accio input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--verd); }
.pt-gestio-accio .pt-gestio-csv { border-radius: 10px; min-height: 120px; }
.pt-gestio-accio .pt-gestio-membres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pt-gestio-membres-col { min-width: 0; }
.pt-gestio-membres-col h3 { margin: 0 0 8px; font-size: 17px; color: var(--profund); }
.pt-gestio-membres-col .pt-gestio-camp-cerca { margin-top: 12px; }
.pt-gestio-membres select { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--linia); border-radius: 8px; background: var(--blanc); color: var(--tinta); font: inherit; font-size: 13px; }
.pt-gestio-seleccio { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pt-gestio-membres .pt-check span { min-width: 0; overflow-wrap: anywhere; }
.pt-gestio-membres .pt-check small { display: block; margin-top: 3px; color: var(--pissarra); font-size: 11px; }
.pt-optativa-alta { margin-top: 18px; border: 1px solid var(--linia); border-radius: 12px; padding: 14px; background: #f5faf7; }
.pt-optativa-alta summary { cursor: pointer; font-weight: 600; color: var(--profund); font-size: 13px; }
.pt-optativa-alta p { font-size: 12px; color: var(--pissarra); margin: 12px 0; }
.pt-optativa-alta button { margin-top: 14px; }
.pt-gestio-membres-peu { padding-top: 16px; border-top: 1px solid var(--linia); }
.pt-direccio-graella { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.pt-direccio .pt-gestio-bloc { border: 1px solid var(--linia); border-radius: 16px; padding: 24px; }
.pt-direccio .pt-direccio-llista { list-style: none; padding: 0; margin: 20px 0; }
.pt-direccio-llista li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--linia); }
.pt-direccio-llista li > div { display: grid; gap: 4px; overflow-wrap: anywhere; }
.pt-direccio-llista span, .pt-direccio-llista small { font-size: 12px; color: var(--pissarra); }
.pt-centre-avatar { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 50%; background: #e9f3ed; }
.pt-direccio .pt-gestio-nou-camps { display: grid; grid-template-columns: 1fr; gap: 12px; }
.pt-direccio .pt-gestio-nou-camps .ui-btn { justify-self: start; }
.pt-direccio-nota { font-size: 12px; }
@media (hover: hover) and (pointer: fine) {
  .pt-gestio-tauler tbody tr:hover { background: #f7fbf8; }
  .pt-gestio-tabs button:hover { color: var(--profund); }
}
@media (max-width: 820px) {
  .pt-centre-cap { align-items: start; flex-direction: column; gap: 16px; }
  .pt-direccio-graella { grid-template-columns: 1fr; }
  .pt-centre-total { padding: 14px; gap: 10px; }
  .pt-centre-icona { flex-basis: 38px; height: 38px; }
}
@media (max-width: 560px) {
  #pantalla:has(:is(.pt-gestio, .pt-direccio)) .pt-pestanyes-marc { width: calc(100% - 28px); }
  #pantalla:has(:is(.pt-gestio, .pt-direccio)) .pt-pestanyes { gap: 8px; }
  #pantalla:has(:is(.pt-gestio, .pt-direccio)) .pt-pestanya { font-size: 12px; }
  #pantalla:has(:is(.pt-gestio, .pt-direccio)) .ui-peu { height: auto; flex-wrap: wrap; gap: 8px; padding-block: 12px; }
  :is(.pt-gestio, .pt-direccio) { width: calc(100% - 28px); padding-top: 16px; }
  .pt-centre-resum { gap: 8px; }
  .pt-centre-total { flex-direction: column; align-items: start; padding: 12px; }
  .pt-centre-total strong { font-size: 24px; }
  .pt-centre-total span { font-size: 11px; }
  .pt-centre-icona { display: none; }
  .pt-gestio-tauler { padding-inline: 12px; }
  .pt-gestio-tabs { gap: 0; }
  .pt-gestio-tabs button { padding-inline: 10px; font-size: 12px; }
  .pt-gestio-eines > label, .pt-gestio-eines > button { flex: 1 1 100%; }
  .pt-gestio-eines input { min-width: 0; }
  .pt-gestio-accio { padding: 16px; }
  .pt-gestio-accio .pt-gestio-persona-camps, .pt-gestio-accio .pt-gestio-membres { grid-template-columns: 1fr; }
  .pt-gestio-taula-grups thead { display: none; }
  .pt-gestio-taula-grups, .pt-gestio-taula-grups tbody { display: block; }
  .pt-gestio-tauler .pt-gestio-taula-grups tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 12px 10px; border-bottom: 1px solid var(--linia); }
  .pt-gestio-tauler .pt-gestio-taula-grups tr:last-child { border-bottom: 0; }
  .pt-gestio-tauler .pt-gestio-taula-grups td { display: block; border: 0; padding: 3px; overflow-wrap: anywhere; }
  .pt-gestio-taula-grups td:nth-child(2) { grid-column: 1 / -1; }
  .pt-gestio-taula-grups td[data-etiqueta] { grid-column: 1 / -1; }
  .pt-gestio-taula-grups td[data-etiqueta]::before { content: attr(data-etiqueta) ': '; color: var(--pissarra); font-size: 11px; }
  .pt-gestio-taula-grups td:last-child { grid-column: 2; grid-row: 1; }
}
