/* ==========================================================================
   CoPaternia UI 2  ·  v2.0
   --------------------------------------------------------------------------
   Capa visual i d'usabilitat que es carrega DESPRÉS de style.css. S'activa
   amb <html data-cp2="1"> (l'aparença «clara», que és la de fàbrica) — qui
   triï expressament viva/compacta/suau/nativa continua veient-la com abans.
   No canvia cap lògica ni cap identificador del DOM: només tokens, estil i
   els components nous que injecta public/js/ui2.js (#cp-home, #cp-nav…).

   Principis (veure docs/UI-V2.md):
     1. Una acció principal per pantalla, en estil primari.
     2. Accessibilitat AA: contrast ≥ 4,5:1 en text, objectius tàctils ≥ 44 px,
        focus visible, mida de lletra de formulari 16 px (iOS no fa zoom).
     3. Llenguatge i estructura per tasques, no per «eines».
     4. El degradat de marca només com a línia fina (mai com a fons).
   ========================================================================== */

/* ---------- 1. Tokens (blocs amb text → tons accessibles AA) ------------- */
html[data-cp2="1"] {
  --blue: #207bbd;          /* blanc sobre aquest blau = 4,54:1 */
  --teal: #11856d;          /* 4,57:1 */
  --orange-dark: #a76809;   /* 4,54:1 */
  --ink-faint: #69747b;     /* 4,55:1 sobre #FAF9F5 */
  --grad: linear-gradient(90deg, #2489d3 0%, #16a98b 45%, #7cb93c 75%, #fca311 100%);
  --cp-ok: #11856d;
  --cp-warn-bg: #fef1dc;
  --cp-warn-ink: #8a5206;   /* 5,3:1 sobre el fons taronja suau */
  --cp-info-bg: #e8f2fb;
  --cp-surface: #ffffff;
  --cp-r: 16px;
  --cp-r-sm: 12px;
  --cp-shadow: 0 1px 2px rgba(30, 42, 50, .06), 0 10px 28px -14px rgba(30, 42, 50, .22);
  --cp-shadow-lg: 0 2px 6px rgba(30, 42, 50, .08), 0 22px 44px -18px rgba(30, 42, 50, .30);
  --cp-nav-h: 68px;
  --cp-tap: 48px;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html[data-cp2="1"] { scroll-behavior: auto; }
  html[data-cp2="1"] *, html[data-cp2="1"] *::before, html[data-cp2="1"] *::after {
    animation-duration: .001ms !important; transition-duration: .001ms !important;
  }
}

/* ---------- 2. Base: tipografia, focus, objectius tàctils ---------------- */
html[data-cp2="1"] body { font-size: 16px; }
html[data-cp2="1"] p { line-height: 1.6; }
html[data-cp2="1"] .step-lede { font-size: 15px; }
html[data-cp2="1"] :focus-visible {
  outline: 3px solid #207bbd; outline-offset: 2px; border-radius: 6px;
}
html[data-cp2="1"] .input-field:focus-visible { outline: none; }
html[data-cp2="1"] a { color: #0f5c8c; text-underline-offset: 3px; }

html[data-cp2="1"] .site-header { padding-top: 14px; padding-bottom: 6px; }
.cp-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-height: 44px; }
html[data-cp2="1"] .site-header .cp-brand img { height: 40px; width: auto; }
.cp-wordmark { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 26px; letter-spacing: -.01em; line-height: 1; }
.cp-wm-a { color: #207bbd; } .cp-wm-b { color: #11856d; }
@media (max-width: 480px) { .cp-wordmark { font-size: 22px; } html[data-cp2="1"] .site-header .cp-brand img { height: 34px; } }
.cp-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; color: #0f5c8c; padding: 10px 14px; border-radius: 10px; font-weight: 600; box-shadow: var(--cp-shadow, 0 4px 14px rgba(0,0,0,.2)); }
.cp-skip:focus { left: 8px; }

/* ---------- 3. Botons amb jerarquia ------------------------------------- */
html[data-cp2="1"] .btn {
  min-height: var(--cp-tap); border-radius: var(--cp-r-sm); font-size: 16px; padding: 12px 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  line-height: 1.2; letter-spacing: .005em;
  transition: transform .08s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
html[data-cp2="1"] .btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px -8px rgba(32, 123, 189, .7); }
html[data-cp2="1"] .btn-primary:hover:not(:disabled) { background: var(--blue-dark); box-shadow: 0 8px 20px -8px rgba(15, 92, 140, .75); }
html[data-cp2="1"] .btn-child { background: var(--teal); box-shadow: 0 6px 16px -8px rgba(17, 133, 109, .7); }
html[data-cp2="1"] .btn-secondary { border-width: 2px; color: #14689f; border-color: #207bbd; }
html[data-cp2="1"] .btn-ghost { color: #3f4a52; border-color: #d4d0c4; }
html[data-cp2="1"] .btn-ghost:hover:not(:disabled) { background: #f4f2ec; }
/* Accions de «refresc» manuals → discretes (enllaç), perquè no competeixin
   amb l'acció principal (acció #3 del pla d'UI). */
html[data-cp2="1"] .btn-ghost[id*="refresh"],
html[data-cp2="1"] .btn-ghost[id^="btn-load-"] {
  background: none; border: none; width: auto; min-height: 36px; padding: 6px 4px;
  color: #0f5c8c; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
html[data-cp2="1"] .btn-small, html[data-cp2="1"] .btn-tiny { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: 10px; }
html[data-cp2="1"] .btn-link { min-height: 40px; }
html[data-cp2="1"] .btn:disabled { opacity: .5; }

/* ---------- 4. Formularis ---------------------------------------------- */
html[data-cp2="1"] .input-field, html[data-cp2="1"] select.input-field, html[data-cp2="1"] textarea.input-field {
  min-height: var(--cp-tap); font-size: 16px; border-radius: var(--cp-r-sm); border-color: #cfcabc; background: #fff;
}
html[data-cp2="1"] .input-field:focus { border-color: var(--blue); box-shadow: var(--cp-focus, 0 0 0 3px rgba(32, 123, 189, .28)); }
html[data-cp2="1"] label { font-weight: 600; color: #2c3740; }
html[data-cp2="1"] .field { margin-bottom: 14px; }
html[data-cp2="1"] .input-status.ok { color: #0c6e5a; }
html[data-cp2="1"] .input-status.err, html[data-cp2="1"] .input-status.error { color: #b3261e; }

/* Camp de contrasenya amb «ull» */
.cp-pw { position: relative; display: block; }
.cp-pw > .input-field { padding-right: 52px; }
.cp-pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: none; background: none; border-radius: 10px;
  color: #3f4a52; cursor: pointer; display: grid; place-items: center;
}
.cp-pw-toggle:hover { background: #f1efe8; }
.cp-pw-toggle svg { width: 22px; height: 22px; }

/* ---------- 5. Targetes, avisos, estats buits ---------------------------- */
html[data-cp2="1"] .card { border-radius: var(--cp-r); box-shadow: var(--cp-shadow); border-color: #ece9e0; }
html[data-cp2="1"] .banner { border-radius: var(--cp-r-sm); padding: 12px 14px 12px 16px; border-left: 4px solid currentColor; font-size: 14.5px; line-height: 1.5; }
html[data-cp2="1"] .banner.info { background: var(--cp-info-bg); color: #0f5c8c; }
html[data-cp2="1"] .banner.warn { background: var(--cp-warn-bg); color: var(--cp-warn-ink); }
html[data-cp2="1"] .banner.error { background: #fbeaea; color: #a3261e; }
html[data-cp2="1"] .none {
  padding: 18px 16px; border: 1.5px dashed #d4d0c4; border-radius: var(--cp-r-sm);
  background: #fdfcf8; color: #4b565e; text-align: center; font-size: 14.5px;
}
html[data-cp2="1"] .tag.tag-dad { background: var(--orange-dark); color: #fff; }
html[data-cp2="1"] .tag.tag-mom { background: var(--teal); color: #fff; }

/* Icones de línia (substitueixen els emojis; veure ui2.js → ICONS) */
.cp-ic { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.cp-ic svg { width: 100%; height: 100%; display: block; }
.cp-dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; vertical-align: .05em; margin-right: .1em; }
.cp-dot.red { background: #d3453c; } .cp-dot.yellow { background: #e0a100; } .cp-dot.white { background: #fff; border: 1.5px solid #8b959c; } .cp-dot.black { background: #1e2a32; }

/* ---------- 6. Imports: ocults si tot és 0,00 (acció #2) ----------------- */
html[data-cp2="1"] .account-totals-fixed.cp-totals-zero { display: none !important; }
html[data-cp2="1"] .account-totals-fixed { border-radius: var(--cp-r); background: var(--cp-surface); box-shadow: var(--cp-shadow); border-color: #ece9e0; }

/* ---------- 7. Inici nou (#cp-home) ------------------------------------- */
html[data-cp2="1"] #cp-home[hidden], html[data-cp2="1"] #cp-nav[hidden] { display: none !important; }
.cp-home { max-width: 980px; margin: 0 auto; padding: 4px 0 24px; }
.cp-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 2px 16px; }
.cp-hello .cp-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #0c6e5a; margin: 0 0 2px; }
.cp-hello h1 { font-size: clamp(26px, 5vw, 34px); line-height: 1.1; margin: 0; }
.cp-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px;
  border: 1.5px solid #d4d0c4; border-radius: 999px; background: #fff; color: #2c3740; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 500;
}
.cp-chip:hover { background: #f4f2ec; }
.cp-chip .cp-ic { width: 16px; height: 16px; color: #3f4a52; }
.cp-chip small { font-family: 'Inter', sans-serif; font-size: 12px; color: #4b565e; }

.cp-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) {
  .cp-grid { grid-template-columns: 1.15fr 1fr; align-items: start; }
  .cp-grid .cp-wide { grid-column: 1 / -1; }
}
.cp-card {
  background: var(--cp-surface); border: 1px solid #ece9e0; border-radius: var(--cp-r);
  box-shadow: var(--cp-shadow); padding: 18px 18px 16px; position: relative; overflow: hidden;
}
.cp-card h2 { font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: #0c6e5a; font-family: 'JetBrains Mono', monospace; font-weight: 500; margin: 0 0 10px; }
.cp-card p { margin: 0; color: #4b565e; font-size: 15px; }
.cp-card .cp-big { font-family: 'Quicksand', sans-serif; font-weight: 700; color: var(--ink); font-size: clamp(22px, 4.6vw, 28px); line-height: 1.15; }
.cp-arc { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad); }

/* Avui */
.cp-today-who { display: flex; align-items: center; gap: 12px; margin: 2px 0 12px; }
.cp-avatar {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: #fff; font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 20px; background: var(--teal);
}
.cp-avatar.pa { background: var(--cal-pa-strong, #11856d); }
.cp-avatar.pb { background: var(--cal-pb-strong, #a76809); }
.cp-today-next {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--cp-r-sm);
  background: #f6f4ee; color: #2c3740; font-size: 14.5px; margin-bottom: 14px;
}
.cp-today-next .cp-ic { color: #0f5c8c; width: 20px; height: 20px; }
.cp-today-next b { color: var(--ink); }
.cp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cp-actions .btn { width: auto; flex: 1 1 180px; }

/* Següent pas + progrés */
.cp-progress { height: 8px; border-radius: 99px; background: #ece9e0; overflow: hidden; margin: 6px 0 14px; }
.cp-progress > i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .4s ease; }
.cp-next-title { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 20px; margin: 0 0 4px; color: var(--ink); }
.cp-steps-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.cp-step {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 52px;
  border-radius: var(--cp-r-sm); border: 1.5px solid #ece9e0; background: #fff; width: 100%;
  text-align: left; cursor: pointer; font: inherit; color: var(--ink);
}
.cp-step:hover { border-color: #b9d5ea; background: #f7fbfe; }
.cp-step .cp-check {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 2px solid #b8b3a4; color: #fff; background: #fff;
}
.cp-step .cp-check svg { width: 15px; height: 15px; opacity: 0; }
.cp-step.done { background: #f4faf8; border-color: #cfe9e2; }
.cp-step.done .cp-check { background: var(--teal); border-color: var(--teal); }
.cp-step.done .cp-check svg { opacity: 1; }
.cp-step.done .cp-step-t { text-decoration: line-through; text-decoration-color: #8fb9ae; color: #4b565e; }
.cp-step.current { border-color: #207bbd; box-shadow: 0 0 0 3px rgba(32, 123, 189, .14); }
.cp-step-t { font-weight: 600; font-size: 15px; display: block; }
.cp-step-h { font-size: 13px; color: #4b565e; display: block; margin-top: 1px; }
.cp-step .cp-go { margin-left: auto; color: #3f4a52; flex: none; }
.cp-step .cp-go svg { width: 18px; height: 18px; }
.cp-invite { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.cp-invite .btn { width: auto; min-height: 44px; flex: 1 1 130px; font-size: 14.5px; }
.cp-dismiss { background: none; border: none; color: #4b565e; text-decoration: underline; cursor: pointer; font: inherit; font-size: 13.5px; padding: 8px 2px; min-height: 40px; }

/* Atenció */
.cp-attn-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.cp-attn-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--cp-r-sm);
  background: var(--cp-warn-bg); color: var(--cp-warn-ink); font-size: 14.5px; line-height: 1.4;
}
.cp-attn-item .cp-ic { margin-top: 2px; width: 18px; height: 18px; }
.cp-badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  background: #a76809; color: #fff; font: 700 12px 'Inter', sans-serif; margin-left: 6px; vertical-align: 1px;
}
.cp-allgood { display: flex; align-items: center; gap: 10px; color: #0c6e5a; font-weight: 600; }
.cp-allgood .cp-ic { width: 22px; height: 22px; }

/* Accions ràpides */
.cp-quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .cp-quick { grid-template-columns: repeat(4, 1fr); } }
.cp-q {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 96px; padding: 12px 8px; background: #fff; border: 1.5px solid #ece9e0; border-radius: var(--cp-r);
  color: var(--ink); font: 600 14px 'Inter', sans-serif; cursor: pointer; box-shadow: var(--cp-shadow);
  transition: transform .1s ease, border-color .15s ease;
}
.cp-q:hover { border-color: #9cc6e4; transform: translateY(-1px); }
.cp-q .cp-ic { width: 28px; height: 28px; color: #14689f; }
.cp-q.primary { background: #207bbd; border-color: #207bbd; color: #fff; }
.cp-q.primary .cp-ic { color: #fff; }

/* Eines per tasca */
.cp-section-title { font-family: 'Quicksand', sans-serif; font-size: 18px; margin: 26px 2px 10px; }
.cp-group { margin-bottom: 18px; }
.cp-group h3 { font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: #4b565e; font-family: 'JetBrains Mono', monospace; font-weight: 500; margin: 0 2px 8px; display: flex; align-items: center; gap: 8px; }
.cp-group h3::after { content: ""; flex: 1; height: 1px; background: #e6e3da; }
.cp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cp-tile {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; text-align: left;
  background: #fff; border: 1.5px solid #ece9e0; border-radius: var(--cp-r); cursor: pointer; color: var(--ink);
  font: 600 14.5px/1.25 'Inter', sans-serif; position: relative;
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.cp-tile:hover { border-color: #9cc6e4; box-shadow: var(--cp-shadow); transform: translateY(-1px); }
.cp-tile-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: #e8f2fb; color: #14689f; }
.cp-tile-ic svg { width: 22px; height: 22px; }
.cp-group[data-g="money"] .cp-tile-ic { background: #e5f4ef; color: #0c6e5a; }
.cp-group[data-g="docs"] .cp-tile-ic { background: #eef5e2; color: #3d6b1c; }
.cp-group[data-g="help"] .cp-tile-ic { background: #fef1dc; color: #8a5206; }
.cp-tile .cp-badge { margin: 0 0 0 auto; flex: none; }
.cp-tile[disabled] { opacity: .55; }

/* Eina oberta: la barra lateral antiga es comporta com una targeta de pantalla */
html[data-cp2="1"] .tools-sidebar { border-radius: var(--cp-r); box-shadow: var(--cp-shadow); border-color: #ece9e0; margin-top: 10px; }
html[data-cp2="1"].cp-ready .tools-sidebar > h3 { display: none; }
html[data-cp2="1"].cp-ready .tools-sidebar:has(#tools-menu:not([hidden])) { display: none; }
html[data-cp2="1"].cp-ready #tools-menu { display: none !important; } /* el mosaic antic es substitueix per #cp-home (els seus botons segueixen sent la font de veritat) */
html[data-cp2="1"] .tools-block h4 { font-size: 20px; }
html[data-cp2="1"] .tools-back, html[data-cp2="1"] .tools-block > .btn-link:first-child, html[data-cp2="1"] .tools-sidebar .btn-link[data-i18n="tools.backToMenu"] {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px 8px 4px; font-size: 15px; color: #0f5c8c;
}
html[data-cp2="1"] .native-tabbar { display: none !important; }
html[data-cp2="1"] #btn-notifications-indicator { display: none !important; }

/* ---------- 8. Navegació principal (#cp-nav) ---------------------------- */
.cp-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; justify-content: space-around; align-items: stretch;
  background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid #e6e3da; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  min-height: var(--cp-nav-h);
}
.cp-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px;
  border: none; background: none; color: #4b565e; font: 600 11.5px 'Inter', sans-serif; cursor: pointer; border-radius: 12px; position: relative;
}
.cp-nav button .cp-ic { width: 24px; height: 24px; }
.cp-nav button[aria-current="page"] { color: #0f5c8c; }
.cp-nav button[aria-current="page"] .cp-ic { color: #207bbd; }
.cp-nav button[aria-current="page"]::before { content: ""; position: absolute; top: -7px; width: 28px; height: 3px; border-radius: 3px; background: var(--grad); }
.cp-nav .cp-add .cp-ic-wrap { width: 48px; height: 48px; margin-top: -22px; border-radius: 50%; background: #207bbd; color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -6px rgba(32, 123, 189, .8); border: 4px solid #faf9f5; }
.cp-nav .cp-add .cp-ic-wrap .cp-ic { width: 24px; height: 24px; }
.cp-nav .cp-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
@media (min-width: 901px) {
  .cp-nav {
    position: sticky; top: 8px; bottom: auto; left: auto; right: auto; width: max-content; max-width: 100%; margin: 0 auto 12px;
    border: 1px solid #e6e3da; border-radius: 999px; padding: 4px; box-shadow: var(--cp-shadow); min-height: 0; gap: 2px;
  }
  .cp-nav button { flex-direction: row; gap: 8px; padding: 8px 16px; min-height: 44px; font-size: 14px; border-radius: 999px; }
  .cp-nav button[aria-current="page"] { background: #e8f2fb; }
  .cp-nav button[aria-current="page"]::before { display: none; }
  .cp-nav .cp-add .cp-ic-wrap { width: 28px; height: 28px; margin: 0; border: none; box-shadow: none; }
  .cp-nav .cp-add .cp-ic-wrap .cp-ic { width: 18px; height: 18px; }
  .cp-nav .cp-badge { position: static; margin-left: 2px; }
}
@media (max-width: 900px) {
  body.cp-in-account { padding-bottom: calc(var(--cp-nav-h) + 24px + env(safe-area-inset-bottom)); }
  body.cp-in-account .yaiza-indicator { bottom: calc(var(--cp-nav-h) + 14px + env(safe-area-inset-bottom)); }
  body.cp-in-account .settings-indicator { display: none; }
}

/* Fulla «Afegir» (acció ràpida central) */
.cp-sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 30, 40, .45); z-index: 70; opacity: 0; transition: opacity .2s ease; }
.cp-sheet-backdrop.open { opacity: 1; }
.cp-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; background: #fff; border-radius: 20px 20px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -16px 40px -12px rgba(15, 30, 40, .35); transform: translateY(105%); transition: transform .25s ease; max-width: 560px; margin: 0 auto;
}
.cp-sheet.open { transform: none; }
.cp-sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: #d4d0c4; margin: 0 auto 12px; }
.cp-sheet h3 { font-size: 18px; margin: 0 0 10px; }
.cp-sheet-list { display: grid; gap: 8px; }
.cp-sheet-item { display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 60px; border: 1.5px solid #ece9e0; border-radius: var(--cp-r); background: #fff; cursor: pointer; text-align: left; font: inherit; color: var(--ink); width: 100%; }
.cp-sheet-item:hover { border-color: #9cc6e4; background: #f7fbfe; }
.cp-sheet-item .cp-tile-ic { width: 40px; height: 40px; }
.cp-sheet-item b { display: block; font-size: 15px; }
.cp-sheet-item span span { font-size: 13px; color: #4b565e; }

/* ---------- 9. Alta guiada: indicador de pas ---------------------------- */
.cp-stepper { margin: 4px auto 14px; max-width: 520px; }
.cp-stepper-top { display: flex; justify-content: space-between; font: 600 13px 'Inter', sans-serif; color: #2c3740; margin-bottom: 6px; }
.cp-stepper-top span:last-child { color: #4b565e; font-weight: 500; }
.cp-stepper-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cp-stepper-bar i { height: 6px; border-radius: 6px; background: #e0dccf; }
.cp-stepper-bar i.on { background: var(--grad); }

/* ---------- 10. Pàgina d'inici pública: CTA enganxós i bàner de mesura --- */
.cp-sticky-cta {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 55; display: none;
}
.cp-sticky-cta.show { display: block; }
.cp-sticky-cta .btn { width: 100%; box-shadow: 0 14px 30px -10px rgba(32, 123, 189, .8); }
@media (min-width: 761px) { .cp-sticky-cta { display: none !important; } }

.cp-consent {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 90; max-width: 560px; margin: 0 auto;
  background: #fff; border: 1px solid #e6e3da; border-radius: var(--cp-r); box-shadow: var(--cp-shadow-lg); padding: 14px 16px;
}
.cp-consent p { margin: 0 0 10px; font-size: 14px; color: #2c3740; }
.cp-consent .cp-actions .btn { min-height: 44px; font-size: 15px; flex: 1 1 120px; }
body.cp-in-account .cp-consent { bottom: calc(var(--cp-nav-h) + 12px + env(safe-area-inset-bottom)); }

/* Esquelet de càrrega */
.cp-skel { position: relative; overflow: hidden; background: #efece4; border-radius: 10px; min-height: 18px; }
.cp-skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); animation: cp-shimmer 1.3s infinite; }
@keyframes cp-shimmer { to { transform: translateX(100%); } }

/* Toast */
.cp-toast {
  position: fixed; left: 50%; bottom: calc(var(--cp-nav-h) + 18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 95;
  background: #1e2a32; color: #fff; padding: 12px 18px; border-radius: 999px; font: 600 14px 'Inter', sans-serif; transition: all .25s ease; pointer-events: none; max-width: 90vw;
}
.cp-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Alt contrast i impressió */
:root.high-contrast .cp-card, :root.high-contrast .cp-tile, :root.high-contrast .cp-q { border-color: #000; }
@media print { .cp-nav, .cp-sticky-cta, .cp-consent, .cp-sheet, .cp-sheet-backdrop { display: none !important; } }

/* Calaixos tancats: sense ombra residual a la vora de la pantalla */
html[data-cp2="1"] .calendar-drawer:not(.open), html[data-cp2="1"] .notifications-drawer:not(.open),
html[data-cp2="1"] .settings-drawer:not(.open), html[data-cp2="1"] .yaiza-drawer:not(.open) { box-shadow: none !important; visibility: hidden; }

/* Drawers (avisos/calendari/configuració): la targeta interna no aporta padding propi */
html[data-cp2="1"] .notifications-drawer .notifications-card,
html[data-cp2="1"] .settings-drawer .card { box-shadow: none; border: 0; padding: 28px 4px 16px; background: transparent; }

/* ===== Eines tipus «pantalla d'inici» (pulsació llarga per reordenar) ===== */
html[data-cp2="1"] .cp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cp-apps-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cp-apps-head .cp-section-title { margin-bottom: 4px; }
.cp-apps-edit {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid #9cc6e4; background: #fff; color: #14689f;
  font: 600 15px/1 'Inter', sans-serif; cursor: pointer; margin-top: 18px;
}
.cp-apps-wrap.editing .cp-apps-edit { background: #207bbd; border-color: #207bbd; color: #fff; }
.cp-apps-hint { margin: 0 2px 12px; color: #55616a; font-size: 14px; line-height: 1.4; }
.cp-apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 2px; padding: 6px 0 12px; }
@media (min-width: 560px) { .cp-apps { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); } }
.cp-app {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 4px 2px; min-height: 48px;
  background: transparent; border: 0; border-radius: 16px; cursor: pointer; color: #1f2a30; font: inherit;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.cp-app-ic {
  position: relative; width: 62px; height: 62px; border-radius: 19px; display: grid; place-items: center;
  background: #e8f2fb; color: #14689f; box-shadow: 0 2px 6px rgba(20,40,60,.10); transition: transform .12s ease, box-shadow .12s ease;
}
.cp-app-ic svg { width: 29px; height: 29px; }
.cp-app[data-g="money"] .cp-app-ic { background: #e5f4ef; color: #0c6e5a; }
.cp-app[data-g="docs"] .cp-app-ic { background: #eef5e2; color: #3d6b1c; }
.cp-app[data-g="help"] .cp-app-ic { background: #fef1dc; color: #8a5206; }
.cp-app:active .cp-app-ic { transform: scale(.93); }
.cp-app:focus-visible { outline: 3px solid #207bbd; outline-offset: 2px; }
.cp-app-l { font-size: 12.5px; line-height: 1.2; text-align: center; font-weight: 500; max-width: 100%; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cp-app-badge { position: absolute; top: -6px; right: -6px; margin: 0 !important; }
/* mode edició: les icones «tremolen» com al mòbil */
.cp-apps.editing .cp-app { touch-action: none; cursor: grab; }
.cp-apps.editing .cp-app:nth-child(odd) .cp-app-ic { animation: cp-jiggle .26s ease-in-out infinite alternate; }
.cp-apps.editing .cp-app:nth-child(even) .cp-app-ic { animation: cp-jiggle2 .30s ease-in-out infinite alternate; }
@keyframes cp-jiggle { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }
@keyframes cp-jiggle2 { from { transform: rotate(2.2deg); } to { transform: rotate(-2.2deg); } }
.cp-placeholder { opacity: .28; }
.cp-placeholder .cp-app-ic { animation: none !important; }
.cp-ghost { display: flex; flex-direction: column; align-items: center; gap: 7px; transform: scale(1.12); filter: drop-shadow(0 10px 14px rgba(20,40,60,.28)); opacity: .96; background: transparent; border: 0; font: inherit; color: #1f2a30; }
.cp-ghost.cp-ghost-drop { transform: scale(1); }
.cp-ghost .cp-app-ic { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .cp-apps.editing .cp-app .cp-app-ic { animation: none !important; outline: 2px dashed #207bbd; outline-offset: 2px; }
}

/* ===== Configuració: centre de control ===== */
html[data-cp2="1"] .cp-hide { display: none !important; }
html[data-cp2="1"] .settings-drawer { background: #faf9f5; }
html[data-cp2="1"] .settings-card { background: transparent; border: 0; box-shadow: none; padding: 0; }
/* vistes: hub o una categoria */
html[data-cp2="1"] .settings-card[data-cp-view="hub"] [data-cp-sec="look"],
html[data-cp2="1"] .settings-card[data-cp-view="hub"] [data-cp-sec="alerts"],
html[data-cp2="1"] .settings-card[data-cp-view="hub"] [data-cp-sec="cal"],
html[data-cp2="1"] .settings-card[data-cp-view="hub"] [data-cp-sec="tools"],
html[data-cp2="1"] .settings-card[data-cp-view="hub"] [data-cp-sec="sechead"] { display: none; }
html[data-cp2="1"] .settings-card[data-cp-view="look"] [data-cp-sec="hub"],
html[data-cp2="1"] .settings-card[data-cp-view="alerts"] [data-cp-sec="hub"],
html[data-cp2="1"] .settings-card[data-cp-view="cal"] [data-cp-sec="hub"],
html[data-cp2="1"] .settings-card[data-cp-view="tools"] [data-cp-sec="hub"] { display: none; }
html[data-cp2="1"] .settings-card[data-cp-view="look"] [data-cp-sec]:not([data-cp-sec="look"]):not([data-cp-sec="sechead"]),
html[data-cp2="1"] .settings-card[data-cp-view="alerts"] [data-cp-sec]:not([data-cp-sec="alerts"]):not([data-cp-sec="sechead"]),
html[data-cp2="1"] .settings-card[data-cp-view="cal"] [data-cp-sec]:not([data-cp-sec="cal"]):not([data-cp-sec="sechead"]),
html[data-cp2="1"] .settings-card[data-cp-view="tools"] [data-cp-sec]:not([data-cp-sec="tools"]):not([data-cp-sec="sechead"]) { display: none; }

/* capçalera del hub */
html[data-cp2="1"] .settings-card .eyebrow { font: 500 12px/1 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: #11856d; display: block; margin: 36px 0 6px; }
html[data-cp2="1"] .settings-card .step-title { font-family: 'Quicksand', sans-serif; font-size: 28px; margin: 0 0 4px; }
html[data-cp2="1"] .settings-card .settings-intro-lede { display: none; }

/* perfil + idioma */
html[data-cp2="1"] .settings-account-block { background: #fff; border: 1px solid #e6e3da; border-radius: 20px; padding: 16px; margin: 14px 0; box-shadow: 0 2px 8px rgba(20,40,60,.05); position: relative; }
html[data-cp2="1"] .settings-account-block::before { content: ""; position: absolute; left: 16px; right: 16px; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, #207bbd, #11856d 55%, #f1a431); }
html[data-cp2="1"] .settings-account-block > .step-lede, html[data-cp2="1"] #btn-settings-data { display: none; }
.cp-set-profile { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cp-set-profile .cp-avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #a76809; color: #fff; font: 700 22px/1 'Quicksand', sans-serif; flex: none; }
.cp-set-profile b { display: block; font: 700 18px/1.2 'Quicksand', sans-serif; color: #1f2a30; }
.cp-set-profile span { font: 500 13px/1.4 'JetBrains Mono', monospace; color: #55616a; }
html[data-cp2="1"] .settings-lang-block { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #efece4; padding-top: 12px; }
html[data-cp2="1"] .settings-lang-block label { font-weight: 600; margin: 0; }
html[data-cp2="1"] .settings-lang-block select { width: auto; min-width: 150px; }

/* llista de categories */
.cp-set-list { display: grid; gap: 10px; margin: 6px 0 14px; }
.cp-set-item {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 12px 14px; text-align: left;
  background: #fff; border: 1px solid #e6e3da; border-radius: 18px; cursor: pointer; font: inherit; color: #1f2a30;
  box-shadow: 0 1px 4px rgba(20,40,60,.05); transition: border-color .12s, box-shadow .12s, transform .12s;
}
.cp-set-item:hover { border-color: #9cc6e4; box-shadow: 0 4px 12px rgba(20,40,60,.10); }
.cp-set-item:active { transform: scale(.985); }
.cp-set-item:focus-visible, .cp-set-back:focus-visible { outline: 3px solid #207bbd; outline-offset: 2px; }
.cp-set-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: #e8f2fb; color: #14689f; }
.cp-set-ic svg { width: 23px; height: 23px; }
[data-k="children"] .cp-set-ic, .cp-set-ic[data-k="children"] { background: #e8f2fb; color: #14689f; }
[data-k="alerts"] .cp-set-ic, .cp-set-ic[data-k="alerts"] { background: #fef1dc; color: #8a5206; }
[data-k="look"] .cp-set-ic, .cp-set-ic[data-k="look"] { background: #eef5e2; color: #3d6b1c; }
[data-k="cal"] .cp-set-ic, .cp-set-ic[data-k="cal"] { background: #e5f4ef; color: #0c6e5a; }
[data-k="tools"] .cp-set-ic, .cp-set-ic[data-k="tools"] { background: #efe9fb; color: #5b3fa3; }
.cp-set-t { flex: 1; min-width: 0; }
.cp-set-t b { display: block; font: 700 16px/1.25 'Quicksand', sans-serif; }
.cp-set-t span { display: block; font-size: 14px; line-height: 1.35; color: #55616a; margin-top: 2px; }
.cp-set-go { color: #69747b; flex: none; }
.cp-set-go svg { width: 20px; height: 20px; }

/* capçalera d'una categoria */
html[data-cp2="1"] #cp-set-head { margin: 34px 0 12px; }
.cp-set-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px 0 4px; background: none; border: 0; cursor: pointer; color: #14689f; font: 600 15px/1 'Inter', sans-serif; }
.cp-set-back svg { transform: rotate(180deg); width: 20px; height: 20px; }
.cp-set-sech { display: flex; gap: 14px; align-items: center; }
.cp-set-sech h3 { font: 700 22px/1.2 'Quicksand', sans-serif; margin: 0; }
.cp-set-sech p { margin: 3px 0 0; color: #55616a; font-size: 14px; line-height: 1.4; }

/* seccions dins d'una categoria */
html[data-cp2="1"] .settings-card .panel-section:not(.settings-account-block) { background: #fff; border: 1px solid #e6e3da; border-radius: 20px; padding: 16px; margin: 0 0 12px; box-shadow: 0 1px 4px rgba(20,40,60,.05); }
html[data-cp2="1"] .settings-card .panel-section > .step-lede:first-child { font: 700 17px/1.3 'Quicksand', sans-serif; color: #1f2a30; display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
html[data-cp2="1"] .settings-card .panel-section.cp-notitle > .step-lede:first-child { display: none; }
html[data-cp2="1"] .settings-card .checkbox-line, html[data-cp2="1"] .settings-card .settings-contrast-toggle { min-height: 48px; padding: 6px 0; }
html[data-cp2="1"] .settings-card .settings-email-prefs-categories { border-left: 3px solid #e8f2fb; padding-left: 12px; margin-left: 2px; }
html[data-cp2="1"] .settings-card .btn-link { min-height: 44px; }
html[data-cp2="1"] .settings-card .btn-secondary { min-height: 48px; border-radius: 14px; }

/* tancar sessió */
html[data-cp2="1"] #btn-settings-logout { min-height: 52px; border-radius: 16px; border: 1.5px solid #e6c9c3; background: #fff; color: #9a3412; font-weight: 600; margin-top: 8px !important; }
html[data-cp2="1"] #btn-settings-logout:hover { background: #fdf1ee; }

/* ajustos finals Configuració / Fills */
html[data-cp2="1"] .settings-drawer .settings-card { margin: 0; padding: 30px 0 24px; }
html[data-cp2="1"] .settings-card .eyebrow { margin-top: 0; }
html[data-cp2="1"] #cp-set-head { margin: 0 0 12px; }
html[data-cp2="1"] .tools-block select, html[data-cp2="1"] .data-modal select {
  width: 100%; min-height: 48px; padding: 0 12px; font: 16px/1.2 'Inter', sans-serif; border: 1.5px solid #cfcabd; border-radius: 12px; background: #fff; color: #1f2a30;
}
html[data-cp2="1"] .tools-block input[type="file"] { width: 100%; padding: 12px; border: 1.5px dashed #9cc6e4; border-radius: 12px; background: #f4f9fd; font: 15px 'Inter', sans-serif; }
html[data-cp2="1"] .tools-block textarea { width: 100%; min-height: 96px; padding: 12px; font: 16px/1.4 'Inter', sans-serif; border: 1.5px solid #cfcabd; border-radius: 12px; }
html[data-cp2="1"] .tools-block input[type="date"] { min-height: 48px; }
html[data-cp2="1"] .settings-card [data-cp-sec="cal"] button.btn-secondary { width: 100%; text-align: center; margin-bottom: 8px; }

/* ===================================================================
   PANTALLES D'EINA — capçalera amb icona, acció principal destacada,
   llistes en targetes, pestanyes en píndoles i formularis grans
   =================================================================== */
html[data-cp2="1"] .account-layout { max-width: 760px; }
html[data-cp2="1"] .tools-sidebar { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 8px 0 24px; }
html[data-cp2="1"] .tools-sidebar > h3 { display: none; }
html[data-cp2="1"] .tools-block { padding: 2px 0 28px; animation: cp-tool-in .22s ease both; }
@keyframes cp-tool-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* botó de tornar */
html[data-cp2="1"] .tools-back-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px 0 14px; margin: 0 0 16px; border-radius: 999px;
  background: #fff; border: 1.5px solid #e0ddd2; color: #14689f; font: 600 15px/1 'Inter', sans-serif; text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 3px rgba(20,40,60,.06);
}
html[data-cp2="1"] .tools-back-btn:hover { border-color: #9cc6e4; background: #f4f9fd; }

/* capçalera: icona + títol + explicació */
.cp-toolhead { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 20px; }
.cp-toolicon { width: 56px; height: 56px; flex: none; border-radius: 18px; display: grid; place-items: center; background: #e8f2fb; color: #14689f; box-shadow: 0 2px 8px rgba(20,40,60,.10); }
.cp-toolicon svg { width: 28px; height: 28px; }
.tools-block[data-g="money"] .cp-toolicon { background: #e5f4ef; color: #0c6e5a; }
.tools-block[data-g="docs"] .cp-toolicon { background: #eef5e2; color: #3d6b1c; }
.tools-block[data-g="help"] .cp-toolicon { background: #fef1dc; color: #8a5206; }
.cp-toolhead > div { min-width: 0; }
html[data-cp2="1"] .cp-toolhead h4 { font: 700 26px/1.15 'Quicksand', sans-serif; margin: 2px 0 6px; color: #1f2a30; }
html[data-cp2="1"] .cp-toolhead .step-lede { font-size: 15px; line-height: 1.5; color: #55616a; margin: 0; }

/* acció principal de l'eina */
html[data-cp2="1"] .tools-block [id^="btn-open-"].btn,
html[data-cp2="1"] .tools-block #btn-generate-report,
html[data-cp2="1"] .tools-block #btn-child-document-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; margin: 0 0 20px; padding: 0 18px;
  background: #207bbd; border: 0; border-radius: 16px; color: #fff; font: 700 17px/1 'Quicksand', sans-serif; cursor: pointer;
  box-shadow: 0 8px 18px -10px rgba(32,123,189,.8);
}
html[data-cp2="1"] .tools-block [id^="btn-open-"].btn:hover, html[data-cp2="1"] .tools-block #btn-generate-report:hover { background: #1a67a0; }
html[data-cp2="1"] .tools-block [id^="btn-open-"].btn:active { transform: scale(.985); }
html[data-cp2="1"] .tools-block .calendar-actions { margin: 0; }

/* títols de secció + «Actualitza» */
html[data-cp2="1"] .tools-block h5 { font: 700 18px/1.3 'Quicksand', sans-serif; color: #1f2a30; margin: 24px 0 10px; }
html[data-cp2="1"] .tools-block .btn-ghost[id^="btn-load-"], html[data-cp2="1"] .tools-block .btn-ghost[id*="refresh"] {
  display: inline-flex; align-items: center; gap: 6px; width: auto; min-height: 40px; padding: 0 14px; margin: 0 0 12px;
  border: 1.5px solid #cfe3f3; border-radius: 999px; background: #f4f9fd; color: #14689f; font: 600 14px/1 'Inter', sans-serif; text-decoration: none; box-shadow: none;
}
html[data-cp2="1"] .tools-block .btn-ghost[id^="btn-load-"]::before { content: "↻"; font-size: 17px; line-height: 1; }

/* llistes en targetes (els elements porten estils en línia: s'imposen) */
html[data-cp2="1"] .tools-block .split-item, html[data-cp2="1"] .tools-block .history-item, html[data-cp2="1"] .tools-block .idea-item,
html[data-cp2="1"] .tools-block .incident-item, html[data-cp2="1"] .tools-block .arbitration-item {
  background: #fff !important; border: 1px solid #e6e3da !important; border-radius: 16px !important; padding: 14px 16px !important; margin-bottom: 12px !important;
  box-shadow: 0 1px 4px rgba(20,40,60,.05); line-height: 1.5;
}
html[data-cp2="1"] .tools-block .split-item .btn-small, html[data-cp2="1"] .tools-block .history-item .btn-small, html[data-cp2="1"] .tools-block .incident-item .btn-small {
  min-height: 40px; padding: 0 14px; border-radius: 12px;
}

/* pestanyes → píndoles desplaçables */
html[data-cp2="1"] .history-doctype-tabs, html[data-cp2="1"] .history-status-tabs, html[data-cp2="1"] .report-kind-tabs, html[data-cp2="1"] .report-period-tabs, html[data-cp2="1"] .history-filter {
  display: flex; gap: 8px; overflow-x: auto; flex-wrap: nowrap; border: 0; padding: 2px 2px 8px; margin: 0 -2px 8px; scrollbar-width: none;
}
html[data-cp2="1"] .history-doctype-tabs::-webkit-scrollbar, html[data-cp2="1"] .history-filter::-webkit-scrollbar { display: none; }
html[data-cp2="1"] .history-doctype-tab, html[data-cp2="1"] .history-status-tab, html[data-cp2="1"] .report-kind-tab, html[data-cp2="1"] .report-period-tab, html[data-cp2="1"] .history-filter-btn {
  flex: none; min-height: 44px; padding: 0 16px; border: 1.5px solid #d9d5c8; border-radius: 999px; background: #fff; color: #3f4a52;
  font: 600 14.5px/1 'Inter', sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap;
}
html[data-cp2="1"] .history-doctype-tab.active, html[data-cp2="1"] .history-status-tab.active, html[data-cp2="1"] .report-kind-tab.active,
html[data-cp2="1"] .report-period-tab.active, html[data-cp2="1"] .history-filter-btn.active { background: #207bbd; border-color: #207bbd; color: #fff; }
html[data-cp2="1"] .history-filter-btn, html[data-cp2="1"] .history-filter .btn-link { min-height: 40px; }

/* camps i botons de les eines i dels formularis emergents */
html[data-cp2="1"] .tools-block .field > label, html[data-cp2="1"] .swap-request-modal .field > label, html[data-cp2="1"] .data-modal .field > label { display: block; font: 600 15px/1.3 'Inter', sans-serif; color: #1f2a30; margin: 0 0 6px; }
html[data-cp2="1"] .swap-request-modal select, html[data-cp2="1"] .swap-request-modal textarea,
html[data-cp2="1"] .swap-request-modal input[type="text"], html[data-cp2="1"] .swap-request-modal input[type="number"], html[data-cp2="1"] .swap-request-modal input[type="date"],
html[data-cp2="1"] .swap-request-modal input[type="time"], html[data-cp2="1"] .swap-request-modal input[type="email"], html[data-cp2="1"] .swap-request-modal input[type="tel"] {
  width: 100%; min-height: 48px; padding: 0 12px; font: 16px/1.2 'Inter', sans-serif; border: 1.5px solid #cfcabd; border-radius: 12px; background: #fff; color: #1f2a30;
}
html[data-cp2="1"] .swap-request-modal textarea { min-height: 110px; padding: 12px; line-height: 1.4; }
html[data-cp2="1"] .swap-request-modal input[type="file"] { width: 100%; padding: 14px; border: 1.5px dashed #9cc6e4; border-radius: 14px; background: #f4f9fd; font: 15px 'Inter', sans-serif; }
html[data-cp2="1"] .swap-request-modal .btn { min-height: 52px; border-radius: 14px; width: 100%; font-weight: 700; }
html[data-cp2="1"] .swap-request-modal .checkbox-line, html[data-cp2="1"] .swap-request-modal .checkbox-inline { min-height: 44px; }

/* modals: full de dades sobre mòbil, targeta centrada a escriptori */
html[data-cp2="1"] .swap-request-modal, html[data-cp2="1"] .data-modal { background: #faf9f5; border-radius: 24px; box-shadow: 0 24px 60px -20px rgba(15,35,50,.5); }
html[data-cp2="1"] .swap-request-modal { width: min(560px, 94vw); height: auto; max-height: 90vh; }
html[data-cp2="1"] .swap-request-modal .document-viewer-body, html[data-cp2="1"] .data-modal .document-viewer-body { background: transparent; padding: 18px 20px 24px; }
html[data-cp2="1"] .swap-request-modal .document-viewer-header, html[data-cp2="1"] .data-modal .document-viewer-header { background: #fff; padding: 14px 18px; border-bottom: 1px solid #e6e3da; position: relative; }
html[data-cp2="1"] .swap-request-modal .document-viewer-header::after, html[data-cp2="1"] .data-modal .document-viewer-header::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: -1px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #207bbd, #11856d 55%, #f1a431);
}
html[data-cp2="1"] .document-viewer-title { font: 700 18px/1.2 'Quicksand', sans-serif; white-space: normal; }
html[data-cp2="1"] .document-viewer-close { width: 44px; height: 44px; border-radius: 50%; font-size: 26px; }
@media (max-width: 700px) {
  html[data-cp2="1"] .swap-request-modal, html[data-cp2="1"] .data-modal { width: 100vw; height: 100dvh; max-height: none; top: 0; left: 0; transform: none; border-radius: 0; }
}
html[data-cp2="1"] .tools-block input[type="checkbox"], html[data-cp2="1"] .swap-request-modal input[type="checkbox"] { width: 22px; height: 22px; accent-color: #207bbd; flex: none; }
html[data-cp2="1"] .tools-block .hint, html[data-cp2="1"] .swap-request-modal .hint { font-size: 14px; line-height: 1.45; color: #55616a; }

/* Eina «Els fills»: cada bloc és una targeta */
html[data-cp2="1"] .tools-block .account-contracts { background: #fff; border: 1px solid #e6e3da; border-radius: 20px; padding: 16px; margin: 0 0 16px; box-shadow: 0 1px 4px rgba(20,40,60,.05); }
html[data-cp2="1"] .tools-block .account-contracts > h3 { font: 700 19px/1.3 'Quicksand', sans-serif; letter-spacing: 0; text-transform: none; color: #1f2a30; margin: 0 0 6px; display: block; }
html[data-cp2="1"] .tools-block .account-contracts > h3::after { display: none; }
html[data-cp2="1"] .tools-block .child-info-card { background: #faf9f5 !important; border: 1px solid #ece9df !important; border-radius: 16px !important; padding: 14px !important; box-shadow: none; }
html[data-cp2="1"] .tools-block .child-info-save { background: #fff; border: 2px solid #207bbd; color: #14689f; font-weight: 700; min-height: 48px; border-radius: 12px; }
html[data-cp2="1"] .tools-block .child-info-save:hover { background: #f4f9fd; }
html[data-cp2="1"] .tools-block .account-contracts input:not([type="file"]):not([type="checkbox"]), html[data-cp2="1"] .tools-block .account-contracts textarea {
  width: 100%; min-height: 48px; padding: 0 12px; font: 16px/1.2 'Inter', sans-serif; border: 1.5px solid #cfcabd; border-radius: 12px; background: #fff;
}
html[data-cp2="1"] .tools-block .account-contracts textarea { padding: 12px; min-height: 96px; }

/* ===== v2.1 — targetes («widgets») dins del mateix tauler que les eines ===== */
.cp-apps > .cp-widget { grid-column: 1 / -1; margin: 0 4px; align-self: start; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
@media (min-width: 900px) {
  .cp-apps { grid-template-columns: repeat(24, minmax(0, 1fr)); }
  .cp-apps > .cp-app { grid-column: span 3; }
  .cp-apps > .cp-widget { grid-column: span 12; }
  .cp-apps > .cp-app + .cp-widget { grid-column: 1 / span 12; } /* després d'una icona, la targeta comença fila nova */
  .cp-apps > .cp-widget[data-cp-item="w-steps"] { grid-column: 1 / span 24; }
}
.cp-widget-grip { display: none; }
.cp-apps.editing .cp-widget { touch-action: none; cursor: grab; outline: 2px dashed #207bbd; outline-offset: 3px; }
.cp-apps.editing .cp-widget * { pointer-events: none; }
.cp-apps.editing .cp-widget-grip {
  display: flex; align-items: center; gap: 10px; margin: -2px 0 12px; color: #14689f; font: 600 13px/1 'Inter', sans-serif;
  letter-spacing: .02em; text-transform: uppercase;
}
.cp-widget-grip i {
  width: 22px; height: 14px; flex: none; opacity: .8;
  background: radial-gradient(circle, currentColor 1.6px, transparent 1.9px) 0 0 / 7.5px 7px;
}
.cp-widget:focus-visible { outline: 3px solid #207bbd; outline-offset: 3px; }
.cp-ghost.cp-widget { display: block; transform: scale(1.015); background: var(--cp-surface); opacity: .97; border-radius: var(--cp-r); }
.cp-ghost.cp-widget .cp-widget-grip { display: none; }
@media (prefers-reduced-motion: reduce) { .cp-apps.editing .cp-widget { outline-style: dashed; } }

/* Targeta «Necessiten la teva atenció»: marcar com a llegit + estat de pagament */
.cp-attn-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cp-attn-pay { font-size: 13px; font-weight: 600; color: #8a5206; }
.cp-attn-pay.k-confirmed, .cp-attn-pay.k-paid { color: #0c6e5a; }
.cp-attn-pay.k-denied, .cp-attn-pay.k-unpaid, .cp-attn-pay.k-pendingMine { color: #a3280b; }
.cp-attn-read {
  flex: none; width: 44px; height: 44px; margin: -8px -6px -8px 0; border-radius: 50%; border: 1.5px solid #cdb78e; background: #fff; color: #0c6e5a;
  display: grid; place-items: center; cursor: pointer;
}
.cp-attn-read .cp-ic { width: 20px; height: 20px; margin: 0; }
.cp-attn-read:hover { background: #e5f4ef; border-color: #0c6e5a; }
.cp-attn-sub { margin: 6px 0 12px !important; font-size: 14px !important; }
.cp-link-btn { background: none; border: 0; color: #14689f; text-decoration: underline; font: 600 14.5px/1 'Inter', sans-serif; padding: 12px 6px; min-height: 44px; cursor: pointer; }

/* Panell de notificacions: llegides + fases de pagament */
html[data-cp2="1"] .notif-toolbar { display: flex; justify-content: flex-end; margin: 0 0 8px; }
html[data-cp2="1"] .notification-item.is-read { opacity: .72; background: #f7f5ef; }
html[data-cp2="1"] .notif-read-tag { background: #e9edf0 !important; color: #3f4a52 !important; }
html[data-cp2="1"] .notif-actions { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; }
html[data-cp2="1"] .notif-actions .btn-link, html[data-cp2="1"] .notif-actions .btn-small { min-height: 44px; }
html[data-cp2="1"] .notif-allread { color: #0c6e5a; font-weight: 600; }
html[data-cp2="1"] .notif-read-group { margin-top: 14px; }
html[data-cp2="1"] .notif-read-group > summary { cursor: pointer; font: 600 14px/1.2 'Inter', sans-serif; color: #3f4a52; padding: 12px 4px; min-height: 44px; display: flex; align-items: center; }
.notif-pay { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.notif-pay-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; font: 600 13px/1.2 'Inter', sans-serif; background: #f1ede2; color: #5b4a22; }
.notif-pay-chip.k-paid { background: #e5f4ef; color: #0c6e5a; }
.notif-pay-chip.k-confirmed { background: #0c6e5a; color: #fff; }
.notif-pay-chip.k-pending { background: #fef1dc; color: #7a4a05; }
.notif-pay-chip.k-pendingMine { background: #fde7e1; color: #8f2209; }
.notif-pay-chip.k-unpaid { background: #fde7e1; color: #8f2209; }
.notif-pay-chip.k-denied { background: #a3280b; color: #fff; }
:root.high-contrast .notif-pay-chip { border: 1.5px solid #000; }
#cp-attn .cp-actions .btn { flex: 0 1 auto; white-space: nowrap; }
.cp-apps.editing .cp-widget-grip span { display: none; }
.cp-apps.editing .cp-widget-grip { margin-bottom: 8px; }

/* Botons de les notificacions (confirmació de pagament): primari + contorn */
html[data-cp2="1"] .notif-actions .btn-small { border: 2px solid #207bbd; background: #207bbd; color: #fff; font-weight: 600; border-radius: 999px; padding: 8px 16px; cursor: pointer; }
html[data-cp2="1"] .notif-actions .btn-small + .btn-small { background: #fff; color: #14689f; }
html[data-cp2="1"] .notif-actions .btn-small:disabled { opacity: .55; cursor: default; }
/* El pastís de navegació d'escriptori no ha de tapar el calaix de notificacions */
@media (min-width: 901px) { html[data-cp2="1"] .cp-nav { z-index: 40; } }

/* Botó «Restableix l'ordre original» (només visible en mode edició) */
.cp-apps-reset { display: block; margin: -4px 0 6px; padding-left: 0; }
.cp-apps-reset[hidden] { display: none; }
