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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #e8ecef;
    color: #333;
}

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

.sidebar {
    width: 220px;
    background-color: #f5f7fa;
    padding: 20px 10px;
    border-right: 1px solid #dee2e6;
}

.sidebar h1 {
    color: #007bff;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    padding-left: 15px;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 12px;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: #f0f0f0 !important;
    color: #008080 !important;
}

/* Font Awesome icons for sidebar */
.sidebar ul li a::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 10px;
    font-size: 16px;
    color: #495057;
    transition: color 0.2s;
}

.sidebar ul li a:hover::before,
.sidebar ul li a.active::before {
    color: #007bff;
}

.sidebar ul li:nth-child(1) a::before { content: "\f15c"; } /* New Registration - File */
.sidebar ul li:nth-child(2) a::before { content: "\f080"; } /* Analysis - Chart Bar */
.sidebar ul li:nth-child(3) a::before { content: "\f0ca"; } /* Patient List - List */
.sidebar ul li:nth-child(4) a::before { content: "\f058"; } /* Enter & Verify - Check Circle */
.sidebar ul li:nth-child(5) a::before { content: "\f201"; } /* Financial Analysis - Chart Line */
.sidebar ul li:nth-child(6) a::before { content: "\f0c9"; } /* Tests - Bars */
.sidebar ul li:nth-child(7) a::before { content: "\f085"; } /* Lab Management - Gears */
.sidebar ul li:nth-child(8) a::before { content: "\f2bb"; } /* Lab Profile - Address Card */

.main-content {
    flex-grow: 1;
    padding: 0;
    background-color: #f0f2f5;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f5f7fa;
    padding: 10px 20px;
    border-bottom: 1px solid #dee2e6;
}

.search-container {
    position: relative;
}

.header input {
    padding: 8px 12px;
    width: 300px;
    border: 1px solid #ced4da;
    border-radius: 20px;
    font-size: 14px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="gray" class="bi bi-search" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-5.5-5.5 5.5 5.5 0 0 1 5.5 5.5z"/></svg>') no-repeat 10px center;
    background-size: 16px;
    padding-left: 35px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-result {
    padding: 8px 12px;
    font-size: 14px;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}

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

.search-result a {
    text-decoration: none;
    color: #007bff;
    display: block;
}

.search-result a:hover {
    background-color: #f8f9fa;
    color: #0056b3;
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header .user-info a {
    text-decoration: none;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
}

.header .user-info a:last-child {
    display: flex;
    align-items: center;
}

.header .user-info a:last-child::after {
    content: '⚙️';
    margin-left: 5px;
}

.form-container {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin: 20px;
    max-width: 900px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #343a40;
}

.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

label {
    width: 150px;
    font-weight: 500;
    font-size: 14px;
    color: #495057;
}

input, select, textarea {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

input[type="text"], input[type="email"], input[type="number"], select {
    width: 200px;
}

textarea {
    width: 300px;
    height: 60px;
    resize: none;
}

input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    width: auto;
    margin-right: 5px;
    font-weight: normal;
}

.radio-group input {
    margin-right: 5px;
}

.required {
    color: #dc3545;
    margin-left: 3px;
    font-size: 12px;
}

button, .action-btn, .modal-content button, .payment-method, #registerPatient, #registerAndPrint, #printBill, #closePrintModal, #printSelectedReports, #sendSelectedReports {
  background-color: #008080 !important;
  color: #fff !important;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s;
}
button:hover, .action-btn:hover, .modal-content button:hover, .payment-method:hover, #registerPatient:hover, #registerAndPrint:hover, #printBill:hover, #closePrintModal:hover, #printSelectedReports:hover, #sendSelectedReports:hover {
  background-color: #006666 !important;
}

.optional-select {
    display: flex;
    align-items: center;
    gap: 10px;
}

.optional-select select {
    width: 150px;
}

.optional-select button {
    padding: 5px 10px;
    font-size: 12px;
    background-color: #007bff;
    border-radius: 3px;
}

.age-group input[type="number"] {
    width: 80px;
}

.age-group select {
    width: 100px;
    margin-left: 10px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
    padding: 20px;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #343a40;
}

.modal-header .close {
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.modal-body {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.modal-left {
    width: 30%;
    border-right: 1px solid #dee2e6;
    padding-right: 20px;
    min-width: 250px;
}

.modal-left p {
    font-size: 14px;
    color: #495057;
    margin-bottom: 8px;
}

.modal-left p strong {
    font-weight: 600;
}

.modal-right {
    width: 70%;
    min-width: 300px;
}

#billingTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

#billingTable th, #billingTable td {
    padding: 10px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #dee2e6;
}

#billingTable th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #495057;
}

#billingTable td {
    color: #495057;
}

#billingTable .delete-test {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 16px;
    cursor: pointer;
}

.test-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.test-search input, .test-search select {
    width: 200px;
}

.billing-summary {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.discount {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.discount label {
    width: auto;
    margin-right: 10px;
}

.discount input[type="number"] {
    width: 100px;
}

.discount label input[type="checkbox"] {
    margin-right: 5px;
}

.amounts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.amounts p {
    font-size: 14px;
    color: #495057;
}

.amounts input {
    width: 100px;
}

.payment-methods {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.payment-methods label {
    width: auto;
    margin-right: 10px;
}

.payment-methods button {
    padding: 6px 12px;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #495057;
}

.payment-methods button.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.total-amount {
    font-size: 16px;
    font-weight: 600;
    color: #343a40;
    text-align: right;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
    text-align: right;
    position: sticky;
    bottom: 0;
    background-color: white;
}

#registerAndPrint {
    padding: 10px 20px;
}

/* Print Bill Modal Styles */
.print-bill-content {
    width: 60%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.bill-content {
    padding: 20px;
}

.bill-header {
    text-align: center;
    margin-bottom: 20px;
}

.bill-header h1 {
    color: #007bff;
    font-size: 24px;
    font-weight: 600;
}

.bill-header p {
    font-size: 14px;
    color: #495057;
}

.bill-details {
    margin-bottom: 20px;
}

.bill-details p {
    font-size: 14px;
    color: #495057;
    margin-bottom: 5px;
}

.bill-details p strong {
    font-weight: 600;
}

.bill-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.bill-table th, .bill-table td {
    padding: 8px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #dee2e6;
}

.bill-table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #495057;
}

.bill-table td {
    color: #495057;
}

.bill-summary {
    margin-bottom: 20px;
}

.bill-summary p {
    font-size: 14px;
    color: #495057;
    margin-bottom: 5px;
}

.bill-summary p strong {
    font-weight: 600;
}

.bill-footer {
    text-align: center;
}

.bill-footer p {
    font-size: 12px;
    color: #6c757d;
}

hr {
    border: 0;
    border-top: 1px solid #dee2e6;
    margin: 10px 0;
}

#closePrintModal {
    background-color: #6c757d;
    margin-left: 10px;
}

#closePrintModal:hover {
    background-color: #5a6268;
}

/* Table header font color to Teal for all tables */
table th, thead th {
  color: #008080 !important;
}

/* Print-specific styles */
@media print {
    body * {
        visibility: hidden;
    }
    .print-bill-content, .print-bill-content * {
        visibility: visible;
    }
    .print-bill-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 20px;
        box-shadow: none;
        border-radius: 0;
    }
    .modal-header, .modal-footer {
        display: none;
    }
}

/* Ensure modals are centered and responsive at different zoom levels */
@media screen and (max-width: 768px) {
    .modal-content {
        width: 90%;
        max-width: 100%;
        margin: 10% auto;
    }
    .modal-body {
        flex-direction: column;
    }
    .modal-left, .modal-right {
        width: 100%;
        border-right: none;
        padding-right: 0;
    }
    .print-bill-content {
        width: 90%;
    }
}