/* Eigene Anpassungen des Admin-Panels; liegt ueber dem Theme der Vorlage. */

/* Abschnittsueberschriften der hellen Sidebar (skin6): das Theme setzt sie weiss. */
.sidebar-nav ul .nav-small-cap {
    color: #64748b;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 12px 13px 4px;
    margin-top: 6px;
}
.sidebar-nav ul .nav-small-cap i {
    display: none;
}

/* Noch nicht portierte Menuepunkte bleiben sichtbar, aber ohne Funktion. */
#sidebarnav .sidebar-item.disabled > .sidebar-link {
    opacity: .45;
    cursor: default;
    pointer-events: none;
}

/* Profilmenue unten in der Sidebar (wie GebietsManager / Franchiseverzeichnis), klappt nach oben auf. */
.ap-profilfuss { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; background: #fff; border-top: 1px solid rgba(0,0,0,.10); padding: 8px; }
.ap-profilknopf { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: #334155; text-decoration: none; }
.ap-profilknopf:hover, .ap-profilknopf:focus-visible { background: rgba(0,0,0,.05); color: #0f172a; }
.ap-profilbild { flex: none; object-fit: cover; }
.ap-profiltext { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ap-profilname { font-weight: 600; font-size: 13px; }
.ap-profilmail { font-size: 11px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-profilpfeil { margin-left: auto; color: #94a3b8; }
.ap-profilmenue { min-width: 240px; }
.ap-profilmenue .dropdown-item i { width: 22px; color: #64748b; }
.left-sidebar .scroll-sidebar { padding-bottom: 64px; }
#main-wrapper[data-sidebartype="mini-sidebar"] .ap-profilknopf { justify-content: center; }

/* Monitoring: kompakte Tabelle, keine Umbrueche, dunkle Trennlinien, zweite Zeile klein */
.mon-table > :not(caption) > * > * { padding: .1rem .2rem; white-space: nowrap; vertical-align: middle; border-bottom: 1px solid #8a8f98; line-height: 1.2em;}
.mon-table thead th { border-bottom: 2px solid #4b5563; }
.mon-table .mon-zweit { font-size: .8em; color: #555; }
.mon-table tr[class^="mon-"] .mon-zweit { color: #333; }
.mon-table a.text-reset { text-decoration: none; }
.mon-table a.text-reset:hover { text-decoration: underline; }
/* Monitoring: Ampelfarben der Zeilen (Legacy: gelb neu, rot Fehler, rot2 MUTE, blau Kasse/geschlossen, gruen erledigt) */
.mon-table tr.mon-gelb  > td { background-color: #ffffaa; }
.mon-table tr.mon-rot   > td { background-color: #ffaaaa; }
.mon-table tr.mon-mute  > td { background-color: #ffcc88; }
.mon-table tr.mon-blau  > td { background-color: #bbbbff; }
.mon-table tr.mon-gruen > td { background-color: #ccffcc; }
.mon-table .mon-aktionen .btn { margin-right: 2px; padding: .15rem .4rem; }
.mon-table .mon-status { max-width: 220px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
/* Monitoring: Tabellenkoerper scrollt in sich (Hoehe setzt monitoring.js auf den freien Platz bis zum Fensterrand),
   damit die waagerechte Scrollleiste immer erreichbar bleibt; der Kopf bleibt dabei stehen. */
.mon-scroll { overflow: auto; max-height: calc(100vh - 260px); }
.mon-scroll .mon-table thead th { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 0; box-shadow: inset 0 -2px 0 #4b5563; }

/* Benutzerliste: Aktionsknoepfe eng */
.ap-aktionen .btn { margin-right: 2px; }

/* Kennzeichnung der Sandbox, damit Dev und Prod nicht verwechselt werden. */
body.env-sandbox .topbar {
    box-shadow: inset 0 3px 0 #f0ad4e;
}

/* Shopliste: Livefilter-Feld, dauerhaft geschlossene Shops rosa wie im Altbestand */
.sl-suche { width: 360px; max-width: 100%; }
.sl-table tr.sl-geschlossen > td { background-color: #ffd2d2; }
.sl-table.table-hover tr.sl-geschlossen:hover > td { background-color: #ffc2c2; --bs-table-accent-bg: transparent; }

/* Benutzer: Shop-Zuordnung im Rechte-Popup */
.rs-liste { max-height: 320px; overflow-y: auto; }
.rs-zeile { display: flex; align-items: center; gap: .6rem; padding: .25rem .6rem; margin: 0; border-bottom: 1px solid #eee; cursor: pointer; font-size: .9rem; }
.rs-zeile:hover { background: #f5f7fa; }
.rs-zeile.rs-aktiv { background: #e8f5e9; }
.rs-zeile.rs-geschlossen .rs-name { color: #a33; }
.rs-zeile .form-check-input { margin: 0; flex: none; }
.rs-zeile .rs-id { flex: none; width: 3rem; color: #64748b; font-variant-numeric: tabular-nums; }
.rs-zeile .rs-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-zeile .rs-db { flex: none; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Fehler-SMS-Empfaenger in der Sidebar (blocks/fehlersms) */
.ap-sms .ap-sms-feld { padding: 0 20px 8px; }
.ap-sms .ap-sms-label { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; }
.ap-sms .ap-sms-label i { margin-right: 2px; }
.ap-sms select { font-size: 13px; }

/* Shop-Stammdaten: je Zeile nur der passende Google-Food-Knopf (wie Legacy activate_google_x) */
.sd-aktionen.sd-google-1 .sd-aktivieren, .sd-aktionen.sd-google-0 .sd-deaktivieren { display: none; }
.sd-spezialitaeten .form-check-label { font-size: .9rem; }
/* Geo-Tool: Google-Vorschlagsliste ueber dem Modal, Trefferfeld klein */
.pac-container { z-index: 1100; }
.sd-geo-treffer { font-size: .8rem; }
.sd-place-id { font-family: monospace; font-size: .85em; }

/* Shopanlage / Domains: Pruef- und Protokolllisten */
.ap-protokoll li { padding: .15rem 0; }
.ap-protokoll li .mdi { font-size: 1.1em; vertical-align: -1px; margin-right: .25rem; }
.sa-vorschau code, .dm-vorschau code { word-break: break-all; }

/* Topbar mit Megamenü immer über dem Inhalt: das Theme gibt .alert z-index 99, .topbar nur 50,
 * dadurch lagen Hinweiskästen im Inhalt über dem aufgeklappten Admin-Menü. */
.topbar { z-index: 100; }
.page-wrapper .alert { z-index: auto; }

/* Bestelluebersicht: Shop-Auswahl (select2) */
.mon-shopwahl .select2-container { min-width: 320px; max-width: 100%; }
.mon-shopwahl .select2-container--default .select2-selection--single { height: 31px; border-color: #ced4da; border-radius: 4px; }
.mon-shopwahl .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 29px; font-size: .875rem; }
.mon-shopwahl .select2-container--default .select2-selection--single .select2-selection__arrow { height: 29px; }

/* API-Keys / Header-Bilder */
.ak-secret { letter-spacing: .5px; }
.hb-galerie .card-img-top { aspect-ratio: 16 / 5; object-fit: cover; background: #eee; }
.hb-vorschau { position: relative; display: block; }
.hb-fehlt { position: absolute; top: 6px; left: 6px; }
.hb-mini { width: 80px; height: 25px; object-fit: cover; border-radius: 3px; }

/* select2: lange Eintraege (Shoplisten) abschneiden statt umbrechen */
.select2-container .select2-results__option,
.select2-container--default .select2-selection--single .select2-selection__rendered { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select2-container .select2-results__option { max-width: 100%; }
.select2-container--open .select2-dropdown { max-width: 480px; }
/* API-Keys: Ziel-Spalte begrenzen, voller Text im title */
.ak-tabelle .ak-ziel { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Rechnungslauf */
.rl-tabelle td, .rl-tabelle th { vertical-align: middle; }
#rl-protokoll li { padding: .1rem 0; }

/* Statistik */
.st-kacheln .st-wert { font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.st-chart { position: relative; height: 300px; }
.st-chart-klein { height: 220px; }
.st-chart-shops { height: 420px; }
/* Shopliste unter dem Vergleich: feste Hoehe mit eigener Scrollleiste, Kopf bleibt stehen */
.st-shops-scroll { max-height: 440px; overflow: auto; }
.st-shops-scroll thead th { position: sticky; top: 0; z-index: 2; background: #fff; box-shadow: inset 0 -1px 0 #dee2e6; }
.st-shops-scroll td, .st-shops-scroll th { white-space: nowrap; }
.st-legende td { padding: .15rem .25rem; border-top: 0; }
.st-punkt { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
/* Drehendes Icon (mdi-spin fehlt in der eingebundenen Font-Version) */
@keyframes mdi-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.mdi-spin:before { display: inline-block; animation: mdi-spin 1s linear infinite; }

/* Mobil: Karten bis an den Bildschirmrand und kleinerer Innenabstand. Das Theme gibt 15 px Seitenabstand
 * plus 25 px Karten-Innenabstand und 30 px Spaltengutter, auf dem Handy bleibt dann kaum Platz fuer Inhalt.
 * Seiten ohne Karte (Monitoring, Shopliste) behalten die 10 px Seitenabstand, Inhalte liegen so buendig. */
@media (max-width: 767.98px) {
    .page-wrapper > .page-content { padding: 10px; }
    .page-content > .row { --bs-gutter-x: 0; }
    .page-content > .card,
    .page-content > .row > [class*="col"] > .card { margin-left: -10px; margin-right: -10px; margin-bottom: 10px; }
    .card-body { padding: 12px 10px; }
    .page-breadcrumb { padding-left: 10px !important; padding-right: 10px !important; }
}

/* Shopadministration: Umschalter und Shopkopf in der Sidebar (an der Stelle der Fehler-SMS) */
.ap-wechsel { background: #f4f7fb; border-bottom: 1px solid #e3e8ee; padding: 8px 0 6px; }
.ap-wechsel .ap-wechsel-feld { padding: 0 12px; }
.ap-wechsel .ap-wechsel-label { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; }
.ap-wechsel .select2-container { width: 100% !important; }
.ap-wechsel .select2-container--default .select2-selection--single { height: 31px; border-color: #ced4da; border-radius: 4px; }
.ap-wechsel .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 29px; font-size: 13px; padding-right: 24px; }
.ap-wechsel .select2-container--default .select2-selection--single .select2-selection__arrow { height: 29px; }
.ap-shopkopf .ap-shopkopf-feld { display: flex; flex-direction: column; padding: 10px 13px 4px; min-width: 0; }
.ap-shopkopf .ap-shopkopf-name { font-weight: 600; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-shopkopf .ap-shopkopf-info { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-shop-zurueck { border-top: 1px solid #e3e8ee; margin-top: 6px; padding-top: 4px; }
.select2-container .select2-results__option[aria-selected] { font-size: 13px; }

/* Oeffnungszeiten: schmale Zeitfelder, Kopiermenue */
.oz-tabelle .oz-zeit, .oz-sonder .oz-zeit { width: 5.2em; text-align: center; }
.oz-tabelle .form-select-sm, .oz-sonder .form-select-sm { min-width: 11em; }
.oz-sonder .oz-datum { width: 8.5em; }
.oz-kopie-menue { min-width: 14rem; }

/* Profil: Zahlweisen-Tabelle */
.sp-zw .sp-zw-zahl { width: 6em; text-align: right; }
.sp-zw .sp-zw-artnr { width: 8em; }
.sp-zw .form-select-sm { min-width: 7em; }
