.appointment-shell {
        --app-surface: #ffffff;
        --app-surface-alt: #f8fafc;
        --app-border: #e7e9f5;
        --app-border-strong: #9db1cf;
        --app-text: #1f3150;
        --app-muted: #6b7280;
        --app-label: #3f4254;
        --app-input-bg: #ffffff;
        --app-input-border: #d5d9e5;
        --app-input-placeholder: #9ca3af;
        --app-result-bg: #ffffff;
        --app-result-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
        --panel-heading-bg: var(--app-surface-alt);
        --panel-heading-text: var(--app-text);
        background: var(--app-surface-alt);
        color: var(--app-text);
        font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
        font-size: 0.75rem;
        letter-spacing: 0.01em;
        width: auto;
        max-width: 100%;
    }

    [data-theme=dark] .appointment-shell {
        --app-surface: #111827;
        --app-surface-alt: #0f1724;
        --app-border: rgba(255, 255, 255, 0.08);
        --app-border-strong: rgba(255, 255, 255, 0.14);
        --app-text: #f3f4f6;
        --app-muted: #cbd5e1;
        --app-label: #e5e7eb;
        --app-input-bg: #1f2937;
        --app-input-border: #2d3748;
        --app-input-placeholder: #9ca3af;
        --app-result-bg: #111827;
        --app-result-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
        --panel-heading-bg: #152137;
        --panel-heading-text: #f8fafc;
    }

    .appointment-shell .page-card {
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        border-radius: 10px;
        box-shadow: var(--bs-box-shadow-sm, 0 4px 14px rgba(15, 23, 42, 0.04));
        width: 100%;
        color: var(--app-text);
    }

    /* Patient info header */
    .appointment-shell .info-header-row .card,
    .appointment-shell .info-header-row .card-body {
        background: transparent;
        border: none;
        box-shadow: none;
        color: var(--app-text);
    }

    .appointment-shell .info-header-row table,
    .appointment-shell .info-header-row tr,
    .appointment-shell .info-header-row td {
        background: transparent !important;
        border: none !important;
    }

    .appointment-shell .info-header-row span,
    .appointment-shell .info-header-row .col-form-label {
        color: var(--app-text) !important;
        font-size: 0.9rem;
        font-weight: 700;
    }

    .appointment-shell .info-header-row .text-muted {
        color: var(--app-text) !important;
        opacity: 0.9;
        font-size: 0.92rem;
        font-weight: 700;
    }

    .appointment-shell .info-header-row .text-primary,
    .appointment-shell .info-header-row .text-success {
        color: var(--app-text) !important;
    }

    .appointment-shell .patient-info-table td {
        vertical-align: top;
        padding: 6px 10px;
    }

    .appointment-shell .info-label {
        font-size: 0.92rem;
        font-weight: 700;
        color: var(--app-text);
    }

    .appointment-shell .info-value {
        font-size: 0.92rem;
        font-weight: 700;
        color: var(--app-text);
    }

    .appointment-shell .card {
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        box-shadow: 0 4px 14px rgba(31, 49, 80, 0.05);
        color: var(--app-text);
    }

    .appointment-shell .card-body {
        padding: 8px 10px;
        color: var(--app-text);
    }

    .appointment-shell .patient-summary td {
        padding: 0.26rem 0.32rem;
        width: 25%;
        color: var(--app-text);
    }

    .appointment-shell .patient-summary .label {
        display: inline-block;
        min-width: 92px;
        color: var(--app-label);
        font-weight: 600;
        font-size: 0.8rem;
    }

    .appointment-shell .patient-tabs {
        display: flex;
        align-items: stretch;
        gap: 12px;
        min-height: calc(100vh - 260px);
    }

    .appointment-shell .nav-container {
        max-height: none;
        overflow: visible;
        position: sticky;
        top: 0;
        align-self: flex-start;
    }

    .appointment-shell .appointment-nav {
        width: 190px;
        flex-shrink: 0;
    }

    .appointment-shell .appointment-nav .nav-item {
        background: var(--app-surface-alt);
        color: var(--app-text);
        border: 1px solid var(--app-border);
        border-radius: 10px;
        padding: 4px 8px;
        margin-bottom: 4px;
        font-weight: 600;
        font-size: 0.86rem;
        line-height: 1.15;
        min-height: 28px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .appointment-shell .appointment-nav .nav-item:hover {
        background: var(--app-surface);
    }

    .appointment-shell .appointment-nav .nav-item.active {
        background: var(--bs-primary);
        color: #fff;
        border-color: var(--bs-primary);
        box-shadow: 0 12px 30px rgba(15, 121, 243, 0.25);
    }
    .appointment-shell.appointment-view-page {
        font-size: 0.82rem;
    }

    .appointment-shell.appointment-view-page label,
    .appointment-shell.appointment-view-page .form-label,
    .appointment-shell.appointment-view-page .col-form-label,
    .appointment-shell.appointment-view-page .info-label,
    .appointment-shell.appointment-view-page .info-value {
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .appointment-shell.appointment-view-page .form-control,
    .appointment-shell.appointment-view-page .form-select {
        height: 34px;
        font-size: 0.82rem;
        padding: 6px 10px;
        border-radius: 8px;
    }

    .appointment-shell.appointment-view-page .appointment-nav .nav-item {
        font-size: 0.95rem;
        padding: 5px 8px;
        min-height: 30px;
        border-radius: 10px;
    }

    .appointment-shell.appointment-view-page .appointment-nav {
        width: 175px;
    }

    .appointment-shell.appointment-view-page .table,
    .appointment-shell.appointment-view-page .table th,
    .appointment-shell.appointment-view-page .table td {
        font-size: 0.82rem;
    }

    /* Appointment view (viewAndAddConsultation): slightly larger, consistent sizing */
    .appointment-shell.appointment-view-page {
        font-size: 0.82rem;
    }

    .appointment-shell.appointment-view-page label,
    .appointment-shell.appointment-view-page .form-label,
    .appointment-shell.appointment-view-page .col-form-label,
    .appointment-shell.appointment-view-page .info-label,
    .appointment-shell.appointment-view-page .info-value {
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .appointment-shell.appointment-view-page .form-control,
    .appointment-shell.appointment-view-page .form-select {
        height: 34px;
        font-size: 0.82rem;
        padding: 6px 10px;
        border-radius: 8px;
    }

    .appointment-shell.appointment-view-page .appointment-nav .nav-item {
        font-size: 0.95rem;
        padding: 5px 8px;
        min-height: 30px;
        border-radius: 10px;
    }

    .appointment-shell.appointment-view-page .appointment-nav {
        width: 175px;
    }

    .appointment-shell.appointment-view-page .table,
    .appointment-shell.appointment-view-page .table th,
    .appointment-shell.appointment-view-page .table td {
        font-size: 0.82rem;
    }

    .appointment-shell .content-container {
        flex: 1;
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        border-radius: 10px;
        box-shadow: var(--bs-box-shadow-sm, 0 3px 12px rgba(15, 23, 42, 0.04));
        padding: 9px;
        overflow: visible;
        min-height: 100%;
        height: auto;
        max-height: none;
        width: 100%;
        position: relative;
    }

    .appointment-shell .section {
        padding: 9px;
        border: 1px solid var(--app-border);
        border-radius: 10px;
        margin-bottom: 9px;
        background: var(--app-surface);
    }

    /* Modal styling aligned to appointment theme */
    .appointment-shell .theme-modal .modal-content {
        border-radius: 14px;
        border: 1px solid var(--app-border);
        box-shadow: var(--app-result-shadow);
        background: var(--app-surface);
    }

    .appointment-shell .theme-modal .modal-header {
        background: var(--app-surface-alt);
        border-bottom: 1px solid var(--app-border);
        color: var(--app-text);
        padding: 12px 16px;
    }

    .appointment-shell .theme-modal .modal-title {
        font-weight: 800;
        font-size: 1rem;
        color: var(--app-text);
        margin: 0;
    }

    .appointment-shell .theme-modal .btn-close {
        box-shadow: none;
        opacity: 1;
    }

    .appointment-shell .theme-modal .modal-body {
        background: var(--app-surface);
    }
    .appointment-shell .upload-documents-modal .modal-dialog {
        max-width: 440px;
    }

    @media (max-width: 576px) {
        .appointment-shell .upload-documents-modal .modal-dialog {
            max-width: calc(100vw - 24px);
            margin: 12px auto;
        }
    }

	    .appointment-shell .upload-documents-modal .modal-header {
	        padding: 10px 12px;
	        background: var(--app-surface) !important;
	        color: var(--app-text) !important;
	        border-bottom: 1px solid var(--app-border);
	    }

    .appointment-shell .upload-documents-modal .modal-body {
        padding: 12px;
    }

	    .appointment-shell .upload-documents-modal .modal-title {
	        font-size: 0.95rem;
	        font-weight: 800;
	        color: var(--app-text) !important;
	    }

	    .appointment-shell .upload-documents-modal .btn-close {
	        filter: none;
	        opacity: 0.9;
	    }

    .appointment-shell .upload-documents-modal label,
    .appointment-shell .upload-documents-modal .form-label,
    .appointment-shell .upload-documents-modal .col-form-label {
        font-size: 0.85rem;
        font-weight: 700;
        margin-bottom: 4px;
    }

    .appointment-shell .upload-documents-modal .form-control,
    .appointment-shell .upload-documents-modal .form-select {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    .appointment-shell .upload-documents-modal input[type="file"].form-control {
        padding: 4px 10px;
    }

    .appointment-shell .upload-documents-modal .form-text,
    .appointment-shell .upload-documents-modal .upload-doc-hint {
        font-size: 0.78rem;
        margin-top: 6px;
    }

    .appointment-shell .upload-documents-modal .upload-doc-actions button {
        font-size: 0.82rem;
        padding: 5px 10px;
    }

    .appointment-shell .upload-documents-modal .select2-container .select2-selection--single {
        min-height: 32px;
        font-size: 0.85rem;
    }

    .appointment-shell .upload-documents-modal .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 30px;
        padding-left: 10px;
        padding-right: 24px;
    }

    .appointment-shell .upload-documents-modal .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 30px;
    }
    .appointment-shell .procedure-add-btn {
        width: auto;
        min-height: 30px;
        padding: 4px 10px;
        font-size: 0.82rem;
        line-height: 1.2;
        white-space: nowrap;
    }

    .appointment-shell .procedure-add-btn .fa {
        font-size: 0.9em;
    }
    .appointment-shell.appointment-dashboard-page {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .appointment-shell.appointment-dashboard-page ~ .flex-grow-1 {
        display: none !important;
    }

    .appointment-shell.appointment-dashboard-page .appointment-compact-card {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
        margin-bottom: 0 !important;
    }

    .appointment-shell.appointment-dashboard-page .default-table-area {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .appointment-shell.appointment-dashboard-page .default-table-area .table-responsive {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
    }

    .appointment-shell .theme-modal .card {
        border: 1px solid var(--app-border);
        box-shadow: 0 6px 18px rgba(31, 49, 80, 0.06);
    }

    .appointment-shell .theme-modal .quickMedicineTab .table thead th,
    .appointment-shell .theme-modal .quickMedicineTab .table thead td {
        background: var(--app-surface-alt);
    }

    .appointment-shell .theme-modal .quickMedicineTab .table td,
    .appointment-shell .theme-modal .quickMedicineTab .table th {
        border-color: var(--app-border);
    }

    .appointment-shell .quick-med-modal .modal-dialog,
    .appointment-shell .quick-test-modal .modal-dialog {
        max-width: 1200px;
    }

    .appointment-shell .quick-test-modal .quickTestTab .cnm-table {
        border-radius: 10px;
        background: var(--app-surface);
    }

    .appointment-shell .quick-test-modal .testTab {
        gap: 12px;
    }

    .appointment-shell .quick-test-modal .testTab .nav-tabs {
        flex-wrap: wrap;
    }

    .appointment-shell .quick-test-modal .tab-toolbar {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .appointment-shell .quick-test-modal #testsTable {
        min-height: 260px;
    }

    .appointment-shell .quick-test-modal #testsTable .table-placeholder td {
        padding: 14px 10px;
        font-weight: 600;
        color: var(--app-muted);
    }

    .appointment-shell .quick-test-modal #testsTable td,
    .appointment-shell .quick-test-modal #testsTable th {
        vertical-align: middle;
    }

    .appointment-shell .quick-test-modal .testTab .nav-tabs .nav-link {
        border-radius: 8px 8px 0 0;
        padding: 6px 14px;
        font-weight: 700;
    }

    .appointment-shell .quick-med-modal .modal-body,
    .appointment-shell .quick-test-modal .modal-body {
        padding: 14px;
    }

    .appointment-shell .quick-med-modal .card-body,
    .appointment-shell .quick-test-modal .card-body {
        padding: 12px;
    }

    .appointment-shell .quick-med-modal .form-control,
    .appointment-shell .quick-test-modal .form-control {
        height: 32px;
    }

    .appointment-shell .quick-med-modal .form-group label,
    .appointment-shell .quick-test-modal .form-group label {
        font-size: 0.88rem;
        font-weight: 700;
    }

    .appointment-shell .quick-med-modal .col-form-label.fs-3 {
        font-size: 1rem !important;
    }

    .appointment-shell .quick-med-modal .btn,
    .appointment-shell .quick-test-modal .btn {
        min-height: 32px;
    }

    .appointment-shell .quick-med-modal .card,
    .appointment-shell .quick-test-modal .card {
        border-radius: 10px;
    }

    .appointment-shell .quick-med-modal .card {
        overflow: visible;
    }

    .appointment-shell .quick-med-modal .table thead th,
    .appointment-shell .quick-test-modal .table thead th {
        font-size: 0.82rem;
        padding: 8px;
        vertical-align: middle;
    }

    .appointment-shell .quick-med-modal .table tbody td,
    .appointment-shell .quick-test-modal .table tbody td {
        padding: 7px;
        vertical-align: middle;
    }

    .appointment-shell .quick-med-modal .select2-container,
    .appointment-shell .quick-test-modal .select2-container {
        width: 100% !important;
    }

    .appointment-shell .quick-med-modal #quickMedTable thead th {
        padding: 6px 8px;
        font-size: 0.8rem;
        line-height: 1.15;
    }

    .appointment-shell .quick-med-modal #quickMedTable tbody td {
        padding: 6px 8px;
    }

    .appointment-shell .quick-med-modal #quickMedTable .form-control,
    .appointment-shell .quick-med-modal #quickMedTable .form-select {
        height: 32px;
        padding: 6px 8px;
    }

    .appointment-shell .quick-med-modal #quickMedTable .form-group {
        margin-bottom: 4px;
    }

    .appointment-shell .quick-med-modal #quickMedTable .form-group .form-check-input {
        margin-top: 0;
    }

    .appointment-shell .quick-med-modal .quick-med-layout {
        gap: 12px;
        align-items: flex-start;
    }

    .appointment-shell .quick-med-modal .quick-med-entry-table {
        border: 1px solid var(--app-border);
        border-radius: 10px;
        overflow: hidden;
    }

    .appointment-shell .quick-med-modal .quick-med-entry-table thead th {
        background: var(--app-surface-alt);
    }

    .appointment-shell .quick-med-modal #quickMedicineTable {
        table-layout: auto;
    }

    .appointment-shell .quick-med-modal #quickMedicineTable th {
        white-space: normal;
        text-align: center;
        vertical-align: middle;
        padding: 8px 10px;
    }

    .appointment-shell .quick-med-modal #quickMedicineTable td {
        white-space: nowrap;
        text-align: center;
        vertical-align: middle;
        padding: 8px 10px;
    }

    .appointment-shell .quick-med-modal #quickMedicineTable th:nth-child(1),
    .appointment-shell .quick-med-modal #quickMedicineTable td:nth-child(1) {
        text-align: left;
        min-width: 180px;
    }

    .appointment-shell .quick-med-modal #quickMedicineTable th:nth-child(6),
    .appointment-shell .quick-med-modal #quickMedicineTable td:nth-child(6) {
        text-align: left;
        min-width: 120px;
    }

    .appointment-shell .quick-med-modal #quickMedicineTable th:nth-child(2),
    .appointment-shell .quick-med-modal #quickMedicineTable td:nth-child(2),
    .appointment-shell .quick-med-modal #quickMedicineTable th:nth-child(3),
    .appointment-shell .quick-med-modal #quickMedicineTable td:nth-child(3),
    .appointment-shell .quick-med-modal #quickMedicineTable th:nth-child(4),
    .appointment-shell .quick-med-modal #quickMedicineTable td:nth-child(4) {
        min-width: 80px;
    }

    .appointment-shell .quick-med-modal #quickMedicineTable th:nth-child(5),
    .appointment-shell .quick-med-modal #quickMedicineTable td:nth-child(5) {
        min-width: 130px;
    }

    .appointment-shell .quick-med-modal #quickMedicineTable .dosage-head {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 4px;
        flex-direction: column;
    }

    .appointment-shell .quick-med-modal .quickMedicineTab .card-body {
        padding: 12px 12px 10px;
    }

    .appointment-shell .quick-med-modal .quickMedicineTab .nav-tabs {
        border: 0;
        gap: 6px;
        flex-wrap: wrap;
        margin-bottom: 6px;
    }

    .appointment-shell .quick-med-modal .quickMedicineTab .nav-tabs .nav-link {
        border: 1px solid var(--app-border);
        border-radius: 8px;
        background: var(--app-surface-alt);
        color: var(--app-text);
        padding: 6px 10px;
        font-weight: 700;
        min-height: 32px;
    }

    .appointment-shell .quick-med-modal .quickMedicineTab .nav-tabs .nav-link.active {
        background: var(--bs-primary);
        color: #fff;
        border-color: var(--bs-primary);
    }

    .appointment-shell .quick-med-modal .quickMedicineTab .nav-tabs .nav-link:hover {
        background: var(--app-surface);
    }

    .appointment-shell .quick-med-modal .quickMedicineTab #quickMedicineTable thead th {
        padding: 8px 10px;
        font-size: 0.82rem;
        letter-spacing: 0.01em;
        background: var(--app-surface-alt);
    }

    .appointment-shell .quick-med-modal .quickMedicineTable-actions {
        gap: 6px;
    }

    /* Top bar alignment & sizing */
    .appointment-shell #top-title-bar .card-body {
        padding: 6px 10px;
    }

    .appointment-shell #top-title-bar h3 {
        font-size: 0.96rem;
        color: var(--app-text);
        line-height: 1.25;
        margin: 0;
    }

    .appointment-shell .top-actions {
        gap: 6px;
        flex-wrap: nowrap;
    }

    .appointment-shell .top-actions .btn {
        height: 30px !important;
        min-width: 118px;
        padding: 3px 8px !important;
        font-size: 0.78rem;
        font-weight: 600;
        border-radius: 6px;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .appointment-shell .top-actions .svg-icon {
        display: inline-flex;
        align-items: center;
    }

    .appointment-shell .top-actions .svg-icon svg {
        width: 14px;
        height: 14px;
    }

    .appointment-shell .panel {
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        border-radius: 8px;
        overflow: hidden;
    }

    .appointment-shell .panel-heading {
        padding: 10px 12px;
        border-bottom: 1px solid var(--app-border);
        background: var(--panel-heading-bg) !important;
        background-image: none !important;
        color: var(--panel-heading-text) !important;
        box-shadow: none;
    }

    .appointment-shell .panel-heading .panel-title,
    .appointment-shell .panel-heading .panel-title a {
        color: var(--panel-heading-text) !important;
        font-weight: 700;
        opacity: 1;
    }

    .appointment-shell .panel-heading .panel-title a:hover {
        color: var(--bs-primary);
    }

    .appointment-shell .panel {
        border-radius: 12px;
        border-color: var(--app-border);
        box-shadow: 0 12px 30px rgba(31, 49, 80, 0.06);
    }

    .appointment-shell .panel-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        background: linear-gradient(120deg, var(--app-surface-alt), var(--app-surface));
    }

    .appointment-shell .panel-heading .panel-title {
        letter-spacing: 0.01em;
    }

    .appointment-shell .panel-heading .button-group .btn {
        min-height: 32px;
        padding: 6px 12px;
        font-weight: 700;
        font-size: 0.82rem;
    }
    .appointment-shell .panel.panel-default > .panel-heading {
        background: linear-gradient(120deg, var(--app-surface-alt), var(--app-surface)) !important;
        color: var(--panel-heading-text) !important;
        border-color: var(--app-border);
    }

    .appointment-shell .panel.panel-default > .panel-heading a {
        color: var(--panel-heading-text) !important;
    }

    .appointment-shell .panel-body {
        padding: 9px;
        background: var(--app-surface);
        color: var(--app-text);
    }

    .appointment-shell .panel-collapse.collapse {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
    }

    .appointment-shell .table thead th {
        background: var(--app-surface-alt);
        color: var(--panel-heading-text);
        position: sticky;
        top: 0;
        z-index: 5;
        border-color: var(--app-border);
        font-weight: 700;
    }

    .appointment-shell .table tbody td {
        vertical-align: middle;
        color: var(--app-text);
        border-color: var(--app-border);
    }

    .appointment-shell .table {
        font-size: 0.8rem;
    }
    .appointment-shell .appointment-table-wrapper {
        max-height: 420px;
        overflow: auto;
    }

    .appointment-shell .table-appointment {
        --appointment-head-row-height: 48px;
        table-layout: auto;
        min-width: 1500px;
    }

    .appointment-shell .table-appointment thead th {
        position: sticky;
        background: var(--app-surface);
        z-index: 5;
        top: 0;
        border-color: var(--app-border);
        white-space: nowrap;
        vertical-align: middle;
        line-height: 1.15;
    }

    .appointment-shell .table-appointment thead tr:first-child th {
        top: 0;
        z-index: 6;
        height: var(--appointment-head-row-height);
        padding: 10px 8px;
        background: var(--app-surface);
    }

    .appointment-shell .table-appointment thead tr:nth-child(2) th {
        top: var(--appointment-head-row-height);
        z-index: 7;
        background: var(--app-surface);
        padding: 10px 8px;
        line-height: 1.15;
    }

    .appointment-shell .table-appointment tbody td {
        background: var(--app-surface);
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        line-height: 1.2;
    }

    .appointment-shell .panel-body table,
    .appointment-shell .panel-body table thead,
    .appointment-shell .panel-body table tbody,
    .appointment-shell .panel-body table tr,
    .appointment-shell .panel-body table th,
    .appointment-shell .panel-body table td {
        background: transparent !important;
    }

    .appointment-shell .table-striped > tbody > tr:nth-of-type(odd) {
        background-color: var(--app-surface-alt) !important;
    }

    .appointment-shell .table-striped > tbody > tr:nth-of-type(even) {
        background-color: var(--app-surface) !important;
    }

    .appointment-shell label,
    .appointment-shell .form-label,
    .appointment-shell .col-form-label {
        font-size: 0.76rem;
        font-weight: 600;
        color: var(--app-label);
        line-height: 1.2;
    }

    .appointment-shell .form-control,
    .appointment-shell .form-select {
        height: 30px;
        font-size: 0.78rem;
        border-radius: 7px;
        background: var(--app-input-bg);
        color: var(--app-text) !important;
        border: 1px solid var(--app-input-border);
    }
    .appointment-shell .form-control,
    .appointment-shell .form-select,
    .appointment-shell select,
    .appointment-shell textarea {
        color: var(--app-text) !important;
        background: var(--app-input-bg);
        border: 1px solid var(--app-input-border);
    }
    .appointment-shell .nurse-assessment .col-form-label {
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        padding: 2px 0 1px !important;
        line-height: 1.1 !important;
    }

    .appointment-shell .nurse-assessment .form-control {
        height: 30px !important;
        font-size: 0.82rem !important;
        padding: 5px 8px !important;
        border-radius: 6px !important;
    }

    .appointment-shell .nurse-assessment .position-absolute {
        padding: 5px 6px !important;
        font-size: 0.78rem !important;
        line-height: 1 !important;
    }

    .appointment-shell .nurse-assessment .form-group {
        margin-bottom: 6px;
    }
    .appointment-shell .clinical-history label,
    .appointment-shell .clinical-history .col-form-label,
    .appointment-shell .clinical-history .opd_clinical_history label {
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        line-height: 1.1 !important;
    }

    .appointment-shell .clinical-history input,
    .appointment-shell .clinical-history select,
    .appointment-shell .clinical-history textarea,
    .appointment-shell .clinical-history .opd_clinical_history input,
    .appointment-shell .clinical-history .opd_clinical_history select,
    .appointment-shell .clinical-history .opd_clinical_history textarea {
        height: 30px !important;
        font-size: 0.82rem !important;
        padding: 5px 8px !important;
        border-radius: 6px !important;
        border: 1px solid var(--app-border-strong) !important;
        background: var(--app-surface) !important;
        box-shadow: none !important;
    }

    .appointment-shell .clinical-history h4 {
        font-size: 0.95rem !important;
        font-weight: 700 !important;
    }

    .appointment-shell .clinical-history p {
        font-size: 0.78rem !important;
        margin-bottom: 6px;
    }

    .appointment-shell .clinical-history table td,
    .appointment-shell .clinical-history .opd_clinical_history table td {
        padding: 3px 6px !important;
        vertical-align: middle;
        white-space: nowrap;
    }

    .appointment-shell .clinical-history .yes-no-group,
    .appointment-shell .clinical-history .yes-no-inline,
    .appointment-shell .clinical-history .opd_clinical_history .yes-no-inline {
        display: inline-flex;
        align-items: center;
        gap: 2px;
        margin-left: 2px;
    }

    .appointment-shell .clinical-history input[type="checkbox"],
    .appointment-shell .clinical-history .opd_clinical_history input[type="checkbox"] {
        width: 14px;
        height: 14px;
        margin-right: 2px;
        vertical-align: middle;
        transform: translateY(-1px);
        border: 1px solid var(--app-border-strong);
        accent-color: var(--app-text);
    }
    .appointment-shell .diagnosis-icd10 .col-form-label,
    .appointment-shell .diagnosis-icd10 label {
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        line-height: 1.1 !important;
    }

    .appointment-shell .diagnosis-icd10 input,
    .appointment-shell .diagnosis-icd10 select,
    .appointment-shell .diagnosis-icd10 textarea {
        height: 30px !important;
        font-size: 0.82rem !important;
        padding: 5px 8px !important;
        border-radius: 6px !important;
        border: 1px solid var(--app-border-strong) !important;
        background: var(--app-surface) !important;
        box-shadow: none !important;
    }

    .appointment-shell .diagnosis-icd10 .form-group {
        margin-bottom: 8px;
    }

    .appointment-shell .diagnosis-icd10 table td,
    .appointment-shell .diagnosis-icd10 table th {
        padding: 5px 7px !important;
        font-size: 0.82rem;
    }
    .appointment-shell .medicine-section .col-form-label,
    .appointment-shell .medicine-section label {
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        line-height: 1.1 !important;
    }

    .appointment-shell .medicine-section input,
    .appointment-shell .medicine-section select,
    .appointment-shell .medicine-section textarea {
        height: 30px !important;
        font-size: 0.82rem !important;
        padding: 5px 8px !important;
        border-radius: 6px !important;
        border: 1px solid var(--app-border-strong) !important;
        background: var(--app-surface) !important;
        box-shadow: none !important;
    }

    .appointment-shell .medicine-section .form-group {
        margin-bottom: 8px;
    }

    .appointment-shell .medicine-section table td,
    .appointment-shell .medicine-section table th {
        padding: 4px 6px !important;
        font-size: 0.8rem;
        vertical-align: middle;
        white-space: nowrap;
    }

    .appointment-shell .medicine-section .table {
        table-layout: auto;
    }

    .appointment-shell .medicine-section .table thead th {
        font-weight: 700;
        line-height: 1.15;
        text-align: center;
    }
    .appointment-shell .investigations-section .col-form-label,
    .appointment-shell .investigations-section label {
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        line-height: 1.1 !important;
    }

    .appointment-shell .investigations-section input,
    .appointment-shell .investigations-section select,
    .appointment-shell .investigations-section textarea {
        height: 30px !important;
        font-size: 0.82rem !important;
        padding: 5px 8px !important;
        border-radius: 6px !important;
        border: 1px solid var(--app-border-strong) !important;
        background: var(--app-surface) !important;
        box-shadow: none !important;
    }

    .appointment-shell .investigations-section .form-group {
        margin-bottom: 8px;
    }

    .appointment-shell .investigations-section table td,
    .appointment-shell .investigations-section table th {
        padding: 5px 7px !important;
        font-size: 0.82rem;
        vertical-align: middle;
        white-space: nowrap;
        color: var(--app-text);
        border: 1px solid var(--app-border);
    }

    .appointment-shell .investigations-section .table {
        table-layout: auto;
        min-width: 1200px;
    }

    .appointment-shell .investigations-section .table-responsive {
        overflow-x: auto;
    }

    .appointment-shell .investigations-section .table thead th {
        background: var(--app-surface-alt);
        color: var(--app-text);
    }

    .appointment-shell .investigations-section .table tbody td {
        color: var(--app-text);
    }

    .appointment-shell .investigations-section td:last-child {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-width: 100px;
    }

    .appointment-shell .investigations-section .status-pill {
        display: inline-block;
        padding: 3px 8px;
        border-radius: 10px;
        font-weight: 700;
        font-size: 0.78rem;
        color: #fff;
        background: var(--bs-warning, #f6ad55);
    }

    .appointment-shell .investigations-section .action-delete {
        color: #dc3545 !important;
        font-size: 18px;
    }

    .appointment-shell .investigations-section .btn_delete {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 36px;
        min-height: 32px;
        background: #fff;
        border: 1px solid #dc3545;
        border-radius: 6px;
        padding: 0;
        gap: 2px;
        color: #dc3545 !important;
    }

    .appointment-shell .investigations-section .btn_delete .text-danger {
        font-size: 12px;
    }

    .appointment-shell .investigations-section .delete-icon {
        flex-shrink: 0;
    }

    .appointment-shell .investigations-section .btn_delete svg.delete-fallback {
        display: block;
        color: #dc3545;
    }

    .appointment-shell .investigations-section td:last-child {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-width: 100px;
    }

    /* Lab Reports / Bill */
    .appointment-shell .labreports-section .col-form-label,
    .appointment-shell .labreports-section label {
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        line-height: 1.1 !important;
    }

    .appointment-shell .labreports-section input,
    .appointment-shell .labreports-section select,
    .appointment-shell .labreports-section textarea {
        height: 30px !important;
        font-size: 0.82rem !important;
        padding: 5px 8px !important;
        border-radius: 6px !important;
        border: 1px solid var(--app-border-strong) !important;
        background: var(--app-surface) !important;
        box-shadow: none !important;
        color: var(--app-text);
    }

    
    .appointment-shell .labreports-section #labReportsDataTable {
        table-layout: auto;
        min-width: 1200px;
        border: 1px solid var(--app-border);
    }

	    .appointment-shell .labreports-section #labReportsDataTable thead th {
	        background: var(--app-surface-alt);
	        color: var(--app-text);
	        font-weight: 700;
	        text-align: center;
	        border: 1px solid var(--app-border);
	        white-space: nowrap;
	        height: 34px;
	        padding: 6px 8px !important;
	        font-size: 0.78rem;
	        vertical-align: middle;
	    }

	    .appointment-shell .labreports-section #labReportsDataTable tbody td {
	        color: var(--app-text) !important;
	        border: 1px solid var(--app-border);
	        vertical-align: top;
	        white-space: nowrap;
	        font-size: 0.78rem;
	        background: var(--app-surface);
	        padding: 4px 6px !important;
	        line-height: 1.2;
	    }

	    .appointment-shell .labreports-section #labReportsDataTable tbody tr:nth-child(odd) td {
	        background: var(--app-surface-alt);
	    }

    .appointment-shell .labreports-section .dataTables_wrapper .dataTables_scrollBody,
    .appointment-shell .labreports-section .dataTables_wrapper {
        background: #fff;
    }

    .appointment-shell .labreports-section #labReportsDataTable {
        border-collapse: collapse;
        width: 100%;
    }

    .appointment-shell .labreports-section .table-responsive {
        overflow-x: auto;
    }

	    .appointment-shell .labreports-section .default-table-area {
	        padding: 8px 10px;
	        background: #fff;
	        border-radius: 12px;
	        box-shadow: 0 10px 22px rgba(31, 49, 80, 0.06);
	        border: 1px solid var(--app-border);
	    }

	    body[data-theme=dark] .appointment-shell .labreports-section .default-table-area {
	        background: var(--app-surface);
	    }

    .appointment-shell .labreports-section #labReportsDataTable th,
    .appointment-shell .labreports-section #labReportsDataTable td {
        padding: 4px 6px !important;
        vertical-align: top;
    }

	    .appointment-shell .labreports-section #labReportsDataTable th {
	        background: var(--app-surface-alt);
	        color: var(--app-text);
	        font-weight: 700;
	        border: 1px solid var(--app-border);
	        text-align: center;
	        height: 34px;
	    }

	    .appointment-shell .labreports-section #labReportsDataTable_wrapper .dt-buttons {
	        display: none !important;
	    }

	    .appointment-shell .labreports-section #labReportsDataTable_filter label {
	        font-weight: 700;
	        color: var(--app-label);
	        display: inline-flex;
	        align-items: center;
	        gap: 10px;
	    }

	    .appointment-shell .labreports-section #labReportsDataTable_filter input {
	        min-width: 280px;
	        height: 34px !important;
	        padding: 7px 12px !important;
	        border-radius: 10px !important;
	    }

    
    .appointment-shell .labreports-section #labReportsDataTable tbody td table {
        margin-bottom: 0 !important;
    }

	    .appointment-shell .labreports-section #labReportsDataTable tbody td table th,
	    .appointment-shell .labreports-section #labReportsDataTable tbody td table td {
	        padding: 3px 6px !important;
	        font-size: 0.76rem !important;
	        line-height: 1.15 !important;
	        vertical-align: top !important;
	        white-space: nowrap;
	        border-color: var(--app-border) !important;
	    }

    .appointment-shell .labreports-section .dataTables_scrollHeadInner table {
        width: 100% !important;
    }

    
    .appointment-shell .labreports-section #labReportsDataTable td.actionak {
        min-width: 140px;
        text-align: center;
        vertical-align: middle;
        white-space: normal;
    }

    .appointment-shell .labreports-section #labReportsDataTable td.actionak .text-body {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .appointment-shell .labreports-section #labReportsDataTable td.actionak .text-body > a,
    .appointment-shell .labreports-section #labReportsDataTable td.actionak .text-body > button {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        border: 1px solid var(--app-border) !important;
        background: var(--app-surface) !important;
        color: var(--app-text) !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
        margin: 0 !important;
    }

    .appointment-shell .labreports-section #labReportsDataTable td.actionak .text-body i {
        font-size: 16px !important;
        line-height: 1;
    }

    .appointment-shell .labreports-section .status-pill {
        display: inline-block;
        padding: 4px 10px;
        border-radius: 12px;
        background: var(--bs-warning, #f6ad55);
        color: #fff;
        font-weight: 700;
        font-size: 11px;
        line-height: 1;
        text-transform: capitalize;
    }

    .appointment-shell .labreports-section .action-delete {
        color: #dc3545;
    }

    .appointment-shell .labreports-section .btn_delete {
        border: 1px solid var(--app-border);
        background: var(--app-surface);
    }

    .appointment-shell .icd10-details-section .default-table-area {
        padding: 8px 10px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 10px 22px rgba(31, 49, 80, 0.06);
        border: 1px solid var(--app-border);
    }

    body[data-theme=dark] .appointment-shell .icd10-details-section .default-table-area {
        background: var(--app-surface);
    }

    .appointment-shell .icd10-details-section #currentIcd10ListDataTable {
        table-layout: auto;
        min-width: 1200px;
        border: 1px solid var(--app-border);
        border-collapse: collapse;
        width: 100%;
    }

    .appointment-shell .icd10-details-section .dataTables_scrollHeadInner table,
    .appointment-shell .icd10-details-section .dataTables_scrollBody table {
        min-width: 1200px !important;
    }

    .appointment-shell .icd10-details-section #currentIcd10ListDataTable thead th {
        background: var(--app-surface-alt);
        color: var(--app-text);
        font-weight: 700;
        text-align: center;
        border: 1px solid var(--app-border);
        white-space: nowrap;
        height: 34px;
        padding: 6px 8px !important;
        font-size: 0.78rem;
        vertical-align: middle;
    }

    .appointment-shell .icd10-details-section #currentIcd10ListDataTable tbody td {
        color: var(--app-text) !important;
        border: 1px solid var(--app-border);
        vertical-align: top;
        white-space: nowrap;
        font-size: 0.78rem;
        background: var(--app-surface);
        padding: 4px 6px !important;
        line-height: 1.2;
    }

    .appointment-shell .icd10-details-section #currentIcd10ListDataTable tbody tr:nth-child(odd) td {
        background: var(--app-surface-alt);
    }

    .appointment-shell .icd10-details-section .dataTables_wrapper .dt-buttons {
        display: none !important;
    }

    .appointment-shell .icd10-details-section #currentIcd10ListDataTable_filter label {
        font-weight: 700;
        color: var(--app-label);
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    .appointment-shell .icd10-details-section #currentIcd10ListDataTable_filter input {
        min-width: 280px;
        height: 34px !important;
        padding: 7px 12px !important;
        border-radius: 10px !important;
        border: 1px solid var(--app-border-strong);
        background: var(--app-input-bg);
        color: var(--app-text);
        box-shadow: 0 6px 18px rgba(31, 49, 80, 0.05);
        font-weight: 600;
        letter-spacing: 0.01em;
    }

    .appointment-shell .icd10-details-section .dataTables_scrollHeadInner table {
        width: 100% !important;
    }

    #viewdocument .modal-content {
        border-radius: 14px;
        overflow: hidden;
        border: 1px solid var(--app-border, #e7e9f5);
        background: var(--app-surface, #ffffff);
        box-shadow: var(--bs-box-shadow-lg, 0 18px 40px rgba(15, 23, 42, 0.18));
    }

    #viewdocument .modal-header {
        padding: 10px 14px;
        background: var(--app-surface, #ffffff) !important;
        border-bottom: 1px solid var(--app-border, #e7e9f5) !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    #viewdocument .modal-title {
        font-size: 14px;
        font-weight: 800;
        color: var(--app-text, #1f3150);
        margin: 0;
    }

    #viewdocument #closeView.close {
        float: none;
        opacity: 1;
        width: 44px;
        height: 44px;
        border-radius: 999px;
        background: var(--app-surface, #ffffff);
        border: 1px solid var(--app-border, #e7e9f5);
        box-shadow: var(--bs-box-shadow-sm, 0 4px 14px rgba(15, 23, 42, 0.06));
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        line-height: 1;
        font-size: 28px;
        color: var(--app-text, #1f3150);
        text-shadow: none;
        outline: none;
    }

    #viewdocument #closeView.close:hover {
        filter: brightness(0.98);
    }

    #viewdocument .modal-body {
        background: var(--app-surface, #ffffff);
    }

    #viewdocument .modal-body .border-secondary {
        border-color: var(--app-border, #e7e9f5) !important;
    }

    [data-theme="dark"] #viewdocument .modal-body,
    [data-theme=dark] #viewdocument .modal-body {
        background: var(--app-surface, #1b232d);
    }

    .appointment-shell .medicine-section input[type="checkbox"],
    .appointment-shell .medicine-section .sos-checkbox {
        width: 22px;
        height: 22px;
        margin-right: 4px;
        vertical-align: middle;
        border: 1px solid var(--app-border-strong);
        accent-color: var(--app-text);
        background: var(--app-surface);
    }

    .appointment-shell .form-control::placeholder,
    .appointment-shell .form-select::placeholder {
        color: var(--app-input-placeholder) !important;
        font-weight: 600;
        letter-spacing: 0.01em;
    }

    .appointment-shell select option {
        color: var(--app-text);
        background: var(--app-surface);
    }
    .appointment-shell .btn {
        height: 30px;
        min-height: 30px;
        padding: 5px 10px;
        font-size: 0.78rem;
        border-radius: 7px;
        line-height: 1.2;
    }

    .appointment-shell .btn.btn-sm,
    .appointment-shell .btn.btn-xs {
        height: 28px;
        min-height: 28px;
        padding: 4px 9px;
        font-size: 0.76rem;
        border-radius: 7px;
    }

    .appointment-shell h3 {
        font-size: 0.9rem;
        margin: 0;
    }

    .appointment-shell h4,
    .appointment-shell h5 {
        font-size: 0.84rem;
        margin: 0;
    }

    .appointment-shell .panel-title {
        margin: 0;
        font-weight: 600;
        color: var(--app-text);
    }

    .appointment-shell .table td,
    .appointment-shell .table th {
        padding: 5px 7px;
    }

    .section-scroll-btns {
        position: absolute;
        right: 8px;
        bottom: 12px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        z-index: 5;
    }

    .section-scroll-btns .btn {
        padding: 4px 6px;
        line-height: 1;
        border-radius: 6px;
        font-size: 0.78rem;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }

    .appointment-shell .position-absolute.h-30px {
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%);
        padding: 0 !important;
        width: auto !important;
        height: auto !important;
        font-size: 0.75rem !important;
        color: var(--app-muted);
    }

    .appointment-shell .form-control {
        padding-right: 40px;
    }

    .comment-ellipsis {
        max-width: 280px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .comment-required {
        background: #dc3545 !important;
        color: #fff !important;
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: 600;
    }

    .custom-tooltip {
        position: absolute;
        background: #1f2937;
        color: #fff;
        padding: 8px 10px;
        border-radius: 6px;
        font-size: 12px;
        z-index: 1000;
        min-width: 150px;
        max-width: 250px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
        display: none;
        pointer-events: none;
    }

    .panel-btn {
        height: 30px;
        margin-left: 6px;
        cursor: pointer;
        font-size: 0.78rem;
        padding: 4px 9px;
    }

    .select2-search--dropdown {
        width: 100% !important;
    }

    tr.clicked {
        background-color: rgba(15, 121, 243, 0.08) !important;
    }

    .current_medication_th th {
        background-color: var(--app-surface-alt);
    }

    .child-th-color {
        background-color: var(--app-surface-alt) !important;
    }

    .current_medication_data td {
        border: 1px solid var(--app-border) !important;
    }

    .h-10px { height: 10px !important; }
    .h-15px { height: 15px !important; }
    .h-20px { height: 20px !important; }
    .h-25px { height: 25px !important; }
    .h-30px { height: 30px !important; }
    .h-35px { height: 35px !important; }
    .h-50px { height: 50px !important; }
    .h-150px { height: 150px !important; }

    .w-10px { width: 10px !important; }
    .w-15px { width: 15px !important; }
    .w-20px { width: 20px !important; }
    .w-25px { width: 25px !important; }
    .w-30px { width: 30px !important; }
    .w-40px { width: 40px !important; }
    .w-50px { width: 50px !important; }
    .w-55px { width: 55px !important; }
    .w-70px { width: 70px !important; }
    .w-100px { width: 100px !important; }
    .w-110px { width: 110px !important; }

    .auto-h-50 {
        height: 35vh !important;
        overflow-y: auto;
    }

    table.custom-table {
        width: 100%;
    }

    table.custom-table td,
    table.custom-table th {
        padding: 4px 6px !important;
        border-bottom: none;
    }

    .appointment-shell #test_table tr#newTest1 > th:first-child,
    .appointment-shell #test_table tr > td:first-child:not([colspan]) {
        width: 55px !important;
        min-width: 55px !important;
        max-width: 55px !important;
        white-space: nowrap;
    }

    .appointment-shell #investigations .select2-container {
        width: 100% !important;
    }

    .appointment-shell #investigations .select2-container--open {
        z-index: 99999 !important;
    }

    .appointment-shell #investigations .select2-dropdown {
        z-index: 99999 !important;
    }

    .appointment-shell #investigations .select2-container--default .select2-selection--single {
        min-height: 38px;
        border-radius: 8px;
        border: 1px solid var(--app-border-strong);
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
    }

    .appointment-shell #investigations .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 36px;
        padding-left: 10px;
        padding-right: 26px;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--app-text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .appointment-shell #investigations .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 36px;
    }

    .appointment-shell .table-hover > tbody > tr:hover {
        background-color: var(--app-surface-alt) !important;
    }

    .appointment-shell .datatable-search-label {
        font-weight: 700;
        color: var(--app-label);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .appointment-shell .datatable-search-input {
        min-width: 230px;
        height: 34px;
        padding: 7px 12px;
        border-radius: 10px;
        border: 1px solid var(--app-border-strong);
        background: var(--app-input-bg);
        color: var(--app-text);
        box-shadow: 0 6px 18px rgba(31, 49, 80, 0.05);
        font-weight: 600;
        letter-spacing: 0.01em;
    }

    .appointment-shell .datatable-search-input:focus {
        border-color: var(--bs-primary);
        outline: none;
        box-shadow: 0 0 0 3px rgba(15, 121, 243, 0.15);
    }

    .appointment-shell .dataTables_wrapper .dataTables_filter {
        margin-bottom: 8px;
    }

    .appointment-shell .dataTables_wrapper .dataTables_length select {
        height: 32px;
        border-radius: 8px;
        border: 1px solid var(--app-border-strong);
        background: var(--app-input-bg);
        color: var(--app-text);
        padding: 4px 10px;
        box-shadow: 0 4px 12px rgba(31, 49, 80, 0.04);
    }

    .appointment-shell #consultationcharges .row > div {
        margin-bottom: 10px;
    }

    .appointment-shell #consultationcharges .form-control,
    .appointment-shell #consultationcharges .form-select {
        height: 34px;
        padding: 7px 10px;
        border-radius: 9px;
        font-size: 0.82rem;
        font-weight: 600;
        border: 1px solid var(--app-border-strong);
        background: var(--app-input-bg);
        box-shadow: 0 10px 22px rgba(31, 49, 80, 0.06);
        transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .appointment-shell #consultationcharges .form-group.border {
        border-color: var(--app-border) !important;
        box-shadow: 0 10px 20px rgba(31, 49, 80, 0.06);
    }

    .appointment-shell #consultationcharges .form-control:focus,
    .appointment-shell #consultationcharges .form-select:focus {
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 3px rgba(15, 121, 243, 0.16);
    }

    .appointment-shell #consultationcharges .button-group .btn {
        min-width: 94px;
        border-radius: 10px;
        box-shadow: 0 10px 22px rgba(31, 49, 80, 0.08);
    }

    .appointment-shell #consultationcharges #addProcedure {
        width: 100%;
        height: 34px;
        border-radius: 8px;
        font-weight: 700;
        box-shadow: 0 8px 14px rgba(31, 49, 80, 0.06);
        padding: 4px 8px;
        font-size: 0.78rem;
    }

    .appointment-shell #consultationcharges table.custom-table {
        border: 1px solid var(--app-border);
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 14px 26px rgba(31, 49, 80, 0.05);
    }

    .appointment-shell #consultationcharges table.custom-table thead th {
        background: linear-gradient(135deg, var(--app-surface-alt), var(--app-surface));
        border-color: var(--app-border);
        border-bottom: 1px solid var(--app-border);
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--app-text);
        padding: 6px 8px !important;
    }

    .appointment-shell #consultationcharges table.custom-table tbody td {
        font-size: 0.78rem;
        padding: 6px 8px !important;
        color: var(--app-text);
        border-color: var(--app-border);
        border-bottom: 1px solid var(--app-border);
    }

    .appointment-shell #consultationcharges table.custom-table tbody tr:nth-child(odd) td {
        background: var(--app-surface-alt);
    }

    /* Advice tab sizing */
    .appointment-shell #advice .panel-body {
        padding: 12px 10px;
    }

    .appointment-shell #advice .panel-body .p-5 {
        padding: 12px !important;
    }

    .appointment-shell #advice textarea.form-control {
        font-size: 0.82rem;
        padding: 8px 10px;
        border-radius: 9px;
        min-height: 70px;
    }

    .appointment-shell #advice #initial_complaint {
        min-height: 120px;
    }

    .appointment-shell #advice .card.card-bordered {
        border-radius: 10px;
        box-shadow: 0 8px 18px rgba(31, 49, 80, 0.05);
        border-color: var(--app-border);
    }

    .appointment-shell #advice .card.card-bordered .card-body {
        padding: 10px !important;
    }

    .appointment-shell #advice .form-check-input {
        width: 16px;
        height: 16px;
        border-radius: 4px;
    }

    .appointment-shell #advice .form-check-label {
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--app-text);
    }

    .appointment-shell #advice .form-group {
        margin-bottom: 6px;
    }

    .appointment-shell #advice .advice-placeholder::placeholder,
    .appointment-shell #advice textarea::placeholder {
        font-weight: 700;
        letter-spacing: 0.01em;
    }

    .appointment-shell #advice .carry-forward-note {
        font-size: 0.85rem;
        font-weight: 700;
        color: #4377ff;
        margin: 0;
    }

    /* Follow up tab sizing */
    .appointment-shell #follow_up .panel-body {
        padding: 12px 10px;
    }

    .appointment-shell #follow_up #follow_Form {
        margin: 10px 0 16px !important;
    }

    .appointment-shell #follow_up label {
        font-size: 0.82rem !important;
        font-weight: 700;
        margin-bottom: 0;
        line-height: 1.3;
    }

    .appointment-shell #follow_up .followup-days-label {
        margin-right: 14px;
        white-space: nowrap;
    }

    .appointment-shell #follow_up .followup-days-input {
        width: 92px !important;
        height: 30px !important;
        padding: 5px 8px !important;
        font-size: 0.8rem !important;
        font-weight: 700;
        text-align: center;
        border-radius: 8px;
    }

    .appointment-shell #follow_up .followup-date-pill {
        font-size: 0.82rem !important;
        font-weight: 700;
        padding: 5px 9px;
        border-radius: 7px;
        background: var(--app-surface-alt);
        color: var(--app-text);
        display: inline-block;
        min-width: 140px;
        text-align: center;
        border: 1px solid var(--app-border);
    }

    .appointment-shell #follow_up .cnm-table {
        border-radius: 10px;
        box-shadow: 0 10px 22px rgba(31, 49, 80, 0.05);
        border: 1px solid var(--app-border);
        padding: 6px;
    }

    .appointment-shell #follow_up #followUpTable thead th {
        background: var(--app-surface-alt);
        color: var(--app-text);
        font-weight: 700;
        border-color: var(--app-border);
        font-size: 0.78rem;
        padding: 7px 9px;
        white-space: nowrap;
    }

    .appointment-shell #follow_up #followUpTable tbody td {
        font-size: 0.78rem;
        padding: 7px 9px;
        vertical-align: middle;
        border-color: var(--app-border);
    }

    .appointment-shell #follow_up #followUpTable_wrapper {
        background: var(--app-surface);
        border-radius: 12px;
        padding: 8px;
        border: 1px solid var(--app-border);
        box-shadow: 0 12px 24px rgba(31, 49, 80, 0.05);
    }

    .appointment-shell #follow_up #followUpTable_wrapper .dt-buttons {
        display: none !important;
    }

    .appointment-shell #follow_up #followUpTable_filter label {
        font-weight: 700;
        color: var(--app-label);
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    .appointment-shell #follow_up #followUpTable_filter input {
        min-width: 240px;
        height: 34px !important;
        padding: 7px 12px !important;
        border-radius: 10px !important;
        border: 1px solid var(--app-border-strong) !important;
        background: var(--app-input-bg) !important;
        color: var(--app-text) !important;
        box-shadow: 0 6px 18px rgba(31, 49, 80, 0.05);
    }

    .appointment-shell #follow_up .fu-actions {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .appointment-shell #follow_up .fu-icon-btn {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        border: 1px solid var(--app-border);
        background: var(--app-surface);
        color: var(--app-text);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        line-height: 1;
        text-decoration: none;
    }

    .appointment-shell #follow_up .fu-icon-btn:hover {
        background: var(--app-surface-alt);
    }

    .appointment-shell #follow_up .fu-icon-btn.danger {
        color: #dc3545;
        border-color: rgba(220, 53, 69, 0.35);
        background: rgba(220, 53, 69, 0.06);
    }

    body[data-theme=dark] .appointment-shell #follow_up .fu-icon-btn.danger {
        background: rgba(220, 53, 69, 0.12);
    }

    /* Medical certificate tab sizing */
    .appointment-shell #medical_certificate .panel-body {
        padding: 12px 10px;
        background: var(--app-surface);
    }

    .appointment-shell #medical_certificate .row.p-5 {
        padding: 12px !important;
    }

    .appointment-shell #medical_certificate select,
    .appointment-shell #medical_certificate textarea,
    .appointment-shell #medical_certificate .form-control {
        font-size: 0.82rem;
        height: 32px;
        padding: 6px 8px;
        border-radius: 8px;
        border: 1px solid var(--app-border-strong);
        background: var(--app-input-bg);
        color: var(--app-text);
    }

    .appointment-shell #medical_certificate #medical_certificate_tempeditor {
        min-height: 520px;
    }

    .appointment-shell #medical_certificate #medicalCertificateSelect {
        max-width: 520px;
        min-width: 280px;
        height: 34px;
        padding: 7px 12px;
        font-weight: 700;
        letter-spacing: 0.01em;
        box-shadow: 0 6px 18px rgba(31, 49, 80, 0.05);
        border: 1px solid var(--app-border-strong);
        background: var(--app-input-bg);
        color: var(--app-text);
    }

    .appointment-shell #medical_certificate .ck-editor__editable_inline,
    .appointment-shell #medical_certificate .cke_editable {
        min-height: 420px !important;
        font-size: 0.9rem !important;
    }

	    .appointment-shell #medical_certificate .cke_chrome,
	    .appointment-shell #medical_certificate .cke_inner {
	        border-radius: 10px !important;
	        box-shadow: 0 10px 22px rgba(31, 49, 80, 0.06);
	        border: 1px solid var(--app-border);
	        width: 100% !important;
	    }

    .appointment-shell #medical_certificate .cke_top,
    .appointment-shell #medical_certificate .cke_bottom {
        padding: 4px 6px !important;
        background: var(--app-surface-alt) !important;
        border-bottom: 1px solid var(--app-border);
    }

    .appointment-shell #medical_certificate .cke_bottom {
        border-top: 1px solid var(--app-border);
    }

    .appointment-shell #medical_certificate .template-row {
        margin-bottom: 10px;
    }

    .appointment-shell #medical_certificate .button-group .btn {
        height: 34px;
        padding: 6px 12px;
        font-size: 0.78rem;
        border-radius: 10px;
        min-width: 104px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    /* Refer to Doctor tab */
    .appointment-shell #referToDoctor .panel-heading {
        padding: 10px 12px !important;
    }

    .appointment-shell #referToDoctor .panel-title {
        font-size: 0.95rem;
        font-weight: 700;
    }

    .appointment-shell #referToDoctor .panel-body {
        padding: 12px 10px;
    }

    .appointment-shell #referToDoctor .rtd-form .rounded-1 {
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        border-radius: 10px !important;
        padding: 10px;
    }

    .appointment-shell #referToDoctor .rtd-table-wrapper {
        margin-top: 10px;
    }

    .appointment-shell #referToDoctor .form-group {
        margin-bottom: 8px;
    }

    .appointment-shell #referToDoctor label {
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--app-label);
        margin-bottom: 4px;
    }

    .appointment-shell #referToDoctor .form-control,
    .appointment-shell #referToDoctor .form-select,
    .appointment-shell #referToDoctor select {
        height: 32px;
        font-size: 0.82rem;
        padding: 6px 8px;
        border-radius: 8px;
        border: 1px solid var(--app-border-strong);
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
        color: var(--app-text) !important;
        background: var(--app-input-bg);
    }

    .appointment-shell #referToDoctor .form-control::placeholder {
        font-weight: 600;
        color: var(--app-input-placeholder);
    }

    .appointment-shell #referToDoctor .table-responsive {
        border-radius: 10px;
        border: 1px solid var(--app-border);
        box-shadow: 0 10px 18px rgba(31, 49, 80, 0.05);
        padding: 6px;
        overflow-x: auto;
    }

    .appointment-shell #referToDoctor table {
        width: 100% !important;
    }

    .appointment-shell #referToDoctor .dataTables_wrapper .dataTables_filter {
        margin: 0;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
    }

    .appointment-shell #referToDoctor .dataTables_wrapper .dataTables_filter label {
        margin: 0;
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--app-label);
        white-space: nowrap;
    }

    .appointment-shell #referToDoctor .dataTables_wrapper .dataTables_info,
    .appointment-shell #referToDoctor .dataTables_wrapper .dataTables_paginate {
        font-size: 0.82rem;
    }

    .appointment-shell #referToDoctor table thead th {
        font-size: 0.82rem;
        padding: 8px 10px;
        background: var(--app-surface-alt);
        color: var(--app-text);
        border-color: var(--app-border);
    }

    .appointment-shell #referToDoctor table tbody td {
        font-size: 0.82rem;
        padding: 8px 10px;
        vertical-align: middle;
        color: var(--app-text);
        border-color: var(--app-border);
    }

    .appointment-shell #referToDoctor .dataTables_wrapper .dataTables_filter input {
        height: 32px;
        border-radius: 8px;
        border: 1px solid var(--app-border-strong);
        padding: 6px 10px;
    }

    .appointment-shell #referToDoctor .panel {
        overflow: visible;
    }

    .appointment-shell #referToDoctor .select2-container {
        width: 100% !important;
    }

    .appointment-shell #referToDoctor .select2-container .select2-selection--single {
        height: 32px;
        border-radius: 8px;
        border: 1px solid var(--app-border-strong);
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
    }

    .appointment-shell #referToDoctor .select2-container .select2-selection__rendered {
        line-height: 32px;
        padding-left: 8px;
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--app-text);
    }

    .appointment-shell #referToDoctor .select2-container .select2-selection__arrow {
        height: 32px;
        right: 8px;
    }

    .appointment-shell #referToDoctor .select2-dropdown {
        border: 1px solid var(--app-border-strong);
        box-shadow: 0 10px 22px rgba(31, 49, 80, 0.08);
        font-size: 0.82rem;
        z-index: 1051;
    }

    /* Diagnostic Comparison (Reports Comparision) */
    .appointment-shell #compairision .panel-body {
        padding: 12px 10px;
    }

    .appointment-shell #compairision .card {
        border: 1px solid var(--app-border);
        box-shadow: 0 10px 24px rgba(31, 49, 80, 0.05);
        border-radius: 10px;
    }

    .appointment-shell #compairision .nav-tabs > li > a {
        padding: 2px 6px;
        font-size: 0.68rem;
        font-weight: 700;
        color: var(--app-text);
        border-radius: 6px 6px 0 0;
    }

    .appointment-shell #compairision .nav-tabs > li > a:hover,
    .appointment-shell #compairision .nav-tabs > li.active > a {
        background: var(--app-surface-alt);
        border-color: var(--bs-primary);
        color: var(--bs-primary);
    }

    .appointment-shell #compairision .nav-tabs > li.active > a,
    .appointment-shell #compairision .nav-tabs > li.active > a:focus,
    .appointment-shell #compairision .nav-tabs > li.active > a:hover {
        background: var(--bs-primary);
        color: #fff;
        border-color: var(--bs-primary);
    }

    .appointment-shell #compairision .tab-content {
        padding-top: 6px;
    }

    .appointment-shell #compairision label {
        font-size: 0.66rem;
        font-weight: 700;
        color: var(--app-label);
        margin-bottom: 1px;
        white-space: nowrap;
        line-height: 1.1;
    }

    .appointment-shell #compairision .form-control,
    .appointment-shell #compairision .form-select {
        height: 27px !important;
        font-size: 0.74rem !important;
        padding: 4px 7px !important;
        border-radius: 6px !important;
        border: 1px solid var(--app-border-strong) !important;
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.04) !important;
        color: var(--app-text) !important;
        background: var(--app-input-bg) !important;
    }

    .appointment-shell #compairision .form-control:focus,
    .appointment-shell #compairision .form-select:focus {
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 3px rgba(15,121,243,0.15);
    }

    .appointment-shell #compairision .form-control::placeholder {
        font-weight: 600;
        color: var(--app-input-placeholder);
    }

    .appointment-shell #compairision .btn.btn-md {
        height: 27px;
        padding: 4px 9px;
        font-size: 0.72rem;
        border-radius: 6px;
    }

    .appointment-shell #compairision .btn.btn-md i {
        font-size: 0.8rem;
    }

    .appointment-shell #compairision .form-check-input {
        width: 16px;
        height: 16px;
        margin-right: 8px;
        border-radius: 4px;
    }

    .appointment-shell #compairision .form-check-label {
        font-size: 0.8rem !important;
        color: var(--app-text);
        font-weight: 700;
    }

    .appointment-shell #compairision hr {
        margin: 10px 0;
        border-color: var(--app-border);
    }

    .appointment-shell #compairision .tab-content .row {
        row-gap: 6px;
    }

    .appointment-shell #compairision .tab-content .form-group {
        margin-bottom: 8px;
    }

    .appointment-shell #compairision .tab-content .col-sm-3,
    .appointment-shell #compairision .tab-content .col-md-4 {
        margin-bottom: 6px;
    }

    .appointment-shell #compairision .row .form-group.mb-0 {
        margin-bottom: 6px !important;
    }

    .appointment-shell #compairision .compairision-filters .col-sm-3,
    .appointment-shell #compairision .compairision-filters .col-sm-4 {
        display: flex;
        align-items: flex-end;
    }

    .appointment-shell #compairision .compairision-filters .form-group {
        width: 100%;
    }

    .appointment-shell #compairision .compairision-filters .btn {
        height: 27px;
        line-height: 1.1;
    }
    .swal2-popup.swal-sm-popup {
        padding: 1rem 1.1rem;
        font-size: 0.92rem;
    }

    .swal2-title.swal-sm-title {
        font-size: 1.05rem;
    }

    .swal2-styled.swal-sm-btn {
        padding: 0.45rem 0.9rem;
        font-size: 0.92rem;
        border-radius: 6px;
    }

    .swal2-input.swal-sm-input,
    .swal2-textarea.swal-sm-input {
        margin: 0.6rem 0 0.4rem;
        height: 34px;
        font-size: 0.92rem;
        border-radius: 8px;
    }

    .swal2-textarea.swal-sm-input {
        height: auto;
        min-height: 90px;
    }

	    /* Documents tab */
	    .appointment-shell #documents .panel-body {
	        padding: 12px;
	    }

	    .appointment-shell #documents .documents-body {
	        padding: 4px;
	    }

	    .appointment-shell #documents .documents-table-wrapper {
	        background: var(--app-surface);
	        border: 1px solid var(--app-border);
	        border-radius: 12px;
	        overflow: hidden;
	    }

	    .appointment-shell #documents #patientDocumentList_wrapper {
	        width: 100%;
	    }

	    .appointment-shell #documents .dt-buttons {
	        display: none;
	    }

	    .appointment-shell #documents #patientDocumentList_filter {
	        margin: 0;
	    }

	    .appointment-shell #documents #patientDocumentList_filter label {
	        margin: 0;
	        font-weight: 600;
	        color: var(--app-label);
	    }

	    .appointment-shell #documents #patientDocumentList_filter input {
	        height: 34px;
	        font-size: 0.82rem;
	        padding: 6px 10px;
	        border-radius: 10px;
	        border: 1px solid var(--app-input-border);
	        background: var(--app-input-bg);
	        color: var(--app-text);
	        box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
	    }

	    .appointment-shell #documents #patientDocumentList_filter input::placeholder {
	        color: var(--app-input-placeholder);
	    }

	    .appointment-shell #documents #patientDocumentList_filter input:focus {
	        border-color: var(--bs-primary);
	        box-shadow: 0 0 0 3px rgba(15, 121, 243, 0.12);
	    }

	    .appointment-shell #documents table thead th {
	        font-size: 0.82rem;
	        padding: 10px 12px;
	        background: var(--app-surface-alt);
	        color: var(--app-text);
	        border-color: var(--app-border);
	        text-align: center;
	        white-space: nowrap;
	    }

	    .appointment-shell #documents table tbody td {
	        font-size: 0.82rem;
	        padding: 10px 12px;
	        border-color: var(--app-border);
	        vertical-align: middle;
	        text-align: center;
	    }

	    .appointment-shell #documents .dataTables_scrollHead {
	        border-bottom: 1px solid var(--app-border) !important;
	    }

	    .appointment-shell #documents .dataTables_scrollBody {
	        border: none !important;
	    }

	    .appointment-shell #documents .dataTables_empty {
	        padding: 1.25rem 0.75rem !important;
	        color: var(--app-muted);
	        font-weight: 600;
	    }

	    .appointment-shell #documents .dataTables_info,
	    .appointment-shell #documents .dataTables_paginate {
	        font-size: 0.78rem;
	        color: var(--app-muted);
	    }

    /* Prescription tab */
    .appointment-shell #prescription .panel-body {
        padding: 12px 10px;
    }

    .appointment-shell #prescription #prescriptionDataTable_filter input {
        height: 30px;
        font-size: 0.78rem;
        padding: 5px 8px;
        border-radius: 7px;
        border: 1px solid var(--app-border-strong);
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
    }

    .appointment-shell #prescription table thead th {
        font-size: 0.8rem;
        padding: 8px 10px;
        background: var(--app-surface-alt);
        color: var(--app-text);
        border-color: var(--app-border);
        text-align: left;
        white-space: nowrap;
    }

    .appointment-shell #prescription table tbody td {
        font-size: 0.78rem;
        padding: 8px 10px;
        border-color: var(--app-border);
        vertical-align: middle;
        color: var(--app-text);
    }

    .appointment-shell #prescription .table-wrapper {
        width: 100%;
    }

    .appointment-shell #prescription .prescription-layout {
        align-items: stretch;
        gap: 10px;
        flex-wrap: nowrap;
        min-height: 70vh;
    }

    .appointment-shell #prescription .prescription-table,
    .appointment-shell #prescription .prescription-preview {
        min-height: 70vh;
        height: 70vh;
    }

    .appointment-shell #prescription .prescription-table {
        flex: 1 1 50%;
        max-width: 50%;
        display: flex;
        flex-direction: column;
    }

    .appointment-shell #prescription .prescription-preview {
        flex: 1 1 50%;
        max-width: 50%;
        display: flex;
        flex-direction: column;
    }

    .appointment-shell #prescription .prescription-table .table-wrapper {
        flex: 1;
        overflow: auto;
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        border-radius: 10px;
        box-shadow: 0 10px 24px rgba(31, 49, 80, 0.06);
    }

    .appointment-shell #prescription thead.sticky th {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .appointment-shell #prescription .prescription-preview .pdf {
        width: 100%;
        height: 100%;
        border: 0;
        display: block;
        background: #f8fafc;
        flex: 1;
    }

    .appointment-shell #prescription .button-group .btn {
        height: 28px;
        padding: 4px 8px;
        font-size: 0.74rem;
        border-radius: 6px;
        min-width: 96px;
        font-weight: 700;
        border: 1px solid transparent;
    }

    .appointment-shell #prescription .button-group {
        gap: 6px;
        flex-wrap: nowrap;
        flex-shrink: 1;
        justify-content: flex-start;
        margin-top: 2px;
        overflow-x: auto;
    }

    .appointment-shell #prescription .btn-view-doctor {
        background: #0d6efd;
        border-color: #0d6efd;
        color: #fff;
        box-shadow: 0 8px 18px rgba(13, 110, 253, 0.25);
    }

    .appointment-shell #prescription .btn-view-doctor:hover {
        background: #0b5ed7;
        border-color: #0b5ed7;
    }

    .appointment-shell #prescription .btn-view-patient {
        background: #0bbf61;
        border-color: #0bbf61;
        color: #fff;
        box-shadow: 0 8px 18px rgba(11, 191, 97, 0.25);
    }

    .appointment-shell #prescription .btn-view-patient:hover {
        background: #0aa355;
        border-color: #0aa355;
    }

    .appointment-shell #prescription .btn-generate-doctor {
        background: #f97316;
        border-color: #f97316;
        color: #fff;
        box-shadow: 0 8px 18px rgba(249, 115, 22, 0.25);
    }

    .appointment-shell #prescription .btn-generate-doctor:hover {
        background: #ea580c;
        border-color: #ea580c;
    }

    .appointment-shell #prescription .btn-generate-patient {
        background: #dc2626;
        border-color: #dc2626;
        color: #fff;
        box-shadow: 0 8px 18px rgba(220, 38, 38, 0.25);
    }

    .appointment-shell #prescription .btn-generate-patient:hover {
        background: #b91c1c;
        border-color: #b91c1c;
    }

    /* Allergies & Immunization tabs */
    .appointment-shell #allergies .panel-body {
        padding: 12px 10px;
    }

    .appointment-shell #allergies label {
        font-size: 0.78rem;
        font-weight: 700;
        color: var(--app-label);
        margin-bottom: 4px;
    }

    .appointment-shell #allergies .form-control,
    .appointment-shell #allergies .form-select {
        height: 30px !important;
        font-size: 0.78rem !important;
        padding: 5px 8px !important;
        border-radius: 7px !important;
        border: 1px solid var(--app-border-strong) !important;
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.04) !important;
    }

    .appointment-shell #allergies .button-group .btn {
        height: 28px;
        padding: 4px 8px;
        font-size: 0.74rem;
        border-radius: 6px;
        min-width: 90px;
    }

    .appointment-shell #allergies .button-group {
        gap: 6px;
        flex-wrap: wrap;
    }

    .appointment-shell #allergies table thead th {
        font-size: 0.8rem;
        padding: 7px 9px;
        background: var(--app-surface-alt);
        color: var(--app-text);
        border-color: var(--app-border);
        text-align: center;
    }

    .appointment-shell #allergies table tbody td {
        font-size: 0.78rem;
        padding: 7px 9px;
        border-color: var(--app-border);
        vertical-align: middle;
    }

    .appointment-shell #allergies .section {
        margin-bottom: 8px;
    }
    .appointment-shell #currentInvestigationsDataTable_wrapper,
    .appointment-shell #labReportsDataTable_wrapper,
    .appointment-shell #currentConsultationsDataTable_wrapper,
    .appointment-shell #currentMedicationsDataTable_wrapper,
    .appointment-shell #prescriptionDataTable_wrapper {
        background: var(--app-surface);
        border-radius: 12px;
        padding: 8px;
        border: 1px solid var(--app-border);
        box-shadow: 0 12px 24px rgba(31, 49, 80, 0.05);
    }

    .appointment-shell #currentConsultationsDataTable thead th,
    .appointment-shell #currentMedicationsDataTable thead th,
    .appointment-shell #currentInvestigationsDataTable thead th,
    .appointment-shell #labReportsDataTable thead th,
    .appointment-shell #prescriptionDataTable thead th {
        background: var(--app-surface-alt);
        color: var(--app-text);
        font-weight: 700;
        border-color: var(--app-border);
    }

	    .appointment-shell #currentConsultationsDataTable tbody td,
	    .appointment-shell #currentMedicationsDataTable tbody td,
	    .appointment-shell #currentInvestigationsDataTable tbody td,
	    .appointment-shell #labReportsDataTable tbody td,
	    .appointment-shell #prescriptionDataTable tbody td {
	        border-color: var(--app-border);
	        font-weight: 600;
	    }

	    .appointment-shell #prescriptionDataTable_wrapper .dt-buttons,
	    .appointment-shell #prescriptionDataTable_wrapper .dt-button {
	        display: none !important;
	    }

	    .appointment-shell #prescriptionDataTable {
	        min-width: 1140px;
	    }

	    .appointment-shell #prescriptionDataTable thead th {
	        white-space: nowrap;
	    }

	    .appointment-shell #prescriptionDataTable td:nth-child(6),
	    .appointment-shell #prescriptionDataTable th.prescription-col-test {
	        min-width: 320px;
	        max-width: 420px;
	        white-space: normal;
	        word-break: break-word;
	    }

    body[data-theme=dark] .appointment-shell {
        color: var(--app-text);
        background: #0b1220;
    }

    body[data-theme=dark] .appointment-shell .page-card,
    body[data-theme=dark] .appointment-shell .content-container,
    body[data-theme=dark] .appointment-shell .section {
        background: var(--app-surface);
        border-color: var(--app-border);
        color: var(--app-text);
    }

    body[data-theme=dark] .appointment-shell .appointment-nav .nav-item {
        background: var(--app-surface-alt);
        border-color: var(--app-border);
        color: var(--app-text);
    }

    body[data-theme=dark] .appointment-shell .appointment-nav .nav-item:hover {
        background: var(--app-surface);
    }

    body[data-theme=dark] .appointment-shell .appointment-nav .nav-item.active {
        background: #0f79f3;
        color: #fff;
        border-color: #0f79f3;
        box-shadow: 0 10px 22px rgba(15, 121, 243, 0.35);
    }

    body[data-theme=dark] .appointment-shell .section,
    body[data-theme=dark] .appointment-shell .panel,
    body[data-theme=dark] .appointment-shell .panel-body,
    body[data-theme=dark] .appointment-shell .card {
        background: var(--app-surface);
        border-color: var(--app-border);
        color: var(--app-text);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    }

    body[data-theme=dark] .appointment-shell .panel-heading {
        background: #0b0f1a !important;
        border-color: var(--app-border) !important;
        color: var(--app-text) !important;
    }

    body[data-theme=dark] .appointment-shell .panel-default,
    body[data-theme=dark] .appointment-shell .panel-default > .panel-heading,
    body[data-theme=dark] .appointment-shell .panel-default > .panel-heading a {
        background: #0b0f1a !important;
        border-color: var(--app-border) !important;
        color: var(--app-text) !important;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    }

    body[data-theme=dark] .appointment-shell .panel-heading .panel-title a:hover {
        color: #63b3ff !important;
    }
    body[data-theme=dark] .appointment-shell .panel .table thead th,
    body[data-theme=dark] .appointment-shell .panel .table tbody td {
        border-color: var(--app-border);
    }

    body[data-theme=dark] .appointment-shell .panel-heading .panel-title,
    body[data-theme=dark] .appointment-shell .panel-heading .panel-title a {
        color: var(--app-text) !important;
    }

    body[data-theme=dark] .appointment-shell table thead th,
    body[data-theme=dark] .appointment-shell #prescription table thead th {
        background: var(--app-surface-alt);
        color: var(--app-text);
        border-color: var(--app-border);
    }

    body[data-theme=dark] .appointment-shell table tbody td,
    body[data-theme=dark] .appointment-shell #prescription table tbody td {
        color: var(--app-text);
        border-color: var(--app-border);
        background: var(--app-surface);
    }

    body[data-theme=dark] .appointment-shell .table-striped > tbody > tr:nth-of-type(odd) {
        background: rgba(255, 255, 255, 0.03);
    }

    body[data-theme=dark] .appointment-shell .form-control,
    body[data-theme=dark] .appointment-shell .form-select,
    body[data-theme=dark] .appointment-shell select,
    body[data-theme=dark] .appointment-shell textarea {
        background: var(--app-input-bg);
        color: var(--app-text) !important;
        border: 1px solid var(--app-input-border);
    }

    body[data-theme=dark] .appointment-shell .nav-tabs > li > a,
    body[data-theme=dark] .appointment-shell .nav-tabs > li > a:focus,
    body[data-theme=dark] .appointment-shell .nav-tabs > li > a:hover {
        background: var(--app-surface);
        color: var(--app-text);
        border-color: var(--app-border);
    }

    body[data-theme=dark] .appointment-shell #prescription .panel-heading {
        background: var(--app-surface-alt) !important;
        border-color: var(--app-border) !important;
        color: var(--app-text) !important;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    }

    body[data-theme=dark] .appointment-shell #prescription .button-group .btn {
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    }

    body[data-theme=dark] .appointment-shell #prescription .prescription-table .table-wrapper,
    body[data-theme=dark] .appointment-shell #prescription .prescription-preview {
        background: var(--app-surface);
        border-color: var(--app-border);
    }

    body[data-theme=dark] .appointment-shell #prescription .prescription-preview .pdf {
        background: #0f172a;
    }

    @media (max-width: 991.98px) {
        .appointment-shell .patient-tabs {
            min-height: auto;
        }

        .appointment-shell .nav-container {
            max-height: none;
            position: relative;
            top: auto;
            overflow: visible;
        }

        .appointment-shell .content-container {
            height: auto;
            min-height: 0;
            max-height: none;
            overflow: visible;
        }
        .appointment-shell #top-title-bar .card-body {
            padding: 6px 10px;
        }

        .appointment-shell #top-title-bar h3 {
            margin: 0;
            font-size: 18px;
            font-weight: 800;
        }

        .appointment-shell #top-title-bar .top-actions .btn {
            padding: 6px 8px;
            font-size: 12px;
            border-radius: 8px;
            line-height: 1.2;
        }

        .appointment-shell #top-title-bar .top-actions {
            gap: 4px;
        }
    }
