/* Interface-local styles for admin/interfaces/dashboard/style.css */

.dashboard-device-summary-page .card-body {
    overflow: visible;
}

.dashboard-map-card,
.dashboard-map-card .card-body {
    min-height: calc(100vh - 180px);
}

.dashboard-map-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.dashboard-map-metrics {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    min-width: min(100%, 520px);
}

.dashboard-map-metric-card {
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.98), #fff);
    border: 1px solid rgba(1, 41, 112, 0.08);
    border-radius: 0.8rem;
    padding: 0.8rem 0.9rem;
}

.dashboard-map-metric-card .metric-label {
    color: #6c757d;
    display: block;
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.dashboard-map-metric-card .metric-value {
    color: #24324b;
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
}

.dashboard-map-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-map-filter {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 220px;
}

.dashboard-map-canvas-wrap {
    border: 1px solid rgba(1, 41, 112, 0.08);
    border-radius: 1rem;
    min-height: 68vh;
    overflow: hidden;
    position: relative;
}

.dashboard-map-canvas {
    height: 68vh;
    min-height: 520px;
    width: 100%;
}

.dashboard-map-empty {
    align-items: center;
    background: rgba(255, 255, 255, 0.86);
    color: #6c757d;
    display: flex;
    inset: 0;
    justify-content: center;
    pointer-events: none;
    position: absolute;
    z-index: 500;
}

.dashboard-map-popup-title {
    color: #24324b;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.dashboard-map-popup-type {
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.dashboard-device-summary-totals {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    margin-bottom: 1rem;
}

.dashboard-device-summary-kpi {
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.98), #fff);
    border: 1px solid rgba(1, 41, 112, 0.08);
    border-radius: 0.8rem;
    padding: 0.85rem 0.95rem;
}

.dashboard-device-summary-kpi .k-label {
    color: #6c757d;
    display: block;
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.dashboard-device-summary-kpi .k-value {
    color: #24324b;
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
}

.dashboard-device-summary-kpi.is-healthy {
    border-color: rgba(25, 135, 84, 0.18);
}

.dashboard-device-summary-kpi.is-warning {
    border-color: rgba(255, 193, 7, 0.28);
}

.dashboard-device-summary-kpi.is-critical {
    border-color: rgba(220, 53, 69, 0.24);
}

.dashboard-device-summary-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-device-summary-groupby {
    align-items: center;
    display: inline-flex;
    gap: 0.55rem;
}

.dashboard-device-summary-groupby .form-control {
    min-width: 130px;
}

.dashboard-device-summary-matrix {
    overflow: auto;
    padding-bottom: 0.25rem;
}

.dashboard-device-summary-header-row,
.dashboard-device-summary-row {
    display: grid;
    gap: 0.25rem;
    grid-template-columns: minmax(180px, 2fr) repeat(var(--device-summary-columns), minmax(28px, 32px));
    min-width: max-content;
}

.dashboard-device-summary-header-row {
    position: sticky;
    top: 0;
    z-index: 2;
}

.dashboard-device-summary-header-row.is-groups {
    margin-bottom: 0.35rem;
}

.dashboard-device-summary-header-row.is-metrics {
    margin-bottom: 0.75rem;
}

.dashboard-device-summary-device-header,
.dashboard-device-summary-group-header,
.dashboard-device-summary-metric-header,
.dashboard-device-summary-device-cell,
.dashboard-device-summary-cell {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(1, 41, 112, 0.09);
    border-radius: 0.45rem;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    min-height: 30px;
    width: 100%;
}

.dashboard-device-summary-device-header,
.dashboard-device-summary-group-header,
.dashboard-device-summary-metric-header {
    background: #f8fafc;
    color: #495057;
    font-size: 0.72rem;
    font-weight: 600;
}

.dashboard-device-summary-device-header,
.dashboard-device-summary-device-cell {
    justify-content: flex-start;
    padding: 0.35rem 0.55rem;
}

.dashboard-device-summary-device-link {
    background: transparent;
    border: 0;
    color: #24324b;
    display: block;
    font-size: 0.79rem;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    padding: 0;
    text-overflow: ellipsis;
    text-align: left;
    white-space: nowrap;
    width: 100%;
}

.dashboard-device-summary-device-link:hover {
    text-decoration: underline;
}

.dashboard-device-summary-cell {
    background: #f8fafc;
    border-width: 1px;
    color: #5c6770;
    cursor: pointer;
    font-size: 0.78rem;
    padding: 0;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.dashboard-device-summary-cell:hover {
    box-shadow: 0 6px 12px rgba(2, 34, 86, 0.08);
    transform: translateY(-1px);
}

.dashboard-device-summary-cell.is-healthy {
    background: #e9f7ef;
    border-color: rgba(25, 135, 84, 0.2);
    color: #198754;
}

.dashboard-device-summary-cell.is-warning {
    background: #fff4da;
    border-color: rgba(255, 193, 7, 0.36);
    color: #9b6a00;
}

.dashboard-device-summary-cell.is-critical {
    background: #fde8eb;
    border-color: rgba(220, 53, 69, 0.28);
    color: #b42318;
}

.dashboard-device-summary-cell.is-unavailable {
    background: #f3f4f6;
    border-color: rgba(108, 117, 125, 0.14);
    color: #98a2b3;
}

.dashboard-device-summary-bucket {
    color: #6c757d;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0.65rem 0 0.25rem;
    text-transform: uppercase;
}

.dashboard-device-summary-matrix.is-compact .dashboard-device-summary-device-header,
.dashboard-device-summary-matrix.is-compact .dashboard-device-summary-group-header,
.dashboard-device-summary-matrix.is-compact .dashboard-device-summary-metric-header,
.dashboard-device-summary-matrix.is-compact .dashboard-device-summary-device-cell,
.dashboard-device-summary-matrix.is-compact .dashboard-device-summary-cell {
    min-height: 26px;
}

.dashboard-device-summary-matrix.is-compact .dashboard-device-summary-device-cell {
    padding: 0.25rem 0.45rem;
}

.dashboard-device-summary-matrix.is-compact .dashboard-device-summary-header-row,
.dashboard-device-summary-matrix.is-compact .dashboard-device-summary-row {
    grid-template-columns: minmax(160px, 1.8fr) repeat(var(--device-summary-columns), minmax(24px, 28px));
}

@media (max-width: 991px) {
    .dashboard-map-header {
        flex-direction: column;
    }

    .dashboard-map-metrics {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        min-width: 0;
        width: 100%;
    }

    .dashboard-map-filter {
        min-width: 0;
        width: 100%;
    }

    .dashboard-map-canvas,
    .dashboard-map-canvas-wrap {
        min-height: 60vh;
    }

    .dashboard-device-summary-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-device-summary-groupby {
        width: 100%;
    }
}
