/* Klubix design system. Layout: classic ERP shell (dark nav rail + work area);
   records open in a right-side drawer instead of floating windows. */
:root {
  /* Official palette (docs/brand/manual-identidad.md). Every other token derives from these;
     text tones are darkened or lightened just enough to pass WCAG AA. */
  --brand-navy: #0a3a60; --brand-cyan: #0a84d6; --brand-neon: #00d4ff; --brand-green: #00b050; --brand-graphite: #64748b;
  --bg: #f3f6fa; --surface: #ffffff; --surface-2: #eaf0f6; --line: #d5dee8; --line-strong: #b3c1d1;
  --fg: #0f2236; --muted: #5a687c; --accent: #0a6fb8; --accent-hover: #0a5a96; --accent-soft: #e1effa; --accent-fg: #ffffff; --on-ok: #ffffff; --on-danger: #ffffff;
  /* Light sidebar; the sign-in panel, avatars and club marks keep the institutional navy ("hero"). */
  --nav: #ffffff; --nav-fg: #2c3e52; --nav-muted: #5a687c; --nav-active: var(--accent-soft); --nav-active-fg: var(--brand-navy);
  --nav-brand: var(--accent); --nav-hover: rgba(10, 58, 96, .06); --nav-line: var(--line);
  --nav-logo-text: var(--brand-navy); --nav-logo-sub: #4f5d71; --nav-mark-light: inline; --nav-mark-dark: none;
  --hero: var(--brand-navy); --hero-fg: #c9d8e8; --hero-muted: #8eaac6; --hero-brand: var(--brand-green);
  --focus: var(--brand-cyan);
  --ok: #00733a; --ok-bg: #ddf3e6; --off: #5f6b7d; --off-bg: #e9edf2; --danger: #b42318; --danger-bg: #fdecea;
  --warn: #8a5300; --warn-bg: #fff4dc;
  --scrim: rgba(4, 19, 34, .42); --shadow: 0 18px 48px rgba(10, 58, 96, .22);
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06182a; --surface: #0b2236; --surface-2: #102c45; --line: #1c3b58; --line-strong: #2c5175;
    --fg: #e4edf6; --muted: #93a9bf; --accent: #3eaaf0; --accent-hover: #6cc0f5; --accent-soft: #0f3456; --accent-fg: #03111d; --on-ok: #03111d; --on-danger: #1d0907;
    --nav: #041322; --nav-fg: #bccde0; --nav-muted: #7f9ab5; --nav-active: #0f3352; --nav-active-fg: #ffffff;
    --nav-brand: var(--brand-green); --nav-hover: rgba(255, 255, 255, .05); --nav-line: rgba(255, 255, 255, .07);
    --nav-logo-text: #ffffff; --nav-logo-sub: var(--nav-muted); --nav-mark-light: none; --nav-mark-dark: inline;
    --hero: #041322; --hero-fg: #bccde0; --hero-muted: #7f9ab5; --hero-brand: var(--brand-green); --focus: var(--brand-neon);
    --ok: #34d17f; --ok-bg: #0b3121; --off: #9aa9ba; --off-bg: #1c3047; --danger: #f2867b; --danger-bg: #3a1714;
    --warn: #f0b54d; --warn-bg: #3a2a0c;
    --scrim: rgba(0, 0, 0, .55); --shadow: 0 18px 48px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #06182a; --surface: #0b2236; --surface-2: #102c45; --line: #1c3b58; --line-strong: #2c5175;
  --fg: #e4edf6; --muted: #93a9bf; --accent: #3eaaf0; --accent-hover: #6cc0f5; --accent-soft: #0f3456; --accent-fg: #03111d; --on-ok: #03111d; --on-danger: #1d0907;
  --nav: #041322; --nav-fg: #bccde0; --nav-muted: #7f9ab5; --nav-active: #0f3352; --nav-active-fg: #ffffff;
  --nav-brand: var(--brand-green); --nav-hover: rgba(255, 255, 255, .05); --nav-line: rgba(255, 255, 255, .07);
  --nav-logo-text: #ffffff; --nav-logo-sub: var(--nav-muted); --nav-mark-light: none; --nav-mark-dark: inline;
  --hero: #041322; --hero-fg: #bccde0; --hero-muted: #7f9ab5; --hero-brand: var(--brand-green); --focus: var(--brand-neon);
  --ok: #34d17f; --ok-bg: #0b3121; --off: #9aa9ba; --off-bg: #1c3047; --danger: #f2867b; --danger-bg: #3a1714;
  --warn: #f0b54d; --warn-bg: #3a2a0c;
  --scrim: rgba(0, 0, 0, .55); --shadow: 0 18px 48px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
/* Test environments: an orange band above every page (production has none). The body keeps the full
   window height, so layouts sized with height:100% shrink by the band instead of overflowing. */
body.env-test { box-sizing: border-box; padding-top: 26px; }
body.env-test .drawer { top: 26px; }
.env-banner { position: fixed; inset: 0 0 auto 0; z-index: 1000; height: 26px; display: grid; place-items: center;
    background: repeating-linear-gradient(135deg, #c2410c 0 14px, #9a3412 14px 28px); color: #fff;
    font: 700 12px/1 var(--font, system-ui); letter-spacing: .08em; text-transform: uppercase; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); background: var(--surface); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.icon { width: 16px; height: 16px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100%; }
.nav { background: var(--nav); color: var(--nav-fg); border-right: 1px solid var(--nav-line); display: flex; flex-direction: column; overflow-y: auto; padding-left: env(safe-area-inset-left, 0px); }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; border-bottom: 1px solid var(--nav-line); text-decoration: none; }
.brand-mark { width: 30px; height: 34px; flex: none; }
.brand-text { display: grid; line-height: 1.05; }
.brand-text b { font-family: "Montserrat", var(--font); font-weight: 800; font-size: 19px; letter-spacing: .04em; }
.brand-text small { font-family: "Montserrat", var(--font); font-weight: 500; font-size: 9.5px; letter-spacing: .03em; margin-top: 3px; }
.brand.on-dark b { color: #fff; }
.brand.on-dark .x { color: var(--brand-green); }
.brand.on-dark small { color: var(--hero-muted); }
.brand.on-nav b { color: var(--nav-logo-text); }
.brand.on-nav .x { color: var(--brand-green); }
.brand.on-nav small { color: var(--nav-logo-sub); }
.brand .mark-light { display: var(--nav-mark-light); }
.brand .mark-dark { display: var(--nav-mark-dark); }
.brand.on-light b { color: var(--brand-navy); }
.brand.on-light .x { color: var(--brand-green); }
.brand.on-light small { color: #4f5d71; }
.brand.lg { gap: 14px; }
.brand.lg .brand-mark { width: 52px; height: 58px; }
.brand.lg .brand-text b { font-size: 30px; }
.brand.lg .brand-text small { font-size: 12px; }
/* The menu never scrolls on a laptop: modules are folding groups (only one open), single pages are plain links. */
.nav .item { display: flex; align-items: center; gap: 10px; margin: 1px 10px; padding: 7px 10px; border-radius: 6px; color: var(--nav-fg); text-decoration: none; font-size: 13.5px; }
.nav .brand + .item, .nav .brand + .group { margin-top: 10px; }
.nav .item:hover { background: var(--nav-hover); }
.nav a.item.active { background: var(--nav-active); color: var(--nav-active-fg); font-weight: 500; box-shadow: inset 3px 0 0 var(--nav-brand); }
.nav .item .icon { opacity: .85; }
.nav summary.item { cursor: pointer; list-style: none; user-select: none; }
.nav summary.item::-webkit-details-marker { display: none; }
.nav summary.item .chev { margin-left: auto; width: 14px; height: 14px; opacity: .6; transition: transform .15s; }
/* Red counter of new items (suggestions): the same red in both modes, white text passes AA on it. */
.nav .nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #b42318; color: #fff; font-size: 11.5px; font-weight: 600; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.nav summary.item .nav-count + .chev { margin-left: 6px; }
.nav details[open] > summary.item .chev { transform: rotate(90deg); }
.nav summary.item.current { color: var(--nav-active-fg); font-weight: 500; }
.nav details:not([open]) > summary.item.current { background: var(--nav-active); box-shadow: inset 3px 0 0 var(--nav-brand); }
.nav a.item.sub { padding: 5px 10px 5px 36px; font-size: 13px; }
.nav details[open] { padding-bottom: 4px; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.topbar { display: flex; align-items: center; gap: 12px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .spacer { flex: 1; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.menu-btn { display: none; }
.club-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; white-space: nowrap; color: var(--fg); text-decoration: none; max-width: 280px; }
.club-pill span { overflow: hidden; text-overflow: ellipsis; }
.club-pill:hover { background: var(--surface-2); }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; line-height: 1.2; padding: 2px 4px; border-radius: 6px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary small { color: var(--muted); }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 6px; z-index: 30; display: grid; }
.user-menu .menu a, .user-menu .menu button { display: block; text-align: left; padding: 8px 10px; border-radius: 6px; border: 0; background: none; cursor: pointer; color: var(--fg); text-decoration: none; width: 100%; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--hero); color: #fff; font-weight: 600; font-size: 12px; flex: none; }

/* Desktop-like window: the page never scrolls as a whole. Lists show the rows that fit (GridPager),
   long screens use tabs, and no scrollbar is ever drawn (wheel and keys still work where needed). */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
.work { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding-block: 18px 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.work > * { flex: none; }
.work > .grid-wrap, .work > .fill > .grid-wrap { flex: 1 1 0; min-height: 140px; overflow: hidden; }
.work > .fill { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.work > .fill > * { flex: none; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 6px 2px 0; font-size: 12.5px; }
.pager .icon-btn { width: 28px; height: 28px; font-size: 18px; line-height: 1; }
.pager .icon-btn:disabled { opacity: .35; cursor: default; }

/* Status bar: system information at the bottom, like a desktop application. */
.statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; min-height: 28px; padding: 4px max(16px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; }
.statusbar b { color: var(--fg); font-weight: 600; }
.statusbar .env { padding: 0 6px; border-radius: 4px; background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.statusbar .push { margin-left: auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); cursor: pointer; font-size: 13px; white-space: nowrap; text-decoration: none; color: var(--fg); }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 500; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.btn.danger-solid:hover:not(:disabled) { background: var(--danger); filter: brightness(.9); }
.btn.ghost { border-color: transparent; background: none; }
.btn.block { width: 100%; justify-content: center; height: 40px; }
.btn kbd { margin-left: 2px; }
.btn.primary kbd { color: inherit; background: transparent; border-color: currentColor; opacity: .75; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters .count { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 34px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--muted); min-width: 0; flex: 0 1 320px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--fg); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 12px; cursor: pointer; font-size: 12.5px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.filters input[type="date"], .filters select { height: 34px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); padding: 0 8px; }

/* ---------- Grid ---------- */
.grid-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 680px; }
.grid th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
.grid td.wrap { white-space: normal; }
/* One line that ends in "…" (full text in the title), so every row keeps the height GridPager measured. */
.grid td.clip { max-width: 0; width: 40%; overflow: hidden; text-overflow: ellipsis; }
.grid td.strong { font-weight: 500; }
.grid tbody tr:hover td { background: var(--surface-2); }
.grid tbody tr[aria-selected="true"] td { background: var(--accent-soft); }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr { cursor: default; }
.grid .empty { padding: 36px; text-align: center; color: var(--muted); white-space: normal; }
.grid td small { display: block; color: var(--muted); font-family: var(--font); }
.hint { margin-top: 10px; color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.on { color: var(--ok); background: var(--ok-bg); }
.status.off { color: var(--off); background: var(--off-bg); }
.status.warn { color: var(--warn); background: var(--warn-bg); }
.status.danger { color: var(--danger); background: var(--danger-bg); }
.load-more { display: flex; justify-content: center; padding: 12px; }
pre.json { margin: 6px 0 0; padding: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; max-width: 720px; }

/* ---------- Cards / summary ---------- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: grid; gap: 4px; }
.tile .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.tile .value { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .value.small { font-size: 16px; }
.tile a { font-size: 12.5px; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.panel-card h2 { margin: 0 0 4px; font-size: 15px; }
.panel-card > p { margin: 0 0 12px; color: var(--muted); font-size: 13px; max-width: 70ch; }
/* A tab's explanation beside its main button, on the filters row above the list. */
.tab-intro { flex: 1 1 360px; color: var(--muted); font-size: 13px; max-width: 90ch; }
.club-logo { display: flex; gap: 18px; align-items: flex-start; }
.club-logo p { margin: 0 0 10px; color: var(--muted); font-size: 13px; max-width: 60ch; }
.club-logo .err-text { color: var(--danger); }
.club-logo-preview { width: 112px; height: 112px; flex: none; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: 10px; background: #fff; overflow: hidden; }
.club-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* Home dashboard: the club's day in figures. KPI cards, three charts that share the remaining height and a strip of
   smaller indicators; it fits the window without scrolling and stacks on the phone. Every card is a link to its screen. */
:root { --chart-1: var(--accent); --chart-2: #c17a00; --chart-free: var(--surface-2); }
:root[data-theme="dark"] { --chart-2: #f0b54d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-2: #f0b54d; } }
.work > .dash { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.dash > * { flex: none; }
.dash-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.dash-head h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.dash-head p { margin: 0; color: var(--muted); font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.kpi, .chart, .mini { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--fg); text-decoration: none; min-width: 0; }
.kpi:hover, .chart:hover, .mini:hover { border-color: var(--accent); }
.kpi { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; }
.kpi .label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kpi .label > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .label .src, .kpi .label .tag { flex: none; }
.kpi .label .src { text-transform: none; letter-spacing: 0; font-weight: 500; }
.kpi .value { font-size: 28px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value small { margin-left: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi .sub { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12.5px; color: var(--muted); }
.kpi .sub b { color: var(--fg); font-weight: 600; }
.tag { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.meter { display: block; height: 6px; margin-top: auto; border-radius: 999px; background: var(--chart-free); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--chart-1); }
.meter.warn i { background: var(--chart-2); }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; vertical-align: 1px; }
.dot.s0, .dot.booked { background: var(--chart-1); }
.dot.s1, .dot.blocked { background: var(--chart-2); }
.dot.free { background: var(--chart-free); box-shadow: inset 0 0 0 1px var(--line-strong); }
.charts { flex: 1 1 0; min-height: 180px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.chart { display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 10px 14px; }
.chart h2 { display: flex; justify-content: space-between; gap: 8px; margin: 0; font-size: 13.5px; font-weight: 600; }
.chart h2 span { font-weight: 400; font-size: 12px; color: var(--muted); }
.chart .plot { flex: 1; min-height: 0; display: flex; }
.chart .empty { margin: auto; font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 11.5px; color: var(--muted); }
/* Column chart (ColumnChart.razor): axis | plot over labels. */
.cc { flex: 1; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; column-gap: 6px; font-size: 10.5px; color: var(--muted); }
.cc-axis { position: relative; min-width: 34px; margin-block: 6px 0; }
.cc-axis span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-plot { position: relative; margin-top: 6px; }
.cc-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.cc-cols { position: absolute; inset: 0; display: grid; align-items: end; gap: 0; }
.cc-col { height: 100%; display: flex; align-items: flex-end; justify-content: center; padding-inline: 18%; }
.cc-stack { width: 100%; max-width: 44px; display: flex; flex-direction: column-reverse; gap: 1px; }
.cc-stack i { display: block; min-height: 2px; border-radius: 2px; }
.cc-stack .s0 { background: var(--chart-1); }
.cc-stack .s1 { background: var(--chart-2); }
.cc-labels { grid-column: 2; display: grid; padding-top: 3px; text-align: center; white-space: nowrap; }
.cc-labels .strong, .cg-hour.strong { color: var(--fg); font-weight: 600; }
/* Court occupancy: one row per court, one cell per hour. */
.court-grid { flex: 1; min-width: 0; display: grid; gap: 2px; align-items: stretch; font-size: 10.5px; color: var(--muted); }
.cg-name { align-self: center; padding-right: 6px; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-cell { min-height: 4px; border-radius: 2px; background: var(--chart-free); }
.cg-cell.booked { background: var(--chart-1); }
.cg-cell.blocked { background: var(--chart-2); }
.cg-cell.closed { background: none; }
.cg-cell.now { box-shadow: 0 0 0 1px var(--fg); }
.cg-hour { padding-top: 2px; text-align: center; white-space: nowrap; overflow: visible; }
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.mini { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.mini .n { min-width: 28px; text-align: center; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mini .n.ok { color: var(--ok); }
.mini .n.warn { color: var(--warn); }
.mini .n.danger { color: var(--danger); }
.mini .t { display: grid; min-width: 0; font-size: 12.5px; line-height: 1.25; }
.mini .t small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 901px) and (max-height: 720px) {
  .dash { gap: 8px; }
  .kpi { padding: 9px 12px; gap: 2px; }
  .kpi .value { font-size: 24px; }
  .mini { padding: 6px 10px; }
}
@media (max-width: 900px) {
  .work > .dash { flex: none; }
  .charts { flex: none; grid-template-columns: minmax(0, 1fr); }
  .chart { height: 240px; }
}

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--surface); z-index: 21; display: flex; flex-direction: column; box-shadow: var(--shadow); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px); }
@media (prefers-reduced-motion: no-preference) { .drawer { animation: slide .18s ease-out; } @keyframes slide { from { transform: translateX(24px); opacity: .6; } } }
.d-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.d-head h2 { margin: 0; font-size: 17px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-head .mode { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); flex: none; }
.d-head .icon-btn { margin-left: auto; }
.d-body { flex: 1; overflow-y: auto; padding: 18px 20px 24px; }
.d-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.d-foot .spacer { flex: 1; }
.dirty { font-size: 12px; color: var(--warn); display: flex; align-items: center; gap: 6px; }
.dirty::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.confirm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }
.confirm-row span { flex: 1; min-width: 180px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.f { display: flex; flex-direction: column; gap: 5px; grid-column: span 6; min-width: 0; }
.f.s2 { grid-column: span 2; } .f.s3 { grid-column: span 3; } .f.s4 { grid-column: span 4; } .f.s5 { grid-column: span 5; } .f.s8 { grid-column: span 8; } .f.s9 { grid-column: span 9; } .f.s12 { grid-column: span 12; }
.f label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.f label .req { color: var(--danger); }
.f input, .f select, .f textarea { height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); min-width: 0; width: 100%; }
.f textarea { height: auto; min-height: 68px; padding: 8px 10px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.f input[readonly] { background: var(--surface-2); color: var(--muted); }
.f.invalid input, .f.invalid select { border-color: var(--danger); }
.f .msg { font-size: 12px; color: var(--muted); }
.f.invalid .msg { color: var(--danger); }
.f .msg.ok { color: var(--ok); }
.section-title { grid-column: span 12; margin: 6px 0 -4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toggle-row { grid-column: span 12; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.toggle-row strong { font-weight: 600; }
.toggle-row small { color: var(--muted); display: block; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }
.checks { grid-column: span 12; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.check:first-child { border-top: 0; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.check small { display: block; color: var(--muted); font-size: 12px; }
.check.disabled { opacity: .55; cursor: not-allowed; }
/* Many options side by side (API key scopes) so the panel never needs to scroll. */
.checks.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checks.cols .check { border-top: 0; outline: 1px solid var(--line); padding: 9px 12px; }
.toggle-row.s4 { grid-column: span 4; } .toggle-row.s6 { grid-column: span 6; }

.notice { grid-column: span 12; display: flex; gap: 10px; padding: 10px 12px; border-radius: 6px; font-size: 13px; background: var(--accent-soft); color: var(--fg); border: 1px solid var(--line); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.danger { background: var(--danger-bg); color: var(--danger); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.secret { grid-column: span 12; display: grid; gap: 8px; padding: 14px; border: 1px dashed var(--accent); border-radius: 8px; background: var(--accent-soft); }
.secret code { font-family: var(--mono); font-size: 20px; letter-spacing: .08em; word-break: break-all; }
.secret .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Members ---------- */
.drawer.wide { width: min(1060px, 100%); }
.code-cell { font-family: var(--mono); font-size: 13px; }
.code-cell span { color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; }
.who small { display: block; color: var(--danger); font-size: 12px; }
.pic { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; flex: none; overflow: hidden; background-size: cover; background-position: center; }
.pic.s30 { width: 30px; height: 30px; font-size: 11px; }
.pic.s44 { width: 44px; height: 44px; font-size: 14px; }
.grid tr.group-start td { border-top: 2px solid var(--line-strong); }
.member-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.photo { width: 108px; height: 132px; border-radius: 8px; display: grid; place-items: center; font-size: 34px; font-weight: 600; color: #fff; position: relative; overflow: hidden; background-size: cover; background-position: center; }
.photo label { position: absolute; inset: auto 6px 6px 6px; height: 26px; border-radius: 5px; background: rgba(9, 16, 27, .72); color: #fff; font-size: 11.5px; cursor: pointer; display: grid; place-items: center; }
.photo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.member-head h3 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.member-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.member-meta b { color: var(--fg); font-weight: 500; }
.member-head .chips { margin-top: 10px; }
.chip.code { font-family: var(--mono); color: var(--fg); font-size: 12px; }
.action-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; display: grid; gap: 3px; min-width: 190px; }
.action-box span { color: var(--muted); }
.action-box b { font-family: var(--mono); font-weight: 500; }
.alert { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 9px 12px; border-radius: 6px; font-size: 13px; background: var(--warn-bg); color: var(--warn); }
.alert.danger { background: var(--danger-bg); color: var(--danger); }
.family { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; margin-top: 6px; }
.fam { flex: 0 0 auto; width: 112px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 8px; display: grid; justify-items: center; gap: 4px; cursor: pointer; text-align: center; position: relative; }
.fam:hover { border-color: var(--line-strong); }
.fam[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.fam strong { font-size: 12px; font-weight: 500; line-height: 1.2; }
.fam small { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.fam .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.fam.add { border-style: dashed; color: var(--muted); align-content: center; min-height: 96px; }
.tabs { display: flex; gap: 2px; margin-top: 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 12px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .badge { font-size: 11px; font-family: var(--mono); padding: 0 5px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.tabs .warn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.tab-panel { padding-top: 16px; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.doc { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 6px; }
.radios { display: flex; gap: 16px; align-items: center; height: 36px; }
.radios label { display: flex; gap: 6px; align-items: center; cursor: pointer; color: var(--fg); font-weight: 400; }
.inline-checks { grid-column: span 12; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.inline-checks label { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; }
.inline-check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-size: 13px; white-space: nowrap; }
.inline-check.no-id { margin-top: 6px; font-size: 12.5px; color: var(--muted); justify-self: start; width: auto; }
.inline-check.no-id input { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
.inline-checks input { width: 16px; height: 16px; accent-color: var(--accent); }
.card-row { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.idcard { aspect-ratio: 85.6 / 54; max-width: 100%; border-radius: 12px; background: linear-gradient(135deg, var(--brand-navy), #14507f); color: #fff; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto; gap: 6px 12px; box-shadow: var(--shadow); overflow: hidden; }
.idcard .club { grid-column: span 2; display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #c3cfe2; }
.idcard .club b { font-family: "Montserrat", var(--font); font-weight: 800; color: #fff; letter-spacing: .04em; }
.idcard .club b span { color: var(--brand-green); }
.idcard .ph { width: 64px; height: 80px; border-radius: 6px; display: grid; place-items: center; font-weight: 600; font-size: 20px; background-size: cover; background-position: center; }
.idcard .data { display: grid; align-content: start; gap: 2px; font-size: 11px; color: #c3cfe2; min-width: 0; }
.idcard .data strong { color: #fff; font-size: 14px; line-height: 1.2; }
.idcard .data .num { font-family: var(--mono); font-size: 15px; color: #fff; letter-spacing: .04em; }
.idcard .bar { grid-column: span 2; display: flex; justify-content: space-between; align-items: end; gap: 10px; }
.idcard .bar svg { height: 30px; width: 60%; border-radius: 3px; }
.idcard .bar span { font-size: 10.5px; color: #c3cfe2; text-align: right; }
.mini-table { grid-column: span 12; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.mini-table table { width: 100%; border-collapse: collapse; min-width: 560px; }
.mini-table th { background: var(--surface-2); text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; font-weight: 600; }
.mini-table td { padding: 6px 10px; border-top: 1px solid var(--line); }
.mini-table input { height: 30px; width: 100%; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); padding: 0 8px; }
.msg-slot { grid-column: span 12; display: grid; grid-template-columns: minmax(0, 1fr) auto 160px; gap: 10px; align-items: end; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.msg-slot .f { grid-column: auto; }
.msg-slot .once { display: flex; gap: 6px; align-items: center; height: 36px; }
.door { grid-column: span 12; border-radius: 8px; background: var(--brand-navy); color: #fff; padding: 14px 16px; display: grid; gap: 6px; }
.door small { color: #a9c0d8; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.door p { margin: 0; padding: 8px 10px; border-radius: 6px; background: rgba(240, 181, 77, .16); color: #ffd892; }
@media (max-width: 900px) {
  .member-head { grid-template-columns: auto minmax(0, 1fr); }
  .action-box { grid-column: span 2; }
  .card-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .photo { width: 80px; height: 98px; font-size: 24px; }
  .msg-slot { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: var(--scrim); }
.modal .box { width: min(440px, 100%); background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 20px; }
.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal p { margin: 0 0 16px; color: var(--muted); }
.modal .row { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; margin-bottom: 16px; font-size: 13px; }
.keys span:nth-child(odd) { display: flex; gap: 4px; white-space: nowrap; }
.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; display: grid; gap: 8px; width: max-content; max-width: calc(100% - 32px); }
.toast { background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: 6px; font-size: 13px; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); color: var(--on-danger); }

/* ---------- Sign-in pages ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-brand { background: var(--hero); color: var(--hero-fg); padding: 40px max(32px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.auth-brand .brand { padding: 0; border: 0; }
.auth-brand h2 { color: #fff; font-size: 30px; font-weight: 600; line-height: 1.2; margin: 0; max-width: 18ch; letter-spacing: -.01em; }
.auth-brand ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; }
.auth-brand li { display: flex; gap: 10px; align-items: center; }
.auth-brand li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--hero-brand); flex: none; }
.auth-brand footer { font-size: 12px; color: var(--hero-muted); }
.auth-form { display: grid; place-items: center; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); }
.auth-card { width: min(400px, 100%); display: grid; gap: 16px; }
.auth-card h1 { margin: 0; font-size: 22px; font-weight: 600; }
.auth-card > p { margin: -8px 0 0; color: var(--muted); }
.auth-card form { display: grid; gap: 14px; }
.auth-card .f, .auth-card .notice { grid-column: auto; }
.auth-card .f input { height: 40px; }
.auth-card .f input.code { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
.auth-card .links { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.auth-card .links button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; }
.qr { display: grid; justify-items: center; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qr svg { width: 180px; height: 180px; }
.club-list { display: grid; gap: 8px; }
.club-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; text-align: left; }
.club-list button:hover { border-color: var(--accent); background: var(--accent-soft); }
.club-list button small { display: block; color: var(--muted); font-size: 12px; }
.club-list .club-mark { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--hero); color: #fff; font-weight: 600; flex: none; }

/* ---------- Installed app (PWA) ---------- */
.install-item { display: none !important; }
.can-install .install-item { display: block !important; }
.auth-brand footer .install-item { margin-top: 10px; color: var(--hero-fg); border: 1px solid rgba(255, 255, 255, .18); }
.can-install .auth-brand footer .install-item { display: inline-flex !important; }
@media (display-mode: standalone) {
  .topbar { padding-top: max(10px, env(safe-area-inset-top, 0px)); }
  .nav { padding-top: env(safe-area-inset-top, 0px); }
}

/* ---------- Errors & reconnect ---------- */
.blazor-error-boundary { background: var(--danger-bg); color: var(--danger); padding: 12px 16px; border-radius: 6px; }
.blazor-error-boundary::after { content: "Ocurrió un error inesperado. Recargue la página."; }
.validation-message { color: var(--danger); font-size: 12px; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .nav { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 25; transform: translateX(-100%); transition: transform .18s; }
  .nav.open { transform: none; }
  body.env-test .nav { top: 26px; }
  .menu-btn { display: inline-grid; }
  .user-menu summary div { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding-block: 24px; }
  .auth-brand ul, .auth-brand footer { display: none; }
  .auth-brand h2 { font-size: 20px; }
}
@media (max-width: 640px) {
  .f, .f.s3, .f.s4, .f.s5, .f.s8, .f.s9, .toggle-row.s4, .toggle-row.s6 { grid-column: span 12; }
  .f.s2 { grid-column: span 6; }
  .checks.cols { grid-template-columns: minmax(0, 1fr); }
  .checks.cols .check small { display: none; }
  .tab-note { display: none; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .btn kbd, .hint .k { display: none; }
  .club-pill { max-width: 160px; }
  .d-head, .d-body, .d-foot { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: 16px; }
}

/* Receipt the member attached, shown inside the payment drawer (image or PDF). */
.receipt-view { height: min(62vh, 560px); border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.receipt-view { display: grid; place-items: center; }
.receipt-view img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.receipt-view object { width: 100%; height: 100%; display: block; }

/* Permissions grouped by module (Roles, Users): module header, the user's effective summary and the state of each permission. */
.perm-module { grid-column: span 12; display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.perm-module small { color: var(--muted); font-size: 12px; }
.perm-summary { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.perm-state { font-style: normal; font-size: 11px; font-weight: 500; margin-left: 6px; padding: 1px 6px; border-radius: 999px; }
.perm-state.on { color: var(--ok); background: var(--ok-bg); }
.perm-state.off { color: var(--danger); background: var(--danger-bg); }
.perm-state.add { color: var(--warn); background: var(--warn-bg); }

/* Lost items (/objetos): photo thumbnails, the photo in the panel and a member's question. */
.grid .li-photo { width: 52px; padding-top: 4px; padding-bottom: 4px; }
.grid .li-photo img, .li-nophoto { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.li-photo-box { grid-column: span 12; display: grid; gap: 8px; justify-items: start; }
.li-photo-box img { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); object-fit: contain; background: var(--surface-2); }
.li-photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Up to three photos of an item side by side, each with its «×». */
.li-photos { display: flex; gap: 8px; flex-wrap: wrap; }
.li-thumb { position: relative; margin: 0; }
.li-photo-box .li-thumb img { width: 128px; height: 96px; max-height: none; object-fit: cover; display: block; }
.li-thumb .icon-btn { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; background: var(--surface); border-color: var(--line); }
.section-title small { margin-left: 6px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.li-who { display: grid; gap: 2px; }
.li-message { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); white-space: pre-wrap; }
/* Custody: state with its tags, the days left, the dates in the panel and the Configuración tab (terms beside the rules). */
.grid td.li-state { white-space: nowrap; }
.li-tag { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 4px; font-size: 11px; background: var(--surface-2); color: var(--muted); }
.li-tag.claim { background: var(--accent-soft); color: var(--accent); }
.grid td.li-term { white-space: nowrap; }
.li-dates { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--muted); }
.li-dates b { color: var(--fg); }
.work > .li-settings { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 14px; }
.li-settings > section { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.li-settings h2 { margin: 0; font-size: 15px; font-weight: 600; }
.li-settings p { margin: 0; font-size: 12.5px; }
.li-rules-body { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 12px; }
.li-rules-body > .f { grid-column: auto; min-height: 0; }
.li-rules-body textarea { flex: 1; height: auto; min-height: 0; padding: 8px 10px; resize: none; font-family: var(--mono); font-size: 12.5px; }
.li-preview { min-height: 0; overflow-y: auto; padding: 4px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-size: 13px; line-height: 1.45; }
.li-preview h2, .li-preview h3, .li-preview h4 { margin: 12px 0 4px; font-size: 14px; }
.li-preview p, .li-preview ul, .li-preview ol { margin: 6px 0; }
.li-preview ul, .li-preview ol { padding-left: 20px; }
@media (max-width: 900px) {
    .work > .li-settings { grid-template-columns: minmax(0, 1fr); flex: none; }
    .li-rules-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: 280px 280px; }
}
/* Suggestions: the member's photos in the panel, the photo count beside the text in the list. */
.sg-photos { display: flex; gap: 8px; flex-wrap: wrap; }
.sg-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); display: block; }
.grid .sg-text small { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; }
.li-camera { display: grid; gap: 8px; justify-items: start; width: 100%; }
.li-camera video { width: 100%; max-height: 260px; border-radius: 8px; background: #000; object-fit: contain; }
/* "Tomar foto": the camera app on phones and tablets (no hover, coarse pointer), the webcam in the page on computers,
   touch-screen laptops included (they have a trackpad that hovers). */
.li-take-touch { display: none !important; }
@media (hover: none) and (pointer: coarse) {
    .li-take-touch { display: inline-flex !important; }
    .li-take-desk { display: none !important; }
}

/* Notifications (/notificaciones): editor with the member's preview beside it, photo strip, camera. */
.nt-editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.nt-reminders { display: grid; gap: 18px; min-width: 0; }
.nt-reminder-intro h2 { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.nt-reminder-intro p, .nt-reminder-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.nt-reminder-card { display: grid; gap: 16px; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.nt-reminder-heading { display: flex; gap: 12px; align-items: flex-start; }
.nt-reminder-heading h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.nt-reminder-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.nt-reminder-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12.5px; }
.nt-reminder-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.nt-reminder-hint strong { font-weight: 500; overflow-wrap: anywhere; }
.nt-reminder-empty { display: grid; justify-items: center; gap: 8px; padding: 24px 16px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--muted); text-align: center; font-size: 13px; }
.nt-reminder-empty strong { color: var(--fg); font-weight: 500; }
.nt-reminder-table { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.nt-reminder-table .grid { min-width: 690px; margin: 0; }
.nt-reminder-table td { white-space: nowrap; }
.nt-reminder-status { display: inline-block; padding: 3px 8px; border-radius: 5px; background: var(--surface-2); font-size: 12px; }
@media (max-width: 680px) {
    .nt-reminder-card { padding: 16px; }
    .nt-reminder-card .f { grid-column: 1 / -1; }
    .nt-reminder-actions > .btn { width: 100%; justify-content: center; }
}
.nt-stats { grid-column: span 12; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.nt-check { grid-column: span 12; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.nt-photos { grid-column: span 12; display: flex; flex-wrap: wrap; gap: 10px; }
.nt-photos:empty { display: none; }
.nt-photo { position: relative; margin: 0; width: 112px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.nt-photo img { display: block; width: 112px; height: 84px; object-fit: cover; }
.nt-photo figcaption { display: flex; align-items: center; justify-content: space-between; padding: 2px; font-size: 12px; }
.nt-photo .icon-btn { width: 24px; height: 24px; font-size: 15px; }
.nt-cover { position: absolute; top: 4px; left: 4px; padding: 1px 6px; border-radius: 4px; font-size: 11px; background: var(--brand-navy); color: #fff; }
.nt-photo-actions { grid-column: span 12; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nt-camera { grid-column: span 12; display: grid; gap: 8px; justify-items: start; }
.nt-camera video { width: 100%; max-height: 260px; border-radius: 8px; background: #000; object-fit: contain; }
.nt-error { color: var(--danger); font-size: 12.5px; }
.nt-deleted { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-size: 13px; }
.confirm-row.danger { background: var(--danger-bg); color: var(--danger); }
.nt-take-touch { display: none !important; }
@media (hover: none) and (pointer: coarse) {
    .nt-take-touch { display: inline-flex !important; }
    .nt-take-desk { display: none !important; }
}
/* The preview uses the club app's colors (CCPDA: green bar, yellow accent), not Klubix's theme. */
.nt-preview { position: sticky; top: 0; display: grid; gap: 6px; }
.nt-preview-label { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.nt-phone { border: 6px solid #1f2937; border-radius: 22px; overflow: hidden; background: #f9fafb; color: #1f2937; font-family: Inter, system-ui, sans-serif; }
.nt-bar { background: #24a632; color: #fff; text-align: center; font-weight: 600; padding: 10px; font-size: 14px; }
.nt-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: #fff; border-bottom: 1px solid #e5e7eb; }
.nt-dot { flex: none; width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: #ef4444; }
.nt-row-text { display: grid; gap: 2px; border-left: 3px solid #f7cc1f; padding-left: 8px; min-width: 0; }
.nt-row-text b { color: #0c4d0a; font-size: 14px; }
.nt-row-text small { color: #6b7280; font-size: 12px; overflow-wrap: anywhere; }
.nt-detail { display: grid; gap: 6px; padding: 12px; max-height: 420px; overflow: hidden; }
.nt-d-title { font-size: 16px; color: #0c4d0a; }
.nt-d-date { font-size: 12px; color: #b08900; }
.nt-gallery { position: relative; border-radius: 10px; overflow: hidden; }
.nt-gallery img { display: block; width: 100%; height: 150px; object-fit: cover; }
.nt-gallery span { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; }
.nt-like { font-size: 14px; color: #1f2937; } .nt-like span { color: #e0a800; font-size: 18px; }
.nt-d-headline { font-size: 14px; }
.nt-d-body { margin: 0; font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 900px) {
    .nt-editor { grid-template-columns: minmax(0, 1fr); }
    .nt-preview { position: static; max-width: 320px; }
}
