/* Einsatzzentrale Light — eigenständiges, schlankes Layout (Karte + Fälle + Chat). */

.el-html,
.el-body {
    height: 100%;
    margin: 0;
}

.el-body {
    overflow: hidden;
    font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #e8e8ea;
    color: #1c2430;
}

main#member-main.el-page-main.page-wrap {
    max-width: none;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.el-page-main.page-wrap {
    max-width: none;
    margin: 0;
    padding: 0;
}

.el-command-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
    background: #ececee;
}

/* Topbar — Malteserrot wie Einsatzzentrale V2 */
.el-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 10px 20px;
    background: #c00;
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.el-topbar__start {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.el-topbar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.el-topbar__logo-img {
    height: 40px;
    width: 40px;
    max-width: 44px;
    max-height: 44px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.el-topbar__titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
    min-width: 0;
}

.el-topbar__title {
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.el-topbar__subtitle {
    font-size: 11px;
    opacity: 0.88;
    font-weight: 500;
}

.el-topbar__status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 18px;
    font-size: 13px;
    font-weight: 600;
}

/* Hamburger nur mobil; Desktop: Sidebar-Toggle */
.el-topbar .member-portal-menu-btn {
    display: none;
}

@media (max-width: 899px) {
    .el-topbar .member-portal-menu-btn {
        display: inline-flex;
    }
}

.el-portal-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}

.el-portal-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.22);
}

.el-portal-sidebar-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.el-portal-sidebar-toggle__icon::before {
    content: "‹";
    font-size: 22px;
    line-height: 1;
    font-weight: 300;
    display: block;
    margin-top: -2px;
}

.el-workspace--portal.el-portal-sidebar--collapsed .el-portal-sidebar-toggle__icon::before {
    content: "›";
}

@media (min-width: 900px) {
    .el-portal-sidebar-toggle {
        display: inline-flex;
    }

    .el-workspace--portal .member-portal-sidebar {
        transition:
            width 0.22s ease,
            min-width 0.22s ease,
            opacity 0.18s ease,
            border-color 0.2s ease;
    }

    .el-workspace--portal.el-portal-sidebar--collapsed .member-portal-sidebar {
        width: 0 !important;
        min-width: 0;
        padding-left: 0;
        padding-right: 0;
        border-right-width: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
    }
}

@media (max-width: 899px) {
    .el-workspace--portal .member-portal-sidebar {
        padding-top: 0;
        z-index: 1060;
    }

    .el-command-center .member-portal-nav-backdrop {
        z-index: 1055;
    }
}

.el-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    opacity: 0.95;
}

.el-operator__name {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.95;
}

.el-topbar__logout {
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: transparent;
    color: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 600;
}

.el-topbar__logout:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Live-Indikator */
.el-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.16);
}

.el-live__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ffd166;
}

.el-live--ok .el-live__dot {
    background: #36d399;
}

.el-live--offline .el-live__dot {
    background: #ff6b6b;
}

/* Workspace */
.el-workspace {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
    position: relative;
}

.el-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 16px;
    gap: 14px;
    overflow: auto;
}

/* Stats */
.el-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.el-stat {
    background: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(20, 30, 45, 0.08);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.el-stat--accent {
    border-left: 4px solid #c81e36;
}

.el-stat__value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.el-stat__label {
    font-size: 0.78rem;
    color: #5a6573;
}

/* Split: Karte + Seitenleiste */
.el-split {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 14px;
    min-height: 0;
}

.el-map-stage {
    position: relative;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(20, 30, 45, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 420px;
}

.el-map {
    flex: 1;
    min-height: 360px;
}

.el-map-note {
    margin: 0;
    padding: 6px 12px;
    font-size: 0.72rem;
    color: #6b7480;
    background: #f7f8fa;
    border-top: 1px solid #e6e9ee;
}

.el-plane-icon.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

.el-plane-marker {
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: 50% 50%;
    line-height: 0;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}

.el-plane-marker__img {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
    pointer-events: none;
}

/* Seitenleiste */
.el-side {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(20, 30, 45, 0.08);
    min-height: 0;
    overflow: hidden;
}

.el-side__head {
    padding: 12px 14px;
    border-bottom: 1px solid #eceff3;
}

.el-side__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.el-side__hint {
    font-size: 0.72rem;
    color: #6b7480;
}

.el-missions {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.el-empty {
    color: #6b7480;
    font-size: 0.85rem;
    padding: 20px 8px;
    text-align: center;
}

/* Karte (Fall) */
.el-card {
    border: 1px solid #e6e9ee;
    border-radius: 12px;
    padding: 12px;
    background: #fbfcfe;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.el-card__top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.el-card__dismiss-btn {
    margin-left: auto;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 1px solid #d8dee6;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.el-card__dismiss-btn:hover {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.el-card__nr {
    font-weight: 800;
    font-size: 0.95rem;
}

.el-card__route {
    font-weight: 600;
    color: #1f2a37;
}

.el-card__phase {
    font-size: 0.8rem;
    color: #335;
    font-weight: 600;
}

.el-card__status {
    font-size: 0.82rem;
    color: #334155;
    line-height: 1.35;
    margin-top: 2px;
}

.el-card__status strong {
    font-weight: 600;
    color: #1e293b;
}

.el-card__eta {
    font-size: 0.8rem;
    color: #0a6b3c;
    font-weight: 600;
}

.el-card__crew,
.el-card__meta {
    font-size: 0.78rem;
    color: #5a6573;
}

.el-card__crew-label {
    font-weight: 700;
    color: #444;
}

.el-card__chat-badge {
    color: #c81e36;
    font-weight: 800;
}

.el-card__chat-btn {
    align-self: flex-start;
    margin-top: 4px;
    border: 1px solid #c81e36;
    color: #c81e36;
    background: #fff;
    border-radius: 8px;
    padding: 5px 12px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
}

.el-card__chat-btn:hover {
    background: #c81e36;
    color: #fff;
}

/* Pills */
.el-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.el-pill--ok {
    background: #e2f7ec;
    color: #0a6b3c;
}

.el-pill--warn {
    background: #fff3d6;
    color: #8a5a00;
}

.el-pill--idle {
    background: #eef1f5;
    color: #6b7480;
}

/* Chat-Overlay */
.el-chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 22, 33, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

/* Wichtig: das HTML-Attribut `hidden` muss die display:flex-Regel schlagen,
   sonst ist das Chat-Overlay dauerhaft sichtbar. */
.el-chat-overlay[hidden] {
    display: none;
}

.el-chat-card {
    width: min(560px, 100%);
    max-height: 86vh;
    background: #fff;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(15, 22, 33, 0.4);
}

.el-chat-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 16px;
    background: #c00;
    color: #fff;
}

.el-chat-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.el-chat-sub {
    font-size: 0.78rem;
    opacity: 0.88;
}

.el-chat-close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}

.el-chat-privacy {
    margin: 0;
    padding: 8px 16px;
    font-size: 0.72rem;
    color: #6b7480;
    background: #f7f8fa;
    border-bottom: 1px solid #eceff3;
}

.el-chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f4f6f9;
}

.el-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.88rem;
}

.el-msg--ez {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e6e9ee;
}

.el-msg--crew {
    align-self: flex-end;
    background: rgba(200, 30, 54, 0.12);
}

.el-msg__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.68rem;
    color: #6b7480;
    margin-bottom: 3px;
}

.el-msg__meta-line {
    flex: 1 1 auto;
    min-width: 0;
}

.el-msg__read-receipt {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: #4b5563;
    opacity: 0.92;
}

.el-msg__read-receipt__icon {
    width: 1.1em;
    height: 1.1em;
    vertical-align: middle;
}

.el-msg__time {
    opacity: 0.8;
}

.el-msg__body {
    white-space: pre-wrap;
    word-break: break-word;
}

.el-chat-compose {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eceff3;
}

.el-chat-input {
    flex: 1;
    resize: vertical;
    border: 1px solid #cfd6df;
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
}

.el-chat-send {
    align-self: stretch;
    border: none;
    background: #c81e36;
    color: #fff;
    border-radius: 10px;
    padding: 0 18px;
    font-weight: 700;
    cursor: pointer;
}

.el-chat-send:disabled {
    opacity: 0.6;
    cursor: default;
}

.el-chat-error {
    margin: 0;
    padding: 0 16px 12px;
    color: #c81e36;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 900px) {
    .el-split {
        grid-template-columns: minmax(0, 1fr);
    }
    .el-side {
        min-height: 320px;
    }
}
