:root {
    --sidebar-width: 260px;
    --clinic-blue: #0d6efd;
    --clinic-cyan: #16a8c7;
    --clinic-soft: #eef6ff;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, .08), transparent 34rem),
        var(--bs-tertiary-bg);
}

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--bs-body-bg);
    border-right: 1px solid var(--bs-border-color);
    padding: 1rem;
    overflow-y: auto;
    z-index: 1040;
    transition: transform .2s ease;
}

.sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    color: var(--bs-body-color);
    font-weight: 700;
    margin-bottom: 0;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--clinic-blue), var(--clinic-cyan));
    color: #fff;
}

.sidebar .nav-link {
    color: var(--bs-body-color);
    border-radius: 8px;
    margin-bottom: .25rem;
    display: flex;
    gap: .75rem;
    align-items: center;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: rgba(13, 110, 253, .12);
    color: var(--clinic-blue);
}

.sidebar .nav-link i {
    width: 1.25rem;
    text-align: center;
}

.sidebar-close,
.sidebar-backdrop {
    display: none;
}

.main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    transition: margin-left .2s ease;
}

body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .main {
    margin-left: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 68px;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 1.25rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.content {
    padding: 1.25rem;
}

.stat-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-body-bg);
    padding: 1rem;
}

.btn-icon {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.btn-icon.btn-sm {
    width: 2rem;
    height: 2rem;
}

.sidebar .sidebar-close {
    display: none;
}

.btn-icon.btn-danger,
.btn-icon.btn-danger:hover,
.btn-icon.btn-danger:focus {
    color: #fff;
    background: var(--bs-danger);
    border-color: var(--bs-danger);
}

.action-bar {
    display: inline-flex;
    gap: .4rem;
    align-items: center;
    flex-wrap: nowrap;
}

.rx-print-language {
    width: 112px;
    min-width: 112px;
}

.card,
.card-body,
.dt-container,
.dt-layout-row,
.dt-layout-cell,
table.dataTable {
    width: 100%;
}

.card-body {
    min-width: 0;
}

.dt-container {
    max-width: 100%;
}

.dt-container .row,
.dt-layout-row {
    width: 100%;
}

.dt-scroll,
.dt-scroll-body,
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.dataTable {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.dt-layout-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.dt-layout-table table,
.dt-scroll table {
    min-width: 760px;
}

.section-hero {
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(13,110,253,.12), rgba(22,168,199,.06)), var(--bs-body-bg);
    padding: 1.25rem;
}

.modal-content {
    border: 0;
    border-radius: 0;
    background: var(--bs-body-bg);
}

.modal-header,
.modal-footer {
    background: #fff;
    border-color: #d8e5f3;
    padding: 1rem 1.25rem;
}

.modal-title {
    color: #0f172a;
    font-weight: 800;
}

.modal-body {
    background:
        radial-gradient(circle at top right, rgba(13,110,253,.10), transparent 30rem),
        #edf4fb;
    overflow-y: auto;
    padding: 1.25rem;
}

.modal-body > .row,
.modal-body > .video-consent-box,
.modal-body > .table-responsive,
.modal-body > .form-control,
.modal-body > .form-select {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.modal-body > .row {
    background: rgba(255,255,255,.96);
    border: 1px solid #d8e5f3;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .10);
    padding: 1rem;
}

.modal-body .form-label {
    color: #42526a;
    font-size: .82rem;
    font-weight: 700;
}

.modal-body .form-control,
.modal-body .form-select {
    border-color: #d8e5f3;
    background-color: rgba(255,255,255,.94);
}

.modal-footer [data-bs-dismiss="modal"]:not(.btn-close) {
    display: none;
}

.compliance-score {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--clinic-blue) var(--score, 0%), var(--bs-border-color) 0);
    color: var(--bs-body-color);
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
}

.compliance-score::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: var(--bs-body-bg);
}

.compliance-score span {
    position: relative;
    z-index: 1;
}

.signature-pad-preview {
    min-height: 96px;
    border: 1px dashed var(--bs-border-color);
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--bs-tertiary-bg);
}

.rx-paper {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    color: #111827;
    border: 1px solid #dbe8f7;
}

.rx-watermark {
    background:
        linear-gradient(135deg, rgba(13,110,253,.06), transparent),
        #fff;
}

.rx-print-body {
    background: #eef4fb;
    color: #111827;
    padding: 1.25rem;
}

.rx-print-toolbar {
    max-width: 960px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
}

.rx-print-toolbar label {
    color: #475569;
    font-weight: 700;
}

.rx-print-toolbar .form-select {
    width: 190px;
}

.rx-print-page {
    max-width: 960px;
    min-height: 1180px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #d7e6f6;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
}

.rx-print-header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.6rem 1.75rem;
    background: linear-gradient(135deg, rgba(13,110,253,.11), rgba(22,168,199,.06));
    border-bottom: 4px solid var(--clinic-blue);
}

.rx-print-clinic {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.rx-print-logo {
    max-width: 118px;
    max-height: 82px;
    object-fit: contain;
}

.rx-print-logo-mark {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--clinic-blue), var(--clinic-cyan));
    font-size: 2rem;
    font-weight: 800;
}

.rx-print-clinic h1 {
    margin: 0;
    color: #0f172a;
    font-size: 1.9rem;
    font-weight: 800;
}

.rx-print-tagline {
    color: var(--clinic-blue);
    font-weight: 700;
}

.rx-print-muted,
.rx-print-small {
    color: #526173;
}

.rx-print-small {
    font-size: .82rem;
}

.rx-print-meta {
    min-width: 180px;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    color: #1f2937;
}

.rx-print-chip {
    align-self: flex-end;
    border-radius: 999px;
    background: var(--clinic-blue);
    color: #fff;
    padding: .35rem .7rem;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.rx-print-info-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1rem;
    padding: 1.25rem 1.75rem 0;
}

.rx-print-info-card {
    border: 1px solid #dbe7f5;
    border-radius: 10px;
    background: #fbfdff;
    padding: 1rem;
}

.rx-print-info-card h2 {
    margin: .1rem 0 .35rem;
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 800;
}

.rx-print-doctor {
    text-align: right;
}

.rx-print-label {
    color: var(--clinic-blue);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.rx-print-clinical-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem 1.75rem;
}

.rx-print-clinical-grid div {
    min-height: 82px;
    border-bottom: 1px solid #dbe7f5;
    color: #1f2937;
}

.rx-print-clinical-grid span {
    display: block;
    color: #0f172a;
    font-weight: 800;
    margin-bottom: .35rem;
}

.rx-print-section {
    padding: 0 1.75rem 1rem;
}

.rx-print-section-title {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    margin-bottom: .6rem;
}

.rx-print-section-title span {
    color: var(--clinic-blue);
    font-family: Georgia, serif;
    font-size: 2.15rem;
    font-weight: 800;
}

.rx-print-section-title small {
    color: #64748b;
    font-weight: 700;
}

.rx-print-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #dbe7f5;
}

.rx-print-table th {
    background: #edf6ff;
    color: #0f172a;
    font-weight: 800;
    padding: .75rem;
    border: 1px solid #dbe7f5;
}

.rx-print-table td {
    padding: .72rem;
    border: 1px solid #dbe7f5;
    vertical-align: top;
}

.rx-dosage-col {
    width: 142px;
    text-align: center;
}

.rx-dosage-pattern {
    display: block;
    color: #020617;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: .04em;
    line-height: 1.2;
    white-space: nowrap;
}

.rx-print-footer-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1rem;
    padding: 1rem 1.75rem 1.4rem;
}

.rx-print-advice {
    min-height: 95px;
}

.rx-print-advice p {
    margin-bottom: .35rem;
}

.rx-print-verify {
    display: inline-flex;
    align-items: center;
    gap: .85rem;
    border: 1px solid #dbe7f5;
    border-radius: 10px;
    padding: .65rem;
    background: #fbfdff;
}

.rx-print-verify img {
    display: block;
}

.rx-print-verify strong,
.rx-print-verify span,
.rx-print-verify code {
    display: block;
}

.rx-print-verify span {
    color: #64748b;
    font-size: .86rem;
}

.rx-print-verify code {
    margin-top: .25rem;
    color: #0f172a;
    background: #eef6ff;
    border-radius: 6px;
    padding: .15rem .35rem;
}

.rx-print-signature {
    text-align: right;
    align-self: end;
}

.rx-print-signature img {
    max-width: 220px;
    max-height: 80px;
    object-fit: contain;
}

.rx-print-signature strong,
.rx-print-signature span {
    display: block;
}

.rx-print-signature-box {
    min-height: 90px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #64748b;
    margin-bottom: .5rem;
}

.rx-print-rtl .rx-print-meta,
.rx-print-rtl .rx-print-doctor,
.rx-print-rtl .rx-print-signature {
    text-align: left;
}

.rx-print-rtl .rx-print-chip {
    align-self: flex-start;
}

.rx-print-note {
    border-top: 1px solid #dbe7f5;
    color: #64748b;
    font-size: .86rem;
    text-align: center;
    padding: .8rem 1.75rem;
}

.rx-modal {
    border: 0;
    border-radius: 0;
    overflow: hidden;
}

.rx-modal-header,
.rx-modal-footer {
    background: #fff;
}

.rx-modal-body {
    background: #edf4fb;
    padding: 1.25rem;
    overflow-y: auto;
}

.rx-logo {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--clinic-blue), var(--clinic-cyan));
    border-radius: 10px;
}

.rx-form-paper {
    max-width: 1320px;
    margin: 0 auto;
    background:
        linear-gradient(90deg, rgba(13,110,253,.045) 0 1px, transparent 1px 100%),
        linear-gradient(#fff, #fff);
    background-size: 28px 28px, auto;
    border: 1px solid #d8e5f3;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .12);
    overflow: hidden;
}

.rx-letterhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, rgba(13,110,253,.12), rgba(22,168,199,.08));
    border-bottom: 1px solid #d8e5f3;
}

.rx-letterhead h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
}

.rx-letterhead p {
    margin: .15rem 0 0;
    color: #607089;
    font-size: .84rem;
}

.rx-label {
    color: var(--clinic-blue);
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.rx-section {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #e7eef7;
}

.rx-section:last-child {
    border-bottom: 0;
}

.rx-section .form-label {
    font-size: .82rem;
    font-weight: 700;
    color: #42526a;
}

.rx-note,
.rx-form-paper .form-control,
.rx-form-paper .form-select {
    border-color: #d8e5f3;
    background-color: rgba(255,255,255,.92);
}

.rx-symbol {
    font-size: 2rem;
    font-weight: 800;
    color: var(--clinic-blue);
    font-family: Georgia, serif;
    line-height: 1;
}

.rx-medicine-section {
    background: rgba(255,255,255,.72);
}

.rx-add-medicine-button {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    white-space: nowrap;
}

.rx-medicine-table {
    margin-bottom: 0;
    table-layout: fixed;
    min-width: 1040px;
}

.rx-col-medicine { width: 27%; }
.rx-col-dosage { width: 18%; }
.rx-col-frequency { width: 18%; }
.rx-col-duration { width: 18%; }
.rx-col-instructions { width: 18%; }
.rx-col-action { width: 48px; }

.rx-medicine-table thead th {
    color: #0f172a;
    font-size: .82rem;
    border-bottom: 1px solid #d8e5f3;
    white-space: nowrap;
}

.rx-medicine-table tbody td {
    padding-top: .55rem;
    padding-bottom: .55rem;
    vertical-align: top;
}

.rx-medicine-table .form-control {
    min-width: 0;
    width: 100%;
}

.rx-medicine-table td:first-child .form-control {
    min-width: 0;
}

.rx-medicine-table .form-text {
    margin-top: .22rem;
    color: #64748b;
    font-size: .74rem;
    line-height: 1.1;
    white-space: nowrap;
}

.rx-medicine-table .remove-medicine {
    margin-top: .05rem;
}

.rx-quick-picks {
    display: none;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .45rem;
}

.rx-quick-picks button {
    border: 1px solid #cfe0f5;
    border-radius: 999px;
    background: #f5faff;
    color: #0f172a;
    font-size: .78rem;
    font-weight: 700;
    padding: .32rem .58rem;
}

.rx-quick-picks button:active {
    color: #fff;
    background: var(--clinic-blue);
    border-color: var(--clinic-blue);
}

.patient-modal {
    border: 0;
    border-radius: 0;
    overflow: hidden;
}

.patient-modal-header,
.patient-modal-footer {
    background: #fff;
}

.patient-modal-body {
    background:
        radial-gradient(circle at top right, rgba(22,168,199,.12), transparent 28rem),
        #edf4fb;
    padding: 1.25rem;
    overflow-y: auto;
}

.patient-form-panel {
    max-width: 1180px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #d8e5f3;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .12);
    overflow: hidden;
}

.patient-form-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    background: linear-gradient(135deg, rgba(13,110,253,.13), rgba(22,168,199,.08));
    border-bottom: 1px solid #d8e5f3;
}

.patient-kicker {
    color: var(--clinic-blue);
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.patient-form-banner h2 {
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 800;
    margin: .15rem 0 0;
}

.patient-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #0f766e;
    background: rgba(20,184,166,.12);
    border: 1px solid rgba(20,184,166,.25);
    border-radius: 999px;
    padding: .45rem .75rem;
    font-weight: 700;
    white-space: nowrap;
}

.patient-form-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e7eef7;
}

.patient-form-section:last-child {
    border-bottom: 0;
}

.patient-section-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: #0f172a;
    font-weight: 800;
    margin-bottom: .85rem;
}

.patient-section-title i {
    color: var(--clinic-blue);
}

.patient-form-panel .form-label {
    color: #42526a;
    font-size: .82rem;
    font-weight: 700;
}

.patient-form-panel .form-control,
.patient-form-panel .form-select {
    border-color: #d8e5f3;
    background-color: rgba(255,255,255,.94);
}

.patient-textarea {
    min-height: 132px;
}

.gov-id-scanner {
    display: grid;
    grid-template-columns: minmax(260px, 420px) 1fr;
    gap: 1rem;
    align-items: center;
    border: 1px solid #d8e5f3;
    border-radius: 12px;
    background: #f8fbff;
    padding: .85rem;
}

.gov-id-preview {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #0f172a;
    border-radius: 10px;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.gov-id-preview::before {
    content: "ID card preview";
    color: rgba(255,255,255,.68);
    font-weight: 700;
}

.gov-id-preview video,
.gov-id-preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gov-id-preview img:not([src]) {
    display: none;
}

.gov-id-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.xray-upload-list {
    display: grid;
    gap: .85rem;
}

.xray-upload-row {
    border: 1px solid #d8e5f3;
    border-radius: 12px;
    background: #f8fbff;
    padding: .85rem;
}

.xray-history-panel {
    max-width: 1180px;
    margin: 0 auto;
    border: 1px solid #d8e5f3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .10);
    padding: 1rem;
}

.video-consent-box {
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-tertiary-bg);
    padding: .75rem;
}

.video-consent-box video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0f172a;
    border-radius: 8px;
    object-fit: cover;
}

.stat-card .value {
    font-size: 1.85rem;
    font-weight: 700;
}

.odontogram-card {
    overflow-x: auto;
}

.odontogram-chart {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "upper-right upper-left"
        "lower-right lower-left";
    gap: 2.6rem 1.7rem;
    min-width: 880px;
    padding: 2.4rem 1.5rem 1.7rem;
    border: 1px solid #d8e5f3;
    border-radius: 12px;
    background:
        linear-gradient(90deg, transparent calc(50% - 1px), #b8c7d9 calc(50% - 1px), #b8c7d9 calc(50% + 1px), transparent calc(50% + 1px)),
        linear-gradient(180deg, transparent calc(50% - 1px), #b8c7d9 calc(50% - 1px), #b8c7d9 calc(50% + 1px), transparent calc(50% + 1px)),
        #fbfdff;
}

.tooth-quadrant.upper-right { grid-area: upper-right; }
.tooth-quadrant.upper-left { grid-area: upper-left; }
.tooth-quadrant.lower-right { grid-area: lower-right; }
.tooth-quadrant.lower-left { grid-area: lower-left; }

.quadrant-label {
    color: #64748b;
    font-size: .82rem;
    font-weight: 800;
    margin-bottom: .55rem;
    text-transform: uppercase;
}

.upper-right .quadrant-label,
.lower-right .quadrant-label {
    text-align: right;
}

.tooth-row {
    display: grid;
    grid-template-columns: repeat(8, 48px);
    gap: .6rem;
    justify-content: end;
}

.upper-left .tooth-row,
.lower-left .tooth-row {
    justify-content: start;
}

.arch-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--clinic-blue);
    background: #fff;
    border: 1px solid #d8e5f3;
    border-radius: 999px;
    padding: .25rem .7rem;
    font-size: .78rem;
    font-weight: 800;
}

.arch-label.upper {
    top: .65rem;
}

.arch-label.lower {
    bottom: .65rem;
}

.tooth {
    width: 48px;
    height: 48px;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-body-bg);
    display: grid;
    place-items: center;
    cursor: pointer;
    font-weight: 700;
}

.tooth.healthy { background: #e7f7ee; color: #16794c; }
.tooth.carious { background: #fff3cd; color: #8a6d00; }
.tooth.filled { background: #cff4fc; color: #087990; }
.tooth.extracted { background: #f8d7da; color: #b02a37; }
.tooth.root_canal { background: #e2d9f3; color: #5a32a3; }

.odontogram-legend {
    border: 1px solid #d8e5f3;
    border-radius: 12px;
    background: #fff;
    padding: 1rem;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #334155;
    font-size: .92rem;
}

.legend-swatch {
    width: 30px;
    height: 30px;
    min-width: 30px;
    cursor: default;
    pointer-events: none;
}

@media (max-width: 991.98px) {
    body.mobile-sidebar-open {
        overflow: hidden;
    }
    .sidebar {
        transform: translateX(-100%);
        width: min(86vw, 320px);
        box-shadow: 20px 0 50px rgba(15, 23, 42, .25);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar .sidebar-close {
        display: inline-grid;
        flex: 0 0 auto;
        width: 42px;
        height: 42px;
        color: #0f172a;
        background: #fff;
        border-color: #d8e5f3;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1030;
        background: rgba(15, 23, 42, .45);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
    }
    body.mobile-sidebar-open .sidebar-backdrop {
        display: block;
        opacity: 1;
        visibility: visible;
    }
    .main {
        margin-left: 0;
        width: 100%;
        min-width: 0;
    }
    .topbar {
        align-items: center;
        flex-direction: row;
        padding: .75rem;
    }
    .topbar > div:nth-child(2) {
        min-width: 0;
        flex: 1;
    }
    .topbar > div:nth-child(2) strong,
    .topbar > div:nth-child(2) .small {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .topbar-actions {
        gap: .35rem;
    }
    .topbar-actions .small {
        display: none;
    }
    .content {
        padding: .75rem;
    }
    .section-hero {
        padding: .9rem !important;
    }
    .section-hero h1,
    .section-hero .h4 {
        font-size: 1.1rem;
    }
    .card-body {
        padding: .75rem;
        overflow: hidden;
    }
    .dt-container {
        font-size: .92rem;
    }
    .dt-layout-row {
        gap: .5rem;
    }
    .dt-layout-cell {
        overflow-x: auto;
    }
    .dt-search,
    .dt-length {
        width: 100%;
    }
    .dt-search input {
        width: 100% !important;
        margin-left: 0 !important;
    }
    .action-bar {
        gap: .3rem;
    }
    .rx-print-language {
        width: 96px;
        min-width: 96px;
    }
    .modal-header {
        min-height: 64px;
        padding: .75rem .9rem;
    }
    .modal-header .modal-title {
        font-size: 1rem;
    }
    .modal-body {
        padding: .85rem;
    }
    .modal-body > .row {
        padding: .85rem;
        border-radius: 12px;
        box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    }
    .modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding: .75rem .9rem;
        box-shadow: 0 -12px 28px rgba(15, 23, 42, .08);
    }
    .modal-footer .btn {
        min-height: 42px;
    }
    .rx-modal-body,
    .patient-modal-body {
        padding: .75rem;
    }
    .rx-letterhead,
    .patient-form-banner {
        align-items: flex-start;
        flex-direction: column;
        padding: .9rem;
    }
    .rx-letterhead .brand-mark {
        width: 34px;
        height: 34px;
    }
    .rx-letterhead h2,
    .patient-form-banner h2 {
        font-size: 1.05rem;
    }
    .rx-section,
    .patient-form-section {
        padding: .85rem;
    }
    .rx-medicine-section > .d-flex {
        align-items: flex-start !important;
        gap: .85rem;
    }
    .rx-add-medicine-button {
        width: 100%;
        justify-content: center;
        min-height: 46px;
        border-radius: 10px;
        font-weight: 800;
    }
    .rx-medicine-table {
        min-width: 0;
        table-layout: auto;
    }
    .rx-medicine-table colgroup,
    .rx-medicine-table thead {
        display: none;
    }
    .rx-medicine-table,
    .rx-medicine-table tbody,
    .rx-medicine-table tr,
    .rx-medicine-table td {
        display: block;
        width: 100%;
    }
    .rx-medicine-table tr {
        position: relative;
        border: 1px solid #d8e5f3;
        border-radius: 12px;
        background: #fff;
        padding: .85rem;
        margin-bottom: .85rem;
        box-shadow: 0 12px 24px rgba(15, 23, 42, .06);
    }
    .rx-medicine-table td {
        border: 0;
        padding: 0 0 .75rem;
    }
    .rx-medicine-table td::before {
        content: attr(data-label);
        display: block;
        color: #42526a;
        font-size: .76rem;
        font-weight: 800;
        margin-bottom: .3rem;
        text-transform: uppercase;
    }
    .rx-medicine-table td:last-child {
        position: absolute;
        top: .7rem;
        right: .7rem;
        width: auto;
        padding: 0;
    }
    .rx-medicine-table td:last-child::before {
        display: none;
    }
    .rx-medicine-table td:first-child {
        padding-right: 2.6rem;
    }
    .rx-medicine-table .form-control,
    .patient-form-panel .form-control,
    .patient-form-panel .form-select {
        min-height: 44px;
        font-size: 1rem;
    }
    .rx-quick-picks {
        display: flex;
    }
    .patient-form-panel {
        border-radius: 12px;
        box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    }
    .patient-textarea {
        min-height: 108px;
    }
    .xray-upload-row {
        padding: .85rem;
    }
    .gov-id-scanner {
        grid-template-columns: 1fr;
    }
    .odontogram-chart {
        min-width: 0;
        grid-template-columns: 1fr;
        grid-template-areas:
            "upper-right"
            "upper-left"
            "lower-right"
            "lower-left";
        background: #fbfdff;
        gap: 1.25rem;
    }
    .tooth-row {
        grid-template-columns: repeat(4, 48px);
        justify-content: start;
    }
    .upper-right .quadrant-label,
    .lower-right .quadrant-label {
        text-align: left;
    }
    .arch-label {
        display: none;
    }
}

@media print {
    @page {
        size: A4;
        margin: 10mm;
    }
    .rx-print-body {
        background: #fff;
        padding: 0;
    }
    .rx-print-page {
        max-width: none;
        min-height: auto;
        border: 0;
        box-shadow: none;
    }
    .rx-print-toolbar {
        display: none !important;
    }
}
