/* ===========================================
   RAPOR MODÜLÜ - Özel CSS Stilleri
   Modern & Responsive Design
   =========================================== */

/* =============================================
   PREMIUM FILTER BAR (Ürünler modülü ile uyumlu)
   ============================================= */
.filter-bar-container {
    position: sticky;
    top: var(--header-height);
    z-index: 90;
    background: var(--background, #f5f6fb);
    padding: 16px 0;
    margin-bottom: 24px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: flex-start;
    gap: 12px;
    background: var(--surface, #fff);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.filter-divider {
    width: 1px;
    height: 24px;
    background: #e5e7eb;
    margin: 0 4px;
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    color: #6b7280;
    min-width: 220px;
}

.filter-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 100%;
    color: #111827;
}

.filter-search input::placeholder {
    color: #9ca3af;
}

.filter-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
    overflow: visible;
}

.filter-dropdown {
    position: relative;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-pill:hover {
    background: #f3f4f6;
    color: #111827;
}

.filter-pill.active {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.2);
}

.filter-pill i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.filter-dropdown.open .filter-pill i {
    transform: rotate(180deg);
}

.dropdown-menu-custom {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.15);
    min-width: 240px;
    z-index: 1000;
    display: none;
    padding: 8px;
}

.filter-dropdown.open .dropdown-menu-custom {
    display: block !important;
}

.dropdown-search {
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 8px;
}

.dropdown-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}

.dropdown-search input:focus {
    border-color: #2563eb;
}

.dropdown-options {
    max-height: 260px;
    overflow-y: auto;
}

.dropdown-no-results {
    padding: 8px 12px;
    font-size: 12px;
    color: #9ca3af;
}

.dropdown-option {
    padding: 8px 12px;
    font-size: 13px;
    color: #111827;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-option:hover {
    background: #f3f4f6;
}

.dropdown-option.selected {
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
    font-weight: 600;
}

.dropdown-option.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 10px;
}

.dropdown-menu-wide {
    min-width: 600px;
    padding: 16px;
}

.dropdown-menu-medium {
    min-width: 450px;
    padding: 16px;
}

.dropdown-row {
    display: flex;
    gap: 24px;
}

.dropdown-col {
    flex: 1;
}

.dropdown-col h6 {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.filter-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.filters-pending {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.date-range-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    /* Prevent wrapping inside date group */
}

.date-range-group input {
    min-width: 130px;
    /* Fixed width for single line */
}

/* Group Dropdown Styles */
.group-dropdown .dropdown-menu-custom {
    margin-top: 8px;
}

/* Desktop Single Line Layout */

/* ===========================
   Mobile Responsive Styles
   =========================== */
@media (max-width: 768px) {
    .filter-bar-container {
        position: static;
        padding: 8px 0 16px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .filter-divider {
        display: none;
    }

    .filter-search {
        width: 100%;
        padding: 0;
        background: #fff;
        border-radius: 10px;
        border: 1px solid #e5e7eb;
    }

    .filter-search input {
        padding: 12px 0;
    }

    .filter-pills {
        flex-direction: column;
        gap: 10px;
    }

    .filter-dropdown {
        width: 100%;
    }

    .filter-pill {
        width: 100%;
        justify-content: space-between;
        background: #f3f4f6;
        border-radius: 10px;
        padding: 12px 16px;
    }

    .filter-actions-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-left: 0;
    }

    .date-range-group {
        width: 100%;
        gap: 8px;
        flex-wrap: wrap;
    }

    .date-range-group input {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
    }

    .date-range-group button {
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
    }

    #refreshFiltersBtn {
        width: 100%;
        margin-left: 0;
    }

    .btn-reset-filters {
        align-self: flex-end;
    }

    .dropdown-menu-custom {
        position: fixed;
        left: 16px;
        right: 16px;
        top: 110px;
        width: auto;
        max-height: 70vh;
        overflow-y: auto;
        z-index: 1101;
        border-radius: 16px;
        padding: 16px;
    }

    .dropdown-menu-custom.dropdown-menu-wide {
        min-width: auto;
        padding: 20px;
    }

    .dropdown-row {
        flex-direction: column;
        gap: 16px;
    }

    .active-filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    body.filter-dropdown-open {
        overflow: hidden;
    }

    body.filter-dropdown-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        z-index: 1099;
        pointer-events: none;
    }
}
@media (min-width: 992px) {
    .filter-bar {
        flex-wrap: nowrap;
        /* Force single line */
        overflow: visible;
    }

    .filter-pills {
        flex-wrap: nowrap;
        overflow: visible;
    }

    .filter-search {
        min-width: 200px;
        border-right: 1px solid #e5e7eb;
        margin-right: 8px;
        padding-right: 16px;
    }

    .filter-divider {
        display: none;
        /* Remove divider in new layout */
    }
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }

    .filter-search {
        width: 100%;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 12px;
        margin-bottom: 4px;
    }

    .filter-pills {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns for groups */
        gap: 8px;
        width: 100%;
    }

    .filter-dropdown {
        width: 100%;
    }

    .filter-pill {
        width: 100%;
        justify-content: space-between;
        background: #f9fafb;
        border: 1px solid #e5e7eb;
    }

    .filter-actions-right {
        width: 100%;
        flex-direction: column;
        gap: 12px;
        margin-top: 8px;
        border-top: 1px solid #e5e7eb;
        padding-top: 16px;
    }

    .date-range-group {
        width: 100%;
        justify-content: space-between;
    }

    .date-range-group input {
        flex: 1;
        min-width: 0;
        /* Allow shrinking */
    }

    .btn-reset-filters {
        width: 100%;
        background: #fef2f2;
        color: #dc2626;
        border: 1px solid #fee2e2;
    }

    /* Mobile Dropdowns */
    .dropdown-menu-custom {
        position: fixed;
        /* Full screen modal style on mobile */
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%);
        width: 90vw !important;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 1050;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    }

    /* Overlay for mobile dropdowns */
    .filter-dropdown.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    .dropdown-row {
        flex-direction: column;
        gap: 16px;
    }
}

.btn-reset-filters,
.btn-export {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset-filters:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.btn-export:hover {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.active-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding: 0 4px;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    font-size: 12px;
    color: #111827;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.active-filter-tag span {
    color: #6b7280;
}

.active-filter-tag i {
    cursor: pointer;
    color: #9ca3af;
    font-size: 10px;
    padding: 2px;
}

.active-filter-tag i:hover {
    color: #dc2626;
}

/* =============================================
   DETAY BUTONU - Minimal & Modern
   ============================================= */
.btn-detail {
    transition: all 0.2s ease-in-out;
    border-color: #667eea !important;
    color: #667eea !important;
}

.btn-detail:hover {
    background-color: #667eea !important;
    color: white !important;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-detail:active {
    transform: scale(0.95);
}

.btn-detail i {
    transition: transform 0.2s ease-in-out;
}

.btn-detail:hover i {
    transform: scale(1.1);
}

/* Mobil Detay Butonu */
.btn-detail-mobile {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    cursor: pointer;
}

.btn-detail-mobile:active {
    transform: scale(0.9);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.btn-detail-mobile i {
    font-size: 16px;
    transition: transform 0.2s;
}

.btn-detail-mobile:active i {
    transform: scale(1.2);
}

/* Desktop'ta mobil buton gizli */
@media (min-width: 769px) {
    .btn-detail-mobile {
        display: none !important;
    }
}

/* =============================================
   RAPOR SAYFA DÜZENİ - Modern Container
   ============================================= */
@media (min-width: 769px) {

    /* Rapor kartlarına ekstra margin */
    .content-area .card {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        margin-bottom: 24px;
    }

    /* Filtre kartı daha kompakt */
    .card-body {
        padding: 20px 24px;
    }

    /* Tablo kartı padding optimizasyonu */
    .card .card-body.p-0 {
        padding: 0 !important;
    }

    /* Toplam istatistik kartı */
    #totalStatsCard {
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        border: 1px solid #e9ecef;
    }

    #totalStatsCard .card-body {
        padding: 28px 32px;
    }

    #totalStatsCard h5 {
        font-size: 14px;
        font-weight: 600;
        color: #495057;
        margin-bottom: 12px;
    }

    #totalStatsCard .display-4 {
        font-size: 2.5rem;
        font-weight: 700;
        letter-spacing: -0.5px;
    }

    #totalStatsCard small {
        font-size: 12px;
        color: #6c757d;
    }
}

/* Rapor Tablosu Stilleri */
.table-responsive {
    border-radius: 0 0 12px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
}

.table {
    margin-bottom: 0;
}

#reportTableContainer.grouping-mode {
    background: #f8fafc;
    border-radius: 18px;
    padding: 12px;
    border: 1px solid #e2e8f0;
}

#reportTableContainer.grouping-mode table {
    border-collapse: separate;
    border-spacing: 0 12px;
}

#reportTableContainer.grouping-mode thead {
    display: none;
}

#reportTableContainer.grouping-mode tbody {
    border: none;
}

#reportTableContainer.grouping-mode .group-row td {
    border: none;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    padding: 18px 20px;
}

#reportTableContainer.grouping-mode .group-title-section {
    flex-wrap: wrap;
    gap: 8px;
}

#reportTableContainer.grouping-mode .group-summary {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px 18px;
}

#reportTableContainer.grouping-mode .group-stat {
    margin-left: 0 !important;
    font-size: 13px;
}

#reportTableContainer.grouping-mode .group-child-row td {
    border: none;
    background: transparent;
    padding: 0 !important;
}

#reportTableContainer.grouping-mode .group-child-row table {
    border-spacing: 0 10px;
}

#reportTableContainer.grouping-mode .group-child-row .group-row td {
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

#reportTableContainer.grouping-mode .group-row.level-1 td {
    padding-left: 32px !important;
}

#reportTableContainer.grouping-mode .group-row.level-2 td {
    padding-left: 56px !important;
}

#reportTableContainer.grouping-mode .group-row.level-3 td {
    padding-left: 72px !important;
}

#reportTableContainer.grouping-mode .group-row.level-4 td {
    padding-left: 96px !important;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 12px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
}

/* Resim Stili */
.image-container {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.image-container a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.product-image {
    width: 90px;
    height: 90px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 6px;
}

.product-image:hover {
    transform: scale(1.05);
}

.no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 12px;
    text-align: center;
}

.no-image i {
    font-size: 24px;
    margin-bottom: 5px;
}

/* Badge Stilleri - Rapor Özel */
.badge-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
}

.badge-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.badge-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.badge-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Filtre Panel Stilleri */
#filterCardBody {
    transition: all 0.3s ease;
    overflow: hidden;
}

#filterCardBody.collapsed {
    max-height: 0;
    padding: 0;
    opacity: 0;
}

/* =============================================
   MODERN FILTER DROPDOWN - Professional Design
   ============================================= */

/* Filter Dropdown Container */
.filter-dropdown {
    position: relative;
}

/* Dropdown Menu - Enhanced */
.filter-dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid #e0e0e0;
    padding: 8px 0;
    max-height: 420px;
    overflow-y: auto;
    width: 100% !important;
    min-width: 250px;
    margin-top: 4px;
}

/* Custom Scrollbar - Modern */
.filter-dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

.filter-dropdown-menu::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 0 12px 12px 0;
}

.filter-dropdown-menu::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.filter-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Checkbox Items - Touch Friendly */
.filter-check-item {
    padding: 10px 16px;
    margin: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    display: flex;
    align-items: center;
    min-height: 44px;
}

.filter-check-item:hover {
    background-color: #f7fafc;
}

.filter-check-item:active {
    background-color: #edf2f7;
}

/* Checkbox Input - Modern Style */
.filter-check-item .form-check-input {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    margin-top: 0;
    cursor: pointer;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-check-item .form-check-input:hover {
    border-color: #4a90e2;
}

.filter-check-item .form-check-input:checked {
    background-color: #4a90e2;
    border-color: #4a90e2;
}

.filter-check-item .form-check-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Checkbox Label */
.filter-check-item .form-check-label {
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #2d3748;
    font-weight: 400;
    line-height: 1.4;
    flex: 1;
    padding-left: 4px;
}

/* Dropdown Divider */
.filter-dropdown-menu .dropdown-divider {
    margin: 8px 0;
    border-color: #e2e8f0;
}

/* Legacy Support */
.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.form-check {
    cursor: pointer;
}

.form-check-input {
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* =============================================
   FILTER CHIPS - Selected Items Display
   ============================================= */

.filter-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    min-height: 0;
    transition: min-height 0.3s ease;
}

.filter-chips-container:not(:empty) {
    min-height: 32px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
    animation: chipFadeIn 0.2s ease;
    transition: all 0.2s ease;
    cursor: default;
}

.filter-chip:hover {
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.filter-chip-text {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.filter-chip-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.filter-chip-remove:active {
    transform: scale(0.95);
}

/* Chip Animation */
@keyframes chipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.filter-chip.removing {
    animation: chipFadeOut 0.2s ease forwards;
}

@keyframes chipFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Loading Spinner */
#loadingSpinner {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Mobil Loading Spinner */
@media (max-width: 768px) {
    #loadingSpinner {
        min-height: 200px;
        padding: 40px 20px;
    }

    #loadingSpinner .spinner-border {
        width: 3rem;
        height: 3rem;
        border-width: 0.3em;
    }

    #loadingSpinner p {
        font-size: 14px;
        margin-top: 16px;
    }
}

/* Sayfa Bilgileri */
#recordInfo {
    font-size: 13px;
}

/* Export Butonları */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Tablo Hücresi Renklendirme */
.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

/* =============================================
   RESPONSIVE DESIGN - TABLET (768px - 991px)
   ============================================= */
@media (max-width: 991px) {
    .table {
        font-size: 14px;
    }

    .table td,
    .table th {
        padding: 8px;
    }

    .image-container {
        width: 60px;
        height: 60px;
    }

    .product-image {
        width: 50px;
        height: 50px;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        border-radius: 8px !important;
        margin-bottom: 5px;
    }
}

/* =============================================
   RESPONSIVE DESIGN - MOBILE (max 768px)
   Modern & Touch-Friendly
   ============================================= */
@media (max-width: 768px) {

    /* Genel Touch-Friendly Ayarlar */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }

    /* Card Padding */
    .card {
        border-radius: 12px;
        margin-bottom: 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .card-header {
        padding: 12px 16px;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
    }

    .card-header>div:first-child {
        width: 100%;
    }

    .card-body {
        padding: 0 !important;
        /* Mobil kartlar için */
    }

    .card-body .mobile-product-cards {
        padding: 16px;
    }

    .card-body .table-responsive {
        padding: 0;
    }

    /* Filtre Butonları - Touch Friendly */
    .btn {
        min-height: 44px;
        /* Apple Human Interface Guidelines */
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 10px;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .btn:active {
        transform: scale(0.98);
    }

    /* Form Kontrolleri */
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px;
        /* iOS zoom engellemek için */
        padding: 10px 14px;
        border-radius: 10px;
        border: 1.5px solid #dee2e6;
        transition: all 0.2s ease;
    }

    .form-control:focus,
    .form-select:focus {
        border-color: #4a90e2;
        box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    }

    .form-label {
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 6px;
        color: #495057;
    }

    /* Filtre Grid - Mobilde Tek Sütun */
    .row.mb-3 {
        margin-bottom: 12px !important;
    }

    .col-md-2,
    .col-md-3,
    .col-md-4,
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 12px;
    }

    /* Filtre Toggle Butonu */
    #filterToggleBtn {
        width: 100%;
        justify-content: space-between;
        display: flex;
        align-items: center;
    }

    /* Filter Dropdown Menüler - Mobil Optimize */
    .filter-dropdown-menu {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 12px;
        border: none;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        max-height: 50vh;
    }

    .filter-check-item {
        padding: 14px 16px;
        min-height: 48px;
    }

    .filter-check-item .form-check-input {
        width: 20px;
        height: 20px;
        margin-right: 12px;
    }

    .filter-check-item .form-check-label {
        font-size: 15px;
        padding-left: 4px;
    }

    /* Filter Chips - Mobil */
    .filter-chip {
        padding: 8px 14px;
        font-size: 14px;
        gap: 8px;
    }

    .filter-chip-text {
        max-width: 120px;
    }

    .filter-chip-remove {
        width: 20px;
        height: 20px;
        font-size: 16px;
    }

    /* Legacy Dropdown Support */
    .dropdown-menu {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 12px;
        border: none;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }

    .form-check {
        padding: 12px 16px;
        margin: 0;
    }

    .form-check-input {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }

    .form-check-label {
        font-size: 15px;
        padding-left: 8px;
    }

    /* Desktop Tablo Gizle */
    .table-responsive {
        display: none !important;
    }

    /* Mobil Kart Görünümü Aktif */
    .mobile-product-cards {
        display: block !important;
    }

    /* Export Butonları */
    .btn-group {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .btn-group .btn {
        flex: 1;
        border-radius: 10px !important;
    }

    /* Sayfalama */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .pagination .page-item {
        margin: 0;
    }

    .pagination .page-link {
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        font-size: 14px;
        margin: 0 2px;
    }

    .card-footer {
        padding: 12px 16px;
    }

    .card-footer .d-flex {
        flex-direction: column;
        gap: 12px;
    }

    .card-footer .d-flex>div,
    .card-footer .d-flex>nav {
        width: 100%;
    }
}

/* =============================================
   MOBİL KART TASARIMI - Modern & User-Friendly
   Instagram-Style Card Design
   ============================================= */
.mobile-product-cards {
    display: none;
    /* Desktop'ta gizli */
    padding: 0;
    width: 100%;
    min-height: 50px;
}

@media (max-width: 768px) {
    .mobile-product-cards {
        display: block !important;
        padding: 12px;
        background: #f5f5f5;
    }

    /* Ana Kart Container - Liste Stili */
    .mobile-product-card {
        background: #ffffff;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 12px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
        transition: all 0.2s ease;
        border: 1px solid #e5e5e5;
        position: relative;
    }

    .mobile-product-card:active {
        transform: scale(0.99);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    }

    /* Sıra Numarası Badge */
    .mobile-card-number {
        position: absolute;
        top: 8px;
        left: 8px;
        background: #f8f9fa;
        color: #495057;
        font-size: 11px;
        font-weight: 700;
        width: 22px;
        height: 22px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1;
        border: 1px solid #e9ecef;
    }

    /* Yatay Layout - Resim Sol, Bilgiler Orta, Detaylar Sağ */
    .mobile-card-content {
        display: flex;
        gap: 10px;
        align-items: stretch;
    }

    .mobile-product-name {
        font-size: 13px;
        font-weight: 700;
        margin-bottom: 3px;
        line-height: 1.3;
        color: #212529;
    }

    .mobile-product-code {
        font-size: 11px;
        color: #6c757d;
        margin-bottom: 6px;
        display: block;
    }

    /* Ürün Resmi - Kompakt */
    .mobile-product-image-container {
        flex-shrink: 0;
        width: 80px;
        height: 105px;
        border-radius: 8px;
        overflow: hidden;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        cursor: pointer;
        transition: opacity 0.2s ease;
    }

    .mobile-product-image-container:active {
        opacity: 0.8;
    }

    .mobile-product-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mobile-image-placeholder {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: #f8f9fa;
        color: #adb5bd;
    }

    .mobile-image-placeholder i {
        font-size: 24px;
        margin-bottom: 4px;
        opacity: 0.5;
    }

    .mobile-image-placeholder span {
        font-size: 10px;
        opacity: 0.7;
    }

    /* Bilgi Alanı - Orta Bölüm */
    .mobile-product-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding-top: 2px;
    }

    /* Fiyat - Turuncu Vurgu */
    .mobile-price {
        font-size: 15px;
        font-weight: 700;
        color: #ff6b35;
        margin-bottom: 3px;
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .mobile-price i {
        font-size: 11px;
    }

    /* Bilgi Satırları - Kompakt */
    .mobile-info-row {
        display: flex;
        align-items: center;
        font-size: 11px;
        line-height: 1.4;
    }

    .mobile-info-label {
        color: #6c757d;
        font-weight: 500;
        min-width: 70px;
        font-size: 10px;
    }

    .mobile-info-value {
        color: #212529;
        font-weight: 700;
        flex: 1;
        font-size: 11px;
    }

    .mobile-info-value.highlight {
        color: #ff6b35;
        font-weight: 700;
    }

    .mobile-info-value.success {
        color: #212529;
        font-weight: 700;
    }

    .mobile-info-value.info {
        color: #212529;
        font-weight: 700;
    }

    /* Detay Bilgileri Bölümü - Sağ Kolon */
    .mobile-details-section {
        flex-shrink: 0;
        width: 110px;
        display: flex;
        flex-direction: column;
        gap: 2px;
        border-left: 1px solid #e9ecef;
        padding-left: 8px;
    }

    .mobile-details-grid {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-detail-row {
        display: flex;
        flex-direction: column;
        gap: 0px;
    }

    .mobile-detail-label {
        color: #6c757d;
        font-weight: 500;
        font-size: 8px;
        text-transform: uppercase;
        letter-spacing: 0.2px;
        line-height: 1.2;
    }

    .mobile-detail-value {
        color: #495057;
        font-weight: 600;
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.3;
    }

    /* Kar Marjı Badge - Detaylar İçinde */
    .mobile-profit-badge {
        background: #fff;
        border-radius: 6px;
        padding: 5px 6px;
        font-size: 10px;
        font-weight: 700;
        text-align: center;
        border: 1.5px solid;
        margin-top: 4px;
    }

    .mobile-profit-badge.high {
        color: #28a745;
        border-color: #28a745;
        background: #f0fff4;
    }

    .mobile-profit-badge.medium {
        color: #fd7e14;
        border-color: #fd7e14;
        background: #fff5e6;
    }

    .mobile-profit-badge.low {
        color: #dc3545;
        border-color: #dc3545;
        background: #fff0f0;
    }

    /* Loading State */
    .mobile-card-skeleton {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
        border-radius: 16px;
        height: 300px;
        margin-bottom: 16px;
    }

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

        100% {
            background-position: -200% 0;
        }
    }

    /* Kart Giriş Animasyonu - Subtle */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .mobile-product-card {
        animation: fadeInUp 0.25s ease-out;
        animation-fill-mode: both;
    }

    /* Her kart için minimal staggered animasyon */
    .mobile-product-card:nth-child(1) {
        animation-delay: 0.02s;
    }

    .mobile-product-card:nth-child(2) {
        animation-delay: 0.04s;
    }

    .mobile-product-card:nth-child(3) {
        animation-delay: 0.06s;
    }

    .mobile-product-card:nth-child(4) {
        animation-delay: 0.08s;
    }

    .mobile-product-card:nth-child(5) {
        animation-delay: 0.10s;
    }

    .mobile-product-card:nth-child(n+6) {
        animation-delay: 0.12s;
    }

    /* Smooth Scroll Behavior */
    html {
        scroll-behavior: smooth;
    }
}

/* Desktop'ta mobil kartları gizle */
@media (min-width: 769px) {
    .mobile-product-cards {
        display: none;
    }
}

/* =============================================
   MOBİL EMPTY STATE & FEEDBACK
   ============================================= */
@media (max-width: 768px) {
    .mobile-empty-state {
        text-align: center;
        padding: 60px 20px;
        color: #6c757d;
    }

    .mobile-empty-state i {
        font-size: 64px;
        margin-bottom: 20px;
        opacity: 0.3;
        color: #dee2e6;
    }

    .mobile-empty-state h5 {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 8px;
        color: #495057;
    }

    .mobile-empty-state p {
        font-size: 14px;
        color: #6c757d;
        margin-bottom: 0;
    }

    /* Mobil Kayıt Bilgisi */
    #recordInfo {
        font-size: 12px;
        display: block;
        width: 100%;
        margin-top: 8px;
        text-align: center;
    }

    /* Mobil için Card Header Düzenlemesi */
    .card-header h6 {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .card-header small {
        font-size: 11px;
        line-height: 1.4;
    }

    /* Mobil Footer Düzenlemesi */
    .card-footer .form-select-sm {
        font-size: 13px;
    }

    .card-footer label {
        font-size: 12px;
    }
}

/* Fancybox Özelleştirmeleri */
.fancybox__container {
    z-index: 10000;
}

.fancybox__backdrop {
    background: rgba(0, 0, 0, 0.85);
}

/* Sayfa Başına Kayıt Seçimi */
#perPageSelect {
    min-width: 80px;
}

/* Filtre Toggle Animasyonu */
#filterToggleIcon {
    transition: transform 0.3s ease;
}

#filterToggleIcon.rotated {
    transform: rotate(180deg);
}

/* Sticky Table Header */
.table-responsive {
    max-height: 600px;
    overflow-y: auto;
}

.table thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
}

/* Scrollbar Stilleri */
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* =============================================
   KOMPAKT TABLO GÖRÜNÜMÜ - PC Optimizasyonu
   ============================================= */
@media (min-width: 769px) {

    /* Kompakt tablo için padding azaltma */
    .table-sm td,
    .table-sm th {
        padding: 6px 10px !important;
        font-size: 12px;
    }

    /* Resim sütunu - daha az padding */
    .table-sm td:first-child {
        padding: 6px !important;
    }

    /* Tablo header stilleri */
    .table thead.table-light th {
        background-color: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
        font-weight: 600;
        color: #495057;
        font-size: 12px;
        padding: 8px 10px !important;
        white-space: nowrap;
    }

    /* Header resim sütunu */
    .table thead.table-light th:first-child {
        padding: 8px 6px !important;
    }

    /* Satır hover efekti */
    .table tbody tr {
        transition: background-color 0.15s ease;
    }

    .table tbody tr:hover {
        background-color: #f8f9fa;
    }

    /* Ürün resmi kompakt */
    #reportTable img {
        border-radius: 6px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s ease;
    }

    #reportTable img:hover {
        transform: scale(1.05);
    }

    /* Satış ve Stok değerleri vurgusu */
    #reportTable tbody td:nth-child(3) strong,
    #reportTable tbody td:nth-child(4) strong {
        color: #000 !important;
        font-weight: 700 !important;
        font-size: 14px !important;
    }

    /* Kar marjı badge kompakt */
    #reportTable .badge {
        padding: 4px 8px;
        font-size: 11px;
        font-weight: 600;
    }

    /* Ürün bilgileri sütunu */
    #reportTable tbody td:nth-child(2) {
        line-height: 1.4;
        max-width: 300px;
    }

    /* Diğer sütunlar - küçük font */
    #reportTable tbody td {
        font-size: 12px;
        color: #495057;
    }

    /* Tablo zebra striping - hafif */
    #reportTable tbody tr:nth-of-type(odd) {
        background-color: rgba(0, 0, 0, 0.02);
    }

    /* Tablo kenarlıkları yumuşak */
    #reportTable {
        border-collapse: separate;
        border-spacing: 0;
    }

    /* Card içeriği padding ayarı */
    .card .table-responsive {
        margin: -1px;
        /* Card padding'i dengelemek için */
    }
}

/* =============================================
   GRUPLAMA (GROUPING) STİLLERİ
   ============================================= */

/* Gruplama Alan Container */
.grouping-dropdown {
    max-width: 960px;
}

.grouping-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 65vh;
}

.grouping-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #475569;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 12px 14px;
}

.grouping-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.grouping-action-buttons {
    display: flex;
    gap: 8px;
}

.grouping-fields-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    max-height: 360px;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* Gruplama Alan İtemi */
.grouping-field-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #ffffff;
    border: 2px solid transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.grouping-field-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #dee2e6;
    transition: all 0.3s ease;
}

.grouping-field-item:hover {
    border-color: #4a90e2;
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.2);
    transform: translateY(-2px);
}

.grouping-field-item:hover::before {
    background: linear-gradient(180deg, #4a90e2 0%, #667eea 100%);
}

/* Checkbox işaretli olduğunda */
.grouping-field-item:has(.form-check-input:checked) {
    border-color: #007bff;
    background: #e7f3ff;
}

.grouping-field-item:has(.form-check-input:checked)::before {
    background: #007bff;
}

/* Checkbox Wrapper */
.field-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.field-checkbox-wrapper .form-check-input {
    width: 22px;
    height: 22px;
    cursor: pointer;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin: 0;
    flex-shrink: 0;
}

.field-checkbox-wrapper .form-check-input:hover {
    border-color: #4a90e2;
    transform: scale(1.05);
}

.field-checkbox-wrapper .form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.field-checkbox-wrapper .form-check-label {
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-checkbox-wrapper .form-check-label i {
    font-size: 16px;
    opacity: 0.7;
    color: #6c757d;
    width: 20px;
    text-align: center;
}

/* Sıralama Kontrolleri */
.field-sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.field-sort-controls.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.field-sort-controls .btn {
    padding: 6px 10px;
    font-size: 12px;
    min-height: auto;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.field-sort-controls .btn-sort-up,
.field-sort-controls .btn-sort-down {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
}

.field-sort-controls .btn-sort-up:hover,
.field-sort-controls .btn-sort-down:hover {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.field-sort-controls .btn-sort-up:active,
.field-sort-controls .btn-sort-down:active {
    transform: translateY(0);
}

/* Sıra Badge */
.sort-order-badge {
    min-width: 32px;
    height: 32px;
    background: #007bff;
    color: #ffffff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
    }

    50% {
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.5);
    }
}

.sort-order-badge.d-none {
    display: none !important;
}

/* Grup Satırları (Tablo içinde) */
.group-row {
    background: #f8f9fa;
    font-weight: 600;
    cursor: default;
    transition: all 0.2s ease;
}

.group-row:hover {
    background: #e9ecef;
}

/* Seviye bazlı renkler - Normal Rapor Gibi Beyaz Zemin */
.group-row.level-0 {
    background: #ffffff;
    color: #212529;
    border-left: 3px solid #007bff;
    font-weight: 700;
}

.group-row.level-0:hover {
    background: #f8f9fa;
}

.group-row.level-0 td {
    padding: 12px;
}

.group-row.level-1 {
    background: #ffffff;
    color: #212529;
    border-left: 3px solid #28a745;
    font-weight: 600;
}

.group-row.level-1:hover {
    background: #f8f9fa;
}

.group-row.level-1 td {
    padding-left: 40px !important;
}

.group-row.level-2 {
    background: #ffffff;
    color: #212529;
    border-left: 3px solid #17a2b8;
    font-weight: 600;
}

.group-row.level-2:hover {
    background: #f8f9fa;
}

.group-row.level-2 td {
    padding-left: 68px !important;
}

.group-row.level-3 {
    background: #ffffff;
    color: #212529;
    border-left: 3px solid #ffc107;
    font-weight: 500;
}

.group-row.level-3:hover {
    background: #f8f9fa;
}

.group-row.level-3 td {
    padding-left: 96px !important;
}

.group-row.level-4 {
    background: #ffffff;
    color: #212529;
    border-left: 3px solid #6c757d;
    font-weight: 500;
}

.group-row.level-4:hover {
    background: #f8f9fa;
}

.group-row.level-4 td {
    padding-left: 124px !important;
}

/* Grup Toggle Butonu */
.group-toggle-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #495057;
    margin-right: 10px;
}

.group-toggle-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.group-toggle-btn:active {
    transform: scale(0.95);
}

.group-toggle-btn i {
    transition: transform 0.3s ease;
    font-size: 12px;
}

/* Grup Başlık Bölümü */
.group-title-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-spacer {
    display: inline-block;
    width: 36px;
    flex-shrink: 0;
}

.group-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.group-value {
    font-size: 14px;
    font-weight: 700;
    color: #212529;
}

/* Grup Özet Bölümü */
.group-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 12px;
}

.group-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    color: #495057;
}

.group-stat strong {
    font-weight: 600;
    color: #212529;
}

.group-stat i {
    font-size: 12px;
}

/* Grup Child Satırları */
.group-child-row {
    transition: all 0.3s ease;
}

.group-child-row.collapsed {
    display: none;
}

/* Child content table */
.group-child-row .table {
    margin-bottom: 0;
    background: transparent;
}

.group-child-row .child-content {
    width: 100%;
}

/* Child row padding sıfırla */
.group-child-row>td {
    padding: 0 !important;
    border: none;
}

/* Scrollbar Özelleştirme - Gruplama Container */
.grouping-fields-container::-webkit-scrollbar {
    width: 8px;
}

.grouping-fields-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.grouping-fields-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.grouping-fields-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobil Gruplama Stilleri */
@media (max-width: 768px) {

    /* Gruplama Panel */
    .grouping-panel {
        max-height: none;
    }

    .grouping-info {
        font-size: 14px;
        line-height: 1.4;
    }

    .grouping-fields-container {
        grid-template-columns: 1fr;
        max-height: 50vh;
        padding: 12px;
    }

    .grouping-field-item {
        padding: 14px;
    }

    .field-checkbox-wrapper .form-check-input {
        width: 24px;
        height: 24px;
    }

    .field-checkbox-wrapper .form-check-label {
        font-size: 16px;
    }

    .field-checkbox-wrapper .form-check-label i {
        font-size: 18px;
    }

    .field-sort-controls {
        margin-left: 0;
        margin-top: 8px;
    }

    .field-sort-controls .btn-sort-up,
    .field-sort-controls .btn-sort-down {
        width: 40px;
        height: 40px;
    }

    .sort-order-badge {
        min-width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .grouping-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Mobil Grup Kartı */
    .mobile-group-card {
        background: #ffffff;
        border-radius: 10px;
        margin-bottom: 10px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        border: 1px solid #dee2e6;
    }

    /* Mobil Grup Children Container */
    .mobile-group-children {
        padding-left: 16px;
        margin-left: 8px;
        margin-top: 0;
        margin-bottom: 0;
        border-left: 3px solid #dee2e6;
        transition: all 0.3s ease;
    }

    .mobile-group-children .mobile-group-card {
        margin-bottom: 8px;
        margin-top: 8px;
    }

    .mobile-group-spacer {
        display: inline-block;
        width: 32px;
        flex-shrink: 0;
    }

    .mobile-group-header {
        padding: 14px;
        background: #ffffff;
        color: #212529;
        display: flex;
        align-items: center;
        gap: 10px;
        border-left: 3px solid #007bff;
        border-bottom: 1px solid #dee2e6;
    }

    .mobile-group-header.level-0 {
        border-left-color: #007bff;
        font-weight: 700;
    }

    .mobile-group-header.level-1 {
        border-left-color: #28a745;
        font-weight: 600;
    }

    .mobile-group-header.level-2 {
        border-left-color: #17a2b8;
        font-weight: 600;
    }

    .mobile-group-header.level-3 {
        border-left-color: #ffc107;
        font-weight: 500;
    }

    .mobile-group-header.level-4 {
        border-left-color: #6c757d;
        font-weight: 500;
    }

    .mobile-group-toggle {
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        width: 32px;
        height: 32px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #495057;
        transition: all 0.2s ease;
    }

    .mobile-group-toggle:active {
        background: #e9ecef;
        transform: scale(0.95);
    }

    .mobile-group-title {
        flex: 1;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .mobile-group-title strong {
        font-weight: 600;
        color: #6c757d;
        font-size: 12px;
    }

    .mobile-group-title span {
        font-weight: 700;
        color: #212529;
        font-size: 14px;
    }

    .mobile-group-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px;
        background: #ffffff;
        border-top: 1px solid #e9ecef;
    }

    .stat-item {
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding: 10px;
        background: #f8f9fa;
        border-radius: 8px;
        border: 1px solid #e9ecef;
        transition: all 0.2s ease;
    }

    .stat-item:active {
        background: #e9ecef;
    }

    .stat-label {
        font-size: 11px;
        color: #6c757d;
        font-weight: 500;
        display: flex;
        align-items: center;
    }

    .stat-label i {
        font-size: 10px;
        opacity: 0.7;
    }

    .stat-value {
        font-size: 15px;
        font-weight: 700;
        color: #212529;
    }

    .stat-value.success {
        color: #28a745;
    }

    .stat-value.info {
        color: #17a2b8;
    }
}

/* =============================================
   FİLTRELENMİŞ İSTATİSTİK KARTLARI
   Filtreleme aktifken kartları vurgula
   ============================================= */

/* Filtrelenmiş istatistik kartı */
#totalStatsCard.filtered-stats {
    border: 2px solid #ffc107;
    background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.2);
    animation: pulse-border 2s ease-in-out infinite;
}

/* Pulse animasyonu */
@keyframes pulse-border {

    0%,
    100% {
        box-shadow: 0 4px 16px rgba(255, 193, 7, 0.2);
    }

    50% {
        box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
    }
}

/* Mobil düzen iyileştirmeleri */
@media (max-width: 768px) {
    .filter-bar-container {
        position: static;
        top: auto;
        padding: 10px 0 16px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
    }

    .filter-search {
        width: 100%;
        padding: 10px 12px;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
    }

    .filter-pills {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .filter-dropdown {
        width: 100%;
    }

    .filter-pill {
        width: 100%;
        justify-content: space-between;
        background: #f9fafb;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        padding: 12px 14px;
    }

    .filter-actions-right {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
        margin-left: 0;
    }

    .btn-reset-filters,
    .btn-export {
        width: 42px;
        height: 42px;
        border: 1px solid #e5e7eb;
        background: #fff;
    }

    .active-filters-row {
        flex-direction: column;
        align-items: stretch;
        padding: 8px 0 0;
    }
}

@media (max-width: 520px) {
    .filter-actions-right {
        flex-direction: column;
        align-items: stretch;
    }

    .date-range-group {
        width: 100%;
        gap: 8px;
        flex-wrap: wrap;
    }

    .date-range-group input,
    .date-range-group button,
    #refreshFiltersBtn {
        width: 100%;
        min-width: 0;
    }
}

/* Filtre badge */
.filter-badge {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    animation: badge-appear 0.3s ease-out;
}

@keyframes badge-appear {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filtrelenmiş kartlardaki değerler */
#totalStatsCard.filtered-stats .display-4 {
    color: #ff9800;
    text-shadow: 0 2px 4px rgba(255, 152, 0, 0.1);
}

/* Filtrelenmiş kart başlıkları */
#totalStatsCard.filtered-stats h5 {
    color: #f57c00;
}

/* Mobil için badge konumu */
@media (max-width: 768px) {
    .filter-badge {
        font-size: 10px;
        padding: 4px 8px;
        top: 8px !important;
        right: 8px !important;
    }
}

/* Tooltip stil ekleme (Bootstrap tooltip yerine custom) */
.filter-info-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.filter-info-tooltip::after {
    content: 'Bu değerler seçili filtrelere göre hesaplanmıştır';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.filter-info-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}
