/* ===== METER READING & INVOICE PAGE ===== */

.meter-reading-invoice-section {
    padding: 60px 0;
    background: #f8f9fa;
    min-height: calc(100vh - 200px);
}

/* Tabs Navigation */
.tabs-wrapper {
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
    border-bottom: 2px solid #e8e8e8;
}

.custom-tabs {
    border: none;
    display: flex;
    gap: 0;
    padding: 0;
    margin: 0;
}

.custom-tabs .nav-item {
    flex: 1;
    margin: 0;
}

.custom-tabs .nav-link {
    border: none;
    border-radius: 0;
    padding: 20px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #666;
    background: transparent;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.custom-tabs .nav-link:hover {
    color: var(--primary-color);
    background: rgba(0, 137, 208, 0.05);
    border-bottom-color: rgba(0, 137, 208, 0.3);
}

.custom-tabs .nav-link.active {
    color: var(--primary-color);
    background: rgba(0, 137, 208, 0.1);
    border-bottom-color: var(--primary-color);
}

.custom-tabs .nav-link i {
    font-size: 1.2rem;
}

/* Tab Content */
.tab-content {
    background: white;
    border-radius: 0 0 16px 16px;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.tab-pane {
    padding: 40px;
}

/* Section Wrapper */
.section-wrapper {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.section-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
}

.section-title i {
    font-size: 1.6rem;
}

/* Search Form Wrapper */
.search-form-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 6px 24px rgba(0, 137, 208, 0.15);
    margin-bottom: 30px;
    border: 2px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.search-form-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.search-form-wrapper:hover {
    box-shadow: 0 8px 32px rgba(0, 137, 208, 0.2);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Styles */
.meter-reading-form .form-label,
.statistics-form .form-label,
.invoice-form .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.meter-reading-form .form-control,
.meter-reading-form .form-select,
.statistics-form .form-control,
.statistics-form .form-select,
.invoice-form .form-control,
.invoice-form .form-select {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
}

.meter-reading-form .form-control:hover,
.meter-reading-form .form-select:hover,
.statistics-form .form-control:hover,
.statistics-form .form-select:hover,
.invoice-form .form-control:hover,
.invoice-form .form-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 137, 208, 0.1);
}

.meter-reading-form .form-control:focus,
.meter-reading-form .form-select:focus,
.statistics-form .form-control:focus,
.statistics-form .form-select:focus,
.invoice-form .form-control:focus,
.invoice-form .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.3rem rgba(0, 137, 208, 0.2);
    outline: none;
    background-color: #f8fbff;
}

.meter-reading-form .form-select,
.statistics-form .form-select,
.invoice-form .form-select {
    cursor: pointer;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

.btn-view-reading,
.btn-view-statistics,
.btn-view-invoice {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 137, 208, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-view-reading:hover,
.btn-view-statistics:hover,
.btn-view-invoice:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003580 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 137, 208, 0.3);
    color: white;
}

.btn-view-reading:active,
.btn-view-statistics:active,
.btn-view-invoice:active {
    transform: translateY(0);
}

/* Results Wrapper */
.results-wrapper {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 20px;
}

.results-table-container {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.results-table thead {
    background: var(--gradient-primary);
    color: white;
}

.results-table thead th {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
    white-space: nowrap;
    border: none;
}

.results-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 0.9rem;
    color: #333;
    vertical-align: middle;
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.results-table tbody tr:hover {
    background-color: #f8f9fa;
}

.no-data {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px !important;
    font-size: 1rem !important;
}

/* Find Customer Link */
.find-customer-link {
    margin-top: 20px;
    text-align: left;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
}

.find-customer-link-inline {
    margin-top: 8px;
    text-align: left;
}

.customer-code-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.customer-code-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.customer-code-link i {
    font-size: 0.85rem;
}

/* Statistics Section */
.statistics-wrapper {
    margin-top: 20px;
}

.statistics-form-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0, 137, 208, 0.1);
    border: 2px solid var(--primary-color);
    height: 100%;
}

/* Chart Wrapper */
.chart-wrapper {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    height: 100%;
}

.chart-wrapper:hover {
    box-shadow: 0 6px 20px rgba(0, 137, 208, 0.15);
    transform: translateY(-2px);
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.chart-title i {
    font-size: 1.2rem;
}

.chart-wrapper canvas {
    max-height: 350px;
    min-height: 300px;
    flex: 1;
}

/* Statistics Summary */
.statistics-summary {
    margin-top: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 137, 208, 0.15);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 1.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* Invoice Status Badge */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.status-badge.paid {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.unpaid {
    background-color: #f8d7da;
    color: #721c24;
}

/* Download Invoice Button */
.btn-download-invoice {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.btn-download-invoice:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 137, 208, 0.3);
    color: white;
}

.btn-download-invoice:active {
    transform: translateY(0);
}

/* Find Customer Modal */
.find-customer-form .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.find-customer-form .form-control,
.find-customer-form .form-select {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
}

.find-customer-form .form-control:hover,
.find-customer-form .form-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 137, 208, 0.1);
}

.find-customer-form .form-control:focus,
.find-customer-form .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.3rem rgba(0, 137, 208, 0.2);
    outline: none;
    background-color: #f8fbff;
}

/* Captcha Styles */
.captcha-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 10px;
    margin-bottom: 10px;
}

.captcha-image-container {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 86px;
}

.captcha-image-container canvas {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    display: block;
}

.captcha-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60px;
}

.captcha-input-wrapper .form-label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.captcha-input {
    max-width: 200px;
    height: 56px;
}

.captcha-refresh {
    margin-top: 10px;
}

.refresh-captcha-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.refresh-captcha-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.refresh-captcha-link i {
    transition: transform 0.3s ease;
}

.refresh-captcha-link:hover i {
    transform: rotate(180deg);
}

/* Customer Search Results */
.customer-search-results {
    border-top: 2px solid #e8e8e8;
    padding-top: 20px;
}

.results-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.customer-result-item {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.customer-result-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 137, 208, 0.1);
    transform: translateY(-2px);
}

.result-item-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.result-item-header .customer-code {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.result-item-body {
    margin-bottom: 15px;
}

.result-item-body p {
    margin: 5px 0;
    font-size: 0.95rem;
    color: #333;
}

.result-item-body strong {
    color: #666;
    margin-right: 5px;
}

.btn-select-customer {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    width: 100%;
    justify-content: center;
}

.btn-select-customer:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003580 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 137, 208, 0.3);
    color: white;
}

.btn-select-customer:active {
    transform: translateY(0);
}

/* Modal Customization */
#findCustomerModal .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#findCustomerModal .modal-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    padding: 20px 30px;
}

#findCustomerModal .modal-title {
    font-weight: 700;
    font-size: 1.3rem;
}

#findCustomerModal .btn-close {
    filter: invert(1);
    opacity: 0.9;
}

#findCustomerModal .btn-close:hover {
    opacity: 1;
}

#findCustomerModal .modal-body {
    padding: 30px;
}

#findCustomerModal .modal-footer {
    border-top: 2px solid #e8e8e8;
    padding: 20px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#findCustomerModal .btn-primary {
    background: var(--gradient-primary);
    border: none;
    padding: 10px 30px;
    font-weight: 600;
    min-width: 150px;
}

#findCustomerModal .btn-primary:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003580 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .meter-reading-invoice-section {
        padding: 40px 0;
    }

    .custom-tabs .nav-link {
        padding: 15px 15px;
        font-size: 0.95rem;
        flex-direction: column;
        gap: 5px;
    }

    .custom-tabs .nav-link i {
        font-size: 1rem;
    }

    .tab-pane {
        padding: 25px 20px;
    }

    .section-wrapper {
        padding: 0;
        margin-bottom: 0;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .search-form-wrapper,
    .statistics-form-wrapper {
        padding: 25px 20px;
        margin-bottom: 20px;
    }

    .form-title {
        font-size: 1.3rem;
        margin-bottom: 25px;
    }

    .chart-wrapper {
        min-height: 350px;
        padding: 20px 15px;
        margin-top: 20px;
    }

    .chart-wrapper canvas {
        max-height: 250px;
        min-height: 200px;
    }

    .btn-view-reading,
    .btn-view-statistics,
    .btn-view-invoice {
        padding: 12px 30px;
        font-size: 1rem;
        width: 100%;
    }

    .results-table {
        font-size: 0.85rem;
    }

    .results-table thead th,
    .results-table tbody td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }

    .results-table thead th {
        font-size: 0.8rem;
    }

    .no-data {
        padding: 30px 15px !important;
        font-size: 0.9rem !important;
    }

    .results-wrapper {
        padding: 20px 15px;
    }

    .stat-card {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .custom-tabs .nav-link {
        padding: 12px 8px;
        font-size: 0.75rem;
        flex-direction: column;
        gap: 5px;
    }

    .custom-tabs .nav-link i {
        font-size: 1.1rem;
    }

    .tab-pane {
        padding: 20px 15px;
    }

    .search-form-wrapper,
    .statistics-form-wrapper {
        padding: 20px 15px;
    }

    .form-title {
        font-size: 1.2rem;
    }

    .results-table-container {
        overflow-x: scroll;
    }

    .chart-wrapper {
        min-height: 300px;
    }

    .chart-wrapper canvas {
        max-height: 200px;
    }

    .captcha-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .captcha-input {
        max-width: 100%;
    }

    .customer-result-item {
        padding: 15px;
    }

    #findCustomerModal .modal-body {
        padding: 20px 15px;
    }

    #findCustomerModal .modal-header {
        padding: 15px 20px;
    }

    #findCustomerModal .modal-footer {
        padding: 15px 20px;
    }
}

