/* Tek tip boşluk: KPI grid ile birebir aynı (1rem) */
.valent-dashboard {
    --valent-dash-gap: 1rem;
    display: flex;
    flex-direction: column;
    gap: var(--valent-dash-gap);
}

/* Bölümler arası dikey boşluk yalnızca flex gap (index.php referansı: 1rem) */
.valent-dashboard > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.valent-dash-grid {
    display: grid;
    gap: var(--valent-dash-gap);
    width: 100%;
    margin: 0;
}

.valent-dash-cell {
    min-width: 0;
}

/* Kart köşelerinde anti-aliasing sızıntısını engelle */
.valent-dashboard .valent-dash-cell > .card,
.valent-page-dashboard .valent-dash-cell > .card {
    overflow: hidden;
}

/* Dashboard kartları — dış çizgi yok (standart, çizgisiz) */
.valent-dashboard .card,
.valent-page-dashboard .card,
.valent-dashboard .valent-filter-card,
.valent-page-dashboard .valent-filter-card {
    border: none !important;
    outline: none !important;
}

.valent-dashboard .valent-dash-cell,
.valent-page-dashboard .valent-dash-cell {
    outline: none !important;
}

.valent-dashboard .card-header,
.valent-page-dashboard .card-header,
.valent-dashboard .card-footer,
.valent-page-dashboard .card-footer,
.valent-dashboard .valent-table-pagination,
.valent-page-dashboard .valent-table-pagination {
    border: none !important;
}

.valent-dash-cell--full {
    grid-column: 1 / -1;
}

.valent-services-panel {
    border: none !important;
}

[data-bs-theme=dark] .valent-services-panel {
    border: none !important;
}

.valent-dash-section-anomalies + .valent-dash-section,
.valent-dash-section-anomalies + .valent-dash-grid,
.valent-anomaly-panel + .valent-services-panel {
    margin-top: 0;
}

.valent-dash-section-services {
    display: block;
}

.valent-anomaly-panel {
    border: none !important;
}

.valent-anomaly-alerts .alert {
    --bs-alert-border: transparent;
    --bs-alert-border-width: 0;
    border-radius: 0.35rem;
    align-items: center;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.valent-anomaly-alerts .valent-anomaly-alert-icon {
    font-size: 1.125rem;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    margin: 0 !important;
}

/* KPI + aşama: 4 sütun */
.valent-dash-grid--kpi {
    grid-template-columns: 1fr;
}

@media (min-width: 576px) {
    .valent-dash-grid--kpi {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .valent-dash-grid--kpi {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .valent-dash-grid--kpi {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Aşama kartları — radial taşması ve sağ sütunun kırpılması */
.valent-dash-cell--stage > .card {
    overflow: visible;
}

.valent-dash-cell--stage .card-body {
    min-width: 0;
}

.valent-dash-cell--stage .valent-stage-radial-wrap {
    width: 70px;
}

.valent-dash-cell--stage [id^="stage-radial-"] {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    overflow: hidden;
}

.valent-dash-cell--stage .valent-stage-metrics {
    min-width: 0;
}

.valent-dash-cell--stage .valent-stage-trend-badge {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    text-align: right;
    line-height: 1.25;
}

/* Grafik + tablo: 3 sütun */
.valent-dash-grid--triple {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .valent-dash-grid--triple {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1400px) {
    .valent-dash-grid--triple {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Footer — kısa içerikte alta yapışmasın (flex); içerik ile footer arası KPI gap */
.page-content > .page-container {
    flex: 1 0 auto;
    padding-bottom: var(--valent-dash-gap, 1rem);
}

body.valent-page-bulk-messaging .page-content > .page-container,
body.valent-page-compact-footer .page-content > .page-container {
    padding-bottom: 0;
}

.page-content > .footer {
    margin-top: auto !important;
    flex-shrink: 0;
}

.valent-filter-card,
.valent-filter-card .card-body,
#gaFilterForm,
.valent-filter-card .dropdown,
#gaFilterForm .dropdown {
    overflow: visible !important;
}

.valent-filter-card {
    position: relative;
    z-index: 20;
    --valent-filter-h: 2.125rem;
}

/* Filtre çubuğu — tüm sayfalarda eşit yükseklik; mobilde tam genişlik alt alta */
.valent-filter-card form.row,
.valent-filter-card .card-body > .row {
    align-items: stretch !important;
}

.valent-filter-card [class*="ms-auto"],
.valent-filter-card .valent-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
}

.valent-filter-card [class*="ms-auto"] > .badge,
.valent-filter-card .valent-filter-actions > .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--valent-filter-h);
    height: var(--valent-filter-h);
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: var(--bs-border-radius, 0.25rem);
}

.valent-filter-card [class*="ms-auto"] > .dropdown,
.valent-filter-card .valent-filter-actions > .dropdown {
    display: flex;
    align-items: stretch;
}

.valent-filter-card [class*="ms-auto"] .dropdown > .btn,
.valent-filter-card [class*="ms-auto"] > a.btn,
.valent-filter-card .valent-filter-actions .dropdown > .btn,
.valent-filter-card .valent-filter-actions > a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--valent-filter-h);
    height: var(--valent-filter-h);
    white-space: nowrap;
}

.valent-filter-card .form-select-sm,
.valent-filter-card .form-control-sm {
    min-height: var(--valent-filter-h);
}

.valent-filter-card #customDateFields {
    min-height: var(--valent-filter-h);
    align-items: center;
}

.valent-filter-form,
.valent-filter-actions {
    align-items: stretch;
}

.valent-filter-chip,
.valent-filter-actions > .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--valent-filter-h);
    height: var(--valent-filter-h);
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1.2;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .valent-filter-card form.row > [class*="col-"],
    .valent-filter-card .card-body > .row > [class*="col-"] {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }

    .valent-filter-card [class*="ms-auto"],
    .valent-filter-card .valent-filter-actions {
        margin-left: 0 !important;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .valent-filter-card [class*="ms-auto"] > .badge,
    .valent-filter-card [class*="ms-auto"] > .dropdown,
    .valent-filter-card [class*="ms-auto"] > a.btn,
    .valent-filter-card .valent-filter-actions > .badge,
    .valent-filter-card .valent-filter-actions > .dropdown,
    .valent-filter-card .valent-filter-actions > a.btn {
        width: 100%;
        max-width: 100%;
    }

    .valent-filter-card [class*="ms-auto"] .dropdown > .btn,
    .valent-filter-card .valent-filter-actions .dropdown > .btn {
        width: 100%;
    }

    .valent-filter-card #customDateFields {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }

    .valent-filter-card .form-select,
    .valent-filter-card .form-control {
        width: 100%;
    }

    .valent-filter-card #customDateFields .form-control {
        flex: 1 1 auto;
        width: 0;
        min-width: 0;
    }
}

@media (min-width: 992px) {
    .valent-filter-card .form-select,
    .valent-filter-card .form-control.w-auto {
        width: auto;
    }
}

/* .valent-view-menu — valent-filters.css */

/* Dashboard — gölge yok (kart, alert, dropdown, dark tema) */
.valent-dashboard .shadow,
.valent-dashboard .shadow-sm,
.valent-dashboard .shadow-lg,
.valent-page-dashboard .shadow,
.valent-page-dashboard .shadow-sm,
.valent-page-dashboard .shadow-lg,
.valent-dashboard .card,
.valent-dashboard .card.shadow-sm,
.valent-page-dashboard .card,
.valent-page-dashboard .card.shadow-sm,
#kpi-cards-container .card,
#kpi-cards-container .card:hover,
.valent-dash-grid .card,
.valent-dash-grid .card:hover {
    box-shadow: none !important;
}

.valent-dashboard .alert,
.valent-dashboard .alert.shadow-sm,
.valent-page-dashboard .alert {
    box-shadow: none !important;
}

.valent-dashboard .dropdown-menu,
.valent-dashboard .dropdown-menu.shadow-lg,
.valent-view-menu {
    box-shadow: none !important;
}

.valent-dashboard [class$="-status-dot"] {
    box-shadow: none !important;
}

[data-bs-theme=dark] .valent-dashboard .card,
[data-bs-theme=dark] .valent-page-dashboard .card,
[data-bs-theme=dark] .valent-dashboard .alert,
[data-bs-theme=dark] .valent-dashboard .dropdown-menu {
    box-shadow: none !important;
}

.text-pink {
    color: #ff8acc !important;
}

.text-purple {
    color: #6658dd !important;
}

.valent-chart-range .btn.active {
    background-color: var(--ct-primary, #188ae2);
    border-color: var(--ct-primary, #188ae2);
    color: #fff;
}

.tbl-card-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.tbl-card-hdr .header-title,
.valent-dashboard .card-header .header-title,
.valent-dashboard .card-body > .header-title,
.valent-dashboard .card-body .tbl-card-hdr .header-title,
.valent-dashboard .header-title {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--ct-body-color, inherit);
}

.header-title .valent-panel-title-icon {
    font-size: 1.125em !important;
    width: 1.125em;
    height: 1.125em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.valent-panel-title-text {
    line-height: inherit;
}

#charts-container .apex-charts {
    min-height: 260px;
}

.valent-currency-kpi .d-block {
    line-height: 1.35;
}

.valent-currency-kpi-alt {
    line-height: 1.25;
    max-width: 48%;
    pointer-events: none;
}

.valent-currency-kpi-alt .d-block + .d-block {
    margin-top: 0.15rem;
}

/* Tablo genişliği — valent-table-pagination.css (yatay kaydırma, auto layout) */

/* Widget tabloları — dikey ortalama; yatay hizayı utility sınıfları belirler */
.valent-dashboard .table th,
.valent-dashboard .table td,
.valent-page-dashboard .table th,
.valent-page-dashboard .table td {
    vertical-align: middle;
}

.valent-dashboard .table td[colspan],
.valent-dashboard .table th[colspan] {
    text-align: center !important;
}

/* Dashboard bölümü — kart/form grupları */
.valent-dash-section {
    display: block;
    min-width: 0;
}

/* Tek bölümde üst üste kart/form — aralık KPI grid ile aynı (1rem) */
.valent-dash-stack {
    display: flex;
    flex-direction: column;
    gap: var(--valent-dash-gap);
    min-width: 0;
}

.valent-dashboard .valent-dash-stack > *,
.valent-page-dashboard .valent-dash-stack > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Split sütunlar — Bootstrap gutter = KPI gap */
.valent-dashboard .valent-sys-ops-split,
.valent-page-dashboard .valent-sys-ops-split {
    --bs-gutter-x: var(--valent-dash-gap);
    --bs-gutter-y: var(--valent-dash-gap);
}

.valent-dashboard .valent-dash-stack .card,
.valent-page-dashboard .valent-dash-stack .card {
    margin-bottom: 0 !important;
}

.valent-dash-info-alert {
    align-items: flex-start;
}

/* Üst aksiyon çubuğu — yalnızca valent-dash-section içinde (billing/dashboard sayfaları).
   datatable-crud / form-page kart başlıklarındaki .valent-page-actions-bar etkilenmez. */
.valent-dash-section > .valent-page-actions-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    align-items: stretch;
    width: 100%;
}

.valent-dash-section > .valent-page-actions-bar > .btn,
.valent-dash-section > .valent-page-actions-bar > a.btn,
.valent-dash-section > .valent-page-actions-bar > button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 575.98px) {
    .valent-dash-section > .valent-page-actions-bar.valent-actions-count-odd {
        flex-direction: column;
    }

    .valent-dash-section > .valent-page-actions-bar.valent-actions-count-odd > .btn,
    .valent-dash-section > .valent-page-actions-bar.valent-actions-count-odd > a.btn,
    .valent-dash-section > .valent-page-actions-bar.valent-actions-count-odd > button.btn {
        width: 100%;
        max-width: 100%;
    }

    .valent-dash-section > .valent-page-actions-bar.valent-actions-count-even {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .valent-dash-section > .valent-page-actions-bar.valent-actions-count-even > .btn,
    .valent-dash-section > .valent-page-actions-bar.valent-actions-count-even > a.btn,
    .valent-dash-section > .valent-page-actions-bar.valent-actions-count-even > button.btn {
        width: 100%;
        max-width: 100%;
    }
}
