* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1976D2 0%, #42A5F5 100%);
    color: white;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-container {
    flex-shrink: 0;
}

.logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: white;
    padding: 5px;
    object-fit: contain;
}

.hospital-info h1 {
    font-size: 28px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hospital-info p {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.95;
}

/* Sections */
.form-section, .records-section {
    padding: 30px;
}

h2 {
    color: #1976D2;
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 3px solid #42A5F5;
    padding-bottom: 10px;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1976D2;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-primary {
    background: #1976D2;
    color: white;
}

.btn-primary:hover {
    background: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(25, 118, 210, 0.3);
}

.btn-secondary {
    background: #757575;
    color: white;
}

.btn-secondary:hover {
    background: #616161;
}

.btn-success {
    background: #4CAF50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-danger {
    background: #f44336;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #da190b;
}

.btn-info {
    background: #2196F3;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-info:hover {
    background: #0b7dda;
}

/* Table */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

thead {
    background: #1976D2;
    color: white;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

tbody tr:hover {
    background: #f5f5f5;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .hospital-info h1 {
        font-size: 22px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Success Message */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Receipt Details in Modal */
.receipt-info {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin: 20px 0;
}

.receipt-info p {
    margin: 10px 0;
    font-size: 14px;
}

.receipt-info strong {
    color: #1976D2;
}

.amount-display {
    font-size: 24px;
    color: #D32F2F;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #ffebee;
    border-radius: 5px;
}
.export-actions {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}

.export-actions .btn-success {
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.export-actions .btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}
/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    margin-bottom: 10px;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid #1976D2;
    background: white;
    color: #1976D2;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: #1976D2;
    color: white;
    transform: translateY(-2px);
}

.page-btn.active {
    background: #1976D2;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(25, 118, 210, 0.3);
}

.page-btn:disabled {
    border-color: #e0e0e0;
    color: #9e9e9e;
    background: #f5f5f5;
    cursor: not-allowed;
    transform: none;
}
/* Service Row Styles */
.service-row {
    display: grid;
    grid-template-columns: 2fr 1fr 40px;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-row .form-group {
    margin-bottom: 0;
}

.btn-remove {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin-top: 28px;
}

.btn-remove:hover {
    background: #da190b;
    transform: scale(1.1);
}

.total-amount-display {
    font-size: 24px;
    font-weight: bold;
    color: #D32F2F;
    padding: 15px;
    background: #ffebee;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #f44336;
}

/* Services List in Modal */
.services-list {
    margin: 15px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.service-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.service-item:last-child {
    border-bottom: none;
}

.service-item strong {
    color: #1976D2;
}

.service-item span {
    font-weight: 600;
    color: #333;
}
.other-service-input {
    padding: 10px;
    border: 2px solid #1976D2;
    border-radius: 5px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
    transition: border-color 0.3s;
}

.other-service-input:focus {
    outline: none;
    border-color: #0d47a1;
    box-shadow: 0 0 5px rgba(25, 118, 210, 0.3);
}
/* Action Buttons Container */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    min-width: 150px;
}

/* Base Button Style */
.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
}

.action-btn i {
    font-size: 14px;
}

/* View Button - Light Blue */
.btn-view {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.btn-view:hover {
    background: #1976d2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(25, 118, 210, 0.3);
}

/* PDF Button - Dark Blue */
.btn-pdf {
    background: #1976d2;
    color: white;
}

.btn-pdf:hover {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(25, 118, 210, 0.4);
}

/* Thermal Button - Green */
.btn-thermal {
    background: #43a047;
    color: white;
}

.btn-thermal:hover {
    background: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(67, 160, 71, 0.4);
}

/* Table Cell Styling */
td:last-child {
    vertical-align: middle;
    padding: 12px 8px;
}

/* Responsive: Stack buttons on mobile */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}
/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Content */
.modal-content {
    background: #ffffff;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    font-size: 28px;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

/* Close Button */
.close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    line-height: 1;
    padding: 0 8px;
}

.close:hover {
    transform: rotate(90deg);
    color: #ffeb3b;
}

/* Receipt Container */
.receipt-container {
    padding: 24px;
    background: #f8f9fa;
    min-height: 300px;
}

#receiptDetails {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: white;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.action-btn i {
    font-size: 16px;
}

/* Print Button */
.btn-print {
    background: #1976d2;
    color: white;
}

.btn-print:hover {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

/* Download Button */
.btn-download {
    background: #43a047;
    color: white;
}

.btn-download:hover {
    background: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 160, 71, 0.4);
}

/* Thermal Button */
.btn-thermal {
    background: #f57c00;
    color: white;
}

.btn-thermal:hover {
    background: #e65100;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 124, 0, 0.4);
}

/* Close Button */
.btn-close {
    background: #e0e0e0;
    color: #424242;
}

.btn-close:hover {
    background: #bdbdbd;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .receipt-container {
        padding: 16px;
    }
    
    .modal-actions {
        padding: 16px;
        justify-content: center;
    }
    
    .action-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

/* Scrollbar Styling */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}