/* Bereich Ablage: Archiv und Suche, Import, Sync-Clients (Agent E). Stil wie Runde 12 (Listen aus „Clean v3“). */

.ablage { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ablage > .karte { flex: none; }
.ab-karte-kopf { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rand); min-height: 46px; flex-wrap: wrap; }
.ab-karte-titel { font-weight: 600; }
.ab-karte-sub { color: var(--text-4); font-size: 12px; }
.ab-karte-rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ab-rumpf { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

/* Filter */
.ab-filter { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 12px; padding: 14px 16px; align-items: end; }
.ab-filter .feld { min-width: 0; }
.ab-filter-breit { grid-column: span 2; }
.ab-von-bis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.ab-filter-knoepfe { display: flex; gap: 6px; justify-content: flex-end; grid-column: span 2; }
.ab-schnell { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 16px 12px; align-items: center; color: var(--text-4); font-size: 12px; }
.ab-schnell a { height: 24px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--rand); display: inline-flex; align-items: center; color: var(--text-2); text-decoration: none; font-weight: 500; }
.ab-schnell a:hover, .ab-schnell a.aktiv { background: var(--primaer-hell); color: var(--primaer); border-color: transparent; }

/* Reiter als Links im Segment-Stil */
.segment a { height: 28px; padding: 0 12px; border-radius: 6px; display: inline-flex; align-items: center; color: var(--text-3); font-weight: 500; text-decoration: none; white-space: nowrap; }
.segment a:hover { color: var(--text); }
.segment a.aktiv { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.12); }

/* Listen (Raster wie in der Rechnungsliste des Designs) */
.ab-liste { display: flex; flex-direction: column; padding: 8px 10px 10px; }
.ab-kopf, .ab-zeile { display: grid; gap: 12px; padding: 0 10px; align-items: center; }
.ab-kopf { height: 30px; border-radius: 7px; background: var(--feld-grau); font-size: 12px; font-weight: 600; color: var(--text-3); }
.ab-zeile { min-height: 37px; border-bottom: 1px solid var(--rand-fein); color: var(--text); text-decoration: none; padding-top: 4px; padding-bottom: 4px; }
a.ab-zeile:hover, button.ab-zeile:hover { background: #F8F9FA; color: var(--text); }
button.ab-zeile { border: 0; border-bottom: 1px solid var(--rand-fein); background: none; text-align: left; font: inherit; cursor: pointer; width: 100%; }
.ab-zeile > * { min-width: 0; }
.ab-zeile.widerrufen { color: var(--text-5); }
.ab-rechts { text-align: right; }
.ab-fett { font-weight: 600; }
.ab-grau { color: var(--text-3); }
.ab-klein { font-size: 12px; color: var(--text-4); }
.ab-abschneiden { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-zwei { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ab-zwei > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-zwei > span:first-child { font-weight: 500; }
.ab-zwei > span + span { font-size: 12px; color: var(--text-4); }
.ab-richtung { width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: var(--primaer-hell); color: var(--primaer); }
.ab-richtung .icon { width: 13px; height: 13px; }
.ab-richtung.in { background: var(--ok-bg); color: var(--ok); }
.ab-pfeil { color: var(--text-5); }

.ab-archiv-raster { grid-template-columns: 22px 84px minmax(90px, 140px) minmax(0, 1fr) 118px 170px 104px 14px; }
.ab-lauf-raster { grid-template-columns: 48px minmax(0, 1.3fr) 150px 130px minmax(0, 1.6fr) 14px; }
.ab-datei-raster { grid-template-columns: minmax(0, 1.6fr) 150px minmax(0, 1.4fr) minmax(0, 1.6fr); }
.ab-offen-raster { grid-template-columns: 50px 110px 96px minmax(0, 1fr) 110px minmax(0, 1.2fr) minmax(240px, 1.5fr); }
.ab-zimport-raster { grid-template-columns: 48px minmax(0, 1fr) 140px 110px 90px 90px 90px; }
.ab-client-raster { grid-template-columns: minmax(0, 1.3fr) 90px 80px 150px 96px 80px 110px 110px; }
.ab-zuordnung-raster { grid-template-columns: 210px minmax(0, 1fr) minmax(0, 1.4fr); }

/* Pillen: SdI-Status und Zahlungsstatus getrennt (Plan, Abweichungen vom Design) */
.ab-pille { display: inline-flex; height: 20px; align-items: center; padding: 0 8px; border-radius: 5px; font-size: 11.5px; font-weight: 600; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ab-pille.ok { background: #E5F4EB; color: #23764A; }
.ab-pille.warn { background: #FDF3DE; color: #8A5A0B; }
.ab-pille.fehler { background: #FBE7E5; color: #B5402F; }
.ab-pille.neutral { background: #F1F2F4; color: #3A4354; }
.ab-marke { display: inline-flex; height: 17px; align-items: center; padding: 0 6px; border-radius: 4px; font-size: 10.5px; font-weight: 600; background: var(--primaer-hell); color: var(--primaer); margin-left: 6px; vertical-align: 1px; }
.ab-punkt { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--schalter-aus); }
.ab-punkt.ok { background: #3E9B66; }
.ab-punkt.warn { background: #E3B04B; }
.ab-punkt.fehler { background: #D9534F; }

.ab-summe { display: flex; align-items: baseline; gap: 8px; padding: 10px 16px 0; flex-wrap: wrap; }
.ab-summe strong { font-weight: 600; }
.ab-seiten { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 8px 16px 12px; color: var(--text-4); }
.ab-leer { padding: 36px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-3); text-align: center; }
.ab-leer .icon { width: 22px; height: 22px; color: var(--text-5); }
.ab-leer strong { color: var(--text); }

/* Menü (Export) */
.ab-menue { position: relative; }
.ab-menue > summary { list-style: none; }
.ab-menue > summary::-webkit-details-marker { display: none; }
.ab-menue-liste { position: absolute; right: 0; top: 34px; z-index: 20; width: 230px; background: var(--flaeche); border-radius: 10px; border: 1px solid var(--rand); box-shadow: 0 12px 32px rgba(16,24,40,.12); padding: 5px; display: flex; flex-direction: column; }
.ab-menue-liste a { height: 30px; padding: 0 9px; border-radius: 6px; display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.ab-menue-liste a:hover { background: var(--bg); }
.ab-menue-liste .icon { color: #6B7486; }
.ab-menue-trenner { height: 1px; background: #F0F1F3; margin: 3px 6px; }
.ab-menue-hinweis { padding: 6px 9px 4px; font-size: 11.5px; color: var(--text-4); line-height: 1.4; }

/* Upload */
.ab-ablage-feld { position: relative; border: 1.5px dashed #D5D9E0; border-radius: 10px; padding: 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-3); background: #FCFCFD; text-align: center; }
.ab-ablage-feld:hover { border-color: var(--primaer); background: var(--primaer-hell); }
.ab-ablage-feld .icon { width: 22px; height: 22px; color: var(--primaer); }
.ab-ablage-feld strong { color: var(--text); }
.ab-ablage-feld input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ab-dateien { display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow: auto; font-size: 12.5px; }
.ab-dateien > div { display: flex; gap: 8px; justify-content: space-between; padding: 3px 2px; border-bottom: 1px solid var(--rand-fein); }
.ab-fortschritt { height: 6px; border-radius: 999px; background: var(--rand-fein); overflow: hidden; }
.ab-fortschritt > div { height: 100%; background: var(--primaer); border-radius: 999px; transition: width .3s; }
.ab-fortschritt.unbestimmt > div { width: 30%; animation: ab-lauf 1.2s ease-in-out infinite; }
@keyframes ab-lauf { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

/* Kennzahlen als Filter */
.ab-zahlen { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.ab-zahl { border: 1px solid var(--rand); border-radius: 8px; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--flaeche); text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.ab-zahl:hover { border-color: #D5D9E0; }
.ab-zahl.aktiv { border-color: var(--primaer); box-shadow: 0 0 0 3px var(--fokus); }
.ab-zahl-wert { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ab-zahl-text { font-size: 12px; color: var(--text-4); }

.ab-befunde { margin: 0 0 6px; padding: 8px 10px 8px 28px; background: var(--feld-grau); border-radius: 7px; font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; gap: 3px; grid-column: 1 / -1; }
.ab-befunde b { font-weight: 600; }

/* Zuordnung der Spalten, Vorschau */
.ab-vorschau-tabelle { overflow: auto; border: 1px solid var(--rand); border-radius: 8px; }
.ab-vorschau-tabelle table { border-collapse: collapse; width: 100%; font-size: 12px; }
.ab-vorschau-tabelle th { background: var(--feld-grau); text-align: left; font-weight: 600; color: var(--text-3); padding: 6px 8px; white-space: nowrap; }
.ab-vorschau-tabelle td { padding: 5px 8px; border-top: 1px solid var(--rand-fein); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ab-vorschau-tabelle td.fehler { color: var(--fehler); }

/* Registrierungscode */
.ab-code { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 10px; background: var(--primaer-hell); flex-wrap: wrap; }
.ab-code code { font-size: 22px; font-weight: 700; letter-spacing: .08em; color: var(--primaer); font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.ab-code-sub { color: var(--text-3); font-size: 12px; }

@media (max-width: 1180px) {
    .ab-filter { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ab-archiv-raster { grid-template-columns: 22px 80px minmax(80px, 120px) minmax(0, 1fr) 104px 140px 96px; }
    .ab-archiv-raster > :last-child { display: none; }
    .ab-client-raster { grid-template-columns: minmax(0, 1.3fr) 80px 140px 90px 70px 100px; }
    .ab-client-raster > :nth-child(3), .ab-client-raster > :nth-child(7) { display: none; }
}
@media (max-width: 860px) {
    .ab-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ab-filter-knoepfe { grid-column: span 2; }
    .ab-kopf { display: none; }
    .ab-zeile { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 4px 10px; padding: 8px 10px; }
    .ablage { padding: 10px; }
}
