* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, sans-serif; }

body.pagina-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f4f5f7;
}

.targeta-login {
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 380px;
}

.targeta-login h1 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: #1a1a2e;
}

.camp {
  margin-bottom: 1rem;
}

.camp label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.3rem;
}

.camp input {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.pagina-login button[type="submit"] {
  width: 100%;
  padding: 0.7rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

.pagina-login button[type="submit"]:hover {
  background: #1d4ed8;
}

.error-text {
  color: #dc2626;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  min-height: 1.2em;
}

.negoci-identificat {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1.2rem;
  text-align: center;
}

body.pagina-app {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: 220px;
  background: #1a1a2e;
  color: white;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-titol {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

#sidebar a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

#sidebar a:hover {
  background: #2a2a4a;
}

#sidebar a.actiu {
  background: #2563eb;
  color: white;
}

#btn-logout {
  margin-top: auto;
  padding: 0.6rem;
  background: transparent;
  border: 1px solid #444;
  color: #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
}

#contingut {
  flex: 1;
  padding: 2rem;
}

.formulari {
  max-width: 600px;
}

.camp {
  margin-bottom: 1.1rem;
}

.camp label {
  display: block;
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.camp input[type="text"],
.camp input[type="email"],
.camp input[type="number"],
.camp textarea {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}

.checkbox-grup {
  display: flex;
  gap: 1.5rem;
}

.checkbox-grup label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: normal;
  cursor: pointer;
}

.camp-toggle label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: #333;
  cursor: pointer;
  width: 100%;
}

.camp-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.camp-meitat {
  display: inline-block;
  width: 48%;
}

.camp-meitat:first-of-type {
  margin-right: 4%;
}

button[type="submit"] {
  padding: 0.65rem 1.5rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

button[type="submit"]:hover {
  background: #1d4ed8;
}

.success-text {
  color: #16a34a;
  font-size: 0.9rem;
}

#contingut h1 {
  margin-bottom: 1.5rem;
}

.separador-sidebar {
  height: 1px;
  background: #3a3a5c;
  margin: 0.6rem 0.7rem;
}

#sidebar a.enllac-destacat {
  background: #164e2e;
  color: #d1fae5;
  font-weight: 600;
}

#sidebar a.enllac-destacat:hover {
  background: #1a5c37;
}

#sidebar a.enllac-destacat.actiu {
  background: #059669;
  color: white;
}

.taula-horari {
  border-collapse: collapse;
  min-width: 720px;
}

.taula-horari th {
  text-align: left;
  font-size: 0.85rem;
  color: #666;
  padding: 0.5rem;
  border-bottom: 2px solid #eee;
}

.taula-horari td {
  padding: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.taula-horari input[type="time"] {
  padding: 0.3rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.taula-horari input[type="time"]:disabled {
  background: #f5f5f5;
  color: #aaa;
}

h2 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.8rem;
  color: #1a1a2e;
}

#btn-desar-horari,
.btn-primari {
  padding: 0.65rem 1.5rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

#btn-desar-horari:hover,
.btn-primari:hover {
  background: #1d4ed8;
}

.label-pausa {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #555;
  font-weight: normal;
  cursor: pointer;
  white-space: nowrap;
}

.taula-horari input[type="time"]::placeholder {
  color: #bbb;
}

.fila-camps {
  display: flex;
  gap: 1rem;
}

.fila-camps .camp {
  flex: 1;
}

.formulari-excepcio {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.2rem;
  max-width: 500px;
}

.taula-excepcions {
  border-collapse: collapse;
  width: 100%;
  min-width: 600px;
}

.taula-excepcions th {
  text-align: left;
  font-size: 0.85rem;
  color: #666;
  padding: 0.5rem;
  border-bottom: 2px solid #eee;
}

.taula-excepcions td {
  padding: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.text-buit {
  color: #888;
  font-style: italic;
  margin-bottom: 1rem;
}

.btn-secundari {
  padding: 0.65rem 1.2rem;
  background: white;
  color: #444;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-left: 0.5rem;
}

.btn-secundari:hover {
  background: #f5f5f5;
}

.btn-perillos {
  padding: 0.35rem 0.8rem;
  background: white;
  color: #dc2626;
  border: 1px solid #dc2626;
  border-radius: 5px;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-perillos:hover {
  background: #fef2f2;
}

.camp-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: #333;
  cursor: pointer;
  margin-bottom: 0.9rem;
  width: 100%;
  flex-wrap: wrap;
  overflow-wrap: break-word;
}

.camp-checkbox input[type="checkbox"],
.camp-checkbox input[type="radio"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.camp-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.camp-checkbox-inline {
  margin-bottom: 1rem;
  font-weight: normal;
  color: #555;
}

.camp-hores-excepcio {
  margin-bottom: 0.9rem;
}

.fila-botons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.fila-botons button {
  box-sizing: border-box;
  height: 42px;
  width: 100%;
  padding: 0 1.2rem;
  line-height: 2.5;
}

.btn-ample {
  flex: 1;
  margin-top: 0;
  margin-left: 0;
  text-align: center;
  border: 1px solid transparent;
}

.btn-ample.btn-secundari {
  border-color: #ccc;
}

.llista-dies-grup {
  margin: 0.4rem 0 0 1.2rem;
  font-size: 0.85rem;
  color: #666;
}

.taula-excepcions details summary {
  cursor: pointer;
}

/* Login: centrar el títol dins la targeta */
.targeta-login h1 {
  text-align: center;
}

/* Responsive: mòbil i pantalles estretes */
@media (max-width: 720px) {
  body.pagina-app {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.8rem;
    gap: 0.4rem;
  }

  .sidebar-titol {
    display: none;
  }

  #sidebar a {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  #btn-logout {
    margin-top: 0.4rem;
    width: 100%;
  }

  #contingut {
    padding: 1rem;
  }

  .formulari {
    max-width: 100%;
  }

  .fila-camps {
    flex-direction: column;
    gap: 0;
  }

  .checkbox-grup {
    flex-direction: column;
    gap: 0.6rem;
  }
}

input[type="checkbox"] {
  flex-shrink: 0;
}

.fila-botons button[type="submit"] {
  border: 1px solid transparent;
}

.taula-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 1rem;
}

html {
  overflow-x: hidden;
}

body {
  overflow-x: clip;
}

.camp > label:first-child {
  margin-bottom: 0.6rem;
}

.panell-detall {
  margin-top: 1.5rem;
  border-top: 2px solid #eee;
  padding-top: 1.5rem;
}

.tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #444;
}

.tab-btn.actiu-tab {
  background: #2563eb;
  color: white;
}

.mostra-color {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid #ddd;
  vertical-align: middle;
}

.grup-fases {
  margin-bottom: 1rem;
  padding: 0.8rem;
  background: #f9fafb;
  border-radius: 6px;
}

.grup-fases strong {
  display: block;
  margin-bottom: 0.5rem;
}

.camp select {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
}

input[type="color"] {
  width: 60px;
  height: 38px;
  padding: 2px;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
}

.fila-botons-inline {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.grup-fases {
  margin-bottom: 0.4rem;
}

.grup-fases strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}

.grup-fases .camp-checkbox {
  margin-bottom: 0.3rem;
}

.fila-botons-inline {
  margin-top: 0.8rem;
}

h2 {
  margin-top: 1rem;
}

.tab-contingut {
  overflow-anchor: none;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

html, body {
  overflow-anchor: none;
}

.fila-fase {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.8rem;
}

.sv-durada-total {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 0.8rem;
}

.rs-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.rs-badge-pendent {
  background: #fef3c7;
  color: #92400e;
}

.rs-badge-confirmada {
  background: #d1fae5;
  color: #065f46;
}

.rs-badge-cancellada {
  background: #fee2e2;
  color: #991b1b;
}

.rs-badge-completada {
  background: #e5e7eb;
  color: #374151;
}

.rs-resultat-client {
  padding: 0.5rem 0.7rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 0.3rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.rs-resultat-client:hover {
  background: #f3f4f6;
}

.fila-botons .btn-perillos.btn-ample {
  border-color: #dc2626;
}

@media (min-width: 721px) {
  #sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
  }
}

.fq-subtitol {
  font-size: 1rem;
  margin: 1.2rem 0 0.6rem;
  color: #1a1a2e;
}

.fq-avis {
  background: #fef3c7;
  color: #92400e;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin-top: 0.8rem;
}

.fq-toggle {
  margin-bottom: 0;
  font-weight: normal;
}

.fq-ordre {
  white-space: nowrap;
}

.fq-ordre button {
  padding: 0.2rem 0.55rem;
  margin: 0 0.2rem 0 0;
}

.fq-btn-mou:disabled {
  opacity: 0.35;
  cursor: default;
}

#fq-btn-traduir {
  margin-left: 0;
}

.fq-ajuda {
  margin-bottom: 1.4rem;
}

#fq-btn-nova {
  margin-bottom: 1.2rem;
}

#cl-btn-nou {
  margin-bottom: 1.2rem;
}

.cl-ajuda {
  margin-bottom: 1rem;
  color: #555;
}

.cl-avis {
  background: #fef3c7;
  color: #92400e;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

.cl-petit {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #666;
}

.cl-info {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 0.4rem;
}

.cl-llista-reserves {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.cl-llista-reserves li {
  padding: 0.45rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

#cl-bq-afegir {
  margin-bottom: 1.2rem;
}

.camp input[readonly] {
  background: #f5f5f5;
  color: #666;
}

.cv-avis {
  background: #fef3c7;
  color: #92400e;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

.cv-petit {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #666;
}

.cv-info {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 0.4rem;
}

.cv-subtitol {
  font-size: 1rem;
  margin: 1.2rem 0 0.6rem;
  color: #1a1a2e;
}

.cv-xat {
  max-height: 420px;
  overflow-y: auto;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cv-bombolla {
  max-width: 80%;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.cv-client {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.cv-bot {
  align-self: flex-end;
  background: #dbeafe;
}

.cv-rol {
  display: block;
  font-size: 0.7rem;
  color: #666;
  margin-bottom: 0.15rem;
}

#cv-btn-actualitzar {
  margin-left: 0;
  margin-bottom: 1.2rem;
}

#us-btn-nou {
  margin-bottom: 1.2rem;
}

.us-ajuda {
  margin-bottom: 1.2rem;
  color: #555;
}

.us-petit {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #666;
}

.us-separador {
  border-top: 1px solid #eee;
  margin: 1.5rem 0 1rem;
}

.st-filtres {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.st-filtres .camp {
  flex: 1;
  min-width: 140px;
  max-width: 220px;
}

.st-subtitol {
  margin: 1.4rem 0 0.7rem;
  font-size: 1.05rem;
}

.st-targetes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.st-targeta {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem;
}

.st-valor {
  font-size: 1.7rem;
  font-weight: 600;
  color: #1a1a2e;
}

.st-etiqueta {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.2rem;
}

.st-nota {
  font-size: 0.8rem;
  color: #777;
  margin-top: 0.4rem;
}

.st-avis {
  background: #fef3c7;
  color: #92400e;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* Avisos al menú lateral */
#sidebar a.te-avis,
#sidebar a.te-avis.actiu {
  background: #d97706;
  color: #ffffff;
}

#sidebar a.te-avis:hover {
  background: #b45309;
}

.avis-comptador {
  display: inline-block;
  margin-left: 0.5rem;
  min-width: 1.2rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #ffffff;
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.us-subtitol {
  font-size: 1rem;
  margin: 1.2rem 0 0.4rem;
  color: #1a1a2e;
}

.cv-panell {
  align-self: flex-end;
  background: #dcfce7;
}

.cv-finestra {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0.2rem 0 1rem;
}

.cv-finestra-oberta {
  background: #d1fae5;
  color: #065f46;
}

.cv-finestra-tancada {
  background: #fee2e2;
  color: #991b1b;
}

.sidebar-usuari {
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.8rem;
  background: #2a2a4a;
  border-radius: 8px;
  word-break: break-word;
}

.sidebar-usuari-nom {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
}

.sidebar-usuari-rol {
  font-size: 0.75rem;
  color: #cbd5e1;
  margin-top: 0.1rem;
}

@media (max-width: 720px) {
  .sidebar-usuari {
    width: 100%;
    margin-bottom: 0.4rem;
  }
}
