/* =====================================================================================
   zugriffe.css · „Zugriffe und Rollen“ (L-0128) – Rechner und Handy, ALMAS-Webdesign v2
   Tokens aus almas-design.css (Rot, weiche Schatten, gerundet); Tabelle ab 900 px, darunter Karten.
   ===================================================================================== */
.zg { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.zg-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.zg-leiste { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.zg-stand { color: var(--text-tertiary, #8a8d96); font-size: 13px; }
.zg-leise { color: var(--text-tertiary, #8a8d96); font-size: 13px; }
.zg-unter { display: block; color: var(--text-secondary, #5b5e66); font-size: 12.5px; overflow-wrap: anywhere; }
.zg-name { font-weight: 600; color: var(--text-primary, #1d1f24); overflow-wrap: anywhere; }
.zg-laedt, .zg-leer { padding: 28px 16px; text-align: center; color: var(--text-secondary, #5b5e66); background: var(--bg-primary, #fff); border-radius: var(--radius-lg, 14px); box-shadow: var(--shadow-sm); }

/* Kennzahlen */
.zg-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.zg-kachel { background: var(--bg-primary, #fff); border-radius: var(--radius-lg, 14px); box-shadow: var(--shadow-sm), var(--shadow-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; animation: zg-ein .28s ease both; }
.zg-kachel-wert { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--text-primary, #1d1f24); font-variant-numeric: tabular-nums; }
.zg-kachel-text { font-size: 12.5px; color: var(--text-secondary, #5b5e66); }
.zg-kachel-rot .zg-kachel-wert { color: #D81020; }
.zg-kachel-warn { box-shadow: inset 3px 0 0 var(--warning, #e5a000), var(--shadow-sm); }

/* Hinweise */
.zg-hinweis { border-radius: var(--radius-md, 10px); padding: 10px 12px; font-size: 13.5px; line-height: 1.4; }
.zg-hinweis-warn { background: var(--warning-bg, #fff6e0); color: #7a5300; }
.zg-hinweis-info { background: var(--info-bg, #eef4ff); color: #1f4f99; }
.zg-hinweise { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

/* Erklärung */
.zg-erklaerung { background: var(--bg-primary, #fff); border-radius: var(--radius-lg, 14px); box-shadow: var(--shadow-sm); padding: 4px 16px; }
.zg-erklaerung summary { cursor: pointer; font-weight: 600; padding: 12px 0; min-height: 44px; display: flex; align-items: center; color: #D81020; }
.zg-erklaerung dl { display: grid; grid-template-columns: minmax(120px, 170px) 1fr; gap: 8px 16px; margin: 0 0 14px; font-size: 13.5px; }
.zg-erklaerung dt { font-weight: 600; }
.zg-erklaerung dd { margin: 0; color: var(--text-secondary, #5b5e66); }

/* Suche + Filter */
.zg-werkzeug { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.zg-suche { position: relative; display: block; max-width: 420px; }
.zg-suche svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-tertiary, #8a8d96); }
.zg-suche input { width: 100%; box-sizing: border-box; border: 1px solid var(--border-primary, #e3e4e8); border-radius: 12px; padding: 11px 12px 11px 38px; font: inherit; font-size: 15px; background: var(--bg-primary, #fff); }
.zg-suche input:focus { outline: 2px solid #FF2325; outline-offset: 1px; border-color: transparent; }
.zg-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.zg-chip { border: 1px solid var(--border-primary, #e3e4e8); background: var(--bg-primary, #fff); color: var(--text-primary, #1d1f24); border-radius: 999px; padding: 8px 14px; min-height: 40px; font: inherit; font-size: 13.5px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.zg-chip:hover { border-color: #D81020; }
.zg-chip.is-aktiv { background: #D81020; border-color: #D81020; color: #fff; }
.zg-chip-n { opacity: .75; font-variant-numeric: tabular-nums; }
.zg-chip:focus-visible, .zg-karte:focus-visible, .zg-zeile:focus-visible, .zg-schalter:focus-visible { outline: 2px solid #FF2325; outline-offset: 2px; }

/* Tabelle (Rechner) */
.zg-tabelle-rahmen { background: var(--bg-primary, #fff); border-radius: var(--radius-lg, 14px); box-shadow: var(--shadow-sm), var(--shadow-md); overflow-x: auto; }
.zg-tabelle { width: 100%; }
.zg-tabelle td { vertical-align: top; }
.zg-zeile { cursor: pointer; transition: background .12s; }
.zg-zeile:hover { background: var(--bg-secondary, #f7f7f9); }
.zg-zeile.is-auffaellig td:first-child { box-shadow: inset 3px 0 0 var(--warning, #e5a000); }
.zg-zahl { text-align: right; font-variant-numeric: tabular-nums; }
.zg-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* Karten (Handy und schmale Fenster) */
.zg-karten { list-style: none; margin: 0; padding: 0; display: none; flex-direction: column; gap: 10px; }
.zg-karte { width: 100%; text-align: left; border: 0; background: var(--bg-primary, #fff); border-radius: var(--radius-lg, 14px); box-shadow: var(--shadow-sm), var(--shadow-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; font: inherit; color: inherit; cursor: pointer; min-width: 0; animation: zg-ein .25s ease both; }
.zg-karte.is-auffaellig { box-shadow: inset 3px 0 0 var(--warning, #e5a000), var(--shadow-sm), var(--shadow-md); }
.zg-karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.zg-karte-zeile { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.zg-karte-zeile span { color: var(--text-secondary, #5b5e66); }
.zg-karte-zeile strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
@media (max-width: 899px) { .zg-tabelle-rahmen { display: none; } .zg-karten { display: flex; } }
.m-inhalt .zg-karten { display: flex; }

/* Detail */
.zg-detail { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.zg-zurueck { align-self: flex-start; }
.zg-detail-kopf h3 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.zg-detail-kopf h3:focus { outline: none; }
.zg-abschnitt { background: var(--bg-primary, #fff); border-radius: var(--radius-lg, 14px); box-shadow: var(--shadow-sm), var(--shadow-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.zg-abschnitt h4 { margin: 0 0 4px; font-size: 14px; text-transform: none; color: var(--text-primary, #1d1f24); }
.zg-werte { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.zg-werte dt { color: var(--text-secondary, #5b5e66); }
.zg-werte dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .zg-werte, .zg-erklaerung dl { grid-template-columns: 1fr; gap: 2px; } .zg-werte dd, .zg-erklaerung dd { margin-bottom: 8px; } }

/* Schalter */
.zg-schalter-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border-secondary, #f0f0f3); }
.zg-schalter-zeile:first-of-type { border-top: 0; }
.zg-schalter-text { min-width: 0; }
.zg-schalter { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; border: 0; background: #d5d7dd; cursor: pointer; padding: 0; transition: background .2s; }
.zg-schalter::before { content: ''; position: absolute; inset: -7px -2px; } /* Trefferfläche ≥ 44 px */
.zg-schalter-knopf { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.zg-schalter[aria-checked="true"] { background: #D81020; }
.zg-schalter[aria-checked="true"] .zg-schalter-knopf { transform: translateX(20px); }
.zg-schalter[disabled] { opacity: .45; cursor: not-allowed; }
.zg-bestaetigen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--danger-bg, #fdecec); border-radius: var(--radius-md, 10px); padding: 10px 12px; font-size: 13.5px; }
.zg-bestaetigen span { flex: 1 1 200px; }

@keyframes zg-ein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .zg-kachel, .zg-karte { animation: none; }
  .zg-schalter, .zg-schalter-knopf, .zg-chip, .zg-zeile { transition: none; }
}

/* Handy (mobile.html lädt almas-design.css nicht): Badges und Knöpfe im Sheet selbst gestalten */
.m-inhalt .zg .almas-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 600; line-height: 1.3; background: #f0f1f4; color: #4a4d55; }
.m-inhalt .zg .almas-badge-success { background: #e7f6ec; color: #17733a; }
.m-inhalt .zg .almas-badge-warning { background: #fff3d6; color: #8a5a00; }
.m-inhalt .zg .almas-badge-info { background: #e8f0fe; color: #1f4f99; }
.m-inhalt .zg .almas-badge-red, .m-inhalt .zg .almas-badge-danger { background: #ffe8e8; color: #D81020; }
.m-inhalt .zg .almas-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid #e3e4e8; background: #fff; color: #1d1f24; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.m-inhalt .zg .almas-btn-ghost { border-color: transparent; background: transparent; color: #D81020; padding: 0 8px; }
.m-inhalt .zg .almas-btn-danger { background: #D81020; border-color: #D81020; color: #fff; }
/* Handy: Karten-Optik mit den Tokens der Handy-App (mobile.html: --card, --linie, --sh-1) */
.m-inhalt .zg-kachel, .m-inhalt .zg-karte, .m-inhalt .zg-abschnitt, .m-inhalt .zg-erklaerung, .m-inhalt .zg-leer, .m-inhalt .zg-laedt {
  background: var(--card, #fff); border: 1px solid var(--linie, #ececf0); box-shadow: var(--sh-1, 0 1px 3px rgba(17, 18, 22, .06));
}
.m-inhalt .zg-karte.is-auffaellig { box-shadow: inset 3px 0 0 #e5a000, var(--sh-1, 0 1px 3px rgba(17, 18, 22, .06)); }
.m-inhalt .zg-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
