/* Relleu PMS — identitat Relleu Digital (blau #0E528F · cel #1AA6D4 · Montserrat + Manrope) */
:root {
  --brand: #0E528F; --brand-d: #0A3F6F; --brand-2: #1AA6D4; --navy: #0B2240; --navy-2: #0A2440;
  --ink: #0B2240; --text: #1F2F45; --muted: #5A6B80; --faint: #8A99AC;
  --bg: #F4F8FC; --card: #FFFFFF; --panel: #F7FAFD; --line: #DDE6F0; --line-2: #EBF1F7;
  --tint: #E6F1FA; --tint-2: #E3F5FB;
  --bad: #C0392B; --badbg: #FDEDEB; --warn: #9A5B00; --warnbg: #FFF4DB; --ok: #12805C; --okbg: #E3F5EE; --info: #0E528F; --infobg: #E6F1FA;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(11,34,64,.05), 0 6px 20px -12px rgba(11,34,64,.18);
  --shadow-lg: 0 24px 60px -24px rgba(11,34,64,.45);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Montserrat", "Manrope", system-ui, sans-serif;
  --cellw: 42px; --rowh: 48px; --namew: 196px; --sidew: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body.noscroll { overflow: hidden; }
a { color: var(--brand); }
code { background: var(--tint); color: var(--brand-d); padding: 1px 6px; border-radius: 6px; font-size: .88em; word-break: break-all; }
h1 { font-family: var(--display); font-size: 24px; font-weight: 700; margin: 0 0 16px; letter-spacing: -.02em; color: var(--ink); }
h2 { font-family: var(--display); font-size: 16px; font-weight: 700; margin: 0 0 12px; color: var(--ink); letter-spacing: -.01em; }
h3 { font-family: var(--display); font-size: 14px; font-weight: 700; margin: 0 0 8px; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 20px; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ================= Estructura: barra lateral + contingut ================= */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidew); z-index: 30; display: flex; flex-direction: column;
  background: linear-gradient(170deg, var(--navy-2) 0%, #0C3563 55%, var(--brand) 100%); color: #DCE9F6;
}
.sidebar::after { content: ""; position: absolute; inset: auto 0 0 0; height: 180px; pointer-events: none;
  background: radial-gradient(120% 90% at 100% 100%, rgba(26,166,212,.32), transparent 60%); }
.side-brand { padding: 22px 22px 6px; display: flex; align-items: center; gap: 10px; }
.side-brand img { height: 34px; width: auto; display: block; }
.side-brand .prod { margin-left: auto; font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .14em; color: #fff;
  background: rgba(26,166,212,.28); border: 1px solid rgba(26,166,212,.55); padding: 3px 8px; border-radius: 99px; }
.side-biz { padding: 10px 22px 18px; font-size: 13px; color: rgba(220,233,246,.72); border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; flex: 1; overflow-y: auto; position: relative; z-index: 1; }
.nav .grp { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(220,233,246,.45); font-weight: 700; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; text-decoration: none; color: rgba(236,244,251,.82);
  font-weight: 600; font-size: 14.5px; position: relative; transition: background .15s, color .15s; }
.nav a svg { width: 20px; height: 20px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-2); }
.nav a.on svg { opacity: 1; color: var(--brand-2); }
.nav .badge { margin-left: auto; }
.side-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-2); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 700; flex: none; }
.side-foot .who { flex: 1; min-width: 0; line-height: 1.25; }
.side-foot .who b { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { color: rgba(220,233,246,.6); font-size: 12px; }
.side-foot a { color: rgba(220,233,246,.75); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; }
.side-foot a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-foot a svg { width: 18px; height: 18px; }
.badge { background: #E5484D; color: #fff; border-radius: 99px; font-size: 11px; font-weight: 800; padding: 1px 7px; min-width: 20px; text-align: center; line-height: 17px; }

.shell { margin-left: var(--sidew); min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 28px; min-height: 64px;
  background: rgba(244,248,252,.86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line-2); }
.top .crumb { font-size: 13.5px; color: var(--muted); }
.top .crumb b { color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 15px; margin-right: 8px; }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.syncchip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; }
.syncchip i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(18,128,92,.15); }
.syncchip.bad i { background: var(--bad); box-shadow: 0 0 0 3px rgba(192,57,43,.15); }
.burger { display: none; border: 0; background: #fff; width: 40px; height: 40px; border-radius: 10px; box-shadow: var(--shadow); cursor: pointer; color: var(--ink); }
.burger svg { width: 22px; height: 22px; }
.scrim { display: none; }
.warnbar { background: var(--warnbg); color: var(--warn); padding: 9px 28px; font-size: 14px; }

main#app { width: 100%; max-width: 1360px; margin: 0 auto; padding: 26px 28px 90px; }
main#app.wide { max-width: none; }

/* ================= Controls ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 16px; border-radius: 11px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: border-color .15s, background .15s, box-shadow .15s, transform .05s; }
.btn:hover { border-color: #B9C9DA; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #1360A3, var(--brand)); color: #fff; border-color: var(--brand); box-shadow: 0 6px 16px -8px rgba(14,82,143,.7); }
.btn.primary:hover { background: var(--brand-d); }
.btn.okb { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.bad { color: var(--bad); }
.btn.badfill { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(14,82,143,.06); }
.btn.small { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.btn.big { min-height: 48px; font-size: 16px; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; font-weight: 700; }
.linkbtn:hover { text-decoration: underline; }
input, select, textarea { font: inherit; padding: 9px 12px; border: 1px solid #CBD8E6; border-radius: 10px; background: #fff; color: var(--ink); min-height: 40px; max-width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(26,166,212,.18); }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 18px; height: 18px; accent-color: var(--brand); }
:focus-visible { outline: 3px solid rgba(26,166,212,.45); outline-offset: 1px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.toolbar input[type=search] { min-width: 220px; flex: 1; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 13px; border-radius: 9px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--brand); color: #fff; box-shadow: 0 4px 10px -6px rgba(14,82,143,.8); }

/* ================= Formularis ================= */
.form label, label.f { display: block; font-size: 12.5px; font-weight: 700; color: #3A4B61; margin: 0 0 14px; letter-spacing: .01em; }
.form label > input:not([type=checkbox]):not([type=radio]), .form label > select, .form label > textarea,
label.f > input, label.f > select, label.f > textarea { display: block; width: 100%; margin-top: 5px; font-weight: 500; color: var(--ink); font-size: 14.5px; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 4px; margin: 0 0 16px; background: #fff; }
.form legend { font-family: var(--display); font-weight: 700; padding: 0 6px; color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
.check { display: flex !important; align-items: center; gap: 9px; font-weight: 600 !important; }
.help { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 4px; display: block; }

/* ================= Caixes ================= */
.alertbox, .warnbox, .okbox, .infobox { border-radius: 12px; padding: 11px 15px; margin: 0 0 12px; font-size: 14px; border: 1px solid transparent; }
.alertbox { background: var(--badbg); color: #7A1F16; border-color: #F6CFCA; }
.warnbox { background: var(--warnbg); color: #6B4200; border-color: #F5E0AE; }
.okbox { background: var(--okbg); color: #0B5A40; border-color: #BFE6D6; }
.infobox { background: var(--infobg); color: #0A3F6F; border-color: #CBE0F2; }
.alertbox ul, .warnbox ul { margin: 6px 0 0; padding-left: 20px; }
.card { background: var(--card); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); border: 1px solid var(--line-2); }
.card + .card { margin-top: 16px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card h2 .count { background: var(--tint); color: var(--brand); border-radius: 99px; font-size: 12px; padding: 1px 9px; font-weight: 800; font-family: var(--font); }
.cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
.cols > div > .card + .card { margin-top: 18px; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }

/* ================= KPI ================= */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border-radius: var(--r); padding: 16px 18px; border: 1px solid var(--line-2); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); opacity: .9; }
.kpi span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.kpi b { display: block; font-family: var(--display); font-size: 30px; line-height: 1.15; margin-top: 6px; letter-spacing: -.03em; color: var(--ink); }
.kpi small { color: var(--muted); font-size: 12.5px; }
.kpi.alert b { color: var(--bad); }
.kpi.alert::before { background: linear-gradient(90deg, #E5484D, #F59E0B); }

/* ================= Llistes ================= */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 11px 8px; margin: 0 -8px; border-radius: 12px; cursor: pointer; transition: background .12s; }
.row + .row { border-top: 1px solid var(--line-2); }
.row:hover { background: var(--panel); }
.row:hover .rname { color: var(--brand); }
.row .when { width: 52px; height: 52px; flex: none; text-align: center; border-radius: 12px; background: var(--tint); display: flex; flex-direction: column; justify-content: center; }
.row .when b { display: block; font-family: var(--display); font-size: 19px; line-height: 1; color: var(--brand); }
.row .when small { color: var(--brand); opacity: .75; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-top: 3px; }
.row .main { flex: 1; min-width: 0; }
.rname { font-weight: 700; color: var(--ink); }
.row .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .side { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.alert-row { display: flex; gap: 11px; align-items: flex-start; padding: 11px 0; font-size: 14px; }
.alert-row + .alert-row { border-top: 1px solid var(--line-2); }
.alert-row .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.alert-row .dot.bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(192,57,43,.14); }
.alert-row .dot.warn { background: #E5A000; box-shadow: 0 0 0 4px rgba(229,160,0,.14); }
.alert-row .dot.info { background: var(--brand-2); box-shadow: 0 0 0 4px rgba(26,166,212,.16); }
.alert-row .txt { flex: 1; }
.alert-row .txt small { display: block; color: var(--faint); font-size: 12px; }

/* ================= Etiquetes ================= */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; font-size: 12px; font-weight: 700; padding: 3px 10px; white-space: nowrap; background: #EEF3F8; color: #3E5068; }
.pill.ok { background: var(--okbg); color: var(--ok); }
.pill.warn { background: var(--warnbg); color: var(--warn); }
.pill.bad { background: var(--badbg); color: var(--bad); }
.pill.info { background: var(--tint-2); color: #0B7196; }
.pill .sw { width: 8px; height: 8px; border-radius: 50%; }

/* ================= Taules ================= */
.tablewrap { overflow-x: auto; background: #fff; border-radius: var(--r); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; padding: 12px 14px; background: var(--panel); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 14px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover td { background: #F6FAFE; }
.tbl td small { display: block; color: var(--muted); font-size: 12px; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl input { min-height: 34px; padding: 5px 8px; width: 100%; min-width: 64px; }

/* ================= Planning (calendari) ================= */
.plan-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.plan-tools .title { font-family: var(--display); font-weight: 700; font-size: 19px; min-width: 200px; text-transform: capitalize; color: var(--ink); }
.plan { background: #fff; border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 200px); position: relative; user-select: none; -webkit-user-select: none; }
.plan-inner { position: relative; min-width: max-content; }
.p-head { display: flex; position: sticky; top: 0; z-index: 6; background: #fff; border-bottom: 1px solid var(--line); }
.p-corner { position: sticky; left: 0; z-index: 7; background: #fff; width: var(--namew); flex: none; border-right: 1px solid var(--line); padding: 8px 14px; font-size: 12px; color: var(--faint); display: flex; align-items: flex-end; }
.p-day { width: var(--cellw); flex: none; text-align: center; padding: 7px 0 6px; border-right: 1px solid var(--line-2); font-size: 11px; color: var(--muted); line-height: 1.2; font-weight: 600; }
.p-day b { display: block; font-family: var(--display); font-size: 14px; color: var(--ink); }
.p-day.we { background: #F8FAFD; }
.p-day.today { background: var(--brand); color: rgba(255,255,255,.8); }
.p-day.today b { color: #fff; }
.p-day.m1 { box-shadow: inset 2px 0 0 #C9D7E6; }
.p-group { display: flex; background: var(--panel); border-bottom: 1px solid var(--line); }
.p-group .p-name { background: var(--panel); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; min-height: 32px; }
.p-row { display: flex; border-bottom: 1px solid var(--line-2); height: var(--rowh); position: relative; }
.p-name { position: sticky; left: 0; z-index: 4; width: var(--namew); flex: none; background: #fff; border-right: 1px solid var(--line); padding: 0 14px; display: flex; flex-direction: column; justify-content: center; }
.p-name b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.p-name small { font-size: 12px; color: var(--muted); }
.p-cells { display: flex; position: relative; }
.p-cell { width: var(--cellw); flex: none; border-right: 1px solid var(--line-2); height: 100%; cursor: cell; }
.p-cell.we { background: #F8FAFD; }
.p-cell.today { background: rgba(26,166,212,.08); }
.p-cell.m1 { box-shadow: inset 2px 0 0 #E0E8F1; }
.p-cell.sel { background: rgba(26,166,212,.24) !important; }
.p-cell.past { background-image: linear-gradient(rgba(236,241,246,.6), rgba(236,241,246,.6)); }
.bk { position: absolute; top: 7px; height: calc(var(--rowh) - 14px); border-radius: 9px; color: #fff; font-size: 12.5px; font-weight: 700; padding: 0 9px; display: flex; align-items: center;
  overflow: hidden; white-space: nowrap; cursor: pointer; z-index: 2; box-shadow: 0 2px 6px -2px rgba(11,34,64,.35); transform: skewX(-12deg); }
.bk > span { transform: skewX(12deg); overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.bk:hover { filter: brightness(1.1); z-index: 3; }
.bk.req { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.22) 0 6px, transparent 6px 12px) !important; outline: 2px dashed rgba(11,34,64,.45); outline-offset: -2px; }
.bk.block { background: repeating-linear-gradient(135deg, #8795A8 0 6px, #7A889B 6px 12px) !important; }
.bk.conflict { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--bad); z-index: 3; }
.bk.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bk.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12.5px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 16px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }

/* ================= Tarifes ================= */
.rgrid .p-row { height: 58px; }
.rc { width: var(--cellw); flex: none; border-right: 1px solid var(--line-2); height: 100%; cursor: cell; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.rc b { font-family: var(--display); font-size: 12.5px; color: var(--ink); font-weight: 700; letter-spacing: -.02em; }
.rc small { font-size: 10px; color: var(--muted); font-weight: 700; margin-top: 3px; }
.rc.we { background: #F8FAFD; }
.rc.today { box-shadow: inset 0 3px 0 var(--brand-2); }
.rc.day b { color: var(--brand); }
.rc.day::after { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-2); }
.rc.busy { background-image: linear-gradient(to top, rgba(14,82,143,.10) 0 9px, transparent 9px); }
.rc.busy::before { content: ""; position: absolute; left: 3px; right: 3px; bottom: 3px; height: 3px; border-radius: 3px; background: var(--brand); opacity: .55; }
.rc.closed { background: repeating-linear-gradient(135deg, #FDECEA 0 5px, #F9DCD8 5px 10px); }
.rc.closed b { color: var(--bad); text-decoration: line-through; }
.rc.cta small::before { content: "⇥ "; color: var(--warn); }
.rc.sel { background: rgba(26,166,212,.28) !important; }
.rc.past { opacity: .45; }
.rc .sband { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
.seasons-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.season { border-radius: var(--r); background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow); padding: 16px 18px; cursor: pointer; position: relative; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.season:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(11,34,64,.45); }
.season .band { position: absolute; inset: 0 auto 0 0; width: 5px; }
.season h3 { font-size: 16px; margin: 0; display: flex; justify-content: space-between; gap: 8px; }
.season .dates { color: var(--muted); font-size: 13px; margin: 2px 0 10px; }
.season table { width: 100%; font-size: 13px; border-collapse: collapse; }
.season td { padding: 4px 0; border-top: 1px solid var(--line-2); }
.season td:last-child { text-align: right; font-weight: 700; color: var(--ink); }
.quote { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.quote .ln { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.quote .ln span { color: var(--muted); }
.quote .ln.tot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 9px; font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--ink); }
.quote .ln.tot span { color: var(--ink); }
.quote .ln.neg b { color: var(--ok); }
.nightlist { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.nightlist span { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 12px; color: var(--muted); }
.nightlist span b { color: var(--ink); margin-left: 4px; }
.wkpick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.wkpick label { margin: 0 !important; }
.wkpick input { display: none; }
.wkpick span { display: inline-grid; place-items: center; min-width: 44px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
.wkpick input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.tri { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 5px; }
.tri button { border: 0; background: #fff; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tri button + button { border-left: 1px solid var(--line); }
.tri button.on { background: var(--tint); color: var(--brand); }

/* ================= Canals ================= */
.unitcard { margin-bottom: 16px; }
.unitcard > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.conn { display: grid; grid-template-columns: 190px 1fr auto; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line-2); }
.conn .ch { display: flex; align-items: center; gap: 11px; font-weight: 700; color: var(--ink); }
.chlogo { width: 36px; height: 36px; border-radius: 10px; color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 14px; flex: none; }
.conn .st { font-size: 13px; color: var(--muted); }
.conn .st b { color: var(--ink); }
.conn .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0; }
.flow > div { background: var(--panel); border-radius: 12px; padding: 14px 16px; border: 1px solid var(--line); }
.flow h3 { display: flex; align-items: center; gap: 6px; }
.copyline { display: flex; gap: 6px; margin-top: 6px; }
.copyline input { flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: #fff; min-width: 0; }
.chpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-bottom: 14px; }
.chpick button { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 10px; font: inherit; font-weight: 700; cursor: pointer; text-align: left; color: var(--ink); }
.chpick button:hover { border-color: #B9C9DA; }
.chpick button.on { border-color: var(--brand-2); background: var(--tint-2); }
.steps { margin: 6px 0 0; padding-left: 20px; }
.steps li { margin: 0 0 7px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.how .card { margin: 0 !important; }
.how .card p { margin: 6px 0 0; font-size: 14px; color: #3A4B61; }
.how .num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--tint); color: var(--brand); font-family: var(--display); font-weight: 800; font-size: 13px; margin-right: 6px; }

/* ================= Finestres ================= */
.modal { position: fixed; inset: 0; background: rgba(8,22,42,.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 44px 16px; overflow-y: auto; }
.sheet { background: #fff; border-radius: 18px; width: 100%; max-width: 780px; box-shadow: var(--shadow-lg); position: relative; animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet.narrow { max-width: 540px; }
.sheet > div > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--line-2); }
.sheet > div > header h2 { margin: 0; font-size: 20px; }
.sheet > div > header .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.sheet .body { padding: 20px 24px; }
.sheet footer { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--line-2); background: var(--panel); border-radius: 0 0 18px 18px; }
.sheet footer .r { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.x { border: 0; background: var(--panel); width: 36px; height: 36px; border-radius: 50%; font-size: 19px; cursor: pointer; flex: none; color: var(--ink); }
.x:hover { background: var(--tint); }
.avail { border-radius: 11px; padding: 10px 13px; font-size: 14px; margin: 0 0 14px; }
.avail.ok { background: var(--okbg); color: #0B5A40; }
.avail.no { background: var(--badbg); color: #7A1F16; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.facts div { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 13px; }
.facts span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.facts b { font-family: var(--display); font-size: 15px; color: var(--ink); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 7px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; color: var(--ink); }
.section { border-top: 1px solid var(--line-2); padding-top: 16px; margin-top: 16px; }
.cibox { background: var(--panel); border-radius: 12px; padding: 13px 15px; border: 1px solid var(--line); }
.cibox .prog { height: 8px; border-radius: 99px; background: #DCE6F0; overflow: hidden; margin: 9px 0; }
.cibox .prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 80; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); }

/* ================= Entrada i instal·lació ================= */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(26,166,212,.18), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(14,82,143,.16), transparent 60%), var(--bg); }
.authcard { display: grid; grid-template-columns: 1fr 1.05fr; width: min(940px, 100%); background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--line-2); }
.authcard.wide { grid-template-columns: 340px 1fr; width: min(1080px, 100%); }
.authside { background: linear-gradient(160deg, var(--navy-2), #0C3563 55%, var(--brand)); color: #E2EEF9; padding: 40px 36px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.authside::after { content: ""; position: absolute; right: -80px; bottom: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(26,166,212,.45), transparent 65%); }
.authside img { height: 44px; width: auto; align-self: flex-start; }
.authside .tag { font-family: var(--display); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 11.5px; color: var(--brand-2); }
.authside h2 { color: #fff; font-size: 24px; line-height: 1.25; margin: 0; }
.authside p { margin: 0; opacity: .85; font-size: 14.5px; }
.authside ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14px; position: relative; z-index: 1; }
.authside li { display: flex; gap: 10px; align-items: flex-start; }
.authside li::before { content: "✓"; flex: none; width: 20px; height: 20px; border-radius: 50%; background: rgba(26,166,212,.3); color: #fff; font-size: 12px; display: grid; place-items: center; margin-top: 1px; }
.authside .foot { margin-top: auto; font-size: 12px; opacity: .6; }
.authform { padding: 40px 38px; }
.authform h1 { font-size: 26px; margin-bottom: 6px; }
.authform .lead { color: var(--muted); margin: 0 0 22px; }
.copy { display: block; margin-top: 6px; padding: 9px 11px; }
ol.steps li { margin-bottom: 10px; }

/* ================= Configuració ================= */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.subtabs button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 15px; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; }
.subtabs button:hover { color: var(--ink); border-color: #B9C9DA; }
.subtabs button.on { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 6px 14px -8px rgba(14,82,143,.8); }
.embed textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* ================= Responsive ================= */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(8,22,42,.45); z-index: 25; }
  .shell { margin-left: 0; }
  .burger { display: grid; place-items: center; }
  .top { padding: 10px 14px; }
  .syncchip { display: none; }
  .authcard, .authcard.wide { grid-template-columns: 1fr; }
  .authside { padding: 28px 26px; }
  .authside ul, .authside .foot { display: none; }
}
@media (max-width: 760px) {
  :root { --namew: 120px; --cellw: 40px; }
  .top .crumb span { display: none; }
  main#app { padding: 16px 12px 80px; }
  h1 { font-size: 21px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi b { font-size: 25px; }
  .grid2, .grid3, .grid4, .flow { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .conn { grid-template-columns: 1fr; }
  .conn .acts { justify-content: flex-start; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { margin-top: 8px; }
  .modal { padding: 0; }
  .sheet { border-radius: 0; min-height: 100%; }
  .sheet footer { border-radius: 0; position: sticky; bottom: 0; }
  .tbl .hide-m { display: none; }
  .plan { max-height: calc(100vh - 230px); }
  .authform { padding: 28px 22px; }
  #newBtn .lbl { display: none; }
}
.btn svg { width: 18px; height: 18px; flex: none; }
.form .wkpick label, .wkpick label { display: inline-block; font-weight: 700; }
