/* ==========================================================================
   REEFMANAGER E-MAIL REPORTER - STYLESHEET (V5.3 BALANCED GLASS THEME)
   Vollständig mobil-optimiert: maximale Screen-Ausnutzung, 4px Blur, White Glow
   ========================================================================== */

/* Haupt-Container & Hero */
.reporter-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.8rem 0.4rem;
}

.reporter-hero {
    text-align: center;
    padding: 1.8rem 1.2rem;
    margin-bottom: 1.4rem;
    background: var(--glass-bg, rgba(4, 6, 12, 0.68));
    border: 2px solid var(--glass-border, rgba(255, 255, 255, 0.55));
    border-radius: var(--radius-lg, 20px);
    box-shadow: var(--glass-shadow, 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 255, 255, 0.12));
    backdrop-filter: blur(var(--card-blur, 4px));
    -webkit-backdrop-filter: blur(var(--card-blur, 4px));
}

.reporter-hero h1 {
    font-size: 2rem;
    color: #ffffff;
    margin-bottom: 0.4rem;
    line-height: 1.25;
}

.reporter-hero .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    color: #ffffff;
    border-radius: var(--radius-full, 50px);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

.reporter-hero p {
    color: #cbd5e1;
    font-size: 0.92rem;
    max-width: 680px;
    margin: 0 auto 0.9rem auto;
    line-height: 1.5;
}

/* User Account Info Bar */
.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    background: var(--inner-glass-bg, rgba(2, 4, 8, 0.42));
    border: 1.5px solid var(--glass-border, rgba(255, 255, 255, 0.3));
    border-radius: var(--radius-md, 14px);
    padding: 0.55rem 1rem;
    margin-top: 0.9rem;
}

.user-info-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #e2e8f0;
}

.user-email-badge {
    color: #ffffff;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.2px solid rgba(255, 255, 255, 0.25);
    color: #cbd5e1;
    border-radius: var(--radius-full, 50px);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-logout:hover {
    background: #ffffff;
    color: #050508;
    border-color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

/* Umschalt-Button für Breite Ansicht */
.btn-wide-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.2px solid rgba(255, 255, 255, 0.28);
    color: #cbd5e1;
    border-radius: var(--radius-full, 50px);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-wide-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #00d2ff;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.35);
}

.btn-wide-toggle.active {
    background: rgba(0, 210, 255, 0.16);
    border-color: #00d2ff;
    color: #38bdf8;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.4);
}

:root {
    --wide-optimal-width: 1780px;
}

/* =========================================================================
   BREITE ANSICHT (NUR SO BREIT WIE FÜR NEBENEINANDER-DARSTELLUNG BENÖTIGT)
   ========================================================================= */
body#page-reporter.wide-view {
    overflow-x: auto;
}

/* Skaliert nicht unkontrolliert auf die gesamte Bildschirmbreite (z.B. bei 2K/4K/Ultrawide),
   sondern öffnet sich exakt auf die für die Geräte nebeneinander benötigte Breite */
body#page-reporter.wide-view main.container,
body#page-reporter.wide-view .reporter-container {
    max-width: min(var(--wide-optimal-width, 1780px), calc(100vw - 32px)) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    transition: max-width 0.3s ease;
}

body#page-reporter.wide-view .reporter-hero,
body#page-reporter.wide-view .reporter-card {
    max-width: 100% !important;
    width: 100% !important;
}

body#page-reporter.wide-view .device-sections-wrapper {
    max-width: 100% !important;
    width: 100% !important;
}

/* Kartenraster in der breiten Ansicht:
   Alternative: grid-auto-flow: column mit horizontalem Scroll. Das hier genutzte
   auto-fill mit minmax(250px, 1fr) nutzt den optimal berechneten Raum exakt so aus,
   dass alle typgleichen Geräte nebeneinander in einer Zeile stehen */
body#page-reporter.wide-view .device-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.85rem;
}

body#page-reporter.wide-view .device-card {
    padding: 0.85rem 0.95rem;
}

/* =========================================================================
   KACHELN & WIDGETS
   ========================================================================= */
.reporter-card {
    background: var(--glass-bg, rgba(4, 6, 12, 0.68));
    border: 2px solid var(--glass-border, rgba(255, 255, 255, 0.55));
    border-radius: var(--radius-lg, 20px);
    box-shadow: var(--glass-shadow, 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 255, 255, 0.12));
    backdrop-filter: blur(var(--card-blur, 4px));
    -webkit-backdrop-filter: blur(var(--card-blur, 4px));
    padding: 1.2rem;
    margin-bottom: 1.4rem;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.reporter-card:hover {
    background: var(--glass-bg-hover, rgba(8, 14, 26, 0.82));
    border-color: var(--glass-border-hover, #ffffff);
    box-shadow: var(--glass-shadow-hover, 0 20px 45px rgba(0, 0, 0, 0.9), 0 0 25px rgba(255, 255, 255, 0.35));
}

.card-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
}

.card-header-bar h2,
.card-header-bar h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

/* =========================================================================
   GERÄTE-BEREICHE (NACH TYP) & GERÄTE-GRID
   ========================================================================= */
.device-sections-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.device-category-group {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.65rem;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
}

.category-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon-bubble {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00d2ff;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.category-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.category-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.2px;
}

.category-subtitle {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 500;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 3px 10px;
    border-radius: 20px;
}

.cat-mini-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.cat-mini-dot.online {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.cat-mini-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

.counter-online {
    color: #34d399;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.counter-offline {
    color: #f87171;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 640px) {
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
    gap: 0.9rem;
}

.device-card {
    background: var(--inner-glass-bg, rgba(2, 4, 8, 0.42));
    border: 1.5px solid var(--glass-border, rgba(255, 255, 255, 0.45));
    border-radius: var(--radius-md, 14px);
    padding: 0.95rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s ease;
    backdrop-filter: blur(var(--card-blur, 4px));
    -webkit-backdrop-filter: blur(var(--card-blur, 4px));
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 255, 255, 0.06);
    box-sizing: border-box;
}

.device-card:hover {
    background: var(--inner-glass-bg-hover, rgba(6, 10, 18, 0.65));
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75), 0 0 20px rgba(255, 255, 255, 0.25);
}

.device-card.is-muted {
    opacity: 0.85;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.35);
}

.device-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 0.6rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.device-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 2px;
}

.device-mac {
    font-size: 0.72rem;
    color: #94a3b8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.device-type-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 1px 5px;
    height: 17px;
    box-sizing: border-box;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1;
}

.mute-indicator-tag {
    font-size: 0.6rem;
    color: #cbd5e1;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 4px;
    height: 17px;
    box-sizing: border-box;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1;
}

/* Flacheres, kompaktes Status-Badge */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 7px;
    height: 20px;
    box-sizing: border-box;
    border-radius: var(--radius-full, 50px);
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transition: all 0.25s ease;
}

/* Leuchtender grüner Punkt bei Online */
.status-pill.online {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.45);
    color: #6ee7b7;
}

.status-pill.online .pulse-dot,
.online .pulse-dot {
    background: #10b981;
    box-shadow: 0 0 7px #10b981, 0 0 14px rgba(16, 185, 129, 0.85);
    animation: statusPulseGlowGreen 2s infinite ease-in-out;
}

/* Leuchtender roter Punkt bei Offline */
.status-pill.offline {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

.status-pill.offline .pulse-dot,
.offline .pulse-dot {
    background: #ef4444;
    box-shadow: 0 0 7px #ef4444, 0 0 14px rgba(239, 68, 68, 0.85);
    animation: statusPulseGlowRed 2.2s infinite ease-in-out;
}

/* Verzögert (Delayed) */
.status-pill.delayed {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fde68a;
}

.status-pill.delayed .pulse-dot,
.delayed .pulse-dot {
    background: #f59e0b;
    box-shadow: 0 0 7px #f59e0b, 0 0 12px rgba(245, 158, 11, 0.7);
    animation: statusPulseGlowAmber 2s infinite ease-in-out;
}

/* Keine Daten (No Data) */
.status-pill.no_data {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.25);
    color: #94a3b8;
}

.status-pill.no_data .pulse-dot,
.no_data .pulse-dot {
    background: #94a3b8;
    box-shadow: 0 0 4px rgba(148, 163, 184, 0.5);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    display: inline-block;
    flex-shrink: 0;
}

@keyframes statusPulseGlowGreen {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 6px #10b981, 0 0 12px rgba(16, 185, 129, 0.65);
        opacity: 1;
    }
    50% {
        transform: scale(1.22);
        box-shadow: 0 0 10px #10b981, 0 0 20px rgba(16, 185, 129, 0.95);
        opacity: 0.85;
    }
}

@keyframes statusPulseGlowRed {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 6px #ef4444, 0 0 12px rgba(239, 68, 68, 0.65);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 10px #ef4444, 0 0 18px rgba(239, 68, 68, 0.9);
        opacity: 0.85;
    }
}

@keyframes statusPulseGlowAmber {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 5px #f59e0b, 0 0 10px rgba(245, 158, 11, 0.5);
    }
    50% {
        transform: scale(1.18);
        box-shadow: 0 0 8px #f59e0b, 0 0 15px rgba(245, 158, 11, 0.85);
    }
}

.device-metrics {
    list-style: none;
    padding: 0;
    margin: 0 0 0.7rem 0;
}

.device-metrics li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.device-metrics li:last-child {
    border-bottom: none;
}

.metric-label {
    color: #94a3b8;
    font-size: 0.78rem;
}

.metric-value {
    color: #f8fafc;
    font-weight: 600;
    font-size: 0.8rem;
}

.btn-mute-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    padding: 2px 7px;
    border-radius: var(--radius-full, 50px);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-mute-toggle:hover {
    background: #ffffff;
    color: #050508;
    border-color: #ffffff;
}

.btn-mute-toggle.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.device-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding-top: 0.55rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
}

.device-actions-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.btn-icon-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    padding: 3px 8px;
    border-radius: var(--radius-full, 50px);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
}

.btn-icon-action:hover {
    background: #ffffff;
    color: #050508;
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}

.device-card.device-card-focus {
    border-color: rgba(56, 189, 248, 0.9) !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.45), 0 0 24px rgba(56, 189, 248, 0.35) !important;
}

.btn-delete-device {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #94a3b8;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-device:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.5);
}

/* =========================================================================
   STANDARD BUTTONS (BALANCED GLASS & WHITE GLOW DESIGN)
   ========================================================================= */
.btn-outline-glass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--glass-border, rgba(255, 255, 255, 0.35));
    color: #f1f5f9;
    border-radius: var(--radius-full, 50px);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(var(--card-blur, 4px));
    -webkit-backdrop-filter: blur(var(--card-blur, 4px));
}

.btn-outline-glass:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-outline-glass:active {
    transform: translateY(0);
}

.btn-outline-glass.active {
    background: rgba(0, 210, 255, 0.18);
    border-color: #00d2ff;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.35);
    font-weight: 700;
}

.btn-primary-white {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    color: #050508 !important;
    border: 1.5px solid #ffffff;
    border-radius: var(--radius-full, 50px);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    user-select: none;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-primary-white:hover {
    background: #e2e8f0;
    border-color: #ffffff;
    color: #000000 !important;
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.5), 0 6px 16px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.btn-primary-white:active {
    transform: translateY(0);
}

.btn-primary-white:disabled,
.btn-outline-glass:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* =========================================================================
   FORMULARE, INPUTS & SWITCHES
   ========================================================================= */
.form-control {
    width: 100%;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1.5px solid var(--glass-border, rgba(255, 255, 255, 0.45));
    border-radius: 8px;
    font-size: 0.88rem;
    outline: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

select.form-control,
select {
    background-color: #050508 !important;
    color: #ffffff !important;
    cursor: pointer;
    border: 1.5px solid rgba(255, 255, 255, 0.45) !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 14px !important;
    padding-right: 28px !important;
}

.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1.5px solid var(--glass-border, rgba(255, 255, 255, 0.4));
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: rgba(255, 255, 255, 0.8);
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    border-color: #ffffff;
    background-color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: #050508;
}

/* Modals */
.rm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-sizing: border-box;
}

.rm-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.rm-modal-box {
    background: rgba(6, 8, 14, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg, 20px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 25px rgba(255, 255, 255, 0.12);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

.rm-modal-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.rm-modal-close:hover {
    color: #050508;
    background: #ffffff;
}

.rm-modal-body {
    padding: 1rem 1.2rem;
    overflow-y: auto;
    flex: 1;
}

.rm-log-box {
    background: rgba(0, 0, 0, 0.65);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: #cbd5e1;
    white-space: pre-wrap;
    max-height: 180px;
    overflow-y: auto;
    margin-top: 0.4rem;
    line-height: 1.4;
}

/* ==========================================================================
   MAXIMALE MOBILE OPTIMIERUNG (FULL-SCREEN, MINIMALE PADDINGS)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Haupt-Container Ränder eliminieren */
    body#page-reporter .container,
    body#page-reporter main.container {
        padding-left: 6px !important;
        padding-right: 6px !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .reporter-container {
        padding: 0.2rem 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* 2. Hero & Header extrem kompakt */
    .reporter-hero {
        padding: 0.9rem 0.6rem !important;
        margin-bottom: 0.65rem !important;
        border-radius: 12px !important;
    }

    .reporter-hero h1 {
        font-size: 1.35rem !important;
        margin-bottom: 0.2rem !important;
    }

    .reporter-hero p {
        font-size: 0.82rem !important;
        margin-bottom: 0.6rem !important;
    }

    .user-bar {
        padding: 0.45rem 0.65rem !important;
        margin-top: 0.6rem !important;
    }

    /* 3. Cards voll ausnutzen */
    .reporter-card {
        padding: 0.8rem 0.6rem !important;
        margin-bottom: 0.65rem !important;
        border-radius: 12px !important;
    }

    .card-header-bar {
        margin-bottom: 0.65rem !important;
        padding-bottom: 0.45rem !important;
    }

    .card-header-bar h2, 
    .card-header-bar h3 {
        font-size: 1.02rem !important;
    }

    /* 4. Gerätekarten auf Mobile */
    .device-grid {
        grid-template-columns: 1fr !important;
        gap: 0.55rem !important;
    }

    .device-card {
        padding: 0.75rem 0.65rem !important;
        border-radius: 10px !important;
    }

    .device-title {
        font-size: 0.95rem !important;
    }

    .device-metrics li {
        padding: 2.5px 0 !important;
        font-size: 0.78rem !important;
    }

    /* Action Buttons auf Mobile flexibel nebeneinander (Umbruch nur bei Bedarf) */
    .device-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        padding-top: 0.5rem !important;
    }

    .device-actions-group {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .device-actions .btn-icon-action {
        flex: 1 1 auto !important;
        justify-content: center !important;
        padding: 5px 10px !important;
        font-size: 0.74rem !important;
    }

    /* 5. Modals für Full-Screen-Nutzung */
    .rm-modal-overlay {
        padding: 0.2rem !important;
    }

    .rm-modal-box {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 96vh !important;
        border-radius: 12px !important;
    }

    .rm-modal-header {
        padding: 0.7rem 0.8rem !important;
    }

    .rm-modal-body {
        padding: 0.8rem 0.6rem !important;
    }

    /* Modul-Tabs im Fernwartungs-Modal auf Mobile */
    .remote-tab-bar {
        gap: 6px !important;
    }

    .remote-tab-bar .btn-outline-glass {
        flex: 1 1 auto;
        padding: 6px 10px !important;
        font-size: 0.76rem !important;
        gap: 5px !important;
    }
}