/* Panell data.carlesfite.com: disseny aprovat el 2026-12-05 */

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-llati-ampliat.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-llati.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --fons: #EEF1F4;
  --superficie: #FFFFFF;
  --text: #17212B;
  --secundari: #5B6775;
  --linia: #D5DBE2;
  --suau: #E4E9EE;
  --vora: #86919E;
  --meu: #3346B8;
  --meu-fons: #E3E7FA;
  --joan: #0E7C6B;
  --joan-text: #0B6657;
  --joan-fons: #DCEFEB;
  --atencio: #B86E00;
  --atencio-text: #8A5300;
  --atencio-fons: #FBEFD9;
  --error: #B83227;
  --error-text: #9E2A20;
  --error-fons: #F8E1DE;
  --correcte: #2C7A4B;
  --correcte-text: #23643D;
  --correcte-fons: #DFF0E5;
  --radi: 10px;
  --menu-amplada: 232px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fons);
  color: var(--text);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 650; }

a { color: var(--meu); }
:focus-visible { outline: 2px solid var(--meu); outline-offset: 2px; }

.amagat {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.salta { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--superficie); padding: 8px 12px; }
.salta:focus { left: 8px; }

.icona {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.icona .ple { fill: currentColor; stroke: none; }

/* ------------------------------------------------------------ menú lateral (ordinador) */
.menu-lateral {
  position: fixed; inset: 0 auto 0 0; width: var(--menu-amplada);
  display: flex; flex-direction: column;
  background: var(--superficie); border-right: 1px solid var(--linia);
  padding: 20px 12px;
}
.menu-lateral .marca { font-weight: 700; font-size: 19px; padding: 4px 12px 18px; }
.menu-lateral ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.menu-lateral a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 44px; padding: 0 12px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 500;
}
.menu-lateral a:hover { background: var(--suau); }
.menu-lateral a[aria-current="page"] { background: var(--meu-fons); color: var(--meu); font-weight: 650; }
.menu-lateral .sortir { margin-top: auto; padding: 0 4px; }

.comptador {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  background: var(--suau); color: var(--secundari);
}
.comptador.atencio { background: var(--atencio-fons); color: var(--atencio-text); }
.comptador.error { background: var(--error-fons); color: var(--error-text); }

/* ------------------------------------------------------------ barra de baix (mòbil) */
.barra-baix { display: none; }

/* ------------------------------------------------------------ contingut */
.contingut {
  margin-left: var(--menu-amplada);
  max-width: calc(1120px + var(--menu-amplada));
  padding: 32px 40px 56px;
}
.capcalera { margin-bottom: 22px; }
.capcalera .secundari { margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tornar { margin: 0 0 8px; }
.tornar a { color: var(--secundari); text-decoration: none; font-weight: 500; }
.tornar a:hover { color: var(--text); }
.secundari { color: var(--secundari); }

.bloc {
  background: var(--superficie); border: 1px solid var(--linia); border-radius: var(--radi);
  padding: 18px 22px; margin-bottom: 20px;
}
.bloc > h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bloc > h2 .compte { color: var(--secundari); font-weight: 500; font-size: 16px; }
#joan > h2::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--joan);
}
#meves > h2::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--meu);
}

.dues-columnes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.dues-columnes > .bloc { margin-bottom: 0; }

.resum { font-size: 18px; margin: 0 0 20px; }
.pendent-text, .buit { color: var(--secundari); margin: 6px 0; }

/* ------------------------------------------------------------ llistes amb separadors */
.llista { list-style: none; margin: 0; padding: 0; }
.llista > li { border-bottom: 1px solid var(--linia); }
.llista > li:last-child { border-bottom: 0; }
.llista.punts > li { padding: 10px 0; }
.llista.dades > li {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 48px; padding: 8px 0;
}

.avis-fila a {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
  color: var(--text); text-decoration: none; font-weight: 500;
}
.avis-fila a:hover { color: var(--meu); }
.punt { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--vora); }
.punt.atencio { background: var(--atencio); }
.punt.error { background: var(--error); }

.menu-mes a {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 52px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 18px;
}
.sortir-mes { margin-top: 24px; }

/* ------------------------------------------------------------ tasques */
.tasca { display: flex; align-items: center; gap: 4px; background: var(--superficie); }
.tasca-marca {
  flex: 1; min-width: 0; min-height: 52px;
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
  cursor: pointer; font-weight: 400; font-size: 16px;
}
.tasca-marca input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.caixa {
  flex: none; width: 24px; height: 24px; border: 2px solid var(--vora); border-radius: 7px;
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.caixa::after {
  content: ""; width: 6px; height: 11px; margin-top: -3px;
  border: solid #FFFFFF; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
  opacity: 0;
}
.tasca-marca:hover .caixa { border-color: var(--text); }
.tasca-marca input:focus-visible + .caixa { outline: 2px solid var(--meu); outline-offset: 2px; }
.tasca-marca input:checked + .caixa { background: var(--meu); border-color: var(--meu); }
.tasca.joan .tasca-marca input:checked + .caixa { background: var(--joan); border-color: var(--joan); }
.tasca-marca input:checked + .caixa::after { opacity: 1; }

.inicial {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.inicial.c { background: var(--meu-fons); color: var(--meu); }
.inicial.j { background: var(--joan-fons); color: var(--joan-text); }

.tasca-text { display: flex; flex-direction: column; min-width: 0; }
.tasca-titol { overflow-wrap: anywhere; }
.tasca.feta .tasca-titol { text-decoration: line-through; color: var(--secundari); }
.tasca-detall { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: var(--secundari); }
.quan.avui { color: var(--meu); font-weight: 600; }
.quan.endarrerida { color: var(--atencio-text); font-weight: 600; }

.tasca-editar, .ansa {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: none; color: var(--secundari); padding: 0;
}
.tasca-editar:hover, .ansa:hover { background: var(--suau); color: var(--text); }
.ansa { cursor: grab; touch-action: none; }
.tasca.arrossegant {
  position: relative; z-index: 2; box-shadow: 0 6px 20px rgba(23, 33, 43, .16);
  border-radius: 8px; border-bottom-color: transparent;
}
.tasca.arrossegant .ansa { cursor: grabbing; }
.tasca.sortint { opacity: .45; transition: opacity .3s; }

.fetes { margin-top: 8px; }
.fetes summary {
  display: flex; align-items: center; min-height: 44px; cursor: pointer;
  color: var(--secundari); font-weight: 500;
}

/* ------------------------------------------------------------ formularis i botons */
label { font-weight: 600; font-size: 14px; color: var(--text); }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--superficie); border: 1px solid var(--vora); border-radius: 8px;
  min-height: 44px; padding: 8px 12px; width: 100%;
}
textarea { resize: vertical; min-height: 120px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--meu); outline-offset: 1px; }

.boto {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 8px;
  font: inherit; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
  background: var(--superficie); color: var(--text); border: 1px solid var(--vora);
}
.boto:hover { background: var(--suau); }
.boto.principal { background: var(--meu); color: #FFFFFF; border-color: var(--meu); }
.boto.principal:hover { background: #2A3A9C; }
.boto.perill { color: var(--error-text); border-color: var(--error); }
.boto.perill:hover { background: var(--error-fons); }
.boto-text {
  font: inherit; font-weight: 500; color: var(--secundari); background: none; border: 0;
  min-height: 44px; padding: 0 8px; cursor: pointer; text-align: left;
}
.boto-text:hover { color: var(--text); }

.nova-tasca {
  background: var(--superficie); border: 1px solid var(--linia); border-radius: var(--radi);
  padding: 16px 22px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px;
}
.nova-tasca > input[name="titol"] { font-size: 18px; min-height: 48px; }
.camps-fila { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.camp { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.camp input, .camp select { width: auto; min-width: 130px; }
[hidden] { display: none !important; }

.fitxa {
  background: var(--superficie); border: 1px solid var(--linia); border-radius: var(--radi);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; max-width: 760px;
}
.fitxa > label { margin-top: 8px; }
.fitxa .camps-fila { margin-top: 8px; }
.accions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.esborrar { margin-top: 20px; }

.etiqueta {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--suau); color: var(--secundari);
}
.etiqueta.meva { background: var(--meu-fons); color: var(--meu); }
.etiqueta.joan { background: var(--joan-fons); color: var(--joan-text); }
.etiqueta.atencio { background: var(--atencio-fons); color: var(--atencio-text); }
.etiqueta.error { background: var(--error-fons); color: var(--error-text); }
.etiqueta.correcte { background: var(--correcte-fons); color: var(--correcte-text); }

.avis { margin: 0 0 16px; padding: 12px 16px; border-radius: 8px; border-left: 4px solid; font-weight: 500; }
.avis.error { background: var(--error-fons); color: var(--error-text); border-color: var(--error); }
.avis.atencio { background: var(--atencio-fons); color: var(--atencio-text); border-color: var(--atencio); }
.nova-tasca .avis { margin: 0; }

.franja-greu {
  background: var(--error-fons); border: 1px solid var(--error); border-radius: var(--radi);
  color: var(--error-text); padding: 12px 18px; margin-bottom: 20px; font-weight: 600;
}
.franja-greu p { margin: 4px 0; }
.franja-greu a { color: var(--error-text); }

/* ------------------------------------------------------------ entrada */
.pagina-entrar { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.entrar {
  width: 100%; max-width: 380px; background: var(--superficie);
  border: 1px solid var(--linia); border-radius: var(--radi); padding: 28px;
}
.entrar h1 { margin-bottom: 20px; }
.entrar form { display: flex; flex-direction: column; gap: 6px; }
.entrar label { margin-top: 8px; }
.entrar .boto { margin-top: 20px; }

/* ------------------------------------------------------------ mòbil */
@media (max-width: 899px) {
  .menu-lateral { display: none; }
  .contingut { margin-left: 0; padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 24px; }
  .bloc, .nova-tasca, .fitxa { padding: 14px 16px; }
  .dues-columnes { grid-template-columns: 1fr; }
  .dues-columnes > .bloc { margin-bottom: 0; }
  .camp { flex: 1 1 130px; }
  .camp input, .camp select { width: 100%; }
  .camps-fila > .boto { flex: 1 1 100%; }

  .barra-baix {
    display: block; position: fixed; inset: auto 0 0 0; z-index: 10;
    background: var(--superficie); border-top: 1px solid var(--linia);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .barra-baix ul { list-style: none; margin: 0; padding: 0; display: flex; }
  .barra-baix li { flex: 1; }
  .barra-baix a {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; min-height: 60px; color: var(--secundari); text-decoration: none;
    font-size: 12px; font-weight: 500;
  }
  .barra-baix a[aria-current="page"] { color: var(--meu); font-weight: 650; }
  .barra-baix .comptador {
    position: absolute; top: 4px; left: calc(50% + 6px);
    min-width: 20px; height: 18px; padding: 0 5px; font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
