/* Admin dashboard — global styles (Client scoped CSS does not load on Interactive Server) */
.db {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
    padding: 0.25rem 0.25rem 1.5rem;
}

.db-loader {
    margin-bottom: 1rem;
    border-radius: 999px;
}

.db-alert {
    margin-bottom: 1rem;
}

.db-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.db-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.95rem 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    border-top: 3px solid var(--kpi-color, #2563eb);
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.db-kpi__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.db-kpi__value {
    display: block;
    margin-top: 0.35rem;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.db-grid {
    display: grid;
    gap: 1.15rem;
    grid-template-columns: minmax(0, 1fr);
}

.db-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    min-width: 0;
}

.db-panel--empty {
    padding: 1.25rem 1.5rem;
    grid-column: 1 / -1;
}

.db-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.db-panel__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.db-panel__link {
    font-size: 0.82rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
}

.db-panel__link:hover {
    text-decoration: underline;
}

.db-panel__body {
    padding: 1rem 1.15rem 1.15rem;
}

.db-panel__body--scroll {
    max-height: 380px;
    overflow-y: auto;
}

.db-empty {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
    padding: 0.5rem 0;
}

.db-section-label {
    margin: 0 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
}

.db-section-label--spaced {
    margin-top: 1.25rem;
}

.db-chart {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.db-chart--line {
    min-height: 220px;
}

.db-chart--bar {
    min-height: 300px;
    overflow: visible;
    padding-bottom: 0.25rem;
}

.db-chart--donut {
    min-height: 200px;
    margin-bottom: 0.75rem;
}

.db-chart svg,
.db-chart canvas {
    max-width: 100% !important;
}

.db-bar-xlabels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 0.35rem;
    padding: 0 0.25rem 0.15rem;
}

.db-bar-xlabels__item {
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    text-align: center;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.db-rank-list__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(60px, 90px) 42px;
    align-items: center;
    gap: 0.65rem;
}

.db-rank-list__name {
    font-size: 0.88rem;
    color: #334155;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-rank-list__bar-wrap {
    height: 8px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
}

.db-rank-list__bar {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    min-width: 4px;
}

.db-rank-list__pct {
    text-align: right;
    font-size: 0.82rem;
    color: #2563eb;
}

.db-feed {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.db-feed__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e8eef5;
    border-radius: 12px;
    background: #fbfcfe;
}

.db-feed__badge {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
}

.db-feed__badge.is-success {
    background: #dcfce7;
    color: #15803d;
}

.db-feed__badge.is-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.db-feed__badge.is-warning {
    background: #fef3c7;
    color: #b45309;
}

.db-feed__content {
    min-width: 0;
    flex: 1 1 auto;
}

.db-feed__text {
    margin: 0;
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.45;
    word-break: break-word;
}

.db-feed__tag {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.db-feed__tag.is-success { color: #15803d; }
.db-feed__tag.is-danger { color: #b91c1c; }
.db-feed__tag.is-warning { color: #b45309; }

.db-funnel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.db-funnel__step {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.db-funnel__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.db-funnel__label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
}

.db-funnel__value {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.db-funnel__value small {
    font-weight: 600;
    color: #64748b;
}

.db-funnel__track {
    height: 10px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
}

.db-funnel__fill {
    height: 100%;
    border-radius: 999px;
    min-width: 0;
    transition: width 0.3s ease;
}

@media (min-width: 640px) {
    .db-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .db {
        padding: 0.75rem 0.5rem 2rem;
    }

    .db-kpis {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .db-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .db-panel--funnel {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1200px) {
    .db-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .db-panel--revenue,
    .db-panel--destinations,
    .db-panel--activity {
        grid-column: span 1;
    }

    .db-panel--advisors {
        grid-column: span 1;
    }

    .db-panel--funnel {
        grid-column: span 2;
    }
}

@media (max-width: 575.98px) {
    .db-rank-list__item {
        grid-template-columns: 1fr 40px;
        grid-template-rows: auto auto;
    }

    .db-rank-list__bar-wrap {
        grid-column: 1 / -1;
    }
}
