/* DRS Analiz - Basecoat UI sayfa bileşenleri
   Tüm kurallar .bc kapsamındaki sayfa içerikleri için; Basecoat token'larını kullanır.
   Bileşenler: .page, .drs-stats, .drs-filters, .drs-table (includes/components/data-table.php), dialog ekleri. */

.bc {
    --drs-success: oklch(52% 0.15 150);
    --drs-warning: oklch(66% 0.16 70);
}

/* Yeni tasarımlı sayfalarda gövde zemini beyaz (common-styles gri zemini geçersiz kılar) */
body:has(> main.bc.page) {
    background: #fff;
    /* Gizli popover'lar (visibility:hidden, absolute) sağa doğru yatay taşma yaratıyordu;
       mobil tarayıcı bu yüzden sayfayı küçültüp sağda boşluk gösteriyordu. */
    overflow-x: clip;
}

/* Gri zeminli sayfa (gündem sayfasıyla aynı ton): main.bc.page.drs-page-gray */
body:has(> main.bc.page.drs-page-gray),
.bc.page.drs-page-gray {
    background: #f8f9fa; /* common-styles --color-gray-100 ile aynı (gündem sayfası gövdesi) */
}

/* Gri zeminde kartlar kesin beyaz kalsın (eski common-styles .card / buton sıfırlamaları ezilmesin) */
.bc.drs-page-gray .card,
.bc.drs-page-gray button.card {
    background-color: #fff;
}

/* Sayfa kapsayıcısı */
.bc.page {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    color: var(--foreground);
    /* Gizli popover'lar yatayda taşmasın (yalnızca yatay kırpma; dikeyde açılmaları serbest) */
    overflow-x: clip;
}

/* common-styles.css sızıntılarını sıfırla (.card / .table-container aynı adla tanımlı) */
.bc .card {
    padding-inline: 0;
    margin: 0;
}

.bc .table-container {
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Yardımcı sınıflar */
.drs-link {
    color: var(--foreground);
    font-weight: 500;
    text-decoration: none;
    text-underline-offset: 3px;
}

.drs-link:hover {
    text-decoration: underline;
}

.drs-muted {
    color: var(--muted-foreground);
    font-size: 0.75rem;
}

.drs-num {
    font-variant-numeric: tabular-nums;
}

.drs-pos { color: var(--drs-success); }
.drs-neg { color: var(--destructive); }
.drs-warn { color: var(--drs-warning); }

.drs-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    line-height: 1.3;
}

.privacy-sensitive.blurred {
    filter: blur(6px);
    user-select: none;
}

body.role-temsilci .col-satis-elemani {
    display: none !important;
}

/* Bölüm başlığı */
.drs-section {
    display: grid;
    gap: 0.75rem;
}

.drs-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.drs-section-head h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.drs-section-head h2 svg {
    width: 1rem;
    height: 1rem;
    color: var(--muted-foreground);
}

/* İstatistik kartları */
.drs-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.75rem;
}

.bc .drs-stat {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: default;
}

.bc .drs-stat[data-clickable] {
    cursor: pointer;
    transition: background-color 0.15s;
}

.bc .drs-stat[data-clickable]:hover {
    background-color: var(--muted);
}

.bc .drs-stat[data-clickable]:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.drs-stat-label {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.drs-stat-value {
    margin-top: 0.125rem;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.drs-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: calc(var(--radius) - 2px);
    background: var(--muted);
    color: var(--muted-foreground);
}

.drs-stat-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* Renk tonları: açık zemin + doygun ikon (oklch, Basecoat token'larıyla uyumlu) */
.drs-stat-icon[data-tone="info"]    { background: oklch(95% 0.03 250); color: oklch(50% 0.18 255); }
.drs-stat-icon[data-tone="danger"]  { background: oklch(95% 0.03 25);  color: oklch(55% 0.21 27); }
.drs-stat-icon[data-tone="warning"] { background: oklch(96% 0.05 80);  color: oklch(62% 0.16 65); }
.drs-stat-icon[data-tone="success"] { background: oklch(95% 0.04 150); color: oklch(50% 0.15 150); }
.drs-stat-icon[data-tone="violet"]  { background: oklch(95% 0.03 300); color: oklch(52% 0.19 300); }
.drs-stat-icon[data-tone="neutral"] { background: var(--muted);        color: var(--muted-foreground); }

/* Filtre çubuğu */
.drs-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.drs-search {
    position: relative;
    flex: 1 1 16rem;
    min-width: 12rem;
}

.drs-search > svg {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    translate: 0 -50%;
    width: 1rem;
    height: 1rem;
    color: var(--muted-foreground);
    pointer-events: none;
}

.bc .drs-search .input {
    padding-left: 2rem;
}

.bc .drs-filters .select {
    width: auto;
    min-width: 9rem;
}

/* Aktif filtre göstergesi: ok ikonunun yanında mavi nokta */
.drs-filter-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-left: 0.125rem;
    border-radius: 9999px;
    background: oklch(60% 0.2 255);
    flex-shrink: 0;
}

/* Genişlik içeriğe göre: kısa listelerde dar, uzun etiketlerde en fazla 20rem */
.bc .drs-filter-popover {
    width: max-content;
    min-width: 100%;
    max-width: 20rem;
    padding: 0.375rem;
    gap: 0.25rem;
}

.drs-check span {
    overflow-wrap: anywhere;
}

.drs-filter-search {
    position: relative;
    padding: 0.125rem 0.125rem 0.25rem;
    border-bottom: 1px solid var(--border);
}

.drs-filter-search > svg {
    position: absolute;
    left: 0.75rem;
    top: calc(50% - 0.0625rem);
    translate: 0 -50%;
    width: 0.875rem;
    height: 0.875rem;
    color: var(--muted-foreground);
    pointer-events: none;
}

.bc .drs-filter-search .input {
    height: 2rem;
    padding-left: 1.875rem;
    font-size: 0.8125rem;
    border-color: transparent;
    box-shadow: none;
}

.drs-filter-list {
    display: flex;
    flex-direction: column;
    max-height: 18rem;
    overflow-y: auto;
}

.drs-check {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.5rem;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.875rem;
    cursor: pointer;
}

.drs-check:hover {
    background: var(--muted);
}

.drs-filter-empty {
    padding: 0.75rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-align: center;
}

/* Data table (kart sarmalayıcı) */
.bc .card > .drs-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    /* Panel başlığıyla (.drs-panel-head) aynı iç boşluk: hücre kenarıyla hizalı, alt çizgiye eşit uzaklık */
    padding: 1rem 1.25rem;
}

.bc .drs-table:has(> .drs-table-head:first-child) {
    padding-top: 0;
}

.drs-table-heading h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.drs-table-heading h2 svg {
    width: 1rem;
    height: 1rem;
    color: var(--muted-foreground);
}

.drs-table-heading p {
    margin: 0.125rem 0 0;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}

.drs-table-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.bc .card > .drs-table-body {
    padding-inline: 0;
    border-top: 1px solid var(--border);
}

/* Başlıksız tablo: üst çizgi ve kart üst boşluğu yok */
.bc .card > .drs-table-body:first-child {
    border-top: 0;
}

.bc .drs-table:has(> .drs-table-body:first-child) {
    padding-top: 0;
}

/* Sayfalama yoksa kartın alt boşluğu da yok */
.bc .drs-table:has(> .drs-table-body:last-child) {
    padding-bottom: 0;
}

.bc .card > .drs-table-foot {
    display: flex;
    padding: 0.625rem 1.25rem;
    border-top: 1px solid var(--border);
}

/* Kart içi bölümler arasında boşluk yok; alt bilgi varken kartın alt boşluğu da yok */
.bc .drs-table {
    gap: 0;
}

.bc .drs-table:has(> .drs-table-foot) {
    padding-bottom: 0;
}

/* Tablo hücreleri */
/* Başlık satırı: zemin yok, sessiz gri etiketler, ince alt çizgi */
.bc .table thead th {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border);
}

.bc .table th {
    height: 2.5rem;
    padding-block: 0;
    vertical-align: middle;
}

.bc .table th:first-child,
.bc .table td:first-child {
    padding-left: 1.25rem;
}

.bc .table th:last-child,
.bc .table td:last-child {
    padding-right: 1.25rem;
}

.bc .table td.drs-wrap {
    white-space: normal;
    min-width: 14rem;
}

.drs-align-end { text-align: end; }
.drs-align-center { text-align: center; }
/* Basecoat'un `.bc .table th { text-align: left }` kuralını geçmek için başlık ve hücreye özel */
.bc .table th.drs-align-end, .bc .table td.drs-align-end { text-align: end; }
.bc .table th.drs-align-center, .bc .table td.drs-align-center { text-align: center; }

.drs-th-label {
    display: inline-block;
    font-weight: 500;
}

.drs-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 500;
    color: inherit;
    white-space: nowrap;
    cursor: pointer;
    border-radius: 4px;
}

.drs-sort:hover,
th[aria-sort] .drs-sort {
    color: var(--foreground);
}

.drs-sort svg {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--muted-foreground);
}

.drs-sort .drs-sort-asc,
.drs-sort .drs-sort-desc,
th[aria-sort] .drs-sort-idle {
    display: none;
}

th[aria-sort="ascending"] .drs-sort-asc,
th[aria-sort="descending"] .drs-sort-desc {
    display: inline;
    color: var(--foreground);
}

/* Sütun filtreleri: sade, zemin yok; odaklanınca belirginleşir */
.bc .drs-filter {
    display: block;
    width: 100%;
    min-width: 6rem;
    height: 1.75rem;
    margin-top: 0.375rem;
    padding-inline: 0.5rem;
    font-size: 0.75rem;
    font-weight: 400;
    background: transparent;
    border-color: var(--border);
    box-shadow: none;
    color: var(--foreground);
}

.bc .drs-filter::placeholder {
    color: color-mix(in oklab, var(--muted-foreground) 70%, transparent);
}

.bc .drs-filter:focus-visible {
    background: var(--background);
}

.drs-table-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Sayfalama */
.drs-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    width: 100%;
}

.drs-pagination-info {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}

.drs-pagination-nav {
    display: flex;
    gap: 0.25rem;
}

.drs-pagination-nav [aria-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
}

.drs-pagination-nav [aria-current="page"] {
    font-weight: 600;
}

/* Mobil kart görünümü */
.drs-table-mobile {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
}

.drs-mobile-card {
    display: grid;
    gap: 0.375rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
}

.drs-mobile-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.drs-mobile-row .drs-muted {
    flex-shrink: 0;
}

.drs-mobile-bakiye {
    display: inline-flex;
    align-items: baseline;
    gap: 0.375rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .bc.page {
        padding: 1rem;
    }

    /* Özet kartları: sayaçlar 2 sütun, para kartları tam satır; değerler daralır */
    .drs-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .drs-stat-wide {
        grid-column: 1 / -1;
    }

    .bc .drs-stat {
        padding: 0.75rem 0.875rem;
        gap: 0.5rem;
    }

    .bc .drs-stat > div {
        min-width: 0;
    }

    .drs-stat-value {
        font-size: 1.0625rem;
        white-space: nowrap;
    }

    .drs-stat-icon {
        width: 2rem;
        height: 2rem;
    }

    .drs-stat-icon svg {
        width: 1rem;
        height: 1rem;
    }

    /* Filtreler: arama tam satır, butonlar ikişerli eşit genişlik */
    .drs-search {
        flex-basis: 100%;
    }

    .drs-filters > .popover {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
    }

    .bc .drs-filters > .popover > .btn {
        width: 100%;
        justify-content: flex-start;
    }

    .bc .drs-filters > .popover > .btn > svg:last-child {
        margin-left: auto;
    }

    .drs-filters > .popover [data-popover] {
        min-width: 100%;
    }

    .drs-table-desktop {
        display: none;
    }

    .drs-table-mobile {
        display: flex;
    }
}

/* Dialog ekleri */
.bc .dialog > .drs-dialog-md {
    max-width: 36rem;
}

.bc .dialog > .drs-dialog-lg {
    max-width: 60rem;
}

.bc .dialog > * > header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    line-height: 1.3;
}

.bc .dialog > * > header h2 svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--muted-foreground);
}

.bc .dialog > * > .drs-dialog-table {
    padding-inline: 0;
    max-height: 60vh;
    overflow: auto;
}

/* Dialog formları (pages/gundem-yonetim.php: Yeni Gündem) */
.drs-form {
    display: grid;
    gap: 1rem;
}

/* .field display:flex, UA [hidden] kuralını ezer; gizlenen alanlar kesin kapansın */
.drs-form [hidden] {
    display: none !important;
}

.drs-optional,
.drs-required {
    font-weight: 400;
    color: var(--muted-foreground);
}

.drs-required {
    color: var(--destructive);
}

.bc .drs-form .field > p {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Basecoat'ta select.select { width: fit-content } kuralı .field > * { width: 100% }
   kuralından sonra geldiği için alan içindeki select'ler input'lardan dar kalıyordu. */
.bc .field > select.select { width: 100%; }

/* field-sizing: content, rows niteliğini yok sayıyor; alan en az üç satır yüksekliğinde
   açılsın ve yalnızca dikeyde boyutlandırılsın. */
.bc .textarea { resize: vertical; }
.bc .drs-form .textarea { min-height: 4.75rem; }

/* Yatay seçenek satırı (radio / checkbox grubu) */
.drs-choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.bc .drs-choice-row .field {
    width: auto;
}

.drs-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Alan altı notu: uyarı / hata */
.drs-form-note {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.4;
}

.drs-form-note svg {
    flex-shrink: 0;
    width: 0.875rem;
    height: 0.875rem;
    margin-top: 0.0625rem;
}

.drs-form-note[data-tone="warn"] { color: var(--drs-warning); }
.drs-form-note[data-tone="error"] { color: var(--destructive); }

/* Combobox: arama girdisi + açılır sonuç listesi */
.drs-combobox {
    position: relative;
}

.drs-combobox > svg {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    translate: 0 -50%;
    width: 1rem;
    height: 1rem;
    color: var(--muted-foreground);
    pointer-events: none;
}

.bc .drs-combobox > .input {
    padding-left: 2rem;
}

.drs-combobox-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 30;
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.25rem;
    background: var(--popover);
    color: var(--popover-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px -8px rgb(0 0 0 / 0.18);
}

.drs-combobox-list .satir {
    padding: 0.375rem 0.5rem;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.875rem;
    cursor: pointer;
}

.drs-combobox-list .satir:hover {
    background: var(--accent);
    color: var(--accent-foreground);
}

.drs-combobox-list .kod {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.drs-combobox-list .bos-satir,
.drs-kv .bos-satir {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}

/* Cari bağlam kartı: özet + "Kime?" tek kutuda (pages/gundem-yonetim.php) */
.drs-cari-baglam {
    display: grid;
    gap: 0;
    margin-top: -0.375rem;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    overflow: hidden;
}

.drs-cari-baglam > * + * {
    border-top: 1px solid var(--border);
}

.bc .drs-cari-baglam > .field {
    padding: 0.75rem 0.875rem;
}

.bc .drs-cari-baglam > .field > .label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Anahtar–değer özet kutusu (cari mini özet) */
.drs-kv {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
}

.drs-kv .baslik {
    font-weight: 600;
    font-size: 0.875rem;
}

.drs-kv .hucreler {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1rem;
}

.drs-kv .satir {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
}

.drs-kv .satir span:first-child {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted-foreground);
}

.drs-kv b {
    font-weight: 600;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* Footer solunda kalan alan (Acil onay kutusu) */
.bc .dialog > * > footer > .drs-footer-left {
    margin-right: auto;
    width: auto;
}

/* Tarih aralığı popover'ı (pages/fatura.php): hızlı seçimler + iki tarih girdisi */
.bc .drs-date-popover {
    display: grid;
    gap: 0.625rem;
    padding: 0.625rem;
    min-width: 19rem;
}

.drs-date-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.drs-date-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.drs-date-field {
    display: grid;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.bc .drs-date-field .input {
    height: 2rem;
    font-size: 0.8125rem;
}

.drs-date-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.375rem;
}

/* Grup bazlı dağılım çipleri (pages/fatura.php) */
.drs-chips-block {
    display: grid;
    gap: 0.5rem;
}

.drs-chips-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-foreground);
}

.drs-chips-title svg {
    width: 0.875rem;
    height: 0.875rem;
}

.drs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bc .drs-chip {
    display: inline-flex;
    align-items: stretch;
    padding: 0;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--foreground);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bc .drs-chip:hover {
    border-color: var(--muted-foreground);
}

.bc .drs-chip:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.drs-chip-name {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.625rem;
    font-weight: 600;
}

/* Ayraçtan sonrası: ton zemini kenardan kenara dolar, iç rozet yok */
.drs-chip-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.625rem;
    border-left: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.drs-chip-stat svg {
    width: 0.75rem;
    height: 0.75rem;
}

.drs-chip-stat[data-tone="success"] { background: oklch(95% 0.04 150); color: oklch(45% 0.15 150); }
.drs-chip-stat[data-tone="danger"]  { background: oklch(95% 0.03 25);  color: oklch(50% 0.21 27); }

@media (max-width: 768px) {
    .bc .drs-chip {
        flex: 1 1 100%;
    }

    .drs-chip-name {
        flex: 1;
    }
}

/* ===== Cari detay (pages/cari-detay.php) ===== */

/* Profil kartı: başlık, aksiyonlar, künye */
.bc .drs-profile {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
}

.drs-profile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.drs-profile-title {
    display: grid;
    gap: 0.375rem;
    min-width: 0;
}

.drs-profile-title h1 {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.drs-profile-back {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-decoration: none;
}

.drs-profile-back:hover { color: var(--foreground); }
.drs-profile-back svg { width: 0.875rem; height: 0.875rem; }

.drs-profile-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.bc .drs-profile-meta .badge svg { width: 0.75rem; height: 0.75rem; }

.drs-profile-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.drs-profile-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem 1.5rem;
    margin: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.drs-profile-info > div { display: grid; gap: 0.125rem; min-width: 0; }

.drs-profile-info dt {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-foreground);
}

.drs-profile-info dd {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* Sekiz stat kartı: geniş ekranda 4 sütun */
@media (min-width: 1100px) {
    .drs-stats-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.bc .drs-stat { position: relative; }

/* Kartın içinde, ikon karesinin sağ üst köşesine oturur (.card overflow:hidden dışarı taşanı kırpar) */
.drs-stat-count {
    position: absolute;
    top: 0.5rem;
    right: 0.625rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 9999px;
    background: var(--destructive);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    box-shadow: 0 0 0 2px var(--background);
}

/* Panel kartı (grafikler) */
.bc .drs-panel {
    display: grid;
    gap: 0;
    padding: 0;
}

.bc .drs-panel > .drs-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.drs-panel-heading h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.drs-panel-heading h2 svg { width: 1rem; height: 1rem; color: var(--muted-foreground); }

.drs-panel-heading p {
    margin: 0.125rem 0 0;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}

.drs-panel-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.bc .drs-panel-actions .select,
.bc .drs-table-actions .select {
    width: auto;
    height: 2rem;
    font-size: 0.8125rem;
}

.bc .drs-table-actions .drs-search { flex: 1 1 14rem; }
.bc .drs-table-actions .drs-search .input { height: 2rem; font-size: 0.8125rem; }

.drs-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.bc .drs-panel > .drs-panel-body {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1.25rem 1.25rem;
}

.drs-chart {
    position: relative;
    height: 16rem;
}

.drs-chart-tall { height: 20rem; }

.drs-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.drs-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.drs-legend-item i {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
}

/* Segment düğmeleri (Ciro / Adet) */
.drs-seg {
    display: inline-flex;
    padding: 0.125rem;
    gap: 0.125rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
}

.bc .drs-seg .btn { height: 1.75rem; }

/* İki sütunlu satır */
.drs-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

/* Yan yana iken tablo kartı soldaki grafik panelinin boyuna uyar; uzun liste kart içinde kayar.
   contain:size → kartın içeriği satır yüksekliğini belirlemez, ölçüyü sol panel verir. */
@media (min-width: 1025px) {
    .bc .drs-two-col > .drs-table {
        contain: size;
        display: flex;
        flex-direction: column;
    }
    .bc .drs-two-col > .drs-table > .drs-table-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }
    .bc .drs-two-col > .drs-table > .drs-table-body thead th {
        position: sticky;
        top: 0;
        background: var(--card);
        z-index: 1;
    }
}

@media (max-width: 1024px) {
    .drs-two-col { grid-template-columns: 1fr; }
}

/* En çok işlem gören ürünler: sıkı satırlar, sıra rozeti, sade ürün adı */
.drs-strong { font-weight: 500; }

.drs-rank {
    color: var(--foreground);
    font-size: 0.8125rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.bc .drs-top-urunler .table td { padding-block: 0.5rem; }
.bc .drs-top-urunler .table td.drs-wrap { min-width: 0; }
.bc .drs-top-urunler .table th { height: 2.25rem; }
.bc .drs-top-urunler .drs-cell-stack { line-height: 1.25; }


/* Not metni ve "Devamı" */
.drs-note-text { white-space: pre-line; }

.drs-read-more {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* Dialog içi satırlar */
.bc .dialog > * > .drs-dialog-stats {
    display: grid;
    gap: 0.5rem;
}

.drs-kv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
}

.drs-kv-row > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted-foreground);
}

.drs-kv-row > span:first-child svg { width: 1rem; height: 1rem; }
.drs-kv-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.drs-kv-row.drs-kv-total { background: var(--muted); border-color: transparent; }
.drs-kv-right { display: inline-flex; align-items: center; gap: 0.5rem; }

.drs-center { text-align: center; margin: 0; }

.drs-note-box {
    display: grid;
    gap: 0.5rem;
    padding: 0.875rem;
    background: var(--muted);
    border-radius: calc(var(--radius) - 2px);
}

.drs-note-konu { margin: 0; font-weight: 600; font-size: 0.875rem; }
.drs-note-body { margin: 0; font-size: 0.875rem; line-height: 1.6; white-space: pre-line; }

/* Bilgi Topla formu */
.drs-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* Başlık flex içinde daralıp ikonu alt satıra düşürmesin */
.drs-field-head > .drs-subhead {
    margin-top: 0;
    white-space: nowrap;
}

.drs-oneri {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.bc .drs-oneri .btn {
    height: auto;
    padding-block: 0.375rem;
    white-space: normal;
    text-align: left;
}

@keyframes drs-spin { to { transform: rotate(360deg); } }
.drs-spin { animation: drs-spin 1s linear infinite; vertical-align: -0.125rem; }

@media (max-width: 768px) {
    .bc .drs-profile { padding: 1rem; }
    .drs-profile-title h1 { font-size: 1.125rem; }
    .drs-profile-actions { width: 100%; }
    .drs-profile-actions > .btn:not([data-size]) { flex: 1 1 auto; }
    .drs-profile-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .drs-chart { height: 14rem; }
    .drs-chart-tall { height: 16rem; }
    .bc .drs-panel > .drs-panel-head { padding: 0.875rem 1rem; }
    .bc .card > .drs-table-head { padding: 0.875rem 1rem; }
    .bc .drs-panel > .drs-panel-body { padding: 0.75rem 1rem 1rem; }
    .drs-two-col { gap: 0.75rem; }
}

/* Tıkla-kopyala metin (pages/fatura.php: Belge No). data-copied="true" iken yeşil metin + "Kopyalandı" balonu */
.bc .drs-copy {
    position: relative;
    display: inline-block;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 500;
    color: var(--foreground);
    cursor: copy;
    text-decoration: none;
    text-underline-offset: 3px;
}

.bc .drs-copy:hover { text-decoration: underline dashed; }
.bc .drs-copy:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 2px; }

/* Mobil kartta ikincil satır: sessiz gri, boyut üst öğeden */
.bc .drs-copy.drs-copy-muted { color: inherit; font-weight: inherit; font-size: inherit; }

.drs-copy[data-copied="true"], .bc .drs-copy.drs-copy-muted[data-copied="true"] { color: var(--drs-success); }

.drs-copy[data-copied="true"]::after {
    content: "Kopyalandı";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.375rem);
    translate: -50% 0;
    padding: 0.2rem 0.5rem;
    border-radius: calc(var(--radius) - 4px);
    background: var(--foreground);
    color: var(--background);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    pointer-events: none;
    animation: drs-copy-pop 1.4s ease forwards;
    z-index: 5;
}

@keyframes drs-copy-pop {
    0%   { opacity: 0; translate: -50% 4px; }
    12%  { opacity: 1; translate: -50% 0; }
    75%  { opacity: 1; translate: -50% 0; }
    100% { opacity: 0; translate: -50% -4px; }
}

/* Tıklanabilir satır: 'row_href' (sayfaya gider) veya row_attrs ile data-clickable (sayfanın kendi JS'i açar) */
.bc .drs-table tbody tr[data-href],
.bc .drs-table tbody tr[data-clickable],
.bc .drs-mobile-card[data-href],
.bc .drs-mobile-card[data-clickable] { cursor: pointer; }
.bc .drs-table tbody tr[data-href]:hover,
.bc .drs-table tbody tr[data-clickable]:hover,
.bc .drs-mobile-card[data-href]:hover,
.bc .drs-mobile-card[data-clickable]:hover { background: var(--muted); }

/* ===== Stok analiz (pages/stok.php) ===== */

/* Ton rozetleri: stat ikon paletiyle aynı renkler (badge üzerinde) */
.bc .badge[data-tone="info"]    { background: oklch(95% 0.03 250); color: oklch(45% 0.18 255); }
.bc .badge[data-tone="danger"]  { background: oklch(95% 0.03 25);  color: oklch(50% 0.21 27); }
.bc .badge[data-tone="warning"] { background: oklch(96% 0.05 80);  color: oklch(55% 0.16 65); }
.bc .badge[data-tone="success"] { background: oklch(95% 0.04 150); color: oklch(45% 0.15 150); }
.bc .badge[data-tone="violet"]  { background: oklch(95% 0.03 300); color: oklch(48% 0.19 300); }
.bc .badge[data-tone="neutral"] { background: var(--muted);        color: var(--muted-foreground); }

/* Özet altı uyarı düğmeleri (fiyat sorunları) */
.drs-notes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bc .drs-notes .btn svg { color: var(--drs-warning); }
.bc .drs-notes .btn[data-tone="danger"] svg { color: var(--destructive); }

/* Depo durumu kartları: ad + toplam içindeki pay, adet/çeşit, ince pay çubuğu */
.drs-depo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.75rem; }
.bc .drs-depo-card { display: grid; gap: 0.375rem; padding: 0.75rem 1rem; }
.drs-depo-bar { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.125rem; }
.drs-depo-bar .drs-dist-bar { flex: 1; }
.drs-depo-name { font-size: 0.8125rem; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.drs-depo-pay { font-size: 0.75rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; min-width: 2.25rem; text-align: end; }
.drs-depo-vals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; font-size: 0.75rem; color: var(--muted-foreground); }
.drs-depo-vals > span { text-align: left; white-space: nowrap; }
.drs-depo-vals b { font-size: 1.0625rem; font-weight: 600; color: var(--foreground); font-variant-numeric: tabular-nums; margin-right: 0.125rem; }

/* Depo çipleri (tablo hücresi) */
.drs-depo-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.bc .drs-depo-chips .badge { font-weight: 400; gap: 0.375rem; }
.bc .drs-depo-chips .badge b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Dağılım listesi (dialog): etiket, değer, yüzde ve ince çubuk */
.bc .dialog > * > .drs-dist { display: grid; gap: 0.75rem; }
.drs-dist-row { display: grid; gap: 0.375rem; }
.drs-dist-head { display: flex; align-items: baseline; gap: 0.75rem; font-size: 0.875rem; }
.drs-dist-label { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.drs-dist-value { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.drs-dist-pct { min-width: 3.25rem; text-align: end; font-size: 0.75rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.drs-dist-bar { height: 0.375rem; border-radius: 9999px; background: var(--muted); overflow: hidden; }
.drs-dist-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.drs-dist-bar[data-tone="success"] > i { background: var(--drs-success); }

/* Dialog: geniş panel, araç çubuğu, sekmeler, kaydırılabilir tablo */
.bc .dialog > .drs-dialog-xl { max-width: 84rem; }
.bc .dialog > .drs-dialog-lg,
.bc .dialog > .drs-dialog-xl { max-height: min(92vh, 64rem); }

.bc .dialog .drs-dialog-toolbar { gap: 0.5rem; }
.bc .drs-dialog-toolbar .select { width: auto; height: 2.25rem; font-size: 0.8125rem; }
.bc .drs-dialog-toolbar .drs-search { flex: 1 1 12rem; }
.bc .drs-dialog-toolbar .drs-search .input { height: 2.25rem; font-size: 0.8125rem; }
.bc .drs-dialog-toolbar .btn[data-variant="outline"]:not([data-size]) { height: 2.25rem; font-size: 0.8125rem; }
.drs-dialog-count { margin-left: auto; font-size: 0.8125rem; color: var(--muted-foreground); white-space: nowrap; }
.drs-dialog-count b { color: var(--foreground); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Esnek panel: başlık/araç çubuğu sabit, tablo bölümü kalan alanda kayar */
.bc .dialog > .drs-dialog-flex { display: flex; flex-direction: column; gap: 1rem; }
.bc .dialog > .drs-dialog-flex .drs-dialog-table { padding-inline: 0; flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; }
.bc .dialog > .drs-dialog-flex .drs-dialog-table thead th { position: sticky; top: 0; background: var(--popover); z-index: 1; }
.drs-dialog-total { margin: 0; padding: 0.625rem 1.25rem; border-top: 1px solid var(--border); font-size: 0.8125rem; color: var(--muted-foreground); }
.drs-dialog-total b { color: var(--foreground); font-variant-numeric: tabular-nums; }
.drs-dialog-empty { display: grid; justify-items: center; gap: 0.5rem; padding: 2.5rem 1rem; text-align: center; font-size: 0.875rem; color: var(--muted-foreground); }
.drs-dialog-empty svg { width: 2rem; height: 2rem; color: var(--drs-success); }
.drs-dialog-empty[data-tone="muted"] svg { color: var(--muted-foreground); opacity: 0.6; }

.drs-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); }
.bc .drs-tabs [role="tab"] {
    display: inline-flex; align-items: center; gap: 0.5rem;
    margin-bottom: -1px; padding: 0.5rem 0.75rem 0.625rem;
    border: 0; border-bottom: 2px solid transparent; background: none;
    font: inherit; font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground); cursor: pointer;
}
.bc .drs-tabs [role="tab"]:hover { color: var(--foreground); }
.bc .drs-tabs [role="tab"][aria-selected="true"] { color: var(--foreground); border-bottom-color: var(--foreground); }
.bc .drs-tabs [role="tab"] svg { width: 1rem; height: 1rem; }
.bc .drs-tabs [role="tab"] .badge { height: 1.125rem; padding-inline: 0.4rem; }
.bc .dialog > .drs-dialog-flex > [role="tabpanel"] { display: flex; flex-direction: column; gap: 0.75rem; flex: 1 1 auto; min-height: 0; }
.bc .dialog > .drs-dialog-flex > [role="tabpanel"][hidden] { display: none; }

/* Depo optimizasyon: bilgi şeridi + aksiyonlar */
.drs-mw-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem;
    padding: 0.625rem 0.875rem; background: var(--muted); border-radius: calc(var(--radius) - 2px); font-size: 0.8125rem;
}
.drs-mw-info { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.5rem; color: var(--muted-foreground); }
.drs-mw-info > svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.drs-mw-info b { color: var(--foreground); font-weight: 600; }
.drs-mw-actions { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-left: auto; }

.drs-mw-num { font-size: 1.125rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.drs-mw-num small { font-size: 0.6875rem; font-weight: 400; color: var(--muted-foreground); }
.drs-mw-kritik { color: var(--destructive); }
.drs-mw-yuksek { color: var(--drs-warning); }
.drs-mw-orta { color: var(--muted-foreground); }

/* Sevk adedi girdileri */
.drs-sevk { display: grid; gap: 0.25rem; min-width: 12rem; }
.drs-sevk-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; }
.drs-sevk-row > span:first-child { flex: 1; min-width: 0; color: var(--muted-foreground); overflow-wrap: anywhere; }
.drs-sevk-row > span:first-child small { color: color-mix(in oklab, var(--muted-foreground) 70%, transparent); }
.bc .drs-sevk-row .input { width: 4.25rem; height: 1.75rem; padding-inline: 0.25rem; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.bc .drs-sevk-row .input[aria-invalid="true"] { border-color: var(--destructive); color: var(--destructive); }
.drs-sevk-max { min-width: 2rem; font-size: 0.6875rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.bc .drs-minadet { width: 5.5rem; height: 2.25rem; text-align: center; font-weight: 600; }

/* B2B stok eksikleri */
.bc .dialog > * > .drs-eksik-body { display: grid; align-content: start; gap: 0.75rem; min-height: 0; overflow: auto; }
.drs-eksik-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.5rem; }
.drs-eksik-tile { padding: 0.625rem 0.75rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); }
.drs-eksik-tile b { display: block; font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.drs-eksik-tile span { font-size: 0.75rem; color: var(--muted-foreground); }
.drs-eksik-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.5rem; }
.drs-eksik-card { display: grid; gap: 0.375rem; padding: 0.75rem; border: 1px solid var(--border); border-left-width: 3px; border-radius: calc(var(--radius) - 2px); font-size: 0.875rem; }
.drs-eksik-card[data-level="critical"] { border-left-color: var(--destructive); }
.drs-eksik-card[data-level="medium"] { border-left-color: var(--drs-warning); }
.drs-eksik-card[data-level="low"] { border-left-color: var(--muted-foreground); }
.drs-eksik-name { font-weight: 600; overflow-wrap: anywhere; }
.drs-eksik-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; font-size: 0.75rem; color: var(--muted-foreground); }
.drs-eksik-meta svg { width: 0.75rem; height: 0.75rem; vertical-align: -0.1em; }

@media (max-width: 768px) {
    .drs-mw-actions { width: 100%; margin-left: 0; }
    .bc .drs-mw-actions .btn { flex: 1 1 auto; }
    .drs-dialog-count { margin-left: 0; flex-basis: 100%; }
    .bc .drs-dialog-toolbar .select { flex: 1 1 calc(50% - 0.25rem); }
    .drs-tabs { overflow-x: auto; }
}

/* ===== Stok detay (pages/stok-detay.php) ===== */

/* Panel içi anahtar–değer ızgarası (künye ile aynı tipografi, üst çizgi yok) */
.drs-kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.875rem 1.5rem;
    margin: 0;
}
.drs-kv-grid > div { display: grid; gap: 0.125rem; min-width: 0; }
.drs-kv-grid dt { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }
.drs-kv-grid dd { margin: 0; font-size: 0.9375rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.drs-kv-grid dd small { font-size: 0.75rem; font-weight: 400; color: var(--muted-foreground); }
.drs-kv-grid dd svg { width: 0.875rem; height: 0.875rem; vertical-align: -0.125rem; }

/* Analiz durumu listesi */
.drs-status-list { display: grid; gap: 0.5rem; }
.drs-status-item {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--border); border-left-width: 3px;
    border-radius: calc(var(--radius) - 2px);
}
.drs-status-item[data-tone="danger"]  { border-left-color: var(--destructive); }
.drs-status-item[data-tone="warning"] { border-left-color: var(--drs-warning); }
.drs-status-item[data-tone="success"] { border-left-color: var(--drs-success); }
.drs-status-item[data-tone="info"]    { border-left-color: oklch(60% 0.18 255); }
.drs-status-item[data-tone="violet"]  { border-left-color: oklch(55% 0.19 300); }
.drs-status-item > svg { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.125rem; color: var(--muted-foreground); }
.drs-status-item[data-tone="danger"] > svg  { color: var(--destructive); }
.drs-status-item[data-tone="warning"] > svg { color: var(--drs-warning); }
.drs-status-item[data-tone="success"] > svg { color: var(--drs-success); }
.drs-status-title { margin: 0; font-size: 0.875rem; font-weight: 600; }
.drs-status-desc { margin: 0.125rem 0 0; font-size: 0.8125rem; color: var(--muted-foreground); line-height: 1.45; }

/* Panel altı bölüm başlığı (depo dağılımı) */
.drs-subhead { margin: 0.25rem 0 0; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-foreground); }

/* Izgaralı anahtar–değer: 4 sütun, hücreler arası ince çizgi (Satış Performansı) */
.drs-kv-grid.drs-kv-lines {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    overflow: hidden;
}
.drs-kv-grid.drs-kv-lines > div { padding: 0.75rem 0.875rem; background: var(--card); }
@media (max-width: 768px) {
    .drs-kv-grid.drs-kv-lines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== Temsilci (pages/temsilci.php) ===== */

/* Temsilci kartları: ad + aktif/pasif rozetleri, dört ölçü */
.drs-rep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr));
    gap: 0.75rem;
}
.bc .drs-rep {
    display: flex;
    flex-direction: row; /* basecoat .card sütun yönünü ezer */
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.125rem;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.15s, background-color 0.15s;
}
/* Kart çerçevesi basecoat'ta ring (box-shadow); box-shadow ezilmez, ring rengi koyulaşır */
.bc .drs-rep:hover { --tw-ring-color: color-mix(in oklab, var(--color-foreground) 30%, transparent); background: color-mix(in oklab, var(--muted) 40%, var(--card)); }
.bc .drs-rep:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.drs-rep-body { display: grid; gap: 0.625rem; flex: 1; min-width: 0; }
.drs-rep-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.drs-rep-badges { flex-shrink: 0; margin-left: auto; }
.drs-rep-name { font-weight: 600; font-size: 1.125rem; letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
.drs-rep-badges { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }
.drs-rep-stats {
    display: grid;
    grid-template-columns: max-content repeat(3, minmax(0, 1fr)); /* ciro tam görünür, kalanlar eşit */
    gap: 0.25rem 1.25rem;
    margin: 0;
    padding-top: 0.625rem;
    border-top: 1px solid var(--border);
}
.drs-rep-stats > div { display: grid; gap: 0.0625rem; min-width: 0; }
.drs-rep-stats dt { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }
.drs-rep-stats dd { margin: 0; font-size: 0.9375rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.drs-rep-arrow { display: inline-flex; color: var(--muted-foreground); flex-shrink: 0; }
.drs-rep-arrow svg { width: 1rem; height: 1rem; }

/* Ürün grubu × temsilci pivotu: ilk sütun yapışkan, toplam satırı vurgulu */
.bc .drs-pivot { overflow-x: auto; }
.bc .drs-pivot .table th:first-child,
.bc .drs-pivot .table td:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; }
.bc .drs-pivot .table th { white-space: nowrap; }
.bc .drs-pivot .table tfoot td { font-weight: 600; background: var(--muted); }
.bc .drs-pivot .table tfoot td:first-child { background: var(--muted); }
.bc .drs-pivot .drs-table-empty { padding: 2rem 1rem; }

/* Görüşme notları: not sütunu geniş, filtre formu başlık sağında */
.bc .drs-notlar .table td.drs-note-col { min-width: 18rem; max-width: 32rem; }
.bc .drs-notlar .drs-table-actions form.drs-filters { display: contents; }
.bc .drs-table-actions .drs-filters .select { min-width: 0; }

/* Durum rozeti düğme olarak tıklanabilir */
.bc .drs-durum-badge { cursor: pointer; border: 0; font: inherit; font-size: 0.75rem; }
.bc .drs-durum-badge:hover { filter: brightness(0.96); }

@media (max-width: 768px) {
    .drs-rep-grid { grid-template-columns: 1fr; }
    .drs-rep-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .drs-rep-head { flex-wrap: wrap; }
    .bc .drs-notlar .table td.drs-note-col { min-width: 0; }
}

/* ===== Temsilci detay (pages/temsilci-detay.php) ===== */

/* Stat kartı alt satırı (aktif / pasif) */
.drs-stat-sub { margin: 0.25rem 0 0; font-size: 0.75rem; color: var(--muted-foreground); }

/* Panel içi sekmeler: kart kenarından içeride */
.bc .drs-panel > .drs-tabs.drs-tabs-inset { padding-inline: 0.75rem; }
.bc .drs-panel > [role="tabpanel"] .drs-table-body { padding: 0; }

/* Açılır satırlar (ürün grubu → segment) */
.drs-expander { cursor: pointer; }
.drs-expander-label { display: inline-flex; align-items: center; gap: 0.375rem; }
.drs-expander-label > svg { width: 0.875rem; height: 0.875rem; color: var(--muted-foreground); transition: transform 0.15s; flex-shrink: 0; }
.drs-expander[aria-expanded="true"] .drs-expander-label > svg:first-child { transform: rotate(90deg); }
.drs-expander-gap { display: inline-block; width: 0.875rem; }
.drs-expander-sub { padding-left: 1.25rem; color: var(--muted-foreground); font-size: 0.8125rem; }
.bc .drs-kart-tablo .table tr.drs-expander-child td { padding-block: 0.375rem; background: color-mix(in oklab, var(--muted) 50%, var(--card)); }
.bc .drs-kart-tablo .table tfoot td { font-weight: 600; background: var(--muted); }

/* Dağılım dialogu: alt segment satırları içeride, çubuk yok */
.bc .dialog > * > .drs-dist .drs-dist-sub { padding-left: 1.5rem; }
.bc .dialog > * > .drs-dist .drs-dist-sub .drs-dist-head { font-size: 0.8125rem; color: var(--muted-foreground); }
.drs-dist-label svg { width: 0.875rem; height: 0.875rem; vertical-align: -0.125rem; margin-right: 0.25rem; color: var(--muted-foreground); transition: transform 0.15s; }
.drs-dist-row.drs-expander[aria-expanded="true"] .drs-dist-label svg { transform: rotate(90deg); }
.drs-dist-row.drs-expander:hover .drs-dist-label { text-decoration: underline; text-underline-offset: 3px; }

/* Haftalık tahsilat takvimi */
.drs-kv-grid.drs-kv-lines.drs-kv-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.drs-kv-grid dt small { display: block; text-transform: none; letter-spacing: 0; font-size: 0.6875rem; }
.drs-week-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.drs-week { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); overflow: hidden; }
.drs-week[data-active] { border-color: oklch(60% 0.18 255); box-shadow: 0 0 0 1px oklch(60% 0.18 255); }
.drs-week-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border); background: var(--muted); }
.drs-week-head p { margin: 0; }
.drs-week-title { font-size: 0.875rem; font-weight: 600; display: flex; align-items: center; gap: 0.375rem; }
.drs-week-head > b { font-size: 0.875rem; white-space: nowrap; }
.drs-week-body { display: grid; align-content: start; max-height: 22rem; overflow-y: auto; }
.drs-week-body .drs-dialog-empty { padding: 1.5rem 0.75rem; }
.drs-week-item { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.75rem; font-size: 0.8125rem; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.drs-week-item:last-child { border-bottom: 0; }
.drs-week-item:hover { background: var(--muted); }
.drs-week-item b { white-space: nowrap; }

@media (max-width: 1024px) {
    .drs-week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .drs-kv-grid.drs-kv-lines.drs-kv-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .drs-week-grid { grid-template-columns: 1fr; }
    .drs-kv-grid.drs-kv-lines.drs-kv-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tablo başlığındaki filtre popover'ı: kart kırpmasın, düğme select ile aynı yükseklikte */
.bc .drs-table:has(.drs-table-actions .popover) { overflow: visible; }
.bc .drs-table:has(.drs-table-actions .popover):not(:has(> .drs-table-foot)) > .drs-table-body { overflow: hidden; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.bc .drs-table-actions > .popover > .btn { height: 2rem; font-size: 0.8125rem; }
.bc .drs-table-actions > .popover > .btn > svg:last-child { width: 0.875rem; height: 0.875rem; color: var(--muted-foreground); }

/* Izgaralı anahtar–değer: iki sütun (not dialogu) */
.drs-kv-grid.drs-kv-lines.drs-kv-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ===== Tahsilat (pages/tahsilat.php) ===== */

/* Yedi özet kartı geniş ekranda tek satır */
@media (min-width: 1200px) {
    .drs-stats-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .drs-stats-7 .drs-stat-value { font-size: 1.125rem; }
}

/* Alt alta paneller (iki sütunlu düzenin sol hücresi) */
.drs-stack { display: grid; gap: 1rem; align-content: start; }

/* Tahmin tabloları: tıklanabilir satırlar, vurgulu toplam satırı */
.bc .drs-forecast .drs-panel-body { padding: 0; }
.bc .drs-forecast .table tbody tr[data-clickable] { cursor: pointer; }
.bc .drs-forecast .table tbody tr[data-clickable]:hover { background: var(--muted); }
.bc .drs-forecast .table tfoot td { font-weight: 600; background: var(--muted); border-top: 1px solid var(--border); }
.bc .drs-forecast .table td { padding-block: 0.625rem; }

/* Dialog formu: iki sütunlu alan ızgarası */
.drs-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.drs-form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.drs-form-grid .drs-field-full { grid-column: 1 / -1; }
/* Taahhüt dialogu: cari ünvanı tek satırda, kod rozet olarak yanında */
.drs-taahhut-cari { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.drs-taahhut-unvan { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.bc .dialog > .drs-taahhut-form { max-width: 42rem; }
.drs-kv-grid.drs-kv-lines.drs-kv-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.drs-kv-grid dd .badge { vertical-align: middle; }

/* Dialog yüklenme durumu */
.drs-dialog-loading { display: grid; justify-items: center; gap: 0.5rem; padding: 2.5rem 1rem; font-size: 0.875rem; color: var(--muted-foreground); }
.drs-dialog-loading svg { width: 1.5rem; height: 1.5rem; }
.drs-dialog-loading[data-tone="error"] svg { color: var(--destructive); }

/* Dialog içi tablo toplam satırı */
.bc .dialog .drs-dialog-table .table tfoot td { font-weight: 600; background: var(--muted); border-top: 1px solid var(--border); }

/* Aylık takvim: 6 ay kartı (hafta kartı stiliyle) */
.drs-month-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.drs-month-grid .drs-week-body { max-height: 18rem; }
.drs-week-sub { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; padding: 0.375rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.75rem; color: var(--muted-foreground); }
.drs-week-sub > span { display: inline-flex; align-items: center; gap: 0.25rem; }
.drs-week-sub svg { width: 0.75rem; height: 0.75rem; }
.drs-week-item .drs-week-amt { display: inline-flex; align-items: center; gap: 0.375rem; white-space: nowrap; }
.drs-week-item .badge { height: 1.125rem; padding-inline: 0.35rem; font-size: 0.625rem; }


@media (max-width: 1024px) {
    .drs-month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .drs-form-grid,
    .drs-form-grid-3 { grid-template-columns: 1fr; }
    .drs-month-grid { grid-template-columns: 1fr; }
    .drs-kv-grid.drs-kv-lines.drs-kv-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .bc .dialog > * > footer .btn[data-variant="destructive"] { margin-right: auto; }
}

/* Dialog tablolarında tıklanabilir satır (kart dışı .table) */
.bc .dialog .table tbody tr[data-href],
.bc .dialog .table tbody tr[data-clickable] { cursor: pointer; }
.bc .dialog .table tbody tr[data-href]:hover,
.bc .dialog .table tbody tr[data-clickable]:hover { background: var(--muted); }

/* Sayfa ızgarasındaki kartlar içeriğin en dar genişliğine kilitlenmesin (geniş tablo kartı sayfayı yatayda taşırıyordu) */
.bc.page > *, .drs-two-col > *, .drs-stack > * { min-width: 0; }

/* Cari vadeleri: arama + temsilci filtresi tablo başlığında (form görünmez sarmalayıcı) */
.bc .drs-cari-vadeleri .drs-table-actions form.drs-filters { display: contents; }
.bc .drs-cari-vadeleri .drs-table-actions .drs-search { flex: 1 1 18rem; }
.bc .drs-cari-vadeleri > .drs-table-body { overflow-x: auto; }
/* Taahhüt ekle düğmesi: satır içinde fark edilsin (ikon + etiket, sarmalanmaz) */
.bc .drs-taahhut-btn { white-space: nowrap; gap: 0.3rem; }
.bc .drs-taahhut-btn svg { width: 0.875rem; height: 0.875rem; }
.bc tr:hover .drs-taahhut-btn { border-color: var(--foreground); }
@media (max-width: 768px) {
    .bc .drs-cari-vadeleri > .drs-table-head,
    .bc .drs-yaklasan > .drs-table-head { flex-wrap: wrap; }
    .bc .drs-cari-vadeleri .drs-table-actions,
    .bc .drs-yaklasan .drs-table-actions { width: 100%; flex-wrap: wrap; }
    .bc .drs-cari-vadeleri .drs-table-actions .drs-search,
    .bc .drs-yaklasan .drs-table-actions .drs-search { flex-basis: 100%; }
    .bc .drs-cari-vadeleri .drs-table-actions > .popover { flex: 1 1 auto; }
    .drs-section-head h2 { white-space: nowrap; }
}

/* ===== Potansiyel (pages/potansiyel.php) ===== */

/* Seçili durum kartı: kenarlık vurgusu */
.bc .drs-stat[data-active] { --tw-ring-color: var(--foreground); background-color: var(--muted); }

/* Dönüşüm çubukları panel içinde (dialog dışı .drs-dist) */
.bc .drs-panel .drs-dist { display: grid; gap: 0.875rem; }
.drs-dist-bar[data-tone="warning"] > i { background: var(--drs-warning); }
.drs-dist-bar[data-tone="danger"] > i { background: var(--destructive); }

/* Ürün grubu rozetleri (tablo hücresi, detay dialogu) */
.drs-urun-list { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.bc .drs-urun-list .badge { font-weight: 500; }

/* Takip tablosu: not sütunu iki satıra kırpılır */
.bc .drs-takip .table td.drs-note-col { min-width: 14rem; max-width: 26rem; }
.drs-note-clamp {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 0.8125rem; line-height: 1.45; color: var(--muted-foreground); white-space: pre-line;
}
.bc .drs-takip .drs-table-actions .drs-search { flex: 1 1 16rem; }
.bc .drs-takip > .drs-table-body { overflow-x: auto; }

/* Detay dialogu blokları */
.drs-detay-block { display: grid; gap: 0.5rem; }
.drs-detay-text { margin: 0; font-size: 0.875rem; line-height: 1.5; }
.drs-subhead svg { width: 0.875rem; height: 0.875rem; vertical-align: -0.1875rem; margin-right: 0.125rem; }
.drs-note-konu svg { width: 0.875rem; height: 0.875rem; vertical-align: -0.125rem; color: var(--muted-foreground); }
.drs-note-list { margin: 0; padding-left: 1.125rem; font-size: 0.8125rem; line-height: 1.6; color: var(--muted-foreground); }
.bc .drs-upper { text-transform: uppercase; }

/* Aktivite ekleme formu (detay dialogu içinde) */
.drs-aktivite-form { display: grid; gap: 0.625rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: color-mix(in oklab, var(--muted) 40%, var(--card)); }
.drs-aktivite-form[hidden] { display: none; }
/* Dar panelde iki sütun: etiket ve alanlar kompakt kalsın */
.drs-aktivite-form .drs-form-grid { gap: 0.625rem; }
.bc .drs-aktivite-form .field { gap: 0.3125rem; }
.bc .drs-aktivite-form .field > label { font-size: 0.75rem; font-weight: 500; color: var(--muted-foreground); }
.bc .drs-aktivite-form .input,
.bc .drs-aktivite-form select.select { height: 2rem; font-size: 0.8125rem; }
.bc .drs-aktivite-form .textarea { min-height: 4.25rem; font-size: 0.8125rem; }
.bc .drs-aktivite-form .drs-optional,
.bc .drs-aktivite-form .drs-required { font-size: 0.75rem; }
/* İşlem satırı ince bir çizgiyle formun gövdesinden ayrılsın */
.drs-aktivite-actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; padding-top: 0.625rem; border-top: 1px solid var(--border); }

/* Aktivite zaman çizelgesi */
.drs-timeline { list-style: none; margin: 0; padding: 0; max-height: 20rem; overflow-y: auto; }
.drs-timeline-item { display: flex; gap: 0.75rem; padding: 0.625rem 0; border-bottom: 1px solid var(--border); }
.drs-timeline-item:last-child { border-bottom: 0; }
.drs-timeline-icon {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 2rem; height: 2rem; border-radius: 9999px; background: var(--muted); color: var(--muted-foreground);
}
.drs-timeline-icon svg { width: 0.875rem; height: 0.875rem; }
.drs-timeline-icon[data-tone="info"]    { background: oklch(95% 0.03 250); color: oklch(50% 0.18 255); }
.drs-timeline-icon[data-tone="success"] { background: oklch(95% 0.04 150); color: oklch(50% 0.15 150); }
.drs-timeline-icon[data-tone="warning"] { background: oklch(96% 0.05 80);  color: oklch(62% 0.16 65); }
.drs-timeline-icon[data-tone="violet"]  { background: oklch(95% 0.03 300); color: oklch(52% 0.19 300); }
.drs-timeline-icon[data-tone="danger"]  { background: oklch(95% 0.03 25);  color: oklch(55% 0.21 27); }
.drs-timeline-body { flex: 1; min-width: 0; display: grid; gap: 0.125rem; }
.drs-timeline-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.drs-timeline-title { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.375rem; font-size: 0.8125rem; font-weight: 600; }
.bc .drs-timeline-title .badge { height: 1.125rem; padding-inline: 0.4rem; font-size: 0.625rem; }
.drs-timeline-date { font-size: 0.75rem; color: var(--muted-foreground); white-space: nowrap; font-variant-numeric: tabular-nums; }
.drs-timeline-desc { margin: 0; font-size: 0.8125rem; line-height: 1.45; color: var(--muted-foreground); white-space: pre-line; overflow-wrap: anywhere; }
.drs-timeline-user { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; color: var(--muted-foreground); }
.drs-timeline-user svg { width: 0.75rem; height: 0.75rem; }
.drs-timeline-empty { display: grid; justify-items: center; gap: 0.375rem; padding: 1.5rem 1rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.drs-timeline-empty svg { width: 1.5rem; height: 1.5rem; opacity: 0.6; }

/* Düzenle dialogu: aramalı onay kutusu listesi (ürün grupları) */
.drs-check-box { border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); overflow: hidden; }
.drs-check-box .drs-filter-search { padding: 0.25rem; }
.drs-check-list { display: flex; flex-direction: column; max-height: 12rem; overflow-y: auto; padding: 0.25rem; }
.bc .drs-check-list .drs-check { font-size: 0.8125rem; }
.drs-check-list .drs-check[hidden] { display: none; }

@media (max-width: 768px) {
    .bc .drs-takip > .drs-table-head { flex-wrap: wrap; }
    .bc .drs-takip .drs-table-actions { width: 100%; flex-wrap: wrap; }
    .bc .drs-takip .drs-table-actions .drs-search { flex-basis: 100%; }
    .bc .drs-takip .drs-table-actions > .popover { flex: 1 1 auto; }
    .drs-timeline-head { flex-direction: column; gap: 0.125rem; }
}

/* ===== Rut planlama (pages/rut-planlama.php) ===== */

/* Başlık sağındaki araç çubuğu: hafta gezinme, plan durumu, temsilci */
.drs-rut-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.bc .drs-rut-toolbar .btn { height: 2rem; }
.bc .drs-rut-toolbar > .popover > .btn { height: 2rem; font-size: 0.8125rem; }
.bc .drs-rut-toolbar > .popover > .btn > svg:last-child { width: 0.875rem; height: 0.875rem; color: var(--muted-foreground); }
.drs-week-nav { display: inline-flex; align-items: center; gap: 0.25rem; }
.bc .drs-week-nav .btn { width: 2rem; padding: 0; }
.drs-week-label { min-width: 12.5rem; text-align: center; font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Havuz (sol) + haftalık takvim (sağ) */
.drs-rut-layout { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 1rem; align-items: start; }

/* Müşteri havuzu paneli: başlık ve filtreler sabit, liste kayar */
.bc .drs-pool { position: sticky; top: 1rem; grid-template-rows: auto auto minmax(0, 1fr); max-height: calc(100vh - 7rem); overflow: hidden; }
.bc .drs-pool > .drs-panel-head { padding: 0.75rem 0.875rem; }
.drs-pool-filters { display: grid; gap: 0.375rem; padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border); }
.drs-pool-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.375rem; }
.bc .drs-pool-filters .input, .bc .drs-pool-filters .select { width: 100%; height: 2rem; font-size: 0.8125rem; }
.drs-pool-list { display: grid; align-content: start; gap: 0.375rem; padding: 0.5rem; overflow-y: auto; }

/* Havuz kartı (takvime sürüklenir) */
.drs-cust {
    display: grid; gap: 0.25rem; padding: 0.5rem 0.625rem;
    border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px);
    background: var(--card); cursor: grab;
}
.drs-cust:hover { background: var(--muted); }
.drs-cust:active { cursor: grabbing; }
.drs-cust-name { margin: 0; font-size: 0.8125rem; font-weight: 500; line-height: 1.35; }

/* Ortak künye satırı (havuz ve ziyaret kartı) */
.drs-cust-meta, .drs-visit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; font-size: 0.6875rem; color: var(--muted-foreground); }
.drs-cust-meta > span:not(.badge), .drs-visit-meta > span:not(.badge), .drs-cust-meta a, .drs-visit-meta a { display: inline-flex; align-items: center; gap: 0.1875rem; }
.drs-cust-meta a, .drs-visit-meta a { color: inherit; text-decoration: none; }
.drs-cust-meta a:hover, .drs-visit-meta a:hover { text-decoration: underline; text-underline-offset: 2px; }
.drs-cust-meta svg, .drs-visit-meta svg { width: 0.75rem; height: 0.75rem; }
.bc .drs-cust .badge, .bc .drs-visit .badge { height: 1rem; padding-inline: 0.3rem; font-size: 0.625rem; font-weight: 500; }

/* Haftalık ızgara: beş gün kartı */
.drs-day-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; align-items: start; }
/* overflow: visible -> ziyaret kartındaki dropdown gün kartını taşabilsin */
.bc .drs-day { display: flex; flex-direction: column; gap: 0; min-height: 17rem; padding: 0; overflow: visible; }
/* Bugünün sütunu: renk yerine başlıktaki beyaz "Bugün" rozeti işaret eder */
.bc .drs-day-head .badge[data-today-label] { background: var(--background); color: var(--foreground); font-weight: 600; }
/* Başlık koyu zemin, yazılar beyaz */
.bc .drs-day > .drs-day-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.625rem; background: var(--foreground); color: var(--background); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.drs-day-title { display: grid; line-height: 1.25; }
.drs-day-title b { font-size: 0.8125rem; }
.drs-day-title span { font-size: 0.6875rem; color: color-mix(in oklab, var(--background) 75%, transparent); font-variant-numeric: tabular-nums; }
.drs-day-tags { display: flex; align-items: center; gap: 0.25rem; }
.bc .drs-day-head .badge { height: 1.125rem; padding-inline: 0.375rem; font-size: 0.6875rem; background: color-mix(in oklab, var(--background) 22%, transparent); color: var(--background); }
.bc .drs-day > .drs-day-body { flex: 1; display: grid; align-content: start; gap: 0.375rem; padding: 0.5rem; }

/* Ziyaret kartı: sol kenarda durum rengi, üst sağda işlemler */
.drs-visit {
    position: relative; display: grid; gap: 0.25rem; padding: 0.5rem 0.625rem;
    border: 1px solid var(--border); border-left: 3px solid var(--border);
    border-radius: calc(var(--radius) - 2px); background: var(--card); cursor: grab;
}
.drs-visit:active { cursor: grabbing; }
.drs-visit[data-durum="tamamlandi"] { border-left-color: var(--drs-success); background: oklch(98% 0.02 150); }
.drs-visit[data-durum="ertelendi"] { border-left-color: var(--drs-warning); background: oklch(98% 0.02 80); }
.drs-visit[data-durum="iptal"] { border-left-color: var(--destructive); background: oklch(98% 0.015 25); opacity: 0.65; }
/* Ad, sağ üstteki üç nokta düğmesinin altına girmesin */
.drs-visit-name { margin: 0; padding-right: 1.75rem; font-size: 0.8125rem; font-weight: 500; line-height: 1.35; }
/* İşlemler menüsü: sağ üstte üç nokta, tıklayınca dropdown */
.bc .drs-visit-actions { position: absolute; top: 0.25rem; right: 0.25rem; }
.bc .drs-visit-actions > .btn { width: 1.5rem; height: 1.5rem; padding: 0; color: var(--muted-foreground); }
.bc .drs-visit-actions > .btn svg { width: 0.875rem; height: 0.875rem; }
.bc .drs-visit-actions > [data-popover] { min-width: 9.5rem; }
.bc .drs-visit-actions [role="menuitem"] { cursor: pointer; }
.bc .drs-visit-actions [role="menuitem"] svg { width: 0.875rem; height: 0.875rem; }
.bc .drs-visit-actions [role="menuitem"][data-tone="destructive"] { color: var(--destructive); }
.bc .drs-visit-actions hr[role="separator"] { margin: 0.25rem -0.25rem; border-top: 1px solid var(--border); }

/* Sürükleme hayaleti */
.drs-visit.drs-ghost, .drs-cust.drs-ghost { opacity: 0.4; }

/* Boş durumlar (gün sütunu, havuz listesi) */
.drs-day-empty, .drs-pool-empty { display: grid; justify-items: center; gap: 0.375rem; padding: 1.5rem 0.5rem; text-align: center; font-size: 0.75rem; color: var(--muted-foreground); }
.drs-day-empty svg, .drs-pool-empty svg { width: 1.25rem; height: 1.25rem; opacity: 0.6; }

/* Gün seçimi dialogu (mobilde dokun-ekle) */
.drs-gun-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
.bc .drs-gun-grid .btn { flex-direction: column; gap: 0.125rem; height: auto; padding: 0.625rem 0.25rem; font-size: 0.8125rem; }
.drs-gun-grid .btn small { font-size: 0.6875rem; font-weight: 400; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

@media (max-width: 1280px) {
    .drs-day-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .drs-rut-layout { grid-template-columns: 1fr; }
    .bc .drs-pool { position: static; max-height: 24rem; }
    .drs-week-label { min-width: 10rem; }
}
@media (max-width: 640px) {
    .drs-day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .drs-section-head { flex-direction: column; align-items: stretch; }
    .drs-rut-toolbar { justify-content: space-between; }
    .drs-week-nav { flex: 1 1 100%; justify-content: space-between; }
    .drs-week-label { min-width: 0; flex: 1; }
}
