* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --success-color: #10b981;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #0ea5e9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    background-attachment: fixed;
    color: var(--gray-900);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

.container {
    display: flex;
    flex: 1;
    min-height: 100vh;
    overflow: visible;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0f172a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

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

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

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

.sidebar-menu ul {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin: 4px 12px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
    font-size: 14px;
    position: relative;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--sidebar-active);
    border-radius: 0 3px 3px 0;
    transition: var(--transition);
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(4px);
}

.sidebar-menu a:hover::before {
    height: 60%;
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.sidebar-menu a.active::before {
    height: 70%;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    background: transparent;
    margin-left: 280px;
}

.content-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px 32px;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--gray-200);
}

.content-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

.content-area {
    flex: 1;
    padding: 32px;
    overflow: visible;
    background: transparent;
    width: 100%;
}

.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

.welcome-message {
    text-align: center;
    padding: 80px 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.welcome-message h1 {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.welcome-message p {
    font-size: 18px;
    color: var(--gray-600);
}

/* Module Content Styles */
.module-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    width: 100%;
    box-sizing: border-box;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-100);
}

.module-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.3px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

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

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #34d399 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--success-color) 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #f87171 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-dark) 0%, var(--danger-color) 100%);
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-700);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #22d3ee 100%);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891b2 0%, var(--info-color) 100%);
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 24px;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 600px; /* Minimum width for horizontal scrolling on mobile */
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    font-weight: 600;
    color: var(--gray-900);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 2px solid var(--gray-100);
}

/* Modal Styles */
.modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    margin: 40px auto;
    padding: 40px;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 700px;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease-out;
    border: 1px solid var(--gray-200);
}

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

.modal-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-100);
}

.close {
    position: absolute;
    right: 24px;
    top: 24px;
    font-size: 28px;
    font-weight: 300;
    color: var(--gray-400);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close:hover {
    color: var(--gray-900);
    background: var(--gray-100);
}

/* Search Section */
.search-section {
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.search-section input[type="text"] {
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    background: white;
}

.search-section input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.pagination button {
    min-width: 100px;
}

.pagination span {
    font-weight: 600;
    color: var(--gray-700);
}

/* Reporting Cards */
.report-cards,
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 28px;
}

.report-card,
.summary-card {
    background: white;
    padding: 28px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.report-card::before,
.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.report-card:hover,
.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.report-card h3,
.report-card h4,
.summary-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-card .value,
.summary-card .summary-number {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--gray-500);
}

.empty-state p {
    margin-top: 12px;
    font-size: 16px;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.OPD {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.badge.IPD {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Search Results */
.search-results {
    list-style: none;
    margin-top: 12px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    max-height: 300px;
    overflow-y: auto;
}

.search-results li {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}

.search-results li:last-child {
    border-bottom: none;
}

.search-results li:hover {
    background: var(--gray-50);
    padding-left: 20px;
}

/* Billing Summary */
.billing-summary,
.case-info,
.case-charges-section,
.case-doctor-charges-section {
    margin-bottom: 32px;
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

/* Case Details Scrollable Container */
.case-details-container {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
}

.case-details-container::-webkit-scrollbar {
    width: 8px;
}

.case-details-container::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.case-details-container::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

.case-details-container::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

.case-charges-section .data-table,
.case-doctor-charges-section .data-table {
    margin-top: 16px;
}

.billing-summary h3,
.case-info h3,
.case-charges-section h3,
.case-doctor-charges-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
}

.bill-totals,
.payout-totals {
    margin-top: 24px;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-color);
}

.bill-totals p,
.payout-totals p {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    margin: 8px 0;
}

.bill-totals strong,
.payout-totals strong {
    color: var(--primary-color);
}

/* Payout Form */
.payout-form {
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.payout-report {
    margin-top: 24px;
}

/* Reports Summary */
.reports-summary {
    padding: 24px;
}

.reports-summary h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 28px;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    touch-action: manipulation;
}

.mobile-menu-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Overlay for mobile menu */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar Close Button */
.sidebar-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
    padding: 0;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Table Responsive Wrapper */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Scrollable table container for doctors module */
.table-scroll-container {
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    overflow-x: auto;
    margin: 20px 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    background: white;
}

.table-scroll-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

.table-scroll-container .data-table {
    margin-top: 0;
    border-radius: 0;
}

.table-scroll-container .data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .sidebar-menu a {
        min-height: 44px;
    }
    
    input, select, textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Body menu-open state */
body.menu-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
    }
    
    .main-content {
        margin-left: 260px;
    }
    
    .content-area {
        padding: 24px;
    }
    
    .module-content {
        padding: 24px;
    }
    
    .data-table {
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 10px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar-close {
        display: flex;
    }
    
    .container {
        flex-direction: row;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        max-width: 85vw;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: var(--shadow-xl);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-menu {
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .main-content {
        width: 100%;
        margin-left: 0;
    }
    
    .content-area {
        padding: 60px 16px 20px;
    }
    
    .module-content {
        padding: 20px 16px;
    }
    
    .module-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 24px 20px;
        margin: 20px 10px;
        width: calc(100% - 20px);
        max-width: none;
    }
    
    .data-table {
        font-size: 12px;
        display: block;
        width: 100%;
    }
    
    .table-wrapper {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
    
    .table-scroll-container {
        max-height: calc(100vh - 350px);
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tbody {
        display: block;
        width: 100%;
    }
    
    .data-table tr {
        display: block;
        margin-bottom: 16px;
        background: white;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        border: 1px solid var(--gray-200);
    }
    
    .data-table td {
        display: block;
        text-align: right;
        padding: 12px 16px;
        border-bottom: 1px solid var(--gray-100);
        position: relative;
        padding-left: 50%;
    }
    
    .data-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 16px;
        font-weight: 600;
        color: var(--gray-700);
        text-transform: uppercase;
        font-size: 11px;
        letter-spacing: 0.5px;
    }
    
    .data-table td:last-child {
        border-bottom: none;
    }
    
    .report-cards,
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .pagination button {
        width: 100%;
    }
    
    .welcome-message {
        padding: 40px 20px;
    }
    
    .welcome-message h1 {
        font-size: 24px;
    }
    
    .welcome-message p {
        font-size: 16px;
    }
    
    .search-section {
        padding: 16px;
    }
    
    .search-section input[type="text"] {
        width: 100%;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        top: 12px;
        left: 12px;
    }
    
    .content-area {
        padding: 56px 12px 16px;
    }
    
    .module-content {
        padding: 16px 12px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }
    
    .module-header {
        gap: 12px;
    }
    
    .module-header h1 {
        font-size: 20px;
    }
    
    .welcome-message {
        padding: 32px 16px;
    }
    
    .welcome-message h1 {
        font-size: 22px;
    }
    
    .welcome-message p {
        font-size: 14px;
    }
    
    .modal-content {
        padding: 20px 16px;
        margin: 12px;
        width: calc(100% - 24px);
    }
    
    .modal-content h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .billing-summary,
    .case-info,
    .case-charges-section,
    .case-doctor-charges-section {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .case-details-container {
        max-height: calc(100vh - 300px);
    }
    
    .payout-form {
        padding: 16px;
    }
    
    .report-card,
    .summary-card {
        padding: 20px;
    }
    
    .report-card .value,
    .summary-card .summary-number {
        font-size: 28px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

/* Prescription Lightbox Styles */
.prescription-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
}

.prescription-lightbox-container {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 95%;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.prescription-lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.prescription-lightbox-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prescription-lightbox-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.prescription-lightbox-controls .btn {
    padding: 8px 16px;
    font-size: 14px;
    min-width: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.zoom-level {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.prescription-lightbox-content {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--gray-100);
    position: relative;
}

.prescription-image-viewer {
    max-width: 100%;
    max-height: calc(95vh - 120px);
    object-fit: contain;
    cursor: grab;
    user-select: none;
    transform-origin: center center;
}

.prescription-image-viewer:active {
    cursor: grabbing;
}

.prescription-pdf-viewer {
    width: 100%;
    min-height: 600px;
    height: calc(95vh - 120px);
    border: none;
}

/* Responsive adjustments for lightbox */
@media (max-width: 768px) {
    .prescription-lightbox-container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .prescription-lightbox-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .prescription-lightbox-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .prescription-lightbox-controls .btn {
        flex: 1;
        justify-content: center;
    }
    
    .prescription-image-viewer {
        max-height: calc(100vh - 180px);
    }
    
    .prescription-pdf-viewer {
        height: calc(100vh - 180px);
    }
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: #2563eb;
    margin: 0 0 8px 0;
    font-size: 28px;
    text-align: center;
}

.login-box h2 {
    color: #1f2937;
    margin: 0 0 24px 0;
    font-size: 20px;
    text-align: center;
    font-weight: 600;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box label {
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

.login-box input[type="text"],
.login-box input[type="password"],
.login-box input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.login-box input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==================== PAYOUTS MODULE ==================== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--gray-200);
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: var(--gray-50);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.header-container h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.filter-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--gray-50);
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    border: 1px solid var(--gray-200);
}

.filter-bar input,
.filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    min-width: 150px;
}

/* Fix table row height */
.data-table td {
    vertical-align: middle;
}

/* Payment Details Column formatting */
.payment-details-cell {
    max-width: 200px;
    font-size: 13px;
    line-height: 1.4;
}

.payment-details-cell div {
    margin-bottom: 2px;
}

.payment-details-cell span {
    color: var(--gray-500);
    font-weight: 500;
}
