/* Marca: vegeu .claude/skills/golden-line-brand/SKILL.md */
:root {
  --gl-gold:       #CDB17C;
  --gl-gold-dark:  #A88E5A;
  --gl-gold-light: #E8DCC2;
  --gl-gold-tint:  #F4EEE2;
  --gl-ink:        #141414;
  --gl-ink-2:      #1F1F1F;
  --gl-ink-3:      #2C2C2C;
  --gl-white:      #FFFFFF;
  --gl-text:       #2B2B2B;
  --gl-muted:      #6B665C;
  --gl-bg:         #F7F5F0;
  --gl-border:     #E4DED2;
  --radius:        10px;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--gl-text);
  background: var(--gl-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gl-gold-dark); }
h1, h2 { font-weight: 700; letter-spacing: -0.01em; color: var(--gl-ink); }

.icon { flex: none; }

/* ---------- Estructura ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 248px;
  height: 100vh;
  padding: 24px 16px;
  background: var(--gl-ink);
  color: #CFCAC0;
}
.sidebar__brand { display: block; padding: 0 8px 24px; margin-bottom: 16px; border-bottom: 1px solid var(--gl-ink-3); }
.sidebar__brand img { display: block; height: 54px; width: auto; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar__label {
  margin: 20px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8A857B;
}
.sidebar__foot { margin: auto 12px 0; font-size: 12px; color: #6F6A61; }

.navlink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #CFCAC0;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.navlink:hover { background: var(--gl-ink-2); color: var(--gl-white); }
/* Element actiu del menú: tot el botó en daurat Golden Line */
.navlink.is-active, .navlink.is-active:hover {
  background: var(--gl-gold);
  color: var(--gl-ink);
  border-left-color: var(--gl-gold);
  font-weight: 600;
}

.main { flex: 1; min-width: 0; padding: 40px 48px; }

/* ---------- Capçalera de pàgina ---------- */
.page-head { max-width: 760px; margin-bottom: 32px; }
.page-head__eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gl-gold-dark);
}
.page-head__eyebrow a { color: inherit; text-decoration: none; }
.page-head__eyebrow a:hover { text-decoration: underline; }
.page-head h1 { margin: 0; font-size: 2rem; line-height: 1.2; }
.page-head__title { display: flex; align-items: center; gap: 14px; }
.page-head__icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--gl-ink);
  color: var(--gl-gold);
}
.page-head__lead { margin: 8px 0 0; color: var(--gl-muted); font-size: 1.05rem; }

/* ---------- Carpetes (inici) ---------- */
.folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  max-width: 980px;
}
.folder {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: var(--gl-white);
  border: 1px solid var(--gl-border);
  border-radius: var(--radius);
  color: var(--gl-text);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.folder:hover {
  border-color: var(--gl-gold);
  box-shadow: 0 6px 20px rgba(20, 20, 20, .07);
  transform: translateY(-1px);
}
.folder__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--gl-gold-tint);
  color: var(--gl-gold-dark);
}
.folder__icon .icon { width: 26px; height: 26px; }
.folder__body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.folder__name { font-size: 1.1rem; font-weight: 700; color: var(--gl-ink); }
.folder__desc { font-size: .92rem; color: var(--gl-muted); }
.folder__arrow { color: var(--gl-gold-dark); font-size: 1.2rem; transition: transform .15s; }
.folder:hover .folder__arrow { transform: translateX(3px); }

/* ---------- Estat buit ---------- */
.empty {
  max-width: 760px;
  padding: 56px 24px;
  text-align: center;
  background: var(--gl-white);
  border: 1px dashed var(--gl-gold-light);
  border-radius: var(--radius);
}
.empty__icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--gl-gold-tint);
  color: var(--gl-gold-dark);
}
.empty__icon .icon { width: 30px; height: 30px; }
.empty h2 { margin: 0 0 6px; font-size: 1.25rem; }
.empty p { margin: 0; color: var(--gl-muted); }

/* ---------- Botons ---------- */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--gl-gold);
  color: var(--gl-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--gl-gold-dark); color: var(--gl-white); }

.btn { display: inline-flex; align-items: center; gap: 8px; }
.btn .icon { width: 18px; height: 18px; }
.btn--ghost { background: var(--gl-white); color: var(--gl-text); border: 1px solid var(--gl-border); }
.btn--ghost:hover { background: var(--gl-gold-tint); color: var(--gl-ink); border-color: var(--gl-gold); }
.btn--text { background: none; color: var(--gl-muted); }
.btn--text:hover { background: var(--gl-bg); color: var(--gl-ink); }
.linkbtn {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none;
  color: var(--gl-gold-dark); font: inherit; font-weight: 600; cursor: pointer;
}
.linkbtn .icon { width: 16px; height: 16px; }
.linkbtn:hover { text-decoration: underline; }

/* ---------- Avisos ---------- */
.flash { max-width: 980px; margin: 0 0 16px; padding: 12px 16px; border-radius: 8px; border-left: 4px solid; font-weight: 500; }
.flash--ok { background: #EDF7EE; border-color: #2E7D32; color: #1E4620; }
.flash--error { background: #FDECEA; border-color: #C62828; color: #611A15; }

/* ---------- Targetes i formularis ---------- */
.folder--off { opacity: .6; }
.card { max-width: 980px; margin-top: 28px; padding: 22px; background: var(--gl-white); border: 1px solid var(--gl-border); border-radius: var(--radius); }
.card__title { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 1.1rem; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--gl-ink); }
.field--grow { flex: 1; min-width: 240px; }
.field--wide { grid-column: 1 / -1; }
.field--check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; grid-column: 1 / -1; }
.field--radios { margin: 14px 0; padding: 0; border: 0; font-weight: 500; }
.field--radios legend { margin-bottom: 6px; font-weight: 600; }
.field--radios label { display: block; padding: 6px 0; }
.field--radios small { color: var(--gl-muted); }
.field__help { margin: 10px 0 0; font-size: .85rem; color: var(--gl-muted); }
.field input[type=text], .field input[type=search], .field input[type=number], .field input[type=time], .field select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--gl-border); border-radius: 8px;
  background: var(--gl-white); font: inherit; font-weight: 400; color: var(--gl-text);
}
.field input:focus, .field select:focus { outline: 2px solid var(--gl-gold); outline-offset: 1px; border-color: var(--gl-gold); }

/* ---------- Quadrant d'horaris ---------- */
.page-head--wide { max-width: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-bottom: 14px; }
.toolbar__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.monthnav { display: flex; align-items: center; gap: 6px; }
.monthnav__label { min-width: 150px; text-align: center; font-size: 1.15rem; font-weight: 700; color: var(--gl-ink); }
.iconbtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--gl-border);
  border-radius: 8px; background: var(--gl-white); color: var(--gl-ink);
}
.iconbtn:hover { border-color: var(--gl-gold); background: var(--gl-gold-tint); }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--gl-border); border-radius: 9px; background: var(--gl-white); }
.segmented a { padding: 6px 14px; border-radius: 6px; color: var(--gl-muted); font-weight: 600; text-decoration: none; }
.segmented a.is-on { background: var(--gl-ink); color: var(--gl-gold); }
.hint { margin: 0 0 14px; font-size: .9rem; color: var(--gl-muted); }

.grid-wrap {
  overflow: auto; max-height: calc(100vh - 260px); min-height: 240px;
  background: var(--gl-white); border: 1px solid var(--gl-border); border-radius: var(--radius);
}
.grid { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.grid th, .grid td { padding: 0; border-right: 1px solid #EEE9DF; border-bottom: 1px solid #EEE9DF; background: var(--gl-white); }
.grid thead th { position: sticky; top: 0; z-index: 2; background: #FBF9F5; font-weight: 600; }
.grid__turno { position: sticky; left: 0; z-index: 1; width: 30px; min-width: 30px; text-align: center; color: var(--gl-muted); font-weight: 600; }
.grid__name { position: sticky; left: 30px; z-index: 1; min-width: 220px; max-width: 260px; text-align: left; box-shadow: 1px 0 0 #E4DED2; }
.grid thead .grid__turno, .grid thead .grid__name { z-index: 3; padding: 8px; }
.namebtn {
  display: block; width: 100%; padding: 8px 10px; border: 0; background: none; text-align: left;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--gl-ink); cursor: pointer;
}
.namebtn:hover { color: var(--gl-gold-dark); text-decoration: underline; }
.dayhead {
  display: flex; flex-direction: column; align-items: center; width: 100%; padding: 6px 0;
  border: 0; background: none; font: inherit; color: var(--gl-muted); cursor: pointer;
}
.dayhead strong { font-size: 14px; color: var(--gl-ink); }
.dayhead:hover { background: var(--gl-gold-tint); }
.grid__day { min-width: 56px; width: 56px; }
.grid__day.is-sat, .grid__day.is-sun { background: #EDEDED; }
.grid__day.is-fest { background: #F2DCDB; }
.grid__day.is-today .dayhead strong { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gl-gold); color: var(--gl-ink); }
.grid__tot { min-width: 64px; padding: 6px 8px !important; text-align: center; white-space: nowrap; background: #FBF9F5 !important; }
.grid__tot.is-neg { color: #B3261E; font-weight: 700; }
.grid__tot.is-pos { color: #2E7D32; font-weight: 700; }

.cell button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; min-height: 46px; padding: 3px 2px; border: 0; background: transparent;
  font: inherit; color: var(--gl-text); cursor: pointer; line-height: 1.2;
}
.cell button:hover { outline: 2px solid var(--gl-gold); outline-offset: -2px; }
.cell button:focus-visible { outline: 2px solid var(--gl-ink); outline-offset: -2px; }
.cell__t { font-variant-numeric: tabular-nums; }
.cell__tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: #3A3A3A; }
.cell__hc { font-size: 10px; font-weight: 700; color: #6B4E00; }
.cell.is-sat, .cell.is-sun, .swatch.is-weekend { background: #EDEDED; }
.cell.is-fest { background: #F2DCDB; }
.cell.is-today { box-shadow: inset 0 0 0 1px var(--gl-gold); }
.cell.is-tw, .swatch.is-tw { background: #CCFFCC; }
.cell__tw { font-size: 9px; font-weight: 700; letter-spacing: .04em; color: #2E7D32; }
/* Capçalera de servei (CHAT B2C, B2B...) dins del quadrant */
.grid__sec th, .grid__sec td { background: #F4EEDF; }
.grid__secname {
  position: sticky; left: 0; z-index: 1; padding: 6px 10px !important; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gl-gold-dark);
}
/* Colors de la llegenda de l'Excel */
.est-ausencia { background: #FFFF00 !important; }
.est-vacaciones { background: #CCC1DA !important; }
.est-compensacion { background: #B7DEE8 !important; }
.est-comite { background: #FCD5B4 !important; }
.est-complementarias { background: #BFBFBF !important; }
.est-formacion { background: #DCE6F2 !important; }
.cell.is-mod button::after, .dot-mod {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #C05621; box-shadow: 0 0 0 2px var(--gl-white);
}
.cell.is-mod button::after { position: absolute; top: 3px; right: 3px; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; padding: 0; list-style: none; font-size: .85rem; color: var(--gl-muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.swatch { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--gl-border); border-radius: 4px; background: var(--gl-white); }
.swatch.is-fest { background: #F2DCDB; }
.inactivos { margin-top: 20px; color: var(--gl-muted); }
.inactivos summary { cursor: pointer; font-weight: 600; }
.inactivos ul { margin: 8px 0 0; padding-left: 20px; }

/* ---------- Diàlegs ---------- */
.dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 24px;
  border: 0; border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); color: var(--gl-text);
}
.dialog--wide { width: min(720px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(20, 20, 20, .55); }
.dialog__title { margin: 0; font-size: 1.25rem; }
.dialog__sub { margin: 4px 0 0; color: var(--gl-muted); text-transform: capitalize; }
.dialog__teo { margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; background: #FFF4E5; color: #7A3E00; font-size: .9rem; }
.dialog__section + .dialog__section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--gl-border); }
.dialog__section h3 { margin: 12px 0 10px; font-size: 1rem; }
.dialog__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week__day { display: flex; flex-direction: column; gap: 4px; }
.week__label { font-size: .8rem; font-weight: 700; text-align: center; color: var(--gl-muted); }
.week__day input { width: 100%; padding: 6px 4px; border: 1px solid var(--gl-border); border-radius: 6px; font: inherit; font-size: .85rem; }
.week__quick { margin: 10px 0; font-size: .85rem; color: var(--gl-muted); }

/* ---------- Taules ---------- */
.table-wrap { overflow: auto; background: var(--gl-white); border: 1px solid var(--gl-border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid #EEE9DF; text-align: left; vertical-align: top; }
.table thead th { background: #FBF9F5; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--gl-muted); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill--teorico { background: var(--gl-gold-tint); color: #6B5320; }
.pill--cambio { background: #FFF4E5; color: #7A3E00; }
.pill--restaurar { background: #EDF7EE; color: #1E4620; }

/* ---------- Mòbil ---------- */
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 12px 16px;
  }
  .sidebar__brand { padding: 0 0 12px; margin-bottom: 8px; }
  .sidebar__brand img { height: 40px; }
  .sidebar__nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .sidebar__label, .sidebar__foot { display: none; }
  .navlink { padding: 8px 10px; border-left: 0; border-bottom: 2px solid transparent; border-radius: 6px; }
  .navlink.is-active { border-bottom-color: var(--gl-gold); background: var(--gl-gold); color: var(--gl-ink); }
  .main { padding: 24px 16px; }
  .page-head h1 { font-size: 1.6rem; }
  .folders { grid-template-columns: 1fr; }
  .toolbar__actions { margin-left: 0; }
  .grid-wrap { max-height: none; }
  .grid__name { min-width: 150px; }
  .form-grid { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(4, 1fr); }
}

/* ------------------------------------------------------------ Informes */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 18px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--gl-white); border: 1px solid var(--gl-border); border-radius: var(--radius); }
.kpi__n { font-size: 1.6rem; font-weight: 700; color: var(--gl-ink); font-variant-numeric: tabular-nums; }
.kpi__l { font-size: .82rem; color: var(--gl-muted); }
.kpi--alert { border-color: #E8B4A0; background: #FFF6F2; }
.kpi--alert .kpi__n { color: #B3261E; }
.alertbox { margin: 0 0 18px; padding: 14px 18px; background: #FFF6F2; border: 1px solid #E8B4A0; border-radius: var(--radius); }
.alertbox h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1rem; color: #8A2A12; }
.alertbox ul { margin: 0; padding-left: 20px; font-size: .9rem; }
.alertbox li + li { margin-top: 4px; }
.muted { color: var(--gl-muted); }
.table--informe th[scope=row] { font-weight: 600; white-space: nowrap; }
.table--informe .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table--informe thead .num { text-align: right; }
.table--informe tr.is-shared > * { background: #FCFAF4; }
.table--informe .table__sub td { padding-top: 4px; padding-bottom: 4px; font-size: .84rem; color: var(--gl-text); background: #FCFAF4; }
.table--informe .table__sub td:first-child { padding-left: 28px; }
.table--informe tfoot th, .table--informe tfoot td { border-top: 2px solid var(--gl-border); background: #FBF9F5; }
.table--informe .swatch { width: 10px; height: 10px; border: 0; vertical-align: baseline; }
.stack { display: flex; width: 160px; height: 10px; overflow: hidden; border-radius: 5px; background: #EEE9DF; }
.stack span { display: block; height: 100%; }
.pill--multi { background: #E7EEF8; color: #23406B; margin-left: 6px; }

/* Torns partits: dues franges petites a la mateixa cel·la */
.cell__t--sm { font-size: 9.5px; letter-spacing: -.02em; }
.tramo2 { padding: 0; }
.tramo2 summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--gl-gold-dark); }
.tramo2[open] summary { margin-bottom: 8px; }

/* ------------------------------------------------------------ Clients */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0 0 22px; padding: 14px 16px; background: var(--gl-white); border: 1px solid var(--gl-border); border-radius: var(--radius); }
.filters .field { margin: 0; }
.filters .field--grow { flex: 1 1 240px; }
.grupo { margin: 0 0 26px; }
.grupo__title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.05rem; }
.grupo__count { margin-left: 4px; font-size: .8rem; font-weight: 600; color: var(--gl-muted); }
.section-title { margin: 34px 0 14px; font-size: 1.15rem; }
.clientes-home { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cliente-card { padding: 16px 18px; background: var(--gl-white); border: 1px solid var(--gl-border); border-radius: var(--radius); }
.cliente-card__head { display: flex; align-items: flex-start; gap: 12px; }
.cliente-card__head > div { flex: 1; min-width: 0; }
.cliente-card__head h3 { margin: 0; font-size: 1rem; }
.cliente-card__head p { margin: 2px 0 0; font-size: .82rem; color: var(--gl-muted); }
.cliente-card__icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--gl-ink); color: var(--gl-gold); flex: none; }
.cliente-card__list { margin: 12px 0 0; padding: 0; list-style: none; }
.cliente-card__list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid #EEE9DF; font-size: .9rem; }
.cliente-card__list a { color: var(--gl-ink); font-weight: 600; text-decoration: none; }
.cliente-card__list a:hover { color: var(--gl-gold-dark); text-decoration: underline; }
.cliente-card__edit { margin-top: 10px; font-size: .85rem; }
.cliente-card__edit summary { cursor: pointer; color: var(--gl-muted); }
.cliente-card__edit .form-row { margin-top: 8px; }
.table--ordenes tr.is-off td { color: var(--gl-muted); }
.asociar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.asociar select, .asociar input { padding: 6px 8px; border: 1px solid var(--gl-border); border-radius: 6px; font: inherit; font-size: .85rem; }
.asociar select { max-width: 240px; }
.asociar input { width: 150px; }
.btn--sm { padding: 6px 10px; font-size: .82rem; }
.pastebox { width: 100%; padding: 10px; border: 1px solid var(--gl-border); border-radius: 8px; font: 12px/1.4 ui-monospace, Consolas, monospace; white-space: pre; }
.pill--orden { background: #F1ECDF; color: #5C4A1E; margin-right: 4px; font-variant-numeric: tabular-nums; }
