/* ════════════════════════════════════════════════════════════════
   QUADRANT GENERAL v2 · interactive layer
   Sits on top of design-system/quadrant.css — only adds what the
   live navigation needs (stacking cells, toggles, conflict flags).
   ═══════════════════════════════════════════════════════════════ */

.q2-page { min-height: 100vh; background: var(--bp-grey-50); padding: 24px; display: flex; justify-content: center; }
.q2-shell {
  width: 100%; max-width: 1560px; background: var(--bp-white);
  border: 1px solid #E0DCD4;
  box-shadow: 0 24px 48px -16px rgba(20,14,6,0.18), 0 2px 6px rgba(20,14,6,0.06);
  position: relative; overflow: hidden;
}

/* role selector in the topbar */
.topbar .q2-role {
  appearance: none; background: rgba(255,255,255,0.16); color: var(--bp-white);
  border: 1px solid rgba(255,255,255,0.4); cursor: pointer;
  font-family: var(--bp-font-display); font-weight: 700; font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 7px 30px 7px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
/* readable options in the native popup (dark text on white) */
.topbar .q2-role option { color: var(--bp-ink); background: var(--bp-white); font-weight: 600; }

/* filter selects styled as chips, always readable */
.toolbar .fsel {
  appearance: none; cursor: pointer; min-height: 30px;
  font-family: var(--bp-font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--bp-ink); background: var(--bp-white);
  border: 1px solid var(--bp-grey-100); border-radius: var(--bp-radius-pill);
  padding: 5px 26px 5px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%231D1D1B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.toolbar .fsel.act { background-color: var(--bp-ink); color: var(--bp-white); border-color: var(--bp-ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
.toolbar .fsel option { color: var(--bp-ink); background: var(--bp-white); font-weight: 600; }
.toolbar .fsel:disabled { background-color: var(--bp-red); color: var(--bp-white); border-color: var(--bp-red); cursor: not-allowed; opacity: 1;
  background-image: none; padding-right: 12px; }
.toolbar .wk-step {
  background: var(--bp-white); border: 1px solid var(--bp-grey-100); cursor: pointer;
  font-family: var(--bp-font-display); font-weight: 700; font-size: 14px; color: var(--bp-ink);
  width: 30px; min-height: 30px; display: inline-flex; align-items: center; justify-content: center;
}
.toolbar .wk-step:hover { background: var(--bp-cream); }
.toolbar .wk-label { font-family: var(--bp-font-display); font-weight: 700; font-size: 11px; letter-spacing: 0.04em;
  color: var(--bp-white); background: var(--bp-ink); border: 1px solid var(--bp-ink); padding: 6px 14px; min-height: 30px;
  display: inline-flex; align-items: center; text-transform: uppercase; white-space: nowrap; }

/* ── timeline grid (variable durations) ─────────────────────────── */
.tg { display: grid; grid-template-columns: 56px repeat(5, 1fr); background: var(--bp-grey-100); gap: 1px; }
.tg-corner { background: var(--bp-cream); }
.tg-gutter { background: var(--bp-white); position: relative; }
.tg-gutter .hr { position: absolute; right: 6px; transform: translateY(-50%); font-family: var(--bp-font-display);
  font-size: 10px; font-weight: 700; color: var(--bp-grey-500); }
.tg-day { background: var(--bp-white); position: relative;
  background-image: repeating-linear-gradient(to bottom, var(--bp-grey-100) 0, var(--bp-grey-100) 1px, transparent 1px, transparent 72px); }
.tg-ev { position: absolute; overflow: hidden; cursor: pointer; color: #fff; padding: 3px 7px;
  font-family: var(--bp-font-display); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16); display: flex; flex-direction: column;
  transition: filter 90ms; }
.tg-ev:hover { filter: brightness(1.08); z-index: 4; }
.tg-ev.esports { background: #2E5BBA; } .tg-ev.musica { background: #1E7A3D; } .tg-ev.idiomes { background: #B85800; }
.tg-ev.culturals { background: #5E2DC6; } .tg-ev.tech { background: #0E7A85; } .tg-ev.manuals { background: #8A4A00; }
.tg-ev .glyph { position: absolute; top: 3px; right: 5px; font-size: 9px; opacity: 0.85; }
.tg-ev .t { font-weight: 700; font-size: 11px; line-height: 1.12; letter-spacing: -0.005em; padding-right: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-ev .m { font-family: var(--bp-font-body); font-size: 9.5px; opacity: 0.92; margin-top: 2px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-ev .pluja-tag { display: inline-block; margin-left: 4px; background: rgba(255,255,255,0.3); padding: 0 4px;
  border-radius: 2px; font-size: 8px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.tg-ev.narrow { padding: 2px 4px; }
.tg-ev.narrow .m { display: none; }
.tg-ev.narrow .t { font-size: 9.5px; white-space: normal; padding-right: 2px; }
.tg-ev.narrow .glyph { top: 2px; right: 2px; }
.tg-ev.micro { padding: 3px 2px; align-items: center; }
.tg-ev.micro .t, .tg-ev.micro .m { display: none; }
.tg-ev.micro .glyph { position: static; font-size: 12px; opacity: 1; }
.tg-ev.sel { box-shadow: 0 0 0 2px var(--bp-ink); z-index: 6; }
.tg-ev.dim { opacity: 0.2; }
.tg-ev.warn { box-shadow: inset 0 0 0 2px var(--bp-red); }
.tg-ev.warn .t { padding-left: 13px; }
.tg-ev .flag { position: absolute; top: 2px; left: 3px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bp-red); color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ── table view ─────────────────────────────────────────────────── */
.tbl-wrap { background: var(--bp-white); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th { position: sticky; top: 0; z-index: 2; background: var(--bp-cream); text-align: left; cursor: pointer;
  font-family: var(--bp-font-display); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bp-grey-700); padding: 13px 16px; border-bottom: 1px solid var(--bp-grey-100); white-space: nowrap; user-select: none; }
.tbl thead th.r { text-align: right; }
.tbl thead th.on { color: var(--bp-ink); }
.tbl thead th .caret { margin-left: 5px; font-size: 8px; color: var(--bp-red); }
.tbl tbody tr { cursor: pointer; border-bottom: 1px solid var(--bp-grey-50); }
.tbl tbody tr:hover { background: var(--bp-cream); }
.tbl td { padding: 11px 16px; font-family: var(--bp-font-body); font-size: 12.5px; color: var(--bp-ink); white-space: nowrap; vertical-align: middle; }
.tbl td.r { text-align: right; }
.tbl td.mono { font-family: var(--bp-font-mono); font-size: 12px; color: var(--bp-grey-700); }
.tbl td.name { font-family: var(--bp-font-display); font-weight: 700; }
.tbl .cdot { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; color: #fff; font-size: 9px;
  align-items: center; justify-content: center; margin-right: 9px; vertical-align: middle; }
.tbl .rer { margin-left: 7px; background: #E2EEF6; color: #0F62A5; font-family: var(--bp-font-display); font-weight: 700;
  font-size: 9px; padding: 1px 5px; border-radius: 999px; text-transform: uppercase; }
.tbl .occwrap { display: inline-flex; align-items: center; gap: 9px; justify-content: flex-end; }
.tbl .occnum { font-family: var(--bp-font-display); font-weight: 700; font-size: 12.5px; color: var(--bp-ink); }
.tbl .occnum.full { color: var(--bp-red); } .tbl .occnum.warn { color: #B85800; }
.tbl .occbar { width: 54px; height: 5px; background: var(--bp-grey-50); position: relative; }
.tbl .occbar i { position: absolute; inset: 0 auto 0 0; background: #0E7A85; }
.tbl .occbar i.warn { background: #B85800; } .tbl .occbar i.full { background: var(--bp-red); }
.tbl-empty { padding: 60px 24px; text-align: center; color: var(--bp-grey-500); font-family: var(--bp-font-body); font-size: 13px; }

/* ── grouped time-band summary card ───────────────────────────── */
.tg-group { position: absolute; overflow: hidden; cursor: pointer; background: var(--bp-white);
  border: 1.5px solid var(--bp-grey-200); border-radius: 3px; box-shadow: 0 2px 7px rgba(20,14,6,0.10);
  padding: 6px 9px 6px 14px; display: flex; flex-direction: column; gap: 3px; transition: box-shadow 120ms, transform 90ms; }
.tg-group:hover { box-shadow: 0 7px 18px -4px rgba(20,14,6,0.30); transform: translateY(-1px); border-color: var(--bp-grey-500); z-index: 5; }
.gc-accent { position: absolute; top: 0; left: 0; bottom: 0; width: 6px; }
.tg-group .gc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tg-group .cnt { font-family: var(--bp-font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; color: var(--bp-ink); line-height: 1; }
.tg-group .dots { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 56%; }
.tg-group .dot { width: 13px; height: 13px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,0.07); }
.tg-group .lbl { font-family: var(--bp-font-display); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bp-grey-500); }
.tg-group .time { font-family: var(--bp-font-mono); font-size: 10.5px; color: var(--bp-grey-700); margin-top: auto; }
.tg-group.narrow { padding: 5px 6px 5px 12px; }
.tg-group.narrow .lbl, .tg-group.narrow .time { display: none; }
.tg-group.narrow .gc-top { flex-direction: column; align-items: flex-start; gap: 5px; }
.tg-group.narrow .dots { justify-content: flex-start; max-width: 100%; }
.tg-group.sel { box-shadow: 0 0 0 2px var(--bp-ink), 0 4px 10px rgba(0,0,0,0.12); z-index: 6; }
.tg-group.warn { border-color: var(--bp-red); box-shadow: 0 2px 9px rgba(231,60,57,0.22); }
.tg-group.dim { opacity: 0.22; }
.tg-group .flag { position: absolute; bottom: 4px; right: 4px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bp-red); color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tg-group .rainchip { display: inline-flex; align-items: center; background: #E2EEF6; color: #0F62A5; align-self: flex-start;
  font-family: var(--bp-font-display); font-weight: 700; font-size: 9px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 999px; margin-top: 2px; }
.tg-ev.rain::after, .tg-group.rain::after { content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0;
  border-style: solid; border-width: 0 15px 15px 0; border-color: transparent #0F62A5 transparent transparent; }

.tg-wrap { position: relative; }

/* ── resource view (per espai / per monitor) ───────────────────────── */
.rg-wrap { overflow-x: auto; padding: 2px; }
.rg { display: grid; min-width: 920px; background: var(--bp-grey-100); gap: 1px; border: 1px solid var(--bp-grey-100); }
.rg-corner { background: var(--bp-cream); padding: 11px 14px; font-family: var(--bp-font-display); font-weight: 700;
  font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--bp-grey-700);
  position: sticky; left: 0; z-index: 3; }
.rg-dh { background: var(--bp-cream); padding: 11px 14px; font-family: var(--bp-font-display); font-weight: 700;
  font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bp-ink); }
.rg-dh span { color: var(--bp-grey-400); font-weight: 700; }
.rg-dh.today { color: var(--bp-red); }
.rg-rowhead { background: var(--bp-white); padding: 11px 14px; display: flex; align-items: center; gap: 9px;
  position: sticky; left: 0; z-index: 2; }
.rg-rowhead .rh-ic { width: 16px; height: 16px; color: var(--bp-grey-500); flex-shrink: 0; }
.rg-rowhead .rh-av { width: 26px; height: 26px; border-radius: 50%; background: var(--bp-cream); color: var(--bp-red);
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--bp-font-display);
  font-weight: 700; font-size: 10px; flex-shrink: 0; }
.rg-rowhead .rh-name { font-family: var(--bp-font-display); font-weight: 700; font-size: 13px; color: var(--bp-ink); line-height: 1.15; }
.rg-occ { margin-left: auto; font-family: var(--bp-font-display); font-weight: 700; font-size: 11px; padding: 3px 8px; border-radius: 999px; }
.rg-occ.ok { background: #E6F4EA; color: #0E6B2E; } .rg-occ.warn { background: #FBF0DC; color: #8A5A00; } .rg-occ.over { background: #FCE9E8; color: #B5302C; }
.rg-cell { background: var(--bp-white); padding: 7px; display: flex; flex-direction: column; gap: 6px; min-height: 56px; }
.rg-cell.today { background: #FFFCF7; }
.rg-cell.clash { background: #FFF6F5; }
.rg-clash { display: inline-flex; align-items: center; gap: 5px; font-family: var(--bp-font-display); font-weight: 700;
  font-size: 9.5px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--bp-red); }
.rg-clash i { width: 13px; height: 13px; border-radius: 50%; background: var(--bp-red); color: #fff; font-style: normal;
  font-size: 9px; display: inline-flex; align-items: center; justify-content: center; }
.rg-block { position: relative; border: 1px solid var(--bp-grey-200); border-radius: 6px; background: #fff;
  padding: 6px 9px 6px 11px; cursor: pointer; overflow: hidden; box-shadow: 0 1px 2px rgba(20,14,6,0.05); transition: box-shadow 110ms; }
.rg-block:hover { box-shadow: 0 5px 13px -4px rgba(20,14,6,0.25); }
.rg-block .rg-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.rg-block.warn { border-color: var(--bp-red); }
.rg-block.warn .rg-accent { background: var(--bp-red) !important; }
.rg-block.sel { box-shadow: 0 0 0 2px var(--bp-ink); }
.rg-block .rg-time { font-family: var(--bp-font-mono); font-size: 10px; color: var(--bp-grey-500); display: flex; align-items: center; gap: 6px; }
.rg-block .rg-rain { background: #E2EEF6; color: #0F62A5; font-family: var(--bp-font-display); font-weight: 700; font-size: 8px;
  letter-spacing: 0.04em; text-transform: uppercase; padding: 0 4px; border-radius: 2px; }
.rg-block .rg-name { font-family: var(--bp-font-display); font-weight: 700; font-size: 12px; color: var(--bp-ink); margin-top: 1px; display: flex; align-items: center; gap: 6px; line-height: 1.12; }
.rg-block .rg-name .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.rg-block .rg-meta { font-family: var(--bp-font-body); font-size: 10.5px; color: var(--bp-grey-700); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.rg-block .rg-flag { width: 13px; height: 13px; border-radius: 50%; background: var(--bp-red); color: #fff; font-size: 9px;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.rg-empty { padding: 64px 24px; text-align: center; }
.rg-empty h3 { font-family: var(--bp-font-display); font-weight: 700; font-size: 18px; color: var(--bp-ink); margin: 0 0 6px; }
.rg-empty p { font-family: var(--bp-font-body); font-size: 13px; color: var(--bp-grey-700); margin: 0; }
.tg-empty-ov { position: absolute; top: 130px; left: 0; right: 0; text-align: center; pointer-events: none; }
.tg-empty-ov h3 { font-family: var(--bp-font-display); font-weight: 700; font-size: 18px; color: var(--bp-ink); margin: 0 0 6px; }
.tg-empty-ov p { font-family: var(--bp-font-body); font-size: 13px; color: var(--bp-grey-700); margin: 0; }

.cell-pop .poprow .gl { display: inline-flex; align-items: center; }
.cell-pop .poprow .pdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cell-pop .poprow.warn { background: #FFF7F6; }
.cell-pop .poprow .cfl { color: var(--bp-red); font-weight: 700; margin-left: 5px; }

/* legend rows double as a category filter */
.grid-side .legend-row { cursor: pointer; padding: 5px 7px; margin: 0 -7px; }
.grid-side .legend-row:hover { background: var(--bp-cream); }
.grid-side .legend-row.on { background: var(--bp-ink); }
.grid-side .legend-row.on .name, .grid-side .legend-row.on .n { color: var(--bp-white); }
.grid-side .legend-row.locked { cursor: default; }
.grid-side .legend-row.locked:hover { background: transparent; }

/* toolbar additions */
.toolbar .fsearch { display: inline-flex; align-items: center; gap: 7px; min-height: 32px;
  padding: 0 10px; border: 1px solid var(--bp-grey-200); background: var(--bp-white); border-radius: var(--bp-radius-pill); }
.toolbar .fsearch svg { width: 14px; height: 14px; color: var(--bp-grey-500); flex-shrink: 0; }
.toolbar .fsearch input { border: none; outline: none; background: none; min-width: 210px;
  font-family: var(--bp-font-body); font-size: 12.5px; color: var(--bp-ink); padding: 6px 0; }
.toolbar .fsearch input::placeholder { color: var(--bp-grey-500); }
.toolbar .fsearch.act { border-color: var(--bp-ink); box-shadow: 0 0 0 2px rgba(29,29,27,0.08); }
.toolbar .fsearch.act svg { color: var(--bp-red); }
.toolbar .fs-clear { background: none; border: none; cursor: pointer; color: var(--bp-grey-500);
  font-size: 12px; padding: 2px 0 2px 2px; line-height: 1; flex-shrink: 0; }
.toolbar .fs-clear:hover { color: var(--bp-red); }
.toolbar .chip { cursor: pointer; }
.toolbar .chip.on { background: var(--bp-ink); color: var(--bp-white); border-color: var(--bp-ink); }
.toolbar .clear-btn {
  background: none; border: none; cursor: pointer; color: var(--bp-red);
  font-family: var(--bp-font-display); font-weight: 700; font-size: 11px; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 5px;
}

/* Mode pluja toggle */
.rain-toggle {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 6px 14px 6px 10px; min-height: 32px;
  border: 1.5px solid var(--bp-grey-200); background: var(--bp-white);
  font-family: var(--bp-font-display); font-weight: 700; font-size: 12px; color: var(--bp-grey-700);
  border-radius: var(--bp-radius-pill);
}
.rain-toggle .sw { width: 32px; height: 18px; border-radius: 999px; background: var(--bp-grey-200); position: relative; transition: background 140ms; flex-shrink: 0; }
.rain-toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--bp-white); transition: transform 140ms; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.rain-toggle.on { background: #E2EEF6; border-color: #0F62A5; color: #0F62A5; }
.rain-toggle.on .sw { background: #0F62A5; }
.rain-toggle.on .sw::after { transform: translateX(14px); }
.rain-toggle svg { width: 15px; height: 15px; }
.csv-btn { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; min-height: 32px;
  padding: 6px 13px; margin-right: 10px; border: 1.5px solid var(--bp-ink); background: var(--bp-white);
  font-family: var(--bp-font-display); font-weight: 700; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--bp-ink); border-radius: var(--bp-radius-pill); }
.csv-btn:hover { background: var(--bp-ink); color: var(--bp-white); }
.csv-btn svg { width: 15px; height: 15px; }
.rain-banner {
  background: #E2EEF6; border-bottom: 1px solid #9CC4DA; padding: 9px 28px;
  display: flex; gap: 11px; align-items: center;
  font-family: var(--bp-font-display); font-size: 12px; font-weight: 700; color: #0F4C7A; letter-spacing: 0.02em;
}
.rain-banner svg { width: 16px; height: 16px; flex-shrink: 0; }

/* role context strip */
.role-strip {
  display: flex; align-items: center; gap: 10px; padding: 8px 28px;
  font-family: var(--bp-font-body); font-size: 12.5px; line-height: 1.3;
}
.role-strip svg { width: 15px; height: 15px; flex-shrink: 0; }
.role-strip.general  { background: var(--bp-cream);  border-bottom: 1px solid #E6D9C4; color: #5A4A2E; }
.role-strip.direccio { background: #FFF4E0; border-bottom: 1px solid #EBD6A8; color: #8A4A00; }

/* ── stacking cells (multiple activities per day×slot) ───────────── */
.cal-cell.stack {
  display: flex; flex-direction: column; gap: 2px; padding: 2px;
  min-height: 92px; align-content: start;
}
.cal-cell.stack .cat-block {
  height: auto; min-height: 0; flex: none;
  padding: 5px 7px 6px;
}
.cal-cell .cat-block .name-l { display: block; padding-right: 12px; }
.cal-cell .cat-block .meta { margin-top: 3px; line-height: 1.25; }

/* dim when filtered out */
.cat-block.dim { opacity: 0.16 !important; filter: saturate(0.3); }

/* selected */
.cat-block.sel { outline: 2px solid var(--bp-ink); outline-offset: 1px; z-index: 3; }

/* conflict flag on a block */
.cat-block.warn { box-shadow: inset 0 0 0 1.5px #FFF, inset 0 0 0 3px var(--bp-red); }
.cat-block .flag {
  position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bp-red); color: #fff;
  font-family: var(--bp-font-display); font-weight: 700; font-size: 10px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.cat-block.warn .name-l { padding-left: 14px; }
.cat-block .pluja-tag {
  display: inline-block; margin-left: 4px; padding: 0 4px;
  background: rgba(255,255,255,0.28); border-radius: 2px;
  font-size: 8px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}

/* occupancy bar (direcció) */
.cat-block .occ { margin-top: 4px; height: 4px; background: rgba(255,255,255,0.32); position: relative; }
.cat-block .occ i { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,0.9); }
.cat-block .occ i.full { background: #FFE08A; }

/* "+N més" overflow chip + popover for dense slots */
.cal-more {
  background: var(--bp-cream); border: 1px dashed var(--bp-grey-200); cursor: pointer;
  color: var(--bp-grey-700); font-family: var(--bp-font-display); font-weight: 700;
  font-size: 10.5px; letter-spacing: 0.02em; padding: 5px 6px; text-align: center; flex: none;
}
.cal-more:hover { background: var(--bp-white); color: var(--bp-ink); border-color: var(--bp-grey-500); }
.cell-pop-scrim { position: fixed; inset: 0; z-index: 70; }
.cell-pop {
  position: fixed; z-index: 71; width: 284px; max-height: 60vh; overflow-y: auto;
  background: var(--bp-white); border: 1px solid var(--bp-grey-100);
  box-shadow: 0 18px 44px rgba(20,14,6,0.28);
}
.cell-pop .hd {
  position: sticky; top: 0; background: var(--bp-cream); border-bottom: 1px solid var(--bp-grey-100);
  padding: 10px 14px; font-family: var(--bp-font-display); font-weight: 700; font-size: 11px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--bp-ink);
}
.cell-pop .poprow {
  display: grid; grid-template-columns: 16px 1fr; gap: 9px; align-items: start;
  padding: 9px 14px; cursor: pointer; border-bottom: 1px solid var(--bp-grey-50);
}
.cell-pop .poprow:hover { background: var(--bp-cream); }
.cell-pop .poprow .gl { font-size: 11px; line-height: 1.4; }
.cell-pop .poprow .nm { font-family: var(--bp-font-display); font-weight: 700; font-size: 12.5px; color: var(--bp-ink); line-height: 1.15; }
.cell-pop .poprow .mt { font-family: var(--bp-font-body); font-size: 11px; color: var(--bp-grey-700); margin-top: 2px; }

/* empty filtered note */
.q2-empty { padding: 64px 24px; text-align: center; grid-column: 1 / -1; background: var(--bp-white); }
.q2-empty h3 { font-family: var(--bp-font-display); font-weight: 700; font-size: 18px; color: var(--bp-ink); margin: 0 0 6px; }
.q2-empty p { font-size: 13px; color: var(--bp-grey-700); margin: 0; }

/* ── modal (detail) ─────────────────────────────────────────────── */
.q2-scrim { position: fixed; inset: 0; background: rgba(20,14,6,0.4); z-index: 60; }
.q2-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 720px; max-width: 92%; max-height: 88%; z-index: 61;
  background: var(--bp-white); box-shadow: 0 30px 70px rgba(0,0,0,0.34);
  display: flex; flex-direction: column; overflow: hidden;
  animation: q2pop 180ms cubic-bezier(0.22,0.61,0.36,1);
}
@keyframes q2pop { from { transform: translate(-50%,-48%) scale(0.97); } to { transform: translate(-50%,-50%) scale(1); } }
.q2-modal .mhead { display: grid; grid-template-columns: 6px 1fr auto; gap: 16px; padding: 22px 24px 18px; border-bottom: 1px solid var(--bp-grey-100); align-items: start; }
.q2-modal .mstripe { width: 6px; align-self: stretch; min-height: 48px; }
.q2-modal .meyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.q2-modal .meyebrow .cat-tag { font-family: var(--bp-font-display); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; color: #fff; }
.q2-modal .meyebrow .day { font-family: var(--bp-font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--bp-grey-500); }
.q2-modal h2 { font-family: var(--bp-font-display); font-weight: 700; font-size: 23px; letter-spacing: -0.01em; color: var(--bp-ink); margin: 0; line-height: 1.1; }
.q2-modal .mx { width: 34px; height: 34px; border: none; background: transparent; color: var(--bp-grey-500); cursor: pointer; }
.q2-modal .mx svg { width: 18px; height: 18px; }

.q2-modal .mwarn { display: flex; gap: 10px; align-items: center; padding: 11px 24px; background: #FFF7F6; border-bottom: 1px solid #F3D2D0; color: var(--bp-red); font-family: var(--bp-font-display); font-weight: 700; font-size: 12.5px; }
.q2-modal .mwarn svg { width: 16px; height: 16px; flex-shrink: 0; }

.q2-students { padding: 18px 24px; overflow-y: auto; flex: 1; }
.q2-students .sh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.q2-students .sh .h { font-family: var(--bp-font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; color: var(--bp-grey-700); }
.q2-students .sh .n { font-family: var(--bp-font-display); font-size: 13px; font-weight: 700; color: var(--bp-ink); }
.q2-students .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.stu-row2 { display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: center; padding: 6px 9px; background: #FAFAF7; }
.stu-row2 .crs { font-family: var(--bp-font-display); font-weight: 700; font-size: 9.5px; color: var(--bp-grey-700); background: var(--bp-grey-100); min-width: 26px; text-align: center; padding: 3px 4px; }
.stu-row2 .nm { font-family: var(--bp-font-display); font-weight: 700; font-size: 12px; color: var(--bp-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.stu-row2 .allergy { background: #FFF2E0; color: #8A4A00; font-size: 10px; padding: 1px 5px; font-weight: 700; flex-shrink: 0; }
.q2-rgpd { font-family: var(--bp-font-body); font-size: 11px; color: var(--bp-grey-500); margin-top: 12px; display: flex; align-items: center; gap: 6px; }
.q2-rgpd svg { width: 14px; height: 14px; flex-shrink: 0; }

.q2-foot { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--bp-grey-100); background: #FAFAF7; }
.q2-foot .btn-ghost, .q2-foot .btn-primary { flex: 1; text-decoration: none; }
.q2-readonly { padding: 14px 24px; background: var(--bp-cream); border-top: 1px solid #E6D9C4; font-family: var(--bp-font-display); font-size: 12px; font-weight: 700; letter-spacing: 0.03em; color: #8A4A00; display: flex; align-items: center; gap: 8px; }
.q2-readonly svg { width: 15px; height: 15px; }

/* side panel rows shared with DS .grid-side */
.side-conflict { background: var(--bp-white); padding: 11px 13px; border-left: 3px solid var(--bp-red); margin-bottom: 8px; cursor: pointer; }
.side-conflict .t { font-family: var(--bp-font-display); font-weight: 700; font-size: 12px; color: var(--bp-red); margin-bottom: 3px; letter-spacing: 0.01em; }
.side-conflict .d { font-size: 11px; color: var(--bp-grey-700); line-height: 1.4; }
.side-conflict.info { border-left-color: #0F62A5; }
.side-conflict.info .t { color: #0F62A5; }
.side-mon { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--bp-white); margin-bottom: 6px; }
.side-mon .av { width: 28px; height: 28px; border-radius: 50%; background: var(--bp-cream); color: var(--bp-red); display: flex; align-items: center; justify-content: center; font-family: var(--bp-font-display); font-weight: 700; font-size: 10px; }
.side-mon .nm { font-family: var(--bp-font-display); font-weight: 700; font-size: 12px; color: var(--bp-ink); }
.side-mon .n { font-family: var(--bp-font-display); font-weight: 700; font-size: 12px; color: var(--bp-grey-500); }
