/* Andere doseersystemen en de geschiedenis per toestel (js/andere-toestellen.js) */

/* ---- Venster Toestel toevoegen: Nexdose-pomp of Ander toestel */
.at-modus { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: var(--alp-radius-sm); background: var(--alp-surface-muted); }
.at-modus button { width: auto; min-height: 34px; padding: 6px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--alp-text-secondary); font-weight: 600; font-size: 0.88rem; box-shadow: none; }
.at-modus button[aria-checked='true'] { background: var(--alp-surface); color: var(--alp-text-primary); box-shadow: var(--alp-shadow-sm); }
.at-modus-uitleg { margin: -4px 0 14px; padding: 10px 12px; border-radius: var(--alp-radius-sm); background: var(--alp-brand-tint); color: var(--alp-brand-tekst); font-size: 0.85rem; }
.at-modus-uitleg[hidden], .at-ander[hidden], #register-form .form-group[hidden] { display: none; }
.at-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; color: var(--alp-text-primary); }
.at-soorten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.at-soort { position: relative; margin: 0; cursor: pointer; }
.at-soort input { position: absolute; opacity: 0; pointer-events: none; }
.at-soort span { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--alp-outline); border-radius: var(--alp-radius-sm); font-size: 0.85rem; font-weight: 500; color: var(--alp-text-primary); background: var(--alp-surface); overflow-wrap: anywhere; }
.at-soort span svg { flex-shrink: 0; color: var(--alp-text-secondary); }
.at-soort input:checked + span { border-color: var(--alp-brand-primary); background: var(--alp-brand-tint); color: var(--alp-brand-tekst); font-weight: 600; }
.at-soort input:checked + span svg { color: var(--alp-brand-tekst); }
.at-soort input:focus-visible + span { outline: 2px solid var(--alp-brand-primary); outline-offset: 2px; }
.at-veldrij { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.at-objectnr { display: flex; align-items: center; gap: 10px; }
.at-objectnr input { flex: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.at-auto { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; font-size: 0.85rem; font-weight: 500; }
.at-auto input { width: 16px; height: 16px; margin: 0; accent-color: var(--alp-brand-primary); }
.at-link { width: auto; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--alp-brand-tekst); font-weight: 600; font-size: inherit; text-decoration: underline; cursor: pointer; }
.at-link.is-rood { color: var(--alp-status-blokkade-tekst); }
.at-fotos { display: flex; flex-wrap: wrap; gap: 8px; }
.at-foto { position: relative; margin: 0; }
.at-foto img { display: block; width: 76px; height: 58px; object-fit: cover; border-radius: 8px; }
.at-foto button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 50%; border: 0; background: var(--alp-text-primary); color: var(--alp-surface); font-size: 14px; line-height: 22px; }
.at-foto-plus { display: grid; place-items: center; width: 76px; height: 58px; margin: 0; border: 1.5px dashed var(--alp-outline); border-radius: 8px; color: var(--alp-text-secondary); font-size: 0.8rem; font-weight: 600; cursor: pointer; text-align: center; }
.at-foto-plus:hover { border-color: var(--alp-brand-primary); color: var(--alp-brand-tekst); }

/* ---- Toestelpagina van een ander toestel */
.at-toestelkop { align-items: center; }
.at-toestelkop h2 { color: var(--alp-text-primary); }
.at-kop-foto { flex-shrink: 0; display: grid; place-items: center; width: 84px; height: 84px; border-radius: var(--alp-radius-md); background: var(--alp-surface-muted); color: var(--alp-text-secondary); overflow: hidden; }
.at-kop-foto img { width: 100%; height: 100%; object-fit: cover; }
.at-kop-sub { margin: 2px 0 0; color: var(--alp-text-secondary); font-size: 0.9rem; }
.at-badge-extern { background: var(--alp-surface-muted); color: var(--alp-text-secondary); }
.at-pagina { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.at-pagina > [hidden] { display: none; }
.at-gegevens { display: flex; flex-direction: column; gap: 4px; max-width: 760px; }
.at-gegevens label, .at-gegevens .at-label { margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; }
.at-gegevens-voet { display: flex; justify-content: flex-end; }
.at-gegevens-voet button { width: auto; }
.at-sectie { margin: 18px 0 10px; font-size: 0.95rem; }
.at-galerij { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.at-galerij-foto { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.at-galerij-foto img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--alp-surface-muted); }
.at-galerij-foto figcaption { font-size: 0.78rem; color: var(--alp-text-secondary); }
.at-galerij-knoppen { display: flex; gap: 12px; font-size: 0.8rem; }
.at-galerij-plus { width: 100%; height: auto; aspect-ratio: 4 / 3; }
/* Onderhoud: een ander toestel telt geen draaiuren of wasbeurten */
.at-onderhoud .oh-vel:has(input[id^='oh-hours-aan-']), .at-onderhoud .oh-vel:has(input[id^='oh-washes-aan-']) { display: none; }

/* De knoppen in een kaart van de toestelpagina krijgen standaard 40px hoog en
   16px opvulling (#device-detail .tp-kaart button); deze hier niet. */
#device-detail .tp-kaart .at-link { min-height: 0; padding: 0; border-radius: 0; font-size: inherit; }
#device-detail .tp-kaart .at-gs-weg { min-height: 0; width: 24px; height: 24px; padding: 0; border-radius: 50%; font-size: 16px; }
#device-detail .tp-kaart .at-gs-filters button { min-height: 30px; padding: 4px 12px; border-radius: var(--alp-radius-pill); font-size: 0.8rem; }
#device-detail .tp-kaart .at-gs-toestel { min-height: 0; padding: 2px 8px; border-radius: var(--alp-radius-pill); font-size: 0.78rem; }
#device-detail .tp-kaart .at-foto button { min-height: 0; width: 22px; height: 22px; padding: 0; border-radius: 50%; font-size: 14px; }
.at-galerij-knoppen { flex-wrap: wrap; gap: 4px 12px; }

/* ---- Geschiedenis (tijdlijn) */
.at-gs-objectnr { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 0.9rem; color: var(--alp-text-secondary); }
.at-gs-objectnr strong { color: var(--alp-text-primary); font-variant-numeric: tabular-nums; }
.at-gs-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; margin-bottom: 14px; border: 1px solid var(--alp-outline); border-radius: var(--alp-radius-md); background: var(--alp-surface-muted); }
.at-gs-form-kop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.at-gs-form-kop select { width: auto; min-width: 180px; }
.at-gs-form-uitleg { font-size: 0.8rem; color: var(--alp-text-secondary); }
.at-gs-form textarea { width: 100%; resize: vertical; font: inherit; padding: 10px 12px; border: 1px solid var(--alp-outline); border-radius: var(--alp-radius-sm); background: var(--alp-surface); color: var(--alp-text-primary); }
.at-gs-form-voet { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; }
.at-gs-form-voet > button { width: auto; }
.at-gs-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.at-gs-filters button { width: auto; min-height: 30px; padding: 4px 12px; border: 1px solid var(--alp-outline); border-radius: var(--alp-radius-pill); background: var(--alp-surface); color: var(--alp-text-secondary); font-size: 0.8rem; font-weight: 500; box-shadow: none; }
.at-gs-filters button.is-gekozen { background: var(--alp-text-primary); border-color: var(--alp-text-primary); color: var(--alp-surface); }
.at-gs-lijst { list-style: none; margin: 0; padding: 0; }
.at-gs-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--alp-outline); }
.at-gs-item:last-child { border-bottom: 0; }
.at-av { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 0.75rem; }
.at-gs-kop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 0.9rem; }
.at-gs-rechts { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.at-gs-kop time { color: var(--alp-text-secondary); font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.at-gs-sub { color: var(--alp-text-secondary); font-size: 0.82rem; }
.at-gs-sub a { color: var(--alp-brand-tekst); font-weight: 600; }
.at-gs-toestel { width: auto; min-height: 0; padding: 2px 8px; border: 1px solid var(--alp-outline); border-radius: var(--alp-radius-pill); background: var(--alp-surface); color: var(--alp-text-primary); font-size: 0.78rem; font-weight: 600; box-shadow: none; }
.at-gs-weg { width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--alp-text-secondary); font-size: 16px; box-shadow: none; }
.at-gs-weg:hover { background: var(--alp-status-blokkade-bg); color: var(--alp-status-blokkade-tekst); }
.at-gs-titel { margin: 4px 0 0; font-weight: 600; font-size: 0.9rem; }
.at-gs-tekst, .at-gs-onderdelen { margin: 4px 0 0; font-size: 0.9rem; line-height: 1.45; color: var(--alp-text-primary); white-space: pre-line; overflow-wrap: anywhere; }
.at-gs-onderdelen { color: var(--alp-text-secondary); }
.at-gs-fotos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.at-gs-foto img { display: block; width: 92px; height: 70px; object-fit: cover; border-radius: 8px; background: var(--alp-surface-muted); }
.at-chip { display: inline-block; padding: 2px 9px; border-radius: var(--alp-radius-pill); font-size: 0.75rem; font-weight: 600; white-space: nowrap; background: var(--alp-surface-muted); color: var(--alp-text-secondary); }
.at-chip.is-ticket { background: var(--alp-status-blokkade-bg); color: var(--alp-status-blokkade-tekst); }
.at-chip.is-onderhoud { background: var(--alp-status-klaar-bg); color: var(--alp-status-klaar-tekst); }
.at-chip.is-werk { background: var(--alp-status-actief-bg); color: var(--alp-status-actief); }
.at-leeg { margin: 8px 0; color: var(--alp-text-secondary); font-size: 0.9rem; }

/* ---- Apparaten: andere toestellen per locatie */
.at-sectie-ap { margin-top: 24px; }
.at-ap-kop { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.at-ap-kop h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.at-ap-kop p { margin: 2px 0 0; color: var(--alp-text-secondary); font-size: 0.85rem; }
.at-ap-kop .btn-secondary { width: auto; }
.at-lijst td small { display: block; color: var(--alp-text-secondary); font-size: 0.8rem; }
.at-lijst .at-k-foto { width: 56px; }
.at-lijst .at-laatste { max-width: 260px; }
.at-lijst .at-laatste span, .at-lijst .at-laatste small { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-lijst .at-nr { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.at-rij-klik { cursor: pointer; }
.at-rij-klik:hover { background: var(--alp-rij-hover); }
.at-mini { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: var(--alp-surface-muted); color: var(--alp-text-secondary); }

/* ---- Dialogen: foto groot, geschiedenis van een locatie */
.at-groot { margin: auto; padding: 0; border: 0; border-radius: var(--alp-radius-md); background: #000; max-width: min(96vw, 1200px); max-height: 92vh; }
.at-groot img { display: block; max-width: min(96vw, 1200px); max-height: 92vh; object-fit: contain; }
.at-groot::backdrop, .at-loc-dlg::backdrop { background: rgba(0, 0, 0, 0.55); }
.at-groot-sluit { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 20px; box-shadow: none; }
.at-loc-dlg { margin: auto; width: min(860px, 96vw); max-height: 90vh; padding: 0; border: 0; border-radius: var(--alp-radius-lg); background: var(--alp-surface); color: var(--alp-text-primary); box-shadow: var(--alp-shadow-lg); }
.at-loc-kop { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; background: var(--alp-surface); border-bottom: 1px solid var(--alp-outline); }
.at-loc-kop h2 { margin: 0; font-size: 1.15rem; }
.at-loc-kop p { margin: 2px 0 0; color: var(--alp-text-secondary); font-size: 0.85rem; }
.at-loc-kop .at-groot-sluit { position: static; background: var(--alp-surface-muted); color: var(--alp-text-primary); }
.at-loc-inhoud { padding: 12px 22px 18px; }

@media (max-width: 720px) {
    .at-veldrij { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .at-gs-rechts { width: 100%; margin-inline-start: 0; justify-content: space-between; }
    .at-lijst .at-k-waar, .at-lijst .at-k-soort, .at-lijst .at-laatste { display: none; }
    .at-toestelkop .at-kop-foto { align-self: flex-start; width: 56px; height: 56px; }
    .at-lijst td { white-space: normal; padding: 8px 10px; }
    .at-lijst .at-k-foto { width: 48px; }
}
@media (max-width: 480px) {
    .at-soort span svg { display: none; }
}
