/* JW261111 Neu: aufgeraeumtes Aussehen von Kopfzeile, Massnahmenliste und Bearbeiten-Seite.
   Farben, Logo und Schrift bleiben; geaendert sind Anordnung und Gewichtung.
   Eingebunden in index.html nach tablet.css. Zum Zuruecknehmen genuegt es, die Zeile dort auszukommentieren. */

/* ---------- Status als Marke ---------- */
.rwp-status,
.rwp-status-zelle a {
    display: inline-block;
    padding: 0.1rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #f1f3f5;
    /* die Statusfarbe aus der Konfiguration, aufgehellt */
    background: color-mix(in srgb, var(--rwp-status, #f1f3f5) 45%, white);
    color: #212529 !important;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: nowrap;
    text-decoration: none !important;
}

/* ---------- Kopfzeile ---------- */
.rwp-nav-gruss,
.rwp-nav-alt,
.rwp-nav-kontakt,
nav.navbar .container-fluid > .flex-grow-1 {
    display: none !important;
}

.rwp-nav-titel {
    margin-left: 16px !important;
}

.rwp-nav-knoepfe {
    flex: 100 1 auto !important;
    align-items: center !important;
    margin-right: 0.75rem !important;
    margin-left: 1.25rem;
    min-width: 0;
}

.rwp-nav-knoepfe > * {
    order: 3;
}

.rwp-nav-knoepfe > .rwp-nav-link {
    order: 1;
}

.rwp-nav-knoepfe > .rwp-nav-luecke {
    order: 2;
    flex: 1 1 auto;
}

.rwp-nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: none;
    color: #495057;
    padding: 0.35rem 0.2rem;
    margin-right: 1.1rem;
    min-height: 0;
}

.rwp-nav-link:hover {
    color: #0d6efd;
}

.rwp-nav-link.aktiv {
    color: #212529;
    font-weight: 600;
    border-bottom-color: #0d6efd;
}

.rwp-benutzer {
    position: relative;
    margin-right: 0.75rem;
}

.rwp-benutzer-knopf {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #b6d4fe;
    background: #e7f1ff;
    color: #0a58ca;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0;
}

.rwp-benutzer-menu {
    position: absolute;
    right: 0;
    top: 46px;
    min-width: 220px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    padding: 0.4rem 0;
    z-index: 1100;
}

.rwp-benutzer-name {
    padding: 0.5rem 1rem 0.6rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0.3rem;
}

.rwp-benutzer-name span {
    color: #6c757d;
    font-size: 0.85rem;
}

.rwp-benutzer-menu a,
.rwp-benutzer-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    color: #212529;
    text-decoration: none;
}

.rwp-benutzer-menu a:hover,
.rwp-benutzer-menu button:hover {
    background: #f1f3f5;
}

/* ---------- Massnahmenliste ---------- */
.rwp-zeile {
    cursor: pointer;
}

.rwp-zeile:hover > td {
    background-color: #eef4ff !important;
    box-shadow: none !important;
}

/* das Symbol "Detailansicht" entfaellt, weil die ganze Zeile die Detailansicht oeffnet */
.rwp-mn-liste button[id^="btnDetail_"] {
    display: none;
}

.rwp-mn-liste thead th {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    border-bottom: 2px solid #dee2e6;
}

/* Schnellfilter als antippbare Marken: die Beschriftung ist die Marke, das Kaestchen selbst ist unsichtbar */
.rwp-chip {
    display: flex;
    align-items: flex-end;
    padding-bottom: 3px;
}

.rwp-chip > label {
    margin: 0 !important;
    padding: 0.3rem 0.95rem;
    border: 1px solid #ced4da;
    border-radius: 999px;
    cursor: pointer;
    color: #495057;
    background: white;
    white-space: nowrap;
    user-select: none;
}

.rwp-chip > label:hover {
    border-color: #86b7fe;
}

.rwp-chip:has(input:checked) > label {
    background: #e7f1ff;
    border-color: #0d6efd;
    color: #0a58ca;
    font-weight: 600;
}

.rwp-chip > div {
    position: absolute;
    width: 1px;
    height: 1px !important;
    overflow: hidden;
    opacity: 0;
}

/* ---------- Bearbeiten-Seite: Reiter und zwei Spalten ---------- */
.rwp-reiter .nav-link {
    color: #495057;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 0.5rem 0.2rem;
    margin-right: 1.5rem;
}

.rwp-reiter .nav-link:hover {
    color: #0d6efd;
}

.rwp-reiter .nav-link.active {
    color: #212529;
    font-weight: 600;
    border-bottom-color: #0d6efd;
    background: none;
}

.rwp-edit-spalten {
    display: flex;
    flex-direction: column;
}

.rwp-edit-haupt {
    order: 1;
    min-width: 0;
}

.rwp-edit-seite {
    order: 2;
    min-width: 0;
}

@media (min-width: 992px) {
    .rwp-edit-spalten {
        display: grid;
        grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
        gap: 1.5rem;
        align-items: start;
    }

    .rwp-edit-haupt {
        grid-column: 1;
        grid-row: 1;
    }

    .rwp-edit-seite {
        grid-column: 2;
        grid-row: 1;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        border-radius: 0.5rem;
        padding: 1rem 1rem 0.25rem;
    }

    /* in der schmalen Spalte stehen zwei Felder nebeneinander, lange Felder nehmen die ganze Breite */
    .rwp-edit-seite .row > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
        width: 50%;
    }

    .rwp-edit-seite .row > div:has(#mnKunde),
    .rwp-edit-seite .row > div:has(#mnKategorie),
    .rwp-edit-seite .row > div:has(#mnMail),
    .rwp-edit-seite .row > div:has(#mnLinie),
    .rwp-edit-seite .row > div:has(#mnErfasstVon) {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }

    .rwp-edit-seite h5 {
        font-size: 1rem;
        color: #495057;
    }

    .rwp-edit-haupt #mnBeschreibung {
        min-height: 200px !important;
    }
}

/* ---------- Seite nie breiter als das Fenster ----------
   JW261111 Lange Woerter in der Beschreibung haben die Massnahmenliste auch am PC breiter als das Fenster gemacht. */
main {
    min-width: 0;
    max-width: 100%;
}

.rwp-mn-liste {
    width: 100%;
}

.rwp-mn-liste td {
    overflow-wrap: anywhere;
}

/* ---------- Detailseite: zwei Spalten, Verlauf als Eintraege ---------- */
.rwp-detail-spalten {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rwp-detail-haupt,
.rwp-detail-seite {
    min-width: 0;
}

/* die Bausteine Beschreibung / Kopfdaten hatten feste Breiten (95vw) und Hoehen: in der Spalte passen sie sich an */
.rwp-detail-haupt div[style*="95vw"] {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
}

.rwp-detail-haupt .container-fluid {
    padding-top: 0.6rem;
}

.rwp-detail-seite {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.9rem 1rem 0.4rem;
}

.rwp-detail-seite .container-fluid {
    padding: 0;
}

.rwp-detail-seite .card {
    border: none;
    background: none;
}

.rwp-detail-seite br {
    display: none;
}

/* leere Angaben (z.B. Linie, Station, Ticket Ende) nicht anzeigen */
.rwp-detail-seite .d-flex:has(> span:last-child:empty) {
    display: none !important;
}

@media (min-width: 992px) {
    .rwp-detail-spalten {
        display: grid;
        grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
        gap: 1.5rem;
        align-items: start;
    }

    /* in der schmalen Spalte stehen die Bloecke der Kopfdaten untereinander */
    .rwp-detail-seite .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100% !important;
        width: 100%;
    }
}

.rwp-eintrag {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 0.6rem;
    background: white;
}

.rwp-eintrag-kommentar {
    border-color: #ffda6a;
    background: #fffdf5;
}

.rwp-eintrag-mail {
    border-color: #b6d4fe;
}

.rwp-eintrag-kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.rwp-eintrag-text {
    overflow-wrap: anywhere;
}

/* Marke ohne Text (Status oder Prio noch nicht geladen) nicht als leeren Kringel zeigen */
.rwp-status:empty {
    display: none;
}

/* JW261111 Die Stammdaten rechts bleiben beim Scrollen durch den Verlauf sichtbar (laufen mit) */
@media (min-width: 992px) {
    .rwp-detail-seite {
        position: sticky;
        top: 80px;   /* unter der festen Kopfzeile */
        max-height: calc(100vh - 150px);
        overflow-y: auto;
    }
}

/* JW261111 Ticket-Ansicht: Titel, Knoepfe und Reiter bleiben beim Scrollen oben stehen
   (unter der festen Kopfzeile, 64px hoch). */
.rwp-ticket-kopf {
    position: sticky;
    top: 64px;
    z-index: 100;
    background: white;
    padding-top: 0.6rem;
    margin-top: -0.6rem;
    margin-bottom: 1rem;
}

.rwp-ticket-kopf > :last-child {
    margin-bottom: 0 !important;
}

/* ohne Reiter (Kunden): Linie unter dem Titel, damit der Inhalt sichtbar darunter durchlaeuft */
.rwp-ticket-kopf > .d-flex:last-child {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

/* die Stammdaten rechts beginnen dann unter dem stehenden Ticket-Kopf */
@media (min-width: 992px) {
    .rwp-ticket-kopf ~ .rwp-detail-spalten .rwp-detail-seite {
        top: 185px;
        max-height: calc(100vh - 255px);
    }
}

/* JW261111 Bearbeiten-Seite: die Vorgangsbearbeitung (StoerungBearbeitung) hat eine feste Breite von 95vw und ragte
   aus der linken Spalte heraus; lange Zeilen waren rechts abgeschnitten. Jetzt so breit wie die Spalte, mit Umbruch. */
.rwp-edit-haupt div[style*="95vw"] {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow-wrap: anywhere;
}

/* ---------- Detailseite: Stammdaten rechts aufgeraeumt ----------
   JW261111 Beschriftung grau in einer festen Spalte, Wert daneben; Gruppen durch feine Linien getrennt.
   Der Status steht schon als Marke im Titel und entfaellt hier. */
.rwp-detail-seite .row .d-flex {
    display: grid !important;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    column-gap: 0.75rem;
    padding: 0.18rem 0;
    align-items: baseline !important;
}

.rwp-detail-seite .row .d-flex > span:first-child {
    width: auto !important;
    min-width: 0 !important;
    font-weight: 400 !important;
    color: #6c757d;
    font-size: 0.9rem;
}

.rwp-detail-seite .row .d-flex > span:last-child {
    overflow-wrap: anywhere;
}

.rwp-detail-seite .row .d-flex:has(> span[style*="background-color"]),
.rwp-detail-seite .row .d-flex:has(> span:only-child) {
    display: none !important;
}

.rwp-detail-seite .row > [class*="col-"] {
    margin-bottom: 0 !important;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.rwp-detail-seite .row > [class*="col-"] + [class*="col-"] {
    border-top: 1px solid #e3e6ea;
}

.rwp-detail-seite .row > [class*="col-"]:empty,
.rwp-detail-seite .row > [class*="col-"]:not(:has(*)) {
    display: none;
}

.rwp-detail-seite .btn {
    margin-right: 0.4rem;
}

/* ---------- Verlauf: wer hat geschrieben ----------
   JW261111 Filter-Marken ueber dem Verlauf und eigene Farbe fuer Eingaenge von Dritten */
.rwp-filter {
    border: 1px solid #ced4da;
    border-radius: 999px;
    background: white;
    color: #495057;
    padding: 0.15rem 0.8rem;
    font-size: 0.85rem;
}

.rwp-filter:hover {
    border-color: #86b7fe;
}

.rwp-filter.aktiv {
    background: #e7f1ff;
    border-color: #0d6efd;
    color: #0a58ca;
    font-weight: 600;
}

.rwp-eintrag-kommentar {
    border-left: 4px solid #ffc107;
}

.rwp-eintrag-eingang {
    border-color: #9eeaf9;
    border-left: 4px solid #0dcaf0;
    background: #f6fdff;
}

/* JW261111 Das Logo steht immer ganz rechts, auch auf der Anmeldeseite (dort gibt es keine Knopfgruppe, die es
   nach rechts schiebt; seit dem Umbau der Kopfzeile stand es deshalb direkt neben dem Titel). */
nav.navbar .container-fluid > .rwp-nav-logo {
    margin-left: auto;
}

/* ---------- Anmeldeseite ----------
   JW261111 schmale Karte in der Mitte auf leicht grauem Hintergrund */
body:has(.rwp-login) {
    background: #f1f3f5;
}

.rwp-login {
    display: flex;
    justify-content: center;
    padding: 2.5rem 0.75rem;
}

.rwp-login-karte {
    width: 100%;
    max-width: 410px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
    padding: 1.9rem 1.9rem 1.5rem;
}

.rwp-login-symbol {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e7f1ff;
    color: #0a58ca;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.6rem;
}

.rwp-login-link {
    font-size: 0.85rem;
    min-height: 0 !important;
    min-width: 0 !important;
    text-decoration: none;
}

/* JW261111 Kontaktseite: unsichtbares Feld gegen Bots. Es liegt ausserhalb des sichtbaren Bereichs (nicht display:none,
   das erkennen viele Bots), Menschen und Vorleseprogramme kommen nicht hinein. */
.rwp-nicht-ausfuellen {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==========================================================================================================
   JW261111 Restliche Seiten im neuen Aussehen
   ========================================================================================================== */

/* ---------- Blatt: weisse Flaeche in der Mitte auf grauem Hintergrund ----------
   Passwort aendern, Ticket anlegen, Kommentar, FAQ, Info. Der Rahmen steht als <div class="rwp-blatt ..."> in der Seite. */
body:has(main article > .rwp-blatt),
body:has(main article > .rwp-karten-seite) {
    background: #f1f3f5;
}

.rwp-blatt {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
    padding: 1.6rem 1.8rem 1.4rem;
    margin: 1.25rem auto 2rem;
    max-width: 920px;
}

.rwp-blatt-s {
    max-width: 520px;
}

.rwp-blatt-m {
    max-width: 780px;
}

.rwp-blatt > h3:first-child,
.rwp-blatt > h4:first-child {
    margin-bottom: 1rem;
}

/* schmale Blaetter: Spalten der alten Anordnung nehmen die ganze Breite */
.rwp-blatt-s .row > [class*="col-"],
.rwp-blatt-m .row > [class*="col-md-6"]:only-child,
.rwp-blatt-m .row > [class*="col-lg-6"]:only-child {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
}

/* "Kommentar hinzufuegen" laeuft auch im Dialog der Detailseite: dort ohne eigenen Rahmen */
dialog .rwp-blatt {
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    max-width: none;
}

@media (max-width: 575.98px) {
    .rwp-blatt {
        padding: 1.1rem 1rem;
        margin: 0.5rem auto 1.5rem;
    }
}

/* ---------- Passwort vergessen: wie die Anmeldeseite ---------- */
.rwp-karten-seite {
    padding: 2.5rem 0.75rem;
    margin: 0;
}

.rwp-karten-seite > div {
    width: 100%;
    max-width: 434px;
    flex: 0 0 auto;
}

.rwp-karten-seite .card {
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07) !important;
}

.rwp-karten-seite .card-body {
    padding: 1.9rem 1.9rem 1.5rem;
}

.rwp-karten-seite .btn-secondary {
    background: white;
    color: #495057;
    border-color: #ced4da;
}

.rwp-karten-seite .btn-secondary:hover {
    background: #f1f3f5;
    color: #212529;
}

/* ---------- OPL- und IB-Liste: wie die Ticketliste ---------- */
.rwp-liste thead th {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    border-bottom: 2px solid #dee2e6;
    background: white;
}

.rwp-liste > tbody > tr > td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    overflow-wrap: break-word;
    vertical-align: top;
}

.rwp-liste > tbody > tr:hover > td {
    background-color: #eef4ff !important;
    box-shadow: none !important;
}

.rwp-status-ok {
    background: #d1e7dd;
}

.rwp-status-warn {
    background: #fff3cd;
}

/* ---------- Bearbeiten-Seite: rechte Spalte wie auf der Detailseite ---------- */
.rwp-edit-seite .form-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.15rem;
}

.rwp-edit-seite .mb-3 {
    margin-bottom: 0.7rem !important;
}

.rwp-edit-seite h5 {
    border-top: 1px solid #e3e6ea;
    padding-top: 0.8rem;
    margin-top: 0.4rem !important;
}

.rwp-edit-seite .form-text {
    font-size: 0.8rem;
}

@media (min-width: 992px) {
    /* laeuft beim Scrollen mit; ist sie hoeher als das Fenster, laesst sie sich fuer sich scrollen */
    .rwp-edit-seite {
        position: sticky;
        top: 80px;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
}

/* ---------- Dialoge (Suche, Verteiler, Download, Kommentar) ---------- */
dialog.m-dialog {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    padding: 0;
    max-width: min(1240px, 96vw);
    max-height: 92vh;
    overflow: auto;
    color: #212529;
}

dialog.m-dialog::backdrop {
    background: rgba(33, 37, 41, 0.45);
}

.m-dialog__remark {
    display: none;
}

.m-dialog__header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
}

.m-dialog__header > .a-icon:empty {
    display: none;
}

.m-dialog__title {
    flex: 1 1 auto;
    font-weight: 600;
    font-size: 1.05rem;
}

.m-dialog .a-divider {
    display: none;
}

.m-dialog__content {
    padding: 1rem 1.25rem 0.5rem;
}

.m-dialog__headline:empty {
    display: none;
}

.m-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 0 0.75rem;
}

.m-dialog__actions:empty {
    display: none;
}

.dialog-close-btn {
    border-radius: 50% !important;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dialog-close-btn:hover {
    background: #f1f3f5 !important;
}

/* ---------- Fusszeile: am Tablet und Smartphone in einer Zeile ---------- */
@media (max-width: 1199.98px) {
    .footer .footer-left,
    .footer .footer-right {
        flex: 0 1 auto !important;
        white-space: nowrap;
    }

    .footer .footer-link {
        margin-left: 0.9rem !important;
    }

    .footer .footer-left .footer-link {
        margin-left: 0 !important;
    }
}

@media (max-width: 699.98px) {
    /* schmal: der Verweis auf die Website entfaellt, die Pflicht-Links bleiben */
    .footer .footer-left {
        display: none !important;
    }

    .footer {
        justify-content: center !important;
        font-size: 0.8rem !important;
    }

    .footer .footer-link:first-child {
        margin-left: 0 !important;
    }
}

/* JW261111 Die Ticketnummer bricht nicht mitten in der Zahl um */
.rwp-mn-liste td:nth-child(2) {
    white-space: nowrap;
    overflow-wrap: normal;
}

/* ---------- Glocke: Neuigkeiten fuer Mitarbeiter ----------
   JW261111 neue Tickets und offene Kundenkommentare, nur Rolle RWP */
.rwp-glocke {
    position: relative;
    margin-right: 0.6rem;
}

.rwp-glocke-knopf {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #ced4da;
    background: white;
    color: #495057;
    font-size: 1.15rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rwp-glocke-knopf:hover {
    border-color: #86b7fe;
    color: #0d6efd;
}

.rwp-glocke-zahl {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc3545;
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

.rwp-glocke-liste {
    position: absolute;
    right: 0;
    top: 46px;
    width: min(420px, 92vw);
    max-height: min(560px, calc(100vh - 140px));
    overflow-y: auto;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    z-index: 1100;
}

.rwp-glocke-kopf {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    background: white;
    font-size: 0.85rem;
}

.rwp-glocke-leer {
    padding: 1rem 0.9rem;
    color: #6c757d;
}

.rwp-glocke-eintrag {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.9rem;
    border: none;
    border-bottom: 1px solid #f1f3f5;
    border-left: 4px solid transparent;
    background: white;
    color: #212529;
    font-size: 0.9rem;
    min-height: 0;
}

.rwp-glocke-eintrag:hover {
    background: #f1f6ff;
}

.rwp-glocke-eintrag.neu {
    border-left-color: #dc3545;
    background: #fff8f8;
}

.rwp-glocke-zeile {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Kopfzeile im Tablet-Hochformat ----------
   JW261111 Mit Glocke und Benutzermenue passt die Kopfzeile unter 900px nicht mehr in eine Zeile: Titel kleiner,
   Abstaende enger, die Suche zeigt nur noch die Lupe. */
@media (max-width: 899.98px) {
    .rwp-nav-titel {
        margin-left: 8px !important;
    }

    .rwp-nav-titel .app-title {
        font-size: 0.9rem !important;
        letter-spacing: 0 !important;
    }

    nav.navbar .container-fluid {
        padding-left: 0.25rem !important;
        padding-right: 0 !important;
    }

    .rwp-nav-knoepfe {
        margin-left: 0.5rem !important;
        margin-right: 0.35rem !important;
    }

    .rwp-nav-link {
        margin-right: 0.55rem !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .rwp-nav-knoepfe > .btn-outline-secondary > span.ms-1 {
        display: none;
    }

    .rwp-nav-knoepfe > .btn {
        margin-left: 0.25rem !important;
        margin-right: 0.25rem !important;
    }

    .rwp-glocke {
        margin-right: 0.35rem;
    }

    .rwp-benutzer {
        margin-right: 0.35rem;
    }
}

/* ---------- Zwei-Faktor-Anmeldung ----------
   JW261111 QR-Code, Code-Feld und Ersatzcodes */
.rwp-qr {
    display: flex;
    justify-content: center;
    margin: 0.4rem 0 0.6rem;
}

.rwp-qr svg {
    width: 200px;
    height: 200px;
}

.rwp-schritte {
    padding-left: 1.2rem;
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
}

.rwp-schritte li {
    margin-bottom: 0.3rem;
}

.rwp-code {
    text-align: center;
    font-size: 1.6rem !important;
    letter-spacing: 0.35rem;
    font-variant-numeric: tabular-nums;
    max-width: 260px;
    margin: 0 auto;
}

.rwp-ersatzcodes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 1rem;
    padding: 0.8rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    font-family: Consolas, "Courier New", monospace;
    font-size: 1.05rem;
    text-align: center;
    max-width: 380px;
    margin: 0 auto;
}

/* ---------- Bestaetigung und Leerzustand ----------
   JW261116 Bestaetigung nach dem Anlegen eines Tickets (CreateStoerung) und leere Ticketliste (ListMnView):
   Symbol im Kreis, Ueberschrift, Erklaerung, Knoepfe. */
.rwp-bestaetigung,
.rwp-leer {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
}

.rwp-leer {
    border: 1px dashed #ced4da;
    border-radius: 0.75rem;
    background: #fafbfc;
    margin: 1rem 0;
}

.rwp-bestaetigung-symbol,
.rwp-leer-symbol {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
}

.rwp-bestaetigung-symbol {
    background: #d1e7dd;
    color: #0f5132;
}

.rwp-bestaetigung-symbol.warn {
    background: #fff3cd;
    color: #664d03;
}

.rwp-leer-symbol {
    background: #e9ecef;
    color: #6c757d;
}

.rwp-bestaetigung p,
.rwp-leer p {
    max-width: 520px;
    margin: 0 auto 1.2rem;
}

/* ---------- Textbausteine ----------
   JW261116 Auswahlliste am Mailtext und am Eintrag zur Vorgangsbearbeitung (Komponente TextbausteinAuswahl)
   und das Formular der Seite Textbausteine */
.rwp-tb {
    position: relative;
}

/* unsichtbare Flaeche hinter der Liste: ein Klick daneben schliesst sie */
.rwp-tb-hinten {
    position: fixed;
    inset: 0;
    z-index: 1090;
}

.rwp-tb-liste {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: min(460px, 92vw);
    max-height: min(440px, calc(100vh - 220px));
    overflow-y: auto;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    z-index: 1100;
    text-align: left;
}

.rwp-tb-kopf {
    position: sticky;
    top: 0;
    background: white;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    z-index: 1;
}

.rwp-tb-gruppe {
    padding: 0.45rem 0.9rem 0.2rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6c757d;
}

h6.rwp-tb-gruppe {
    padding-left: 0;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.35rem;
    margin-bottom: 0;
}

.rwp-tb-eintrag {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.9rem;
    border: none;
    background: white;
    color: #212529;
    font-size: 0.9rem;
    min-height: 0;
}

.rwp-tb-eintrag:hover,
.rwp-tb-eintrag:focus-visible {
    background: #eef4ff;
}

.rwp-tb-zeile {
    color: #6c757d;
    font-size: 0.83rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rwp-tb-leer {
    padding: 0.9rem;
    color: #6c757d;
}

.rwp-tb-fuss {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.9rem;
    margin-top: 0.3rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    font-size: 0.85rem;
}

.rwp-tb-fuss .btn-link,
.rwp-tb-fuss a {
    font-size: 0.85rem;
    text-decoration: none;
    min-height: 0 !important;
    min-width: 0 !important;
}

.rwp-tb-formular {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem 1.1rem;
}

/* ==========================================================================================================
   JW261116 Smartphone (unter 700px): die Ticketliste als Karten statt als Tabelle
   ==========================================================================================================
   Die Tabelle in ListMnView bleibt wie sie ist; hier wird nur ihre Darstellung umgestellt. Jede Zeile wird zu
   einer Karte:
       Ticket 12345                      [Status]
       erste Zeile der Beschreibung (hoechstens zwei Zeilen)
       Kunde
       Prio   Geaendert TT.MM.JJJJ       [Knoepfe]
   Spalten der Tabelle: 1 Knoepfe, 2 Ticket, 3 Kunde, 4 Melder, 5 Status, 6 Prio, 7 Meldung am, 8 Letzte Aenderung,
   9 Kategorie, 10 Beschreibung. Melder, Meldung am und Kategorie blendet schon tablet.css aus; sie stehen in der
   Detailansicht. Sortieren ueber die Spaltenkoepfe gibt es in der Karten-Ansicht nicht (der Kopf ist ausgeblendet). */
@media (max-width: 699.98px) {
    .rwp-mn-liste,
    .rwp-mn-liste > tbody {
        display: block;
        width: 100%;
    }

    .rwp-mn-liste > thead {
        display: none;
    }

    .rwp-mn-liste > tbody > tr {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "nr     status status"
            "text   text   text"
            "kunde  kunde  kunde"
            "prio   datum  knoepfe";
        column-gap: 0.6rem;
        row-gap: 0.2rem;
        align-items: center;
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 0.6rem;
        padding: 0.65rem 0.8rem 0.45rem;
        margin-bottom: 0.6rem;
    }

    .rwp-mn-liste > tbody > tr:active {
        background: #eef4ff;
    }

    /* Zellen ohne Tabellen-Aussehen (Linien, Streifen, Abstaende) */
    .rwp-mn-liste > tbody > tr > td,
    .rwp-mn-liste > tbody > tr.rwp-zeile:hover > td {
        display: block;
        min-width: 0;
        padding: 0 !important;
        border: none !important;
        background: none !important;
        box-shadow: none !important;
    }

    .rwp-mn-liste > tbody > tr > td:nth-child(2) {
        grid-area: nr;
        font-weight: 600;
        font-size: 1.05rem;
    }

    .rwp-mn-liste > tbody > tr > td:nth-child(5) {
        grid-area: status;
        justify-self: end;
        text-align: right;
    }

    /* lange Statustexte duerfen in der Marke umbrechen, statt die Ticketnummer zu ueberdecken */
    .rwp-mn-liste > tbody > tr > td:nth-child(5) a {
        white-space: normal;
    }

    /* Beschreibung: hoechstens zwei Zeilen */
    .rwp-mn-liste > tbody > tr > td:nth-child(10) {
        grid-area: text;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-top: 0.15rem;
    }

    .rwp-mn-liste > tbody > tr > td:nth-child(3) {
        grid-area: kunde;
        color: #6c757d;
        font-size: 0.88rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rwp-mn-liste > tbody > tr > td:nth-child(6) {
        grid-area: prio;
        font-size: 0.88rem;
    }

    /* "Letzte Aenderung": unter 900px sonst ausgeblendet (tablet.css), in der Karte wieder sichtbar */
    .rwp-mn-liste > tbody > tr > td:nth-child(8) {
        grid-area: datum;
        display: block;
        color: #6c757d;
        font-size: 0.88rem;
        white-space: nowrap;
    }

    .rwp-mn-liste > tbody > tr > td:nth-child(6) {
        white-space: nowrap;
    }

    .rwp-mn-liste > tbody > tr > td:nth-child(8):not(:empty)::before {
        content: "Ge\00e4ndert ";
    }

    .rwp-mn-liste > tbody > tr > td:nth-child(1) {
        grid-area: knoepfe;
        justify-self: end;
    }

    .rwp-mn-liste > tbody > tr > td:nth-child(1) .btn {
        margin: 0 0 0 0.25rem !important;
    }

    /* Filter: Von / Bis nebeneinander, die Auswahlfelder ueber die ganze Breite */
    .sticky-filter > .col-auto {
        flex: 1 1 42%;
        min-width: 0;
        margin-bottom: 0.4rem;
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }

    .sticky-filter > .col-auto input[type="date"] {
        padding-left: 0.5rem;
        padding-right: 0.4rem;
    }

    /* Kopfzeile: der Schriftzug entfaellt (ausser auf der Anmeldeseite), "Tickets" fuehrt zur Uebersicht. Reichen die
       Bereiche und Knoepfe der Mitarbeiter nicht in die Breite, laesst sich dieser Teil seitlich wischen; Glocke und
       Benutzermenue bleiben rechts stehen. */
    .rwp-nav-titel:has(~ .container-fluid .rwp-nav-knoepfe) {
        display: none !important;
    }

    nav.navbar .container-fluid {
        min-width: 0;
    }

    .rwp-nav-knoepfe {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        margin-left: 0.25rem !important;
    }

    .rwp-nav-knoepfe > * {
        flex: 0 0 auto;
    }

    .rwp-nav-knoepfe > .rwp-nav-luecke {
        flex: 1 0 0.25rem;
    }

    .sticky-filter > .col-auto:has(> select) {
        flex: 1 1 100%;
    }

    .sticky-filter > .col-auto select {
        max-width: none !important;
    }

    .sticky-filter > .col-auto.rwp-chip,
    .sticky-filter > .col-auto:has(> button) {
        flex: 0 0 auto;
        margin-top: 0 !important;
        margin-right: 0 !important;
    }

    .sticky-filter > h3 {
        font-size: 1.3rem;
    }
}
