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

:root {
  --primary: #2a7000;
  --primary-light: #3d8c00;
  --accent: #cc1111;
  --bg: #f0f6ee;
  --card: #ffffff;
  --text: #1a2b18;
  --muted: #6b7c6a;
  --border: #d0dccf;
  --shadow: 0 2px 8px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.13);

  --c-recogida: #7c3aed;
  --c-entrega: #1d6fb5;
  --c-cambio: #0f7b6c;
  --c-otros: #6b7c72;

  --c-pendiente: #c47a0a;
  --c-en_ruta: #1d6fb5;
  --c-completado: #1a7a3c;
  --c-cancelado: #b93030;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── HEADER ── */
.header {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.logo-img {
  height: 38px;
  width: auto;
  background: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
}

.nav-tabs { display: flex; gap: 2px; flex: 1; }

.btn-assign-toggle {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  margin: 0 4px;
  white-space: nowrap;
}

.nav-tab {
  background: transparent;
  color: rgba(255,255,255,0.65);
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-tab:hover { background: rgba(255,255,255,0.12); color: #fff; }
.nav-tab.active { background: rgba(255,255,255,0.18); color: #fff; font-weight: 700; }

.header-right { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; }

.btn-icon {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}
.btn-icon:hover { background: rgba(255,255,255,0.22); }

.btn-new {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s;
}
.btn-new:hover { background: #d08e10; }

/* ── DATE NAV ── */
.date-nav {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
}
.date-nav button {
  background: none;
  border: 1px solid var(--border);
  padding: 4px 13px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text);
  transition: all 0.15s;
}
.date-nav button:hover { border-color: var(--primary); color: var(--primary); }

#currentDateLabel {
  font-size: 16px;
  font-weight: 700;
  min-width: 260px;
  text-align: center;
  color: var(--text);
}
#todayBtn { font-size: 12px; color: var(--primary); border-color: var(--primary); font-weight: 600; }

/* ── NOTA DEL DIA ── */
#dayNoteBar {
  transition: background 0.2s;
}
#dayNoteInput::placeholder { color: #b08900; opacity: 0.7; }

/* ── FILTERS ── */
.filter-bar {
  background: #fff;
  display: flex;
  gap: 8px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.search-input:focus { outline: none; border-color: var(--primary); }

.filter-select {
  padding: 7px 8px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}
.filter-select:focus { outline: none; border-color: var(--primary); }

/* ── MAIN ── */
.main-content {
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 16px;
}

/* ── STAT CARDS ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--card);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ── SERVICE CARDS (day/list) ── */
.services-list { display: flex; flex-direction: column; gap: 7px; }

.service-card {
  background: var(--card);
  border-radius: 10px;
  padding: 13px 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 64px 90px 1fr auto 110px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-left: 4px solid var(--border);
  transition: box-shadow 0.15s, transform 0.1s;
}
.service-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }

.service-card.tipo-recogida { border-left-color: var(--c-recogida); }
.service-card.tipo-entrega  { border-left-color: var(--c-entrega); }
.service-card.tipo-cambio   { border-left-color: var(--c-cambio); }
.service-card.tipo-otros    { border-left-color: var(--c-otros); }
.color-verde    { background: #e6f4ea !important; }
.color-amarillo { background: #fef9c3 !important; }
.color-azul     { background: #dbeafe !important; }
.color-lila     { background: #ede9fe !important; border-left-color: #7c3aed !important; }
.service-card.estado-cancelado { opacity: 0.45; }

.service-time {
  font-size: 19px;
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
  color: var(--text);
}
.service-time .no-time { font-size: 11px; color: var(--muted); font-weight: 400; }

.service-info { overflow: hidden; }
.service-cliente {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.service-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.service-nota {
  font-size: 12px;
  color: #dc2626;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
  min-width: 100px;
  max-width: 150px;
  text-align: right;
}
.service-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ot-tag {
  font-weight: 700;
  font-size: 11px;
  color: var(--primary);
  background: rgba(26,92,58,0.08);
  padding: 1px 6px;
  border-radius: 4px;
}
.matricula-tag {
  font-weight: 700;
  font-size: 11px;
  color: #92400e;
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.service-card .badge {
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 8px;
  min-width: 80px;
  text-align: center;
}

.badge-recogida { background: #111; color: #fff; }
.badge-entrega  { background: #111; color: #fff; }
.badge-cambio   { background: #111; color: #fff; }
.badge-otros    { background: #444; color: #fff; }

.badge-pendiente              { background: #dbeafe; color: #1d4ed8; }
.badge-pendiente_rosa         { background: #fce7f3; color: #be185d; }
.badge-pendiente_confirmacion { background: #dbeafe; color: #1d4ed8; }
.badge-en_ruta                { background: #fef9c3; color: #a16207; }
.badge-completado             { background: #dcf0e4; color: var(--c-completado); }
.badge-cancelado              { background: #f1f5f9; color: #64748b; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.empty-icon { font-size: 52px; margin-bottom: 14px; }
.empty-state p { font-size: 16px; margin-bottom: 6px; }

/* ── WEEK VIEW ── */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.week-day {
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 120px;
}
.week-day-header {
  background: var(--primary);
  color: #fff;
  padding: 8px 6px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.week-day-header.today { background: var(--accent); }
.week-day-num { font-size: 20px; font-weight: 800; line-height: 1.1; }
.week-day-body { padding: 6px; display: flex; flex-direction: column; gap: 4px; }

.week-item {
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  border-left: 3px solid var(--border);
  background: #f8f8f8;
  transition: opacity 0.15s;
  overflow: hidden;
}
.week-item:hover { opacity: 0.8; }
.week-item.tipo-recogida { border-left-color: var(--c-recogida); background: #f5f0ff; }
.week-item.tipo-entrega  { border-left-color: var(--c-entrega);  background: #eef5ff; }
.week-item.tipo-cambio   { border-left-color: var(--c-cambio);   background: #edfaf6; }
.week-item.tipo-otros    { border-left-color: var(--c-otros);    background: #f4f4f4; }
.week-item strong { display: block; font-size: 12px; }
.week-item span { color: var(--muted); font-size: 10px; }
.week-item-tipus { display: block; margin-bottom: 3px; }
.week-item .badge { color: #fff; font-size: 9px; padding: 1px 6px; }
.week-item-obra {
  display: block;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── MONTH VIEW ── */
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.month-col-header {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.month-day {
  background: var(--card);
  border-radius: 8px;
  padding: 6px 7px;
  min-height: 78px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
  overflow: hidden;
}
.month-day:hover { box-shadow: var(--shadow-lg); }
.month-day.other-month { opacity: 0.35; }
.month-day.today { border: 2px solid var(--primary); }
.month-day-num {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.month-day.today .month-day-num {
  background: var(--primary);
  color: #fff;
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  text-align: center;
  line-height: 22px;
  font-size: 12px;
  margin-bottom: 5px;
}
.month-dot-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
  overflow: hidden;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-recogida { background: var(--c-recogida); }
.dot-entrega  { background: var(--c-entrega); }
.dot-cambio   { background: var(--c-cambio); }
.dot-otros    { background: var(--c-otros); }
.month-more { font-size: 10px; color: var(--muted); }

/* ── LIST VIEW ── */
.list-table {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow-x: auto;   /* si no cap, es desplaça en horitzontal en lloc de tallar-se */
}
.list-table table { width: 100%; border-collapse: collapse; }
.list-table th {
  background: var(--primary);
  color: #fff;
  padding: 11px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.list-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
.list-table tr:last-child td { border-bottom: none; }
.list-table tbody tr:hover td { background: #f5f8f5; cursor: pointer; }
.list-notes-cell {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--muted);
}

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

/* Login modal — fondo completament opac */
#loginModal {
  background: #1a2332;
  z-index: 5000;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 660px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.modal-header h3 { font-size: 17px; font-weight: 800; }
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--bg); }

.modal-form {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full-width { width: 100%; }

.rec-day-label {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.rec-day-label input { width: 13px; height: 13px; cursor: pointer; }
.rec-day-label:has(input:checked) { background: #dbeafe; border-color: #3b82f6; color: #1d4ed8; }

/* ── Calendari personalitzat de recurrència ── */
.rc-calendar { background: #fff; border: 1.5px solid #cbd5e1; border-radius: 8px; padding: 10px; }
.rc-calendar-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rc-calendar-nav button {
  background: #f1f5f9; border: none; border-radius: 6px; width: 26px; height: 26px;
  font-size: 13px; cursor: pointer; color: #475569;
}
.rc-calendar-nav button:hover { background: #e2e8f0; }
.rc-calendar-month-label { font-size: 13px; font-weight: 700; color: #1a2332; text-transform: capitalize; }
.rc-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.rc-calendar-dow { font-size: 10px; font-weight: 700; color: #94a3b8; text-align: center; padding: 2px 0; }
.rc-calendar-day {
  font-size: 12px; text-align: center; padding: 6px 0; border-radius: 5px; cursor: pointer;
  user-select: none; background: #f8faf8; color: #1a2332;
}
.rc-calendar-day:hover { background: #e2ede2; }
.rc-calendar-day.rc-other-month { color: #cbd5e1; cursor: default; }
.rc-calendar-day.rc-other-month:hover { background: #f8faf8; }
.rc-calendar-day.rc-selected { background: #2563eb; color: #fff; font-weight: 700; }
.rc-calendar-day.rc-past { opacity: 0.4; cursor: default; }
.rc-calendar-day.rc-past:hover { background: #f8faf8; }
.rc-calendar-count { font-size: 11px; color: #475569; margin-top: 8px; font-weight: 600; }

/* ── Vista Setmana ampliada (vehicle, conductor, matrícula) ── */
.week-item-vehicle, .week-item-driver, .week-item-plate {
  display: block;
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
}
.week-item-vehicle { color: #1a5c1a; }
.week-item-driver  { color: #475569; }
.week-item-plate   { color: #7c3aed; }

/* ── Panel plegable d'Assignacions del dia ── */
.assign-panel {
  background: #fff;
  border-bottom: 2px solid #e2ede2;
  max-height: 320px;
  overflow-y: auto;
}
.assign-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: #f0f9f0; border-bottom: 1px solid #e2ede2;
  position: sticky; top: 0; z-index: 5;
}
.assign-panel-nav { display: flex; align-items: center; gap: 10px; }
.assign-panel-navbtn {
  background: #fff; border: 1.5px solid var(--border); border-radius: 6px;
  width: 26px; height: 26px; font-size: 13px; cursor: pointer; color: #475569;
}
.assign-panel-navbtn:hover { background: #f1f5f9; }
.assign-panel-date { font-size: 14px; font-weight: 800; color: var(--text); min-width: 140px; text-align: center; }
.assign-panel-today {
  background: #fff; border: 1.5px solid var(--primary); color: var(--primary);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.assign-panel-close {
  background: none; border: none; font-size: 18px; cursor: pointer; color: #888;
}
.assign-panel-body { padding: 16px 20px; }

.assign-readonly-badge {
  background: #f1f5f9; color: #64748b; font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px; display: inline-block; margin-bottom: 12px;
}
.assign-section { margin-bottom: 18px; }
.assign-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: #64748b; margin-bottom: 8px;
}
.assign-section-unavailable .assign-section-title { color: #94a3b8; }
.assign-empty { color: #94a3b8; font-style: italic; font-size: 14px; padding: 8px 0; }
.assign-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 8px 14px; margin-bottom: 6px;
}
.assign-row-disabled { background: #f8fafc; opacity: 0.7; }
.assign-row-warning { border-color: #f59e0b; background: #fffbeb; }
.assign-driver-name { font-weight: 700; font-size: 13px; color: var(--text); }
.assign-vehicle-select { display: flex; align-items: center; gap: 8px; }
.assign-select {
  padding: 5px 10px; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 12px; font-family: inherit; min-width: 150px; cursor: pointer;
}
.assign-residuo-input {
  padding: 5px 10px; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 12px; font-family: inherit; min-width: 150px;
}
.assign-residuo-input:focus { outline: none; border-color: var(--primary); }
.assign-readonly { font-size: 12px; color: #64748b; font-weight: 600; }
.assign-warning-badge { font-size: 13px; cursor: help; }

.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--primary); }
.form-group textarea { resize: vertical; }

/* ── CUSTOM SELECT ──────────────────────────────────────────
   Substitueix el desplegable natiu del navegador per evitar que es tanqui
   sol amb petits moviments del ratolí/trackpad (problema reportat en equips
   amb trackpad molt sensible). El <select> original es manté present (per
   validació de formularis) però invisible, sota el "trigger" clicable. ── */
.cs-wrap { position: relative; display: block; width: 100%; }
.cs-wrap .cs-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; pointer-events: none; border: 0; margin: 0; padding: 0;
}
.cs-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  cursor: pointer; user-select: none;
  padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 14px; font-family: inherit; color: var(--text); background: #fff;
  transition: border-color 0.15s; min-height: 19px; line-height: 19px;
}
.cs-trigger::after {
  content: ''; flex-shrink: 0; width: 7px; height: 7px; margin-top: -3px;
  border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg);
}
.cs-wrap.cs-open .cs-trigger, .cs-trigger:focus { outline: none; border-color: var(--primary); }
.cs-panel {
  display: none; position: fixed; z-index: 6000;
  max-height: 260px; overflow-y: auto;
  background: #fff; border: 1.5px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18); padding: 4px;
}
.cs-panel.cs-open { display: block; }
.cs-option {
  padding: 7px 10px; border-radius: 6px; font-size: 14px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cs-option:hover { background: #f1f5f9; }
.cs-option-selected { background: var(--primary); color: #fff; }
.cs-option-selected:hover { background: var(--primary); }

/* Dins el panel d'Assignacions del dia, mida més compacta */
.assign-vehicle-select .cs-wrap { display: inline-block; width: auto; }
.assign-vehicle-select .cs-trigger {
  padding: 5px 10px; font-size: 12px; min-width: 130px; border-radius: 6px;
}
.assign-vehicle-select .cs-panel .cs-option { padding: 6px 8px; font-size: 12px; }

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 22px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-light); }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 9px 16px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}
.btn-secondary:hover { background: #e4ece6; }

.btn-danger {
  background: #fce8e8;
  color: var(--c-cancelado);
  border: none;
  padding: 9px 16px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  margin-right: auto;
  transition: background 0.15s;
}
.btn-danger:hover { background: #f8d0d0; }

/* ── SETTINGS ── */
.settings-modal { max-width: 660px; }

.settings-body {
  padding: 20px 22px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.settings-section h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.settings-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.settings-section li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--bg);
  border-radius: 7px;
  font-size: 13px;
}

#driversList li {
  align-items: center;
  padding: 8px 10px;
}
#driversList li span { line-height: 1.5; }

.settings-section li.driver-baja {
  background: #fff1f2;
  border-left: 3px solid #fca5a5;
}

.settings-section li.driver-vacaciones {
  background: #f0fdf4;
  border-left: 3px solid #86efac;
}

.settings-section li.empty-item {
  color: var(--muted);
  font-style: italic;
  justify-content: center;
}

.btn-remove {
  background: #fce8e8;
  border: none;
  color: var(--c-cancelado);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.15s;
  flex-shrink: 0;
}
.btn-remove:hover { background: #f8b4b4; }

.settings-add {
  display: flex;
  gap: 8px;
}
.settings-add input {
  flex: 1;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.settings-add input:focus { outline: none; border-color: var(--primary); }
.settings-add .btn-primary { padding: 8px 14px; white-space: nowrap; font-size: 13px; }

.settings-full { grid-column: 1 / -1; }

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.settings-section-header h4 { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }

.btn-sync {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-sync:hover { border-color: var(--primary); color: var(--primary); background: #f0f4f0; }

.settings-search {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.settings-search:focus { outline: none; border-color: var(--primary); }

.li-actions { display: flex; gap: 4px; flex-shrink: 0; }

.btn-edit-client {
  background: #e0eeff;
  border: none;
  color: var(--c-en_ruta);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.15s;
}
.btn-edit-client:hover { background: #bfdbfe; }

.client-edit-input {
  flex: 1;
  padding: 4px 8px;
  border: 1.5px solid var(--primary);
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

.btn-save-client {
  background: #dcfce7;
  border: none;
  color: var(--c-completado);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.15s;
}
.btn-save-client:hover { background: #bbf7d0; }

.btn-cancel-client {
  background: #fce8e8;
  border: none;
  color: var(--c-cancelado);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1;
}

/* Client list items */
#clientsList { max-height: 300px; }
#clientsList li { align-items: flex-start; gap: 8px; }

.client-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.client-name  { font-weight: 600; font-size: 13px; }
.client-address {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inline edit */
#clientsList li.editing { display: block; }
.client-edit-form { display: flex; flex-direction: column; gap: 6px; }
.client-edit-form .li-actions { display: flex; gap: 6px; margin-top: 2px; }
.btn-save-client, .btn-cancel-client { font-size: 12px; padding: 5px 12px; border-radius: 6px; }

/* Add client section */
.settings-add-client {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-add-client input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.settings-add-client input:focus { outline: none; border-color: var(--primary); }
.settings-add-client .btn-primary { align-self: flex-end; padding: 8px 18px; font-size: 13px; }

.settings-danger-zone { border-top: 2px solid #fce8e8; padding-top: 14px; }
.settings-danger-zone h4 { color: var(--c-cancelado); }
.danger-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-danger-full {
  background: var(--c-cancelado);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s;
}
.btn-danger-full:hover { background: #a12020; }

/* ── TV DAY VIEW ── */
.main-content.main-full {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Vista Llista: ocupa tota l'amplada perquè hi càpiguen totes les columnes */
.main-content.main-list {
  max-width: none;
  margin: 16px 0;
  padding: 0 16px;
}

/* ── PANTALLA PARTIDA: Trànsit (dalt) + Avui (baix) — només Sant Fruitós ── */
.main-content.main-split {
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 420px;
}
.main-content.main-split .transit-split-pane {
  flex: 0 0 44%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.main-content.main-split .split-dragger {
  flex: 0 0 11px;
  cursor: row-resize;
  background: #e2ede2;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
}
.main-content.main-split .split-dragger::before {
  content: '';
  width: 48px;
  height: 4px;
  border-radius: 2px;
  background: #94a3b8;
}
.main-content.main-split .split-dragger:hover::before,
.main-content.main-split .split-dragger.dragging::before {
  background: #2a7000;
}
.main-content.main-split .day-split-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.tv-board {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  gap: 10px;
}

.tv-statusbar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  padding: 10px 20px;
  flex-shrink: 0;
}

.tv-clock {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  min-width: 126px;
  flex-shrink: 0;
}

.tv-stats {
  display: flex;
  gap: 24px;
  flex: 1;
  flex-wrap: wrap;
}

.tv-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.tv-stat-value {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.tv-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.75;
  white-space: nowrap;
}

.tv-stat-recogida .tv-stat-value { color: #c4b5fd; }
.tv-stat-entrega  .tv-stat-value { color: #93c5fd; }
.tv-stat-cambio   .tv-stat-value { color: #6ee7b7; }
.tv-stat-ruta     .tv-stat-value { color: #fde68a; }
.tv-stat-ok       .tv-stat-value { color: #bbf7d0; }

.tv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.tv-col {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tv-col-note-wrap {
  padding: 5px 8px;
  background: #fff8f8;
  border-bottom: 2px solid #ffd0d0;
  cursor: pointer;
}
.tv-col-note {
  font-size: 13px;
  font-weight: 700;
  color: #dc2626;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.tv-col-note-empty {
  color: #f8a0a0;
  font-weight: 400;
  font-size: 11px;
  text-transform: none;
}
.tv-col-note-wrap:hover { background: #fff0f0; }

/* ── NOTE EDITOR POPUP ── */
.note-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.note-editor-modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.note-editor-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
}
.note-editor-textarea {
  resize: vertical;
  min-height: 100px;
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #dc2626;
  text-transform: uppercase;
  font-family: inherit;
  outline: none;
}
.note-editor-textarea:focus { border-color: #dc2626; }
.note-editor-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn-note-cancel {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
  font-size: 14px;
}
.btn-note-cancel:hover { background: #f3f4f6; }

.tv-col-header {
  background: var(--primary);
  color: #fff;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-width: 0;
}

.tv-col-header-gray { background: var(--muted); }

.tv-col-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-col-count {
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 14px;
  font-weight: 800;
}

.tv-col-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tv-empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-size: 13px;
  padding: 20px 0;
}

.tv-card {
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, transform 0.1s;
}
.tv-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.tv-card.estado-cancelado { opacity: 0.45; }

/* Franja de color según tipo */
.tv-card-tipo-bar {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-card.tipo-recogida .tv-card-tipo-bar { background: #111; }
.tv-card.tipo-entrega  .tv-card-tipo-bar { background: #111; }
.tv-card.tipo-cambio   .tv-card-tipo-bar { background: #111; }
.tv-card.tipo-otros    .tv-card-tipo-bar { background: #444; }

.tv-card-body { padding: 8px 10px 9px; }

.tv-client {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
  margin-bottom: 3px;
}

.tv-dir {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.tv-nota {
  font-size: 11px;
  font-weight: 800;
  color: #dc2626;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.tv-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.tv-time {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.tv-time.no-time { font-size: 11px; color: var(--muted); font-weight: 400; }

.tv-contenedor {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  background: #f0f4f0;
  padding: 2px 8px;
  border-radius: 5px;
}

.tv-meta-item {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.tv-conductor-row {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}

/* ── RESPONSIVE ── */
@media (max-width: 800px) {
  .header { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .service-card { grid-template-columns: 56px 80px 1fr; }
  .service-meta { display: none; }
  .week-grid { grid-template-columns: repeat(7, 1fr); font-size: 11px; }
  .month-day { min-height: 60px; }
}
@media (max-width: 500px) {
  .nav-tabs .nav-tab { padding: 5px 10px; font-size: 13px; }
  .header-right .btn-icon { display: none; }
  .week-grid { gap: 3px; }
}

/* ── CHOFER VIEW ── */
.chofer-view { padding: 20px; max-width: 900px; margin: 0 auto; }

.chofer-selector { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.chofer-selector-label { font-weight: 700; font-size: 15px; color: var(--text); }
.chofer-select { padding: 10px 14px; border-radius: 8px; border: 2px solid var(--border); font-size: 15px; font-weight: 600; min-width: 260px; outline: none; }
.chofer-select:focus { border-color: var(--primary); }
.chofer-selector .cs-wrap { display: inline-block; width: auto; }
.chofer-selector .cs-trigger {
  padding: 10px 14px; border-radius: 8px; border: 2px solid var(--border);
  font-size: 15px; font-weight: 600; min-width: 260px;
}

.chofer-report-title { font-size: 16px; color: var(--muted); margin-bottom: 20px; }
.chofer-report-title strong { color: var(--text); }

.chofer-month { margin-bottom: 28px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.chofer-month-header { background: var(--primary); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chofer-month-name { font-size: 16px; font-weight: 800; text-transform: uppercase; flex: 1; }
.chofer-month-count { font-size: 13px; opacity: 0.85; }
.chofer-plates { display: flex; gap: 6px; flex-wrap: wrap; }
.chofer-plates .matricula-tag { background: rgba(255,255,255,0.2); color: #fff; }

.chofer-day { border-bottom: 1px solid var(--border); }
.chofer-day:last-child { border-bottom: none; }
.chofer-day-header { background: #f0f4f0; padding: 8px 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chofer-day-label { font-weight: 700; font-size: 13px; text-transform: capitalize; flex: 1; }
.chofer-day-count { font-size: 12px; color: var(--muted); }

.chofer-day-services { padding: 6px 12px; display: flex; flex-direction: column; gap: 5px; }
.chofer-service-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; background: #fafafa; cursor: pointer; flex-wrap: wrap; }
.chofer-service-row:hover { background: #f0f4f0; }
.chofer-svc-hora { font-size: 13px; font-weight: 800; min-width: 42px; color: var(--text); }
.chofer-svc-cliente { font-weight: 700; font-size: 13px; flex: 1; min-width: 120px; }
.chofer-svc-obra { font-size: 12px; color: var(--muted); }
.chofer-svc-cont { font-size: 12px; color: var(--muted); }

/* ── LOCK BADGES ── */
.lock-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.lock-mine  { background: #dcfce7; color: #166534; }
.lock-other { background: #fee2e2; color: #991b1b; }
.card-locked { opacity: 0.7; outline: 2px solid #fca5a5; }

/* ── LOGIN MODAL ── */
#loginModal input:focus {
  outline: none;
  border-color: #4a9eff !important;
}

/* ── COMPANY SELECTOR ── */
.btn-company {
  padding: 14px 20px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.btn-company:hover {
  border-color: var(--primary);
  background: var(--bg);
  color: var(--primary);
}

/* ── POLARFLUID CALENDAR ── */
.pf-calendar {
  padding: 16px;
  max-width: none;
  height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.pf-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.pf-month-title { font-size: 28px; font-weight: 900; flex: 1; color: var(--text); }
.pf-nav-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 18px; font-size: 24px;
  cursor: pointer; color: var(--text);
}
.pf-nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.pf-today-btn {
  font-size: 14px; font-weight: 700; color: var(--primary);
  border: 1px solid var(--primary); border-radius: 8px;
  padding: 8px 18px; background: none; cursor: pointer;
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 5px;
  flex: 1;
  min-height: 0;
}
.pf-day-header {
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 0;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.pf-cell {
  background: var(--card);
  border-radius: 10px;
  padding: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pf-cell:hover { box-shadow: var(--shadow-lg); }
.pf-cell.pf-empty { background: transparent; box-shadow: none; cursor: default; }
.pf-cell.pf-today { outline: 3px solid var(--primary); }

.pf-cell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.pf-day-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.pf-today .pf-day-num {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.pf-add-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.pf-cell:hover .pf-add-btn { opacity: 1; }

.pf-services { display: flex; flex-direction: column; gap: 5px; flex: 1; overflow-y: auto; overflow-x: hidden; }
.pf-services::-webkit-scrollbar { width: 5px; }
.pf-services::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.pf-services::-webkit-scrollbar-track { background: transparent; }
.pf-service {
  background: #ede8ff;
  border-left: 4px solid var(--c-recogida);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 14px;
}
.pf-service:hover { background: #ddd5ff; }
.pf-service.pf-done { opacity: 0.5; background: #f0f0f0; border-left-color: var(--muted); }
.pf-ot { font-weight: 800; color: var(--primary); margin-right: 5px; font-size: 13px; }
.pf-client { font-weight: 700; color: var(--text); font-size: 14px; }
.pf-nota { display: block; color: #dc2626; font-size: 12px; font-weight: 700; text-transform: uppercase; margin-top: 2px; }

/* ══════════════════════════════════════════════════════════
   NOUS ESTILS — matrícula/client cercables, residu, adreces
   ══════════════════════════════════════════════════════════ */

/* Cercador dins el panell del custom-select (matrícula) */
.cs-search {
  position: sticky; top: 0; background: #fff;
  padding: 2px 2px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.cs-search-input {
  width: 100%; box-sizing: border-box;
  padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; color: var(--text); outline: none;
}
.cs-search-input:focus { border-color: var(--primary); }
.cs-options { display: block; }
.cs-empty { padding: 8px 10px; font-size: 13px; color: var(--muted); text-align: center; }

/* Autocompletat de client (panell propi, independent del tancament global de .cs-panel) */
.ac-panel {
  display: none; position: fixed; z-index: 6000;
  max-height: 260px; overflow-y: auto;
  background: #fff; border: 1.5px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18); padding: 4px;
}
.ac-panel.cs-open { display: block; }
.ac-panel .cs-option { white-space: normal; }

/* Etiqueta de residu a la targeta de la vista Avui */
.residuo-tag {
  font-weight: 700; font-size: 11px;
  color: #166534; background: #dcfce7;
  padding: 1px 6px; border-radius: 4px;
}

/* Adreces guardades del client (fitxa de servei) */
.addr-chips {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 6px;
}
.addr-chips-label { font-size: 11px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.addr-chip {
  font-size: 12px; padding: 3px 9px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--border); background: #f8fafc; color: #475569;
  font-family: inherit; transition: all 0.12s; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.addr-chip:hover { border-color: var(--primary); color: var(--primary); background: #f0f4f0; }
.addr-chip-active { border-color: var(--primary); background: var(--primary); color: #fff; }
.addr-chip-active:hover { background: var(--primary); color: #fff; }

/* Codi de client a la llista de Configuració */
.client-code {
  font-size: 11px; font-weight: 700; color: var(--primary);
  background: rgba(42,112,0,0.08); padding: 1px 5px; border-radius: 4px; margin-right: 2px;
}

/* Edició de múltiples adreces per client */
.client-edit-addrs { display: flex; flex-direction: column; gap: 5px; }

/* Residu a la vista Setmana */
.week-item-residuo {
  font-size: 10px; color: #166534; font-weight: 600;
}

.carryover-badge { display:inline-block; font-size:11px; font-weight:700; color:#fff; background:#ef4444; border-radius:4px; padding:2px 7px; margin-bottom:5px; letter-spacing:0.02em; }
