/* GSU.Blazor.Shared — shared widget styles (metric cards, pool breakdown). Loaded by App.razor via _content/GSU.Blazor.Shared/gsu-shared.css. */

/* ── Telemetry widgets (shared by the dashboard, /database and any page hosting a widget) ── */
.card-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.card-title {
    display: flex;
    align-items: center;
    color: #0f3460;
    font-weight: 600;
}

.metrics-subheading {
    color: #0f3460;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.75rem 0 0.25rem;
}

.metrics-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
}

.metrics-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e9ecef;
}

.metric-item:last-child {
    border-bottom: none;
}

.metric-label {
    color: #6c757d;
    font-size: 0.875rem;
}

.metric-value {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 2.5rem;
    text-align: right;
}

.metric-ok { color: #198754; }
.metric-warn { color: #fd7e14; }
.metric-critical { color: #dc3545; }

/* Connection pool breakdown: name | in use / total | max, columns line up */
.pool-breakdown {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 1rem;
    row-gap: 0.25rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.8rem;
    color: #6c757d;
}

.pool-breakdown .pool-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pool-breakdown .pool-count,
.pool-breakdown .pool-max {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pool-breakdown .pool-active {
    color: #fd7e14;
    font-weight: 600;
}

/* Totals row at the bottom of the pool breakdown */
.pool-breakdown .pool-total {
    font-weight: 700;
    color: #0f3460;
    padding-top: 0.25rem;
    border-top: 1px solid #dee2e6;
}

/* Tables that turn into stacked cards on phones (2026-10-28, MCP page): add .table-stack to the <table> and a
   data-label="Column" to each <td>. Each row becomes a small card of "label  value" lines; empty cells drop out.
   Full-width rows (colspan headers, expanded details) just span the card. */
@media (max-width: 576px) {
    .table-stack thead {
        display: none;
    }

    .table-stack tbody tr {
        display: block;
        padding: 0.4rem 0;
        border-bottom: 1px solid #dee2e6;
    }

    .table-stack tbody td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.75rem;
        padding: 0.15rem 0.25rem;
        border: 0;
        text-align: right !important;
        word-break: break-word;
    }

    .table-stack tbody td[data-label]::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-weight: 600;
        color: #6c757d;
        text-align: left;
    }

    .table-stack tbody td[data-label]:empty {
        display: none;
    }

    .table-stack tbody td:not([data-label]) {
        display: block;
        text-align: left !important;
    }

    .table-stack code {
        white-space: normal;
        word-break: break-all;
    }
}

/* Process card: names under the Enabled / Disabled systems rows (2026-11-02) */
.systems-names {
    font-size: 0.85rem;
    color: #6c757d;
    padding: 0.25rem 0 0.5rem 0.75rem;
}
