/* EODMap layout: topbar + toolbar + map | stats */

@font-face {
    font-family: "Furore";
    src: url("../fonts/Furore.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    display: flex;
    flex-direction: column;
    background: #1a1c1e;
    color: #676663;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.app-topbar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 1rem;
    background: #0e1012;
    border-bottom: 1px solid #2e3338;
    z-index: 21;
}

.app-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    grid-column: 1;
}

.app-logo {
    height: 40px;
    width: auto;
    display: block;
}

.app-title {
    grid-column: 2;
    margin: 0;
    justify-self: center;
    font-family: "Furore", sans-serif;
    font-size: clamp(1.05rem, 2.4vw, 1.55rem);
    font-weight: normal;
    letter-spacing: 0.02em;
    color: #ebd500;
    text-align: center;
    line-height: 1.15;
}

.app-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(180deg, #24282c 0%, #1a1c1e 100%);
    border-bottom: 1px solid #3a3f45;
    z-index: 20;
}

.active-only-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: #c8cdd3;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.active-only-wrap input {
    width: 1rem;
    height: 1rem;
    accent-color: #ebd500;
    cursor: pointer;
}

.area-select-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.area-select-label {
    font-size: 0.8rem;
    color: #a8adb4;
    white-space: nowrap;
}

.area-select {
    flex: 1 1 280px;
    max-width: 480px;
    min-width: 160px;
    padding: 0.45rem 0.65rem;
    border: 1px solid #4a5058;
    border-radius: 6px;
    background: #121416;
    color: #f2f0ea;
    font-size: 0.95rem;
}

.area-select:disabled {
    opacity: 0.6;
}

.user-label {
    font-size: 0.8rem;
    color: #8b929a;
    white-space: nowrap;
}

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

.map-pane {
    flex: 1 1 62%;
    position: relative;
    min-width: 0;
}

.map-pane #map {
    width: 100%;
    height: 100%;
}

.stats-panel {
    flex: 0 0 min(380px, 38%);
    max-width: 420px;
    overflow: auto;
    background: #141618;
    border-left: 1px solid #3a3f45;
    padding: 1rem 1.1rem 1.5rem;
}

.stats-empty {
    color: #8b929a;
    font-size: 0.95rem;
    padding: 1rem 0;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.75rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #2a2e33;
}

.stats-row dt {
    color: #8b929a;
    font-size: 0.78rem;
}

.stats-row dd {
    margin: 0;
    font-size: 0.9rem;
    color: #f2f0ea;
    text-align: right;
    word-break: break-word;
}

.stats-eod {
    margin-top: 1.25rem;
}

.stats-eod-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: #ebd500;
}

.stats-eod-empty {
    color: #8b929a;
    font-size: 0.9rem;
}

.stats-eod-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.stats-eod-table th,
.stats-eod-table td {
    padding: 0.35rem 0.25rem;
    border-bottom: 1px solid #2a2e33;
    text-align: left;
}

.stats-eod-table th {
    color: #8b929a;
    font-weight: 500;
}

.stats-eod-goto {
    background: transparent;
    border: 1px solid #ebd500;
    color: #ebd500;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.72rem;
    cursor: pointer;
}

.stats-eod-goto:hover {
    background: #ebd50022;
}

.no-access {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #a8adb4;
    font-size: 1.05rem;
    text-align: center;
}

.no-access[hidden],
.workspace[hidden] {
    display: none !important;
}

/* Legend sits inside map pane */
.map-pane .legend {
    top: 12px;
    left: 12px;
}

.map-pane .map-tools {
    bottom: 20px;
    right: 12px;
}

.map-pane .coord-panel {
    bottom: 16px;
}

.map-pane .maplibregl-ctrl-top-right {
    top: 8px;
    right: 8px;
}

@media (max-width: 860px) {
    .app-topbar {
        grid-template-columns: auto 1fr;
        gap: 0.65rem;
    }

    .app-title {
        font-size: 1rem;
        justify-self: start;
    }

    .workspace {
        flex-direction: column;
    }

    .map-pane {
        flex: 1 1 55%;
        min-height: 45vh;
    }

    .stats-panel {
        flex: 0 0 auto;
        max-width: none;
        max-height: 42vh;
        border-left: none;
        border-top: 1px solid #3a3f45;
    }

    .area-select-label {
        display: none;
    }
}
