/* Istia Crew (docs/26) — mobiel eerst, iPad in kolommen, licht/donker. --cr-brand/--cr-accent komen uit de huisstijl van het event. */
:root {
    --cr-brand: #1f2937; --cr-accent: #2f93b0;
    --cr-bg: #f4f6f8; --cr-panel: #ffffff; --cr-text: #0f172a; --cr-muted: #64748b; --cr-line: #e2e8f0; --cr-hover: #eef2f7;
    --cr-ok: #16a34a; --cr-warn: #d97706; --cr-err: #dc2626;
    --cr-tabs-h: 62px;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --cr-bg: #0b1220; --cr-panel: #111a2b; --cr-text: #e5e7eb; --cr-muted: #94a3b8; --cr-line: #1f2a3d; --cr-hover: #1a2537;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cr-bg); color: var(--cr-text); }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
:where(a), :where(a:visited) { color: var(--cr-accent); }
h1 { font-size: 1.2rem; margin: 0 0 .5rem; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.is-fill { fill: currentColor; stroke: none; }

/* ── shell ── */
.cr-app { min-height: 100vh; display: flex; flex-direction: column; }
.cr-head {
    position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .7rem;
    padding: calc(.55rem + env(safe-area-inset-top)) 1rem .55rem; background: var(--cr-brand); color: #fff;
}
.cr-logo { height: 34px; max-width: 90px; object-fit: contain; border-radius: 6px; padding: 2px; }
.cr-logo--light { background: #fff; }
.cr-logo--dark { background: #111; }
.cr-head__txt { flex: 1; min-width: 0; }
.cr-head__event { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-head__me { font-size: .8rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-lang { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: .25rem .35rem; font: inherit; font-size: .8rem; }
.cr-lang option { color: #000; }
.cr-main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 0 calc(var(--cr-tabs-h) + 1.5rem + env(safe-area-inset-bottom)); }
.cr-bare { min-height: 100vh; }
.cr-offline { background: var(--cr-warn); color: #fff; font-size: .82rem; padding: .35rem 1rem; text-align: center; }

.cr-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex;
    background: var(--cr-panel); border-top: 1px solid var(--cr-line); padding-bottom: env(safe-area-inset-bottom);
}
.cr-tab {
    flex: 1; height: var(--cr-tabs-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--cr-muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.cr-tab svg { width: 22px; height: 22px; }
.cr-tab.active { color: var(--cr-accent); }
:where(a.cr-tab):visited { color: var(--cr-muted); }
a.cr-tab.active:visited { color: var(--cr-accent); }

.cr-center { display: flex; justify-content: center; align-items: center; min-height: 50vh; padding: 1rem; }
.cr-boot { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.cr-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--cr-line); border-top-color: var(--cr-accent); animation: cr-spin .8s linear infinite; }
@keyframes cr-spin { to { transform: rotate(360deg); } }
.cr-card { background: var(--cr-panel); border: 1px solid var(--cr-line); border-radius: 14px; padding: 1.2rem; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.cr-nolink { max-width: 420px; text-align: center; }
.cr-empty { text-align: center; color: var(--cr-muted); padding: 2rem 1rem; }
.cr-muted { color: var(--cr-muted); }
.cr-center-text { text-align: center; }
.cr-error { color: var(--cr-err); text-align: center; }
.cr-tag { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .05rem .4rem; border-radius: 5px; background: var(--cr-hover); color: var(--cr-muted); white-space: nowrap; }
.cr-tag--shift { background: #fef3c7; color: #92400e; }
.cr-tag--desk { background: #dbeafe; color: #1e40af; }
.cr-tag--task { background: #ede9fe; color: #5b21b6; }
@media (prefers-color-scheme: dark) {
    .cr-tag--shift { background: #451a03; color: #fcd34d; }
    .cr-tag--desk { background: #172554; color: #93c5fd; }
    .cr-tag--task { background: #2e1065; color: #c4b5fd; }
}

/* ── programma: filterbalk ── */
.cr-bar { position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 5; background: var(--cr-bg); padding: .6rem 1rem .55rem; border-bottom: 1px solid var(--cr-line); }
.cr-filtertoggle {
    display: none; width: 100%; align-items: center; gap: .45rem; padding: .45rem .7rem; border: 1px solid var(--cr-line); border-radius: 10px;
    background: var(--cr-panel); color: var(--cr-text); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
}
.cr-filtertoggle__n { background: var(--cr-accent); color: #fff; border-radius: 10px; padding: 0 .45rem; font-size: .72rem; }
.cr-filtertoggle__chev { margin-left: auto; font-size: .7rem; color: var(--cr-muted); }
.cr-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.cr-chip {
    display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .75rem; border-radius: 20px; border: 1.5px solid var(--cr-line);
    background: var(--cr-panel); font-size: .8rem; cursor: pointer; user-select: none; white-space: nowrap;
}
.cr-chip svg { width: 14px; height: 14px; }
.cr-chip.is-on { background: var(--cr-accent); border-color: var(--cr-accent); color: #fff; }
.cr-chip__dot { width: .6rem; height: .6rem; border-radius: 50%; }
.cr-searchrow { display: flex; gap: .5rem; margin-top: .55rem; }
.cr-search { position: relative; flex: 1; min-width: 0; }
.cr-search svg { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--cr-muted); width: 16px; height: 16px; }
.cr-search input {
    width: 100%; padding: .5rem .7rem .5rem 2.1rem; border: 1px solid var(--cr-line); border-radius: 10px;
    background: var(--cr-panel); color: var(--cr-text); font: inherit; font-size: 16px; /* geen iOS-zoom */
}
.cr-iconbtn { width: 2.6rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--cr-line); border-radius: 10px; background: var(--cr-panel); color: var(--cr-text); cursor: pointer; }
.cr-iconbtn.is-busy svg { animation: cr-spin .8s linear infinite; }
@media (max-width: 560px) {
    .cr-filtertoggle { display: flex; }
    .cr-filters { display: none; margin-top: .55rem; }
    .cr-filters.is-open { display: block; }
    .cr-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    .cr-chips::-webkit-scrollbar { display: none; }
}

/* ── programma: dagen en kaarten ── */
.cr-days { column-width: 420px; column-gap: 1.4rem; padding: 0 1rem; }
.cr-day { break-inside: avoid; }
.cr-dayhead {
    display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; margin: 1.1rem 0 .55rem; padding: .3rem .75rem;
    background: var(--cr-brand); color: #fff; border-radius: 8px; font-size: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.cr-main > .cr-dayhead { margin-left: 1rem; }
.cr-dayhead__date { font-weight: 700; text-transform: capitalize; }
.cr-dayhead__name { font-size: .8rem; font-weight: 500; opacity: .85; }
.cr-tg { display: grid; grid-template-columns: 3.4rem 1fr; gap: 0 .5rem; margin-bottom: .2rem; break-inside: avoid; }
.cr-tg__time { font-size: .8rem; font-weight: 700; color: var(--cr-accent); padding-top: .65rem; grid-row: span 50; }
.cr-tg__end { display: block; font-weight: 500; color: var(--cr-muted); }
.cr-item {
    display: flex; gap: .65rem; padding: .55rem .7rem; margin-bottom: .45rem; border-radius: 11px; background: var(--cr-panel);
    border: 1px solid var(--cr-line); box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.cr-item.is-expandable { cursor: pointer; }
.cr-item.is-mine { border-color: var(--cr-accent); box-shadow: 0 0 0 1px var(--cr-accent); }
.cr-item__accent { width: 4px; border-radius: 3px; flex-shrink: 0; }
.cr-item__body { flex: 1; min-width: 0; }
.cr-item__titlerow { display: flex; align-items: center; gap: .45rem; }
.cr-item__title { font-weight: 650; flex: 1; min-width: 0; }
.cr-item__chev { color: var(--cr-muted); font-size: .8rem; margin-left: auto; }
.cr-item__sub { font-size: .84rem; color: var(--cr-muted); }
.cr-item__loc { display: inline-flex; align-items: center; gap: .35rem; margin-top: .3rem; font-size: .82rem; color: var(--cr-muted); }
.cr-item__loc.is-link { cursor: pointer; color: var(--cr-text); }
.cr-pin { width: 11px; height: 15px; stroke: none; }
.cr-minimap { position: relative; height: 200px; margin-top: .45rem; border-radius: 10px; overflow: hidden; border: 1px solid var(--cr-line); }
.cr-maproute {
    position: absolute; right: 8px; bottom: 22px; z-index: 500; background: #fff; color: #111 !important; border-radius: 8px; padding: .15rem .5rem;
    font-weight: 700; text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.cr-item__detail { margin-top: .5rem; font-size: .88rem; border-top: 1px dashed var(--cr-line); padding-top: .45rem; overflow-wrap: anywhere; }
.cr-item__detail img { max-width: 100%; height: auto; }

.cr-crew { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.cr-person { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem; border-radius: 14px; background: var(--cr-hover); font-size: .78rem; }
.cr-person.is-coord { background: #fef3c7; color: #78350f; }
.cr-person.is-me { outline: 1.5px solid var(--cr-accent); }
@media (prefers-color-scheme: dark) { .cr-person.is-coord { background: #422006; color: #fde68a; } }
.cr-star { width: 13px; height: 13px; fill: #f59e0b; stroke: none; }
.cr-person__act {
    display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
    background: var(--cr-panel); color: var(--cr-accent) !important; border: 1px solid var(--cr-line);
}
.cr-person__act svg { width: 12px; height: 12px; }
.cr-legend { display: flex; align-items: center; gap: .5rem; padding: 1rem; color: var(--cr-muted); font-size: .82rem; }

/* ── mijn diensten ── */
.cr-next { margin: 1rem; padding: 1rem 1.1rem; border-radius: 14px; background: var(--cr-accent); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.cr-next__label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; opacity: .85; font-weight: 700; }
.cr-next__title { font-size: 1.2rem; font-weight: 700; margin: .15rem 0; }
.cr-next__meta { font-size: .88rem; opacity: .92; text-transform: none; }
.cr-next__count { margin-top: .4rem; font-size: 1.05rem; font-weight: 700; }
.cr-shift { display: flex; gap: .75rem; margin: 0 1rem .45rem; padding: .6rem .8rem; border-radius: 11px; background: var(--cr-panel); border: 1px solid var(--cr-line); }
.cr-shift.is-past { opacity: .5; }
.cr-shift.is-next { border-color: var(--cr-accent); box-shadow: 0 0 0 1px var(--cr-accent); }
.cr-shift__time { min-width: 5.6rem; font-weight: 700; font-size: .85rem; color: var(--cr-accent); }
.cr-shift__title { font-weight: 650; }
.cr-shift__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .82rem; color: var(--cr-muted); margin-top: .15rem; }
.cr-total { padding: .5rem 1rem; }

/* ── inchecken ── */
.cr-checkin { max-width: 440px; margin: 0 auto; padding: 1.2rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.cr-state { display: inline-flex; align-items: center; gap: .55rem; padding: .5rem 1rem; border-radius: 22px; background: var(--cr-panel); border: 1px solid var(--cr-line); font-weight: 700; }
.cr-state__dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--cr-muted); }
.cr-state--in .cr-state__dot { background: var(--cr-ok); }
.cr-state--pending .cr-state__dot { background: var(--cr-warn); }
.cr-state--out .cr-state__dot { background: var(--cr-muted); }
.cr-qr { background: #fff; padding: 1rem; border-radius: 16px; border: 1px solid var(--cr-line); text-align: center; }
.cr-qr img { display: block; margin: 0 auto; width: min(240px, 70vw); height: auto; image-rendering: pixelated; }
.cr-qr__code { color: #111; margin-top: .4rem; font-size: .9rem; }
.cr-qr__code .cr-muted { color: #64748b; }
.cr-actions { display: flex; gap: .6rem; }
.cr-btn { font: inherit; font-weight: 700; padding: .7rem 1.6rem; border-radius: 12px; border: 1px solid var(--cr-line); background: var(--cr-panel); color: var(--cr-text); cursor: pointer; }
.cr-btn--primary { background: var(--cr-accent); border-color: var(--cr-accent); color: #fff; }
.cr-btn:disabled { opacity: .6; cursor: default; }
.cr-install { font-size: .8rem; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; background: #fef3c7; color: #111; padding: .8rem 1rem; }
