/* Downchain Reports Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --danger-gradient: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    --info-gradient: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

/* Header Card */
.header-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8eef4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon {
    width: 55px;
    height: 55px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.header-text p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

.header-actions .btn {
    border-radius: 10px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Report Tabs */
.report-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
    border: 1px solid #e8eef4;
}

.tab-btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #4a5568;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.tab-btn i {
    font-size: 1rem;
}

.tab-btn:hover {
    background: #f7fafc;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Report Card */
.report-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8eef4;
    overflow: hidden;
}

.card-header-custom {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.card-header-custom h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.15rem;
}

.card-header-custom h4 i {
    margin-right: 0.5rem;
}

.card-header-custom p {
    color: #718096;
    margin-bottom: 0;
    font-size: 0.85rem;
}

.card-body-custom {
    padding: 1.5rem;
}

/* Filter Section */
.filter-section {
    margin-bottom: 1.5rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.85rem;
}

.filter-group label i {
    margin-right: 0.25rem;
}

.filter-group .form-select,
.filter-group .form-control {
    padding: 0.6rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
}

.filter-group .form-select:focus,
.filter-group .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-group .form-control.date-input {
    cursor: pointer;
}

.date-input-wrapper {
    position: relative;
}

.date-input-wrapper .date-input {
    padding-right: 2.5rem;
}

.date-input-wrapper .date-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 0.9rem;
}

.filter-action {
    display: flex;
    align-items: end;
}

.filter-action .btn {
    width: 100%;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    position: relative;
}

.btn .btn-spinner {
    display: none;
}

.btn .btn-spinner.show {
    display: inline-block;
}

/* ==================== FILTERS DISPLAY ==================== */

.filters-display {
    background: #f7fafc;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid #e8eef4;
}

.filter-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: white;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #2d3748;
    border: 1px solid #e2e8f0;
}

.filter-badge i {
    color: #667eea;
    font-size: 0.75rem;
}

.filter-badge .filter-value {
    font-weight: 600;
    color: #2d3748;
}

/* Partner Display */
.partner-display {
    padding: 0.75rem 1rem;
    background: #ebf4ff;
    border-radius: 10px;
    border: 2px solid #667eea;
    margin-bottom: 1.5rem;
}

.partner-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.partner-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.partner-name {
    font-weight: 700;
    color: #2d3748;
    font-size: 0.95rem;
}

.partner-id {
    color: #718096;
    font-size: 0.85rem;
}

/* Partner Hint */
.partner-hint {
    padding: 0.75rem 1rem;
    background: #ebf8ff;
    border-radius: 8px;
    border-left: 4px solid #4299e1;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #2d3748;
}

.partner-hint i {
    font-size: 1.1rem;
}

.partner-hint strong {
    color: #2b6cb0;
}

/* Summary Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.summary-card {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8eef4;
    transition: all 0.3s ease;
    text-align: center;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.summary-card .summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 1rem;
    color: white;
}

.summary-card.total-txn .summary-icon {
    background: var(--primary-gradient);
}

.summary-card.total-comm .summary-icon {
    background: var(--success-gradient);
}

.summary-card.total-tds .summary-icon {
    background: var(--warning-gradient);
}

.summary-card.total-charges .summary-icon {
    background: var(--secondary-gradient);
}

.summary-card.total-gst .summary-icon {
    background: var(--info-gradient);
}

.summary-card .summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
}

.summary-card .summary-label {
    color: #718096;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Tables */
.table-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8eef4;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.table-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.table-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* Summary & History Tables */
.summary-table,
.history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.summary-table thead th,
.history-table thead th {
    background: #f8fafc;
    padding: 0.5rem;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.summary-table tbody td,
.history-table tbody td {
    padding: 0.5rem;
    color: #4a5568;
    font-size: 0.85rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.summary-table tbody tr:hover,
.history-table tbody tr:hover {
    background: #f7fafc;
}

/* Status badges */
.status-success {
    background: #c6f6d5;
    color: #22543d;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.status-failed {
    background: #fed7d7;
    color: #9b2c2c;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.status-pending {
    background: #fefcbf;
    color: #744210;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

/* Loading Animation */
.loading-animation {
    display: none;
    text-align: center;
    padding: 2rem 1rem;
}

.loading-content h3 {
    color: #2d3748;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.loading-content p {
    color: #718096;
    font-size: 0.9rem;
}

.loading-spinner {
    position: relative;
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.2s;
    border-top-color: #764ba2;
}

.spinner-ring:nth-child(3) {
    animation-delay: 0.4s;
    border-top-color: #f093fb;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Data Message - Clean Design */
.no-data-message {
    display: none;
    text-align: center;
    padding: 3rem 2rem;
}

.no-data-content h3 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.no-data-content p {
    color: #718096;
    font-size: 0.95rem;
}

.no-data-content .no-data-hint {
    margin-top: 0.75rem;
}

.no-data-icon {
    width: 60px;
    height: 60px;
    background: #f7fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    color: #a0aec0;
}

/* DataTables Customization */
.dataTables_wrapper {
    padding: 0 0.5rem 0.5rem;
}

.dataTables_filter input {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    margin-left: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.dataTables_filter input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dt-buttons {
    display: flex !important;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.dt-buttons .btn {
    border: none;
    color: white;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.75rem;
}

.dt-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.dt-buttons .btn-success { background: #48bb78; }
.dt-buttons .btn-danger { background: #f56565; }
.dt-buttons .btn-info { background: #4299e1; }
.dt-buttons .btn-secondary { background: #718096; }

.dataTables_length select {
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.dataTables_info {
    font-size: 0.85rem;
    color: #718096;
}

.dataTables_paginate .paginate_button {
    padding: 0.3rem 0.6rem !important;
    margin: 0 2px !important;
    border-radius: 4px !important;
    font-size: 0.8rem !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-icon {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
    
    .header-text h1 {
        font-size: 1.25rem;
    }
    
    .report-tabs {
        padding: 0.35rem;
        gap: 0.25rem;
    }
    
    .tab-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        flex: 1;
        justify-content: center;
    }
    
    .tab-btn span {
        display: none;
    }
    
    .card-body-custom {
        padding: 1rem;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-action .btn {
        width: 100%;
    }
    
    /* Filters Display Mobile */
    .filters-display {
        padding: 0.5rem 0.75rem;
    }
    
    .filter-info {
        gap: 0.4rem;
    }
    
    .filter-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .partner-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .partner-hint {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        font-size: 0.85rem;
        padding: 0.6rem 0.75rem;
    }
    
    /* ===== Table to Card transformation (mobile) ===== */
    .summary-table thead,
    .history-table thead {
        display: none !important;
    }

    .summary-table,
    .history-table,
    .summary-table tbody,
    .history-table tbody {
        display: block;
        width: 100%;
        background: transparent;
        border-collapse: collapse;
    }

    .summary-table tbody tr,
    .history-table tbody tr {
        position: relative;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: min-content;
        gap: 0;
        margin-bottom: 1rem;
        border-radius: 16px;
        background-color: #ffffff;
        background-image: var(--primary-gradient);
        background-repeat: no-repeat;
        background-size: 100% 5px;
        background-position: top;
        box-shadow: 0 8px 24px rgba(31, 41, 55, 0.08), 0 1px 2px rgba(31, 41, 55, 0.04);
        border: 1px solid rgba(226, 232, 240, 0.6);
        overflow: hidden;
    }

    /* Tint the top accent strip + avatar by transaction status (History table only) */
    .history-table tbody tr:has(.status-success) {
        background-image: var(--success-gradient);
    }

    .history-table tbody tr:has(.status-failed) {
        background-image: var(--danger-gradient);
    }

    .history-table tbody tr:has(.status-pending) {
        background-image: var(--warning-gradient);
    }

    /* "Name" becomes the card header: avatar icon + name, sharing row 1 with the index chip */
    .summary-table tbody td[data-label="Name"],
    .history-table tbody td[data-label="Name"] {
        order: -3;
        grid-column: 1;
        grid-row: 1;
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        gap: 0.6rem;
        padding: 0.85rem 0.4rem 0.7rem 1rem;
        font-size: 0.9rem;
        font-weight: 700;
        color: #1a202c;
        border: none !important;
        background: #fff;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .summary-table tbody td[data-label="Name"]::before,
    .history-table tbody td[data-label="Name"]::before {
        content: "\f007";
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        min-width: 34px;
        border-radius: 10px;
        background: var(--primary-gradient);
        color: #fff;
        font-size: 0.8rem;
        box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
        text-transform: none;
        letter-spacing: 0;
    }

    .history-table tbody tr:has(.status-success) td[data-label="Name"]::before {
        background: var(--success-gradient);
        box-shadow: 0 3px 8px rgba(67, 233, 123, 0.35);
    }

    .history-table tbody tr:has(.status-failed) td[data-label="Name"]::before {
        background: var(--danger-gradient);
        box-shadow: 0 3px 8px rgba(255, 154, 158, 0.35);
    }

    .history-table tbody tr:has(.status-pending) td[data-label="Name"]::before {
        background: var(--warning-gradient);
        box-shadow: 0 3px 8px rgba(250, 112, 154, 0.35);
    }

    /* "#" becomes a small index chip, sharing the header row, right-aligned */
    .summary-table tbody td[data-label="#"],
    .history-table tbody td[data-label="#"] {
        order: -3;
        grid-row: 1;
        grid-column: 2;
        flex-direction: row !important;
        align-items: center;
        justify-content: flex-end;
        align-self: center;
        padding: 0.85rem 1rem 0.7rem 0;
        border: none !important;
        background: transparent;
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 0.7rem;
        font-weight: 700;
        color: #6b46c1;
    }

    .summary-table tbody td[data-label="#"]::before,
    .history-table tbody td[data-label="#"]::before {
        content: "\2116";
        color: #c4b5fd;
        font-size: 0.7rem;
        text-transform: none;
        letter-spacing: 0;
        margin-right: 0.2rem;
        min-width: 0;
    }

    /* Mobile number becomes a subtitle line right under the header */
    .summary-table tbody td[data-label="Mobile No"],
    .history-table tbody td[data-label="Mobile"] {
        order: -2;
        grid-column: 1 / -1;
        grid-row: 2;
        flex-direction: row !important;
        align-items: center;
        gap: 0.4rem;
        padding: 0 1rem 0.85rem;
        margin-top: -0.5rem;
        font-size: 0.76rem;
        font-weight: 600;
        color: #94a3b8;
        border: none !important;
        border-bottom: 1px solid #eef1f6 !important;
    }

    .summary-table tbody td[data-label="Mobile No"]::before,
    .history-table tbody td[data-label="Mobile"]::before {
        content: "\f3cd";
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        color: #cbd5e1;
        font-size: 0.7rem;
        margin: 0;
        min-width: 0;
    }

    /* Status becomes a footer band, full width, label left / pill right */
    .history-table tbody td[data-label="Status"] {
        order: 999;
        grid-column: 1 / -1;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.65rem 1rem;
        background: #fafbfd;
        border: none !important;
        border-top: 1px solid #eef1f6 !important;
        margin-top: 0.2rem;
    }

    .history-table tbody td[data-label="Status"]::before {
        content: attr(data-label);
        font-weight: 700;
        color: #a0aec0;
        font-size: 0.62rem;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        min-width: 0;
    }

    /* Generic metric cell: label-over-value, two columns */
    .summary-table tbody td,
    .history-table tbody td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.22rem;
        padding: 0.6rem 1rem;
        border: none;
        border-bottom: 1px solid #f5f7fa;
        text-align: left;
        font-size: 0.84rem;
        font-weight: 700;
        color: #2d3748;
        line-height: 1.25;
        background: #fff;
    }

    .summary-table tbody td:nth-of-type(odd):not([data-label="Name"]):not([data-label="Mobile No"]),
    .history-table tbody td:nth-of-type(odd):not([data-label="Name"]):not([data-label="Mobile"]):not([data-label="Status"]):not([data-label="Amount"]):not([data-label="GST"]):not([data-label="TDS"]):not([data-label="User TDS"]) {
        border-right: 1px solid #f5f7fa;
    }

    /* Financial section pairing for History cards: left column gets the divider */
    .history-table tbody td[data-label="Charges"],
    .history-table tbody td[data-label="Comm"],
    .history-table tbody td[data-label="User Comm"] {
        border-right: 1px solid #f5f7fa;
    }

    .summary-table tbody td::before,
    .history-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #a0aec0;
        font-size: 0.6rem;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        min-width: 0;
        margin-right: 0;
    }

    /* Amount-type fields get a richer tint so figures stand out */
    .summary-table tbody td[data-label*="Amt"],
    .summary-table tbody td[data-label*="Total"],
    .summary-table tbody td[data-label="User Comm"],
    .summary-table tbody td[data-label="User TDS"],
    .history-table tbody td[data-label="Amount"],
    .history-table tbody td[data-label="Charges"],
    .history-table tbody td[data-label="GST"],
    .history-table tbody td[data-label="Comm"],
    .history-table tbody td[data-label="TDS"],
    .history-table tbody td[data-label="User Comm"],
    .history-table tbody td[data-label="User TDS"] {
        color: #5b21b6;
    }

    /* History financial fields: Amount sits alone on its own row,
       then Charges+GST, Comm+TDS, and User Comm+User TDS pair up below it */
    .history-table tbody td[data-label="Amount"] {
        order: 10;
        grid-column: 1 / -1;
        border-right: none !important;
    }

    .history-table tbody td[data-label="Charges"] {
        order: 11;
    }

    .history-table tbody td[data-label="GST"] {
        order: 12;
    }

    .history-table tbody td[data-label="Comm"] {
        order: 13;
    }

    .history-table tbody td[data-label="TDS"] {
        order: 14;
    }

    .history-table tbody td[data-label="User Comm"] {
        order: 15;
    }

    .history-table tbody td[data-label="User TDS"] {
        order: 16;
    }

    /* Remove dangling bottom border on the final metric cell(s) */
    .summary-table tbody tr td:last-of-type,
    .history-table tbody tr td:last-of-type {
        border-bottom: none;
    }

    /* DataTables mobile adjustments */
    .dataTables_wrapper {
        padding: 0 0.25rem 0.25rem;
    }
    
    .dataTables_filter input {
        width: 140px;
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .dt-buttons .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-card .summary-value {
        font-size: 1.1rem;
    }

    .summary-table tbody td[data-label="Name"],
    .history-table tbody td[data-label="Name"] {
        font-size: 0.85rem;
    }

    .summary-table tbody td::before,
    .history-table tbody td::before {
        font-size: 0.58rem;
    }
    
    .filter-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .header-card,
    .report-tabs,
    .filter-section,
    .filters-display,
    .partner-hint,
    .partner-display,
    .table-actions,
    .dataTables_filter,
    .dataTables_length,
    .dataTables_paginate,
    .dt-buttons {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .tab-content:not(.active) {
        display: none !important;
    }
    
    .report-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .summary-table,
    .history-table {
        width: 100% !important;
    }
    
    .summary-table thead th,
    .summary-table tbody td,
    .history-table thead th,
    .history-table tbody td {
        font-size: 10pt !important;
        padding: 4px !important;
    }
}

/* Scrollable table container */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Service Table (for any service-related tables) */
.service-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.service-table thead th {
    background: #f8fafc;
    padding: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-table tbody td {
    padding: 0.75rem;
    color: #4a5568;
    font-size: 0.9rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.service-table tbody tr:hover {
    background: #f7fafc;
}

.service-table code {
    background: #edf2f7;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #4a5568;
}

.service-action-bar {
    margin-bottom: 1.5rem;
}

.service-action-bar .btn {
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-action-bar .btn .btn-spinner {
    display: none;
}

.service-action-bar .btn .btn-spinner.show {
    display: inline-block;
}

/* Mobile responsive for service table */
@media (max-width: 768px) {
    .service-table thead {
        display: none !important;
    }
    
    .service-table tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 0.75rem;
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    
    .service-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.35rem 0;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        text-align: left;
        font-size: 0.8rem;
    }
    
    .service-table tbody td:last-child {
        border-bottom: none;
    }
    
    .service-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #4a5568;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        min-width: 90px;
        margin-right: 0.75rem;
    }
}