/* Dashboard Layout */
.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: flex-end;
    align-items: center;
}

@media (max-width: 480px) {
    .filters {
        justify-content: center;
        flex-wrap: wrap;
    }
}

.filter-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-btn:hover {
    color: var(--text);
    border-color: var(--border-h);
}

.filter-btn.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
}

/* Card Grid */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Frosted Glass Bot Card */
.card {
    background: rgba(10, 14, 24, 0.42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

/* Card Head */
.card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card__identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.card__icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
}

.card__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card__icon svg {
    width: 22px;
    height: 22px;
}

.card__name {
    font-size: 18px;
    font-weight: 600;
}

.card__sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.card__status {
    text-align: right;
}

.card__status-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card__status-label--online {
    color: var(--online);
}

.card__status-label--offline {
    color: var(--offline);
}

.card__last-seen {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 3px;
}

/* Metrics Grid */
.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.metric {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.metric__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 3px;
}

.metric__value {
    font-size: 17px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Shard Pills */
.shards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 8px;
}

.shard-pill {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 5px 9px;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.shard-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.shard-pill span {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* Latency Chart Container */
.chart-wrap {
    height: 140px;
    position: relative;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 12px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.chart-skeleton {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: 12px;
}

.chart-skeleton.hidden {
    opacity: 0;
    visibility: hidden;
}

.range-loading .chart-wrap {
    opacity: 0.7;
}

.throbber {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--online);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Card Links */
.card__links {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 10px;
    column-gap: 8px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.card__link:hover {
    color: var(--text);
}

.card__link svg {
    width: 14px;
    height: 14px;
}

/* Skeleton Ghost Loaders */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.card--placeholder {
    pointer-events: none;
}
