/* Dashboard Styles */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container-fluid {
    flex: 1;
}

.footer {
    margin-top: auto;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 0;
    margin-bottom: 0.5rem; /* Reduced */
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    font-size: 0.9rem; /* Smaller */
}

.card-title {
    font-size: 1rem; /* Smaller */
}

.list-group-item {
    border: 0;
    padding: 0.5rem 0; /* Reduced */
    border-bottom: 1px solid #f0f0f0;
}

.list-group-item:last-child {
    border-bottom: 0;
}

.badge-success {
    background-color: #28a745;
}

.badge-danger {
    background-color: #dc3545;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

/* Smaller charts */
.chart-container {
    height: 240px;
    width: 100%;
}

.dashboard-card {
    padding: 8px;
    margin-bottom: 8px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-dot.success {
    background-color: #28a745;
}

.status-dot.error {
    background-color: #dc3545;
}

.status-dot.warning {
    background-color: #ffc107;
}

.navbar-brand {
    font-size: 1.3rem;
}

h1 {
    color: #212529;
    font-weight: 600;
}

h5 {
    color: #495057;
    font-weight: 600;
}

.card-body p {
    margin: 0;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #007bff;
}

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    .card {
        margin-bottom: 0.5rem;
    }

    .row {
        margin-right: -5px;
        margin-left: -5px;
    }

    .col-md-3, .col-md-6 {
        padding-right: 5px;
        padding-left: 5px;
    }
}

/* Shared compact telemetry page styles */
.telemetry-page {
    --card-pad: 0.65rem;
    --panel-gap: 0.65rem;
    --card-radius: 0.45rem;
}

.compact-page-header {
    border-bottom: 1px solid #e6e6e6;
    padding-bottom: 0.2rem;
}

.compact-page-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f2937;
}

.compact-page-subtitle {
    font-size: 0.72rem;
    color: #6b7280;
}

.compact-meta {
    font-size: 0.69rem;
    color: #6b7280;
}

.compact-filter-toolbar {
    padding: var(--card-pad);
    border: 1px solid #e8eaee;
    border-radius: var(--card-radius);
    background: #f9fafb;
}

.compact-filter-toolbar .form-label {
    font-size: 0.72rem;
    margin-bottom: 0.2rem;
    color: #4b5563;
}

.compact-filter-toolbar .form-control,
.compact-filter-toolbar .form-select,
.compact-filter-toolbar .btn {
    font-size: 0.78rem;
    min-height: 30px;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}

.compact-kpi-card {
    border: 1px solid #e8eaee;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.compact-kpi-card .kpi-title {
    font-size: 0.72rem;
    color: #6b7280;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.compact-kpi-card .kpi-value {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.metric-card {
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
    border: 1px solid #dbe3ee;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    border-color: #c7d4e9;
}

.metric-card:active {
    transform: translateY(0px) scale(0.995);
}

.metric-card:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.compact-chart-card {
    border: 1px solid #e8eaee;
    border-radius: var(--card-radius);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.compact-chart-card .card-header {
    background: #f8fafc;
    padding: 0.4rem 0.6rem;
}

.compact-chart-card .card-title {
    font-size: 0.82rem;
}

.compact-chart-wrap {
    height: 240px;
    position: relative;
}

.compact-chart-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0.4rem;
    background: linear-gradient(105deg, rgba(248, 250, 252, 0.65) 25%, rgba(226, 232, 240, 0.35) 40%, rgba(248, 250, 252, 0.65) 55%);
    background-size: 260% 100%;
    animation: telemetryShimmer 1.45s ease-in-out infinite;
    z-index: 0;
    opacity: 0;
}

.compact-chart-wrap.is-loading::before {
    opacity: 1;
}

.compact-chart-wrap .apexcharts-canvas {
    z-index: 1;
}

.apexcharts-tooltip {
    border: 1px solid #dbe3ee !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16) !important;
}

.apexcharts-menu {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
}

.apexcharts-legend-text {
    font-size: 11px !important;
}

.compact-table-card {
    border: 1px solid #e8eaee;
    border-radius: var(--card-radius);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.compact-table-card .card-header {
    background: #f8fafc;
    padding: 0.4rem 0.6rem;
}

.compact-table {
    margin-bottom: 0;
}

.compact-table thead th {
    font-size: 0.72rem;
    font-weight: 600;
    color: #4b5563;
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
}

.compact-table tbody td {
    font-size: 0.78rem;
    padding: 0.35rem 0.5rem;
    vertical-align: middle;
}

.compact-click-row {
    cursor: pointer;
}

.compact-click-row:hover {
    background: #f8fafc;
}

.compact-click-row.selected {
    background: #e8f0ff;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.42rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
}

.status-ok {
    color: #0e6245;
    background: #d1fae5;
}

.status-error {
    color: #9f1239;
    background: #ffe4e6;
}

.status-critical {
    color: #991b1b;
    background: #fee2e2;
}

.status-warn {
    color: #92400e;
    background: #fef3c7;
}

.status-neutral {
    color: #374151;
    background: #e5e7eb;
}

.status-live {
    color: #065f46;
    background: #d1fae5;
}

.compact-modal .modal-body {
    padding: 0.65rem;
}

.compact-modal-section {
    border: 1px solid #edf0f3;
    border-radius: 0.35rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.compact-section-title {
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #374151;
}

.compact-kv-row {
    display: grid;
    grid-template-columns: minmax(110px, 180px) 1fr;
    gap: 0.4rem;
    padding: 0.15rem 0;
    border-bottom: 1px dashed #edf0f3;
}

.compact-kv-row:last-child {
    border-bottom: none;
}

.compact-kv-key {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 600;
}

.compact-kv-val {
    font-size: 0.75rem;
    color: #111827;
    word-break: break-word;
}

.compact-code-block {
    max-height: 230px;
    overflow: auto;
    margin: 0;
    font-size: 0.73rem;
    line-height: 1.32;
    border-radius: 0.3rem;
    background: #111827;
    color: #e5e7eb;
    padding: 0.5rem;
}

.compact-empty {
    color: #6b7280;
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem;
}

.metric-detail-modal .modal-body {
    background: #fbfcfe;
}

.metric-detail-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem;
    border-radius: 0.4rem;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    font-size: 0.78rem;
}

.metric-partial-shell {
    border: 1px solid #e8eaee;
    border-radius: 0.45rem;
    background: #fff;
    padding: 0.55rem;
}

.metric-section-header {
    border-bottom: 1px solid #e9edf3;
    padding-bottom: 0.35rem;
    margin-bottom: 0.45rem;
}

.metric-table-wrap {
    max-height: 58vh;
    overflow: auto;
}

.metric-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
}

.metric-pagination {
    padding-top: 0.45rem;
}

.compact-header-actions .btn {
    font-size: 0.76rem;
    padding: 0.2rem 0.45rem;
}

.telemetry-loading-overlay {
    position: fixed;
    top: 0.85rem;
    right: 1rem;
    z-index: 1090;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.7rem;
    background: rgba(15, 23, 42, 0.92);
    border-radius: 0.45rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.25);
    color: #f8fafc;
    font-size: 0.77rem;
}

.telemetry-loading-overlay .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.telemetry-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1085;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 420px;
}

.telemetry-toast {
    width: min(420px, calc(100vw - 2rem));
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}

.telemetry-toast .toast-body {
    font-size: 0.78rem;
}

.application-map-shell .card-body {
    min-height: 560px;
}

.application-map-canvas {
    width: 100%;
    min-height: 520px;
    border: 1px solid #e8eaee;
    border-radius: 0.4rem;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.04), transparent 35%),
        linear-gradient(180deg, #fcfcfd 0%, #f8fafc 100%);
}

.application-map-state {
    position: absolute;
    inset: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.84rem;
    color: #475569;
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.84);
    z-index: 3;
}

.application-map-tooltip {
    position: absolute;
    z-index: 5;
    max-width: 240px;
    pointer-events: none;
    background: rgba(17, 24, 39, 0.92);
    color: #f8fafc;
    border-radius: 0.4rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    line-height: 1.35;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
}

.application-map-legend-card .card-body {
    max-height: 250px;
    overflow: auto;
}

.application-map-legend-item {
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 0.6rem;
    align-items: start;
    margin-bottom: 0.65rem;
}

.application-map-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    margin-top: 0.1rem;
}

@keyframes telemetryShimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: 0 0;
    }
}

@media (max-width: 992px) {
    .compact-chart-wrap {
        height: 220px;
    }

    .application-map-shell .card-body,
    .application-map-canvas {
        min-height: 420px;
    }

    .compact-page-title {
        font-size: 1.1rem;
    }
}
