/* Razorpay Clone Custom Styles */

:root {
    --primary-color: #528ff0;
    --primary-dark: #3d7bd6;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #1a1a2e;
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #16213e;
    --card-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Global Styles */
/* Base mobile optimizations */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-color);
    color: #333;
}

/* Sidebar Styles */
.sidebar {
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #16213e 100%);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    flex-shrink: 0;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 120px); /* Adjust based on header and footer height */
}

.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* For Firefox */
.sidebar-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.sidebar .navbar-brand {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.4rem;
    text-decoration: none;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8) !important;
    padding: 12px 20px !important;
    border-radius: 8px;
    margin: 2px 10px;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: var(--transition);
}

.sidebar .nav-link:hover::before {
    left: 100%;
}

.sidebar .nav-link:hover, 
.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #ffffff !important;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(82, 143, 240, 0.3);
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

/* EMI² Dropdown Styles */
.sidebar .dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(255,255,255,0.8) !important;
    padding: 12px 0;
    border-radius: 8px;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar .dropdown-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: #ffffff !important;
    transform: translateX(5px);
}

.sidebar .dropdown-toggle.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #ffffff !important;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(82, 143, 240, 0.3);
}

.sidebar .dropdown-toggle i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

.sidebar .dropdown-toggle::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    border: none;
    vertical-align: 0;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.sidebar .dropdown-toggle[aria-expanded="true"]::after,
.sidebar .show .dropdown-toggle::after {
    transform: rotate(180deg);
}

.sidebar .collapse {
    transition: all 0.3s ease;
}

.sidebar .collapse .nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 0 0.5rem 2.5rem;
    color: rgba(255,255,255,0.7) !important;
    border-radius: 6px;
    margin: 2px 0;
}

.sidebar .collapse .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255,255,255,0.1);
    transform: translateX(3px);
}

.sidebar .collapse .nav-link.active {
    background: rgba(82, 143, 240, 0.4);
    color: #ffffff !important;
    transform: translateX(3px);
}

/* Main Content */
.main-content {
    margin-left: 250px;
    background: var(--light-color);
    min-height: 100vh;
    transition: var(--transition);
    padding-top: 0;
}

.content-wrapper {
    padding: 2rem;
}

/* Navbar Styles */
.navbar-top {
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    position: relative;
    z-index: 999;
}

.navbar-top .form-control {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.navbar-top .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(82, 143, 240, 0.25);
}

/* User Avatar */
.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.notification-badge.show {
    display: flex;
}

/* Notification Items */
.notification-item {
    cursor: pointer;
    transition: var(--transition);
}

.notification-item:hover {
    background-color: rgba(0,0,0,0.05) !important;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: scale(0);
    transition: var(--transition);
}

.stats-card:hover::before {
    transform: scale(1);
}

.stats-card-revenue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

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

.stats-card-success-rate {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(82, 143, 240, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #2c5aa0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(82, 143, 240, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Wallet Styles */
.wallet-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wallet-icon i {
    display: block !important;
    line-height: 1 !important;
    font-style: normal !important;
    color: white !important;
}

.wallet-icon i::before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

/* Table Styles */
.table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background: #f8f9fa;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background-color: rgba(82, 143, 240, 0.05);
}

/* Badge Styles */
.badge {
    font-size: 0.75em;
    padding: 0.5em 0.75em;
    border-radius: 6px;
    font-weight: 500;
}

.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

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

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

.badge-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 1.5rem;
}

/* Form Styles */
.form-control {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(82, 143, 240, 0.25);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Search Results */
.search-result-item:hover {
    background-color: rgba(82, 143, 240, 0.05);
}

/* Notification Items */
.notification-item:hover {
    background-color: rgba(82, 143, 240, 0.05);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    z-index: 1001;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-overlay.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        margin-left: 280px;
    }
    
    .col-xl-3, .col-lg-6 {
        margin-bottom: 1rem;
    }
    
    /* Better card spacing */
    .row .col-md-6, .row .col-md-4, .row .col-md-3 {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
        width: 280px;
        z-index: 1001;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
        padding-top: 0;
        width: 100%;
        min-height: 100vh;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .navbar-top {
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    .navbar-top .container-fluid {
        padding: 0;
    }
    
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        border-radius: var(--border-radius);
        margin-bottom: 0;
        font-size: 0.875rem;
    }
    
    /* Hide some columns on mobile */
    .d-none-mobile {
        display: none !important;
    }
    
    /* Stack form elements */
    .row.g-3 > .col-md-6,
    .row.g-3 > .col-md-4,
    .row.g-3 > .col-md-8,
    .row.g-3 > .col-lg-6,
    .row.g-3 > .col-lg-4,
    .row.g-3 > .col-lg-8 {
        margin-bottom: 1rem;
    }
    
    /* Better button spacing */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
    }
    
    /* Better stats cards */
    .stats-card {
        margin-bottom: 1rem;
    }
    
    /* Search bar adjustments */
    .navbar-top .input-group {
        max-width: 100% !important;
        margin-bottom: 0.5rem;
    }
    
    /* Dropdown menu improvements */
    .dropdown-menu {
        border-radius: 12px;
        border: none;
        box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    }
    
    /* Modal improvements for mobile */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Form improvements */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    /* Button improvements */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-group .btn {
        padding: 0.5rem 1rem;
    }
    
    /* Header improvements */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    
    /* Breadcrumb improvements */
    .breadcrumb {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    /* Chart responsiveness */
    .chart-container {
        position: relative;
        height: 300px;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .card {
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .content-wrapper {
        padding: 0.75rem;
    }
    
    /* Stack navbar items */
    .navbar-top .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .navbar-top .input-group {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .navbar-top .gap-3 {
        gap: 0.5rem !important;
        flex-wrap: wrap;
    }
    
    /* Better form layouts */
    .form-row-mobile {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    /* All columns full width on mobile */
    .col-sm-6, .col-md-6, .col-lg-6, .col-xl-6,
    .col-sm-4, .col-md-4, .col-lg-4, .col-xl-4,
    .col-sm-3, .col-md-3, .col-lg-3, .col-xl-3,
    .col-sm-8, .col-md-8, .col-lg-8, .col-xl-8,
    .col-sm-9, .col-md-9, .col-lg-9, .col-xl-9 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Compact tables */
    .table-sm th,
    .table-sm td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Smaller buttons */
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Compact stats cards */
    .stats-card .card-body {
        padding: 0.5rem;
        text-align: center;
    }
    
    .stats-card h3 {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
    
    .stats-card p {
        font-size: 0.8rem;
        margin-bottom: 0;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .modal-body {
        padding: 0.75rem;
    }
    
    .modal-footer {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    /* Form control adjustments */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.5rem;
    }
    
    .input-group-text {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Typography adjustments */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    h4 { font-size: 1rem; }
    h5 { font-size: 0.9rem; }
    h6 { font-size: 0.85rem; }
    
    /* Breadcrumb adjustments */
    .breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        padding: 0.5rem 0;
    }
    
    /* Alert adjustments */
    .alert {
        padding: 0.5rem;
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    /* Badge adjustments */
    .badge {
        font-size: 0.7rem;
        padding: 0.375rem 0.5rem;
    }
    
    /* Chart container adjustments */
    .chart-container {
        height: 250px;
    }
    
    /* Pagination adjustments */
    .pagination {
        justify-content: center;
    }
    
    .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Toast adjustments */
    .toast {
        font-size: 0.875rem;
    }
    
    /* Dropdown adjustments */
    .dropdown-menu {
        font-size: 0.875rem;
    }
    
    /* Tab adjustments */
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Progress bar adjustments */
    .progress {
        height: 0.75rem;
    }
    
    /* List group adjustments */
    .list-group-item {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Card header adjustments */
    .card-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Better spacing for action buttons */
    .d-flex.gap-2 {
        gap: 0.5rem !important;
        flex-wrap: wrap;
    }
    
    .d-flex.gap-3 {
        gap: 0.5rem !important;
        flex-wrap: wrap;
    }
    
    /* Wallet specific improvements */
    .wallet-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* UPI Button adjustments */
    #upiPaymentButton {
        padding: 10px 15px;
        font-size: 1rem;
        text-align: center;
        width: 100%;
        max-width: 280px;
    }
    
    /* Transaction ID input */
    #upiTransactionId {
        font-size: 16px; /* Prevents zoom */
        max-width: 100%;
    }
}

/* Additional mobile optimizations for very small screens */
@media (max-width: 480px) {
    .table th,
    .table td {
        padding: 0.25rem;
        font-size: 0.8rem;
    }
    
    /* Hide non-essential columns */
    .d-none-sm {
        display: none !important;
    }
    
    /* Better modal sizing */
    .modal-dialog {
        margin: 1rem 0.5rem;
    }
    
    /* Chart containers */
    .chart-container {
        position: relative;
        height: 200px !important;
        margin-bottom: 1rem;
    }
    
    /* Extra compact cards */
    .card-body {
        padding: 0.5rem;
    }
    
    /* Smaller icons */
    .fas, .far, .fab {
        font-size: 0.875rem;
    }
}

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

.shadow {
    box-shadow: var(--card-shadow) !important;
}

.shadow-lg {
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
}

/* Mobile-specific utility classes */
@media (max-width: 768px) {
    .d-mobile-none {
        display: none !important;
    }
    
    .d-mobile-block {
        display: block !important;
    }
    
    .d-mobile-flex {
        display: flex !important;
    }
    
    .text-mobile-center {
        text-align: center !important;
    }
    
    .flex-mobile-column {
        flex-direction: column !important;
    }
    
    .w-mobile-100 {
        width: 100% !important;
    }
    
    .gap-mobile-1 {
        gap: 0.25rem !important;
    }
    
    .gap-mobile-2 {
        gap: 0.5rem !important;
    }
    
    .p-mobile-1 {
        padding: 0.25rem !important;
    }
    
    .p-mobile-2 {
        padding: 0.5rem !important;
    }
    
    .m-mobile-1 {
        margin: 0.25rem !important;
    }
    
    .m-mobile-2 {
        margin: 0.5rem !important;
    }
    
    /* Force full width on mobile for specific components */
    .btn-mobile-full {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    .input-mobile-full {
        width: 100% !important;
    }
    
    .card-mobile-compact {
        margin-bottom: 0.75rem !important;
    }
    
    .card-mobile-compact .card-body {
        padding: 0.75rem !important;
    }
    
    /* Better table responsiveness */
    .table-mobile-responsive {
        font-size: 0.8rem;
    }
    
    .table-mobile-responsive th,
    .table-mobile-responsive td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    /* Stack navigation items */
    .nav-mobile-stack {
        flex-direction: column;
    }
    
    .nav-mobile-stack .nav-item {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    /* Additional mobile utilities */
    .text-mobile-center {
        text-align: center !important;
    }
    
    .btn-mobile-block {
        display: block !important;
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    .card-mobile-compact .card-body {
        padding: 0.75rem !important;
    }
    
    .table-mobile-compact th,
    .table-mobile-compact td {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.875rem !important;
    }
    
    .overflow-mobile-scroll {
        overflow-x: auto !important;
    }
}

@media (max-width: 576px) {
    .d-sm-mobile-none {
        display: none !important;
    }
    
    .btn-sm-mobile-block {
        display: block !important;
        width: 100% !important;
        margin-bottom: 0.25rem !important;
    }
    
    .text-sm-mobile-small {
        font-size: 0.875rem !important;
    }
    
    .h-sm-mobile-auto {
        height: auto !important;
    }
    
    .p-sm-mobile-2 {
        padding: 0.5rem !important;
    }
}

/* Chart containers responsive */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

@media (max-width: 992px) {
    .chart-container {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 250px;
    }
}

/* Responsive tables improvements */
.table-responsive {
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    .table .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .table .badge {
        font-size: 0.675rem;
        padding: 0.25em 0.5em;
    }
}

/* Form improvements for mobile */
@media (max-width: 768px) {
    .form-label {
        font-weight: 600;
        margin-bottom: 0.25rem;
    }
    
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
}

/* Card improvements */
@media (max-width: 576px) {
    .card {
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        border-radius: 8px 8px 0 0 !important;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-footer {
        padding: 0.75rem 1rem;
        border-radius: 0 0 8px 8px !important;
    }
}

/* Button group improvements */
@media (max-width: 768px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: var(--border-radius) !important;
        margin-bottom: 0.25rem;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* Navigation improvements */
@media (max-width: 768px) {
    .navbar-nav {
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
}

/* Dropdown improvements */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        box-shadow: none;
        background: transparent;
        padding: 0;
        margin: 0;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        color: rgba(255,255,255,0.8);
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .dropdown-item:hover {
        background: rgba(255,255,255,0.1);
        color: #ffffff;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Payment Method Icons */
.payment-method-icon {
    width: 40px;
    height: 25px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
    margin-right: 8px;
}

.payment-method-card {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23528ff0"><path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"/></svg>');
}

.payment-method-upi {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2328a745"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
}

.payment-method-netbanking {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffc107"><path d="M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 15h2v-6h-2v6z"/></svg>');
}

.payment-method-wallet {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e83e8c"><path d="M21 7.28V5c0-1.1-.9-2-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-2.28A2 2 0 0 0 22 15V9a2 2 0 0 0-1-1.72zM20 9v6h-7V9h7zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2H5z"/><circle cx="16" cy="12" r="1.5"/></svg>');
}

/* Status Indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-success {
    background-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.status-warning {
    background-color: var(--warning-color);
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}

.status-danger {
    background-color: var(--danger-color);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.status-info {
    background-color: var(--info-color);
    box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.2);
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar-top,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Custom Alert Text Colors for Better Readability */
/* Custom Alert Text Colors for Better Readability */
.alert-warning,
.bg-warning {
    color: #856404 !important;
}

.alert-info,
.bg-info {
    color: #0c5460 !important;
}

.alert-light {
    color: #6c757d !important;
}

.alert-success {
    color: #155724 !important;
}

.alert-danger {
    color: #721c24 !important;
}

/* Ensure all elements within alerts have proper color */
.alert-warning *, .bg-warning * {
    color: #856404 !important;
}

.alert-info *, .bg-info * {
    color: #0c5460 !important;
}

.alert-success * {
    color: #155724 !important;
}

.alert-danger * {
    color: #721c24 !important;
}

/* Custom status classes for test pages and forms */
.success, .success p, .success * {
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
    padding: 10px !important;
    border-radius: 5px !important;
    margin: 10px 0 !important;
}

.error, .error p, .error * {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
    padding: 10px !important;
    border-radius: 5px !important;
    margin: 10px 0 !important;
}

.warning, .warning p, .warning * {
    background-color: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffeaa7 !important;
    padding: 10px !important;
    border-radius: 5px !important;
    margin: 10px 0 !important;
}

.info, .info p, .info * {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
    border: 1px solid #bee5eb !important;
    padding: 10px !important;
    border-radius: 5px !important;
    margin: 10px 0 !important;
}

.toast.bg-warning,
.toast.bg-info,
.toast.bg-light {
    color: #333 !important;
}

.toast.bg-warning .btn-close,
.toast.bg-info .btn-close,
.toast.bg-light .btn-close {
    filter: invert(1) grayscale(100%) brightness(0%);
}

.toast.bg-success .btn-close,
.toast.bg-danger .btn-close {
    filter: none; /* Keep white close button for dark backgrounds */
}

/* Ensure all message content is visible */
.toast-body, .toast-body *, .alert-body, .alert-body * {
    color: inherit !important;
}

/* Override any Bootstrap default text colors in messages */
.toast.show, .alert.show {
    color: inherit !important;
}

/* Force proper contrast for all message types */
div[class*="success"], div[class*="error"], div[class*="warning"], div[class*="info"] {
    color: inherit !important;
}

div[class*="success"] *, div[class*="error"] *, div[class*="warning"] *, div[class*="info"] * {
    color: inherit !important;
}

/* Critical Mobile Touch Optimizations */
@media (max-width: 768px) {
    /* Fix layout container to prevent horizontal overflow */
    body {
        overflow-x: hidden;
        font-size: 14px;
    }
    
    /* Sidebar mobile optimizations */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        background: var(--dark-bg, #1a1a1a);
        border-right: 1px solid rgba(255,255,255,0.1);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Mobile navbar adjustments */
    .navbar-top {
        padding: 0.5rem 1rem;
        position: sticky;
        top: 0;
        z-index: 1030;
        background: white !important;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .mobile-menu-toggle {
        background: none;
        border: none;
        font-size: 1.25rem;
        color: #333;
        padding: 0.5rem;
        border-radius: 8px;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(0,0,0,0.1);
    }
    
    /* Main content adjustments for mobile */
    .main-content {
        padding: 1rem 0.75rem;
        margin-left: 0 !important;
        min-height: calc(100vh - 70px);
    }
    
    /* Improve touch targets */
    .btn, .nav-link, .dropdown-item {
        min-height: 44px;
        padding: 0.75rem 1rem;
        border-radius: 8px;
    }
    
    .nav-link {
        padding: 0.875rem 1rem;
        margin-bottom: 0.25rem;
        border-radius: 8px;
    }
    
    /* Prevent horizontal scroll */
    .container-fluid {
        overflow-x: hidden;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Better form controls */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        border-radius: 8px;
        border: 1px solid #ccc;
    }
    
    /* Improve table readability */
    .table {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .table th, .table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .table-responsive {
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    /* Better modal experience */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .modal-content {
        border-radius: 12px;
        border: none;
        box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    }
    
    /* Improve card spacing */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
        border: 1px solid #e0e0e0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.875rem 1rem;
        background: #f8f9fa;
        border-bottom: 1px solid #e0e0e0;
        border-radius: 12px 12px 0 0 !important;
    }
    
    /* Better button groups */
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        border-radius: 8px !important;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Better content spacing */
    .content-wrapper {
        padding: 1rem 0.75rem;
    }
    
    /* Better dropdowns */
    .dropdown-menu {
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        border: none;
        min-width: 200px;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        margin: 0.25rem 0.5rem;
    }
    
    /* Search bar mobile adjustments */
    .input-group {
        max-width: 100% !important;
        flex: 1;
    }
    
    /* Hide less important elements on very small screens */
    @media (max-width: 480px) {
        .d-none-xs {
            display: none !important;
        }
        
        .btn-sm {
            padding: 0.5rem 0.75rem;
            font-size: 0.875rem;
        }
        
        .table th:nth-child(n+4),
        .table td:nth-child(n+4) {
            display: none;
        }
    }
}

/* Additional Mobile Utilities */
@media (max-width: 992px) {
    /* Tablet and mobile layout adjustments */
    .row > [class*="col-"] {
        margin-bottom: 1rem;
    }
    
    .btn-toolbar .btn-group {
        margin-bottom: 0.5rem;
    }
    
    .navbar-expand-lg .navbar-nav {
        flex-direction: column;
    }
}

/* Mobile-first responsive text sizes */
@media (max-width: 576px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
    
    .display-1 { font-size: 2.5rem; }
    .display-2 { font-size: 2rem; }
    .display-3 { font-size: 1.75rem; }
    .display-4 { font-size: 1.5rem; }
}

/* Ensure proper scaling and prevent zoom issues */
* {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Touch-friendly scrollbars on mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
}
