@font-face {
    font-family: "SimplifiedArabicApp";
    src: url("/static/fonts/SimplifiedArabic.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "SimplifiedArabicApp";
    src: url("/static/fonts/SimplifiedArabic-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
}

:root {
    --navy: #06213d;
    --navy-2: #0b315c;
    --blue: #1167d8;
    --blue-2: #0f55b8;
    --blue-soft: #eaf4ff;
    --border: #d5e2f2;
    --text: #10213d;
    --muted: #61708a;
    --green: #15964c;
    --green-soft: #eaf9ef;
    --red: #dc2626;
    --red-soft: #fff0f0;
    --amber: #f28a00;
    --amber-soft: #fff6e7;
    --purple: #6d47c8;
    --shadow: 0 18px 50px rgba(18, 54, 100, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "SimplifiedArabicApp", "Simplified Arabic", Tahoma, Arial, sans-serif;
    background: #f6f9fd;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #cbd8ea;
    border-radius: 8px;
    padding: 13px 16px;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #5c9df2;
    box-shadow: 0 0 0 4px rgba(17, 103, 216, 0.12);
}

label span {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

label small {
    display: block;
    color: var(--muted);
    margin-top: 10px;
}

.password-field {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.password-field input {
    min-width: 0;
    flex: 1;
}

.password-toggle {
    flex: 0 0 auto;
    min-width: 74px;
    border: 1px solid #cbd8ea;
    border-radius: 8px;
    padding: 0 12px;
    color: var(--blue);
    background: #f8fbff;
    cursor: pointer;
    font-weight: 700;
}

.hidden {
    display: none !important;
}

.date-display,
.datetime-display {
    display: inline-block;
    direction: ltr;
    unicode-bidi: isolate;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.warehouse-request-table .datetime-display,
.pharmacy-warehouse-request-table .datetime-display {
    display: block;
    direction: rtl;
    text-align: right;
    white-space: pre-line;
    line-height: 1.12 !important;
}

.date-cell,
.datetime-cell {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: right !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.date-input,
input[type="date"] {
    direction: rtl;
    text-align: right;
    unicode-bidi: isolate;
}

.date-input::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit {
    direction: rtl;
    text-align: right;
}

.flash-stack {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 5000;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 36px));
}

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-weight: 700;
}

.alert span {
    min-width: 0;
}

.alert-ok {
    flex: 0 0 auto;
    min-width: 56px;
    border: 0;
    border-radius: 7px;
    padding: 6px 14px;
    color: #fff;
    background: var(--blue);
    cursor: pointer;
    font-weight: 700;
}

.alert-success { color: var(--green); border-color: #a8e2bd; }
.alert-danger { color: var(--red); border-color: #ffc4c4; }
.alert-warning { color: #a85f00; border-color: #ffd99c; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, #1974e6, #0e58bf);
    box-shadow: 0 10px 20px rgba(17, 103, 216, 0.2);
}

.btn-success {
    color: #fff;
    background: linear-gradient(180deg, #1fb35c, #118741);
    box-shadow: 0 10px 20px rgba(21, 150, 76, 0.18);
}

.btn-danger {
    color: #fff;
    background: var(--red);
}

.btn-warning {
    color: #fff;
    background: linear-gradient(180deg, #ff9d16, #ef7f00);
}

.btn-purple {
    color: #fff;
    background: linear-gradient(180deg, #7b55da, #6540bd);
}

.btn-light {
    background: #fff;
    color: #52617b;
    border-color: #cfdbe9;
}

.btn-outline {
    color: var(--blue);
    background: #fff;
    border-color: #8ebbf2;
}

.btn-outline-green {
    color: var(--green);
    background: #fff;
    border-color: #8dd4a5;
}

.btn-danger-outline {
    color: var(--red);
    background: #fff;
    border-color: #ff9d9d;
}

.btn.wide {
    width: 100%;
}

.btn.mini,
.mini {
    min-height: 32px;
    padding: 6px 12px;
    font-size: 13px;
}

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.7), transparent 16%),
        linear-gradient(145deg, #e5f7ff 0%, #c9efff 44%, #f6fbff 100%);
}

.auth-page::before,
.auth-page::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.35;
    background-image:
        linear-gradient(30deg, transparent 48%, rgba(255, 255, 255, 0.7) 49%, transparent 50%),
        linear-gradient(150deg, transparent 48%, rgba(255, 255, 255, 0.55) 49%, transparent 50%);
    background-size: 170px 170px;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px;
}

.auth-card {
    position: relative;
    width: min(650px, 100%);
    padding: 52px 50px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    text-align: center;
    z-index: 1;
}

.auth-card.compact {
    max-width: 520px;
}

.auth-card h1 {
    margin: 18px 0 10px;
    color: var(--blue);
    font-size: clamp(32px, 4vw, 46px);
}

.auth-card p {
    margin: 0 0 34px;
    color: var(--muted);
    font-size: 22px;
}

.auth-card label {
    display: block;
    margin-bottom: 22px;
    text-align: right;
}

.auth-icon {
    width: 82px;
    height: 82px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(180deg, #2e7cf0, #0f59bf);
    font-size: 48px;
    font-weight: 900;
    box-shadow: 0 18px 36px rgba(17, 103, 216, 0.24);
}

.shield-icon {
    font-size: 42px;
}

.inline-error {
    margin-bottom: 18px;
    color: var(--red);
    background: var(--red-soft);
    border: 1px solid #ffc1c1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
}

.inline-success {
    margin-bottom: 18px;
    color: var(--green);
    background: var(--green-soft);
    border: 1px solid #b6e7c7;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
}

.muted-link,
.muted {
    color: var(--muted);
}

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

body.meda-staff-page {
    overflow: hidden;
}

.meda-staff-shell {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.sidebar {
    width: 143px;
    flex: 0 0 143px;
    min-height: 100vh;
    padding: 18px 9px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(11, 49, 92, 0.98), rgba(3, 24, 45, 1)),
        var(--navy);
    box-shadow: -14px 0 36px rgba(8, 35, 65, 0.24);
}

.meda-staff-shell > .sidebar {
    height: 100vh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.meda-staff-shell > .main-area {
    height: 100vh;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.brand-badge {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(180deg, #2d78dc, #124b9f);
    border: 2px solid rgba(255, 255, 255, 0.26);
    font-size: 24px;
}

.sidebar h2 {
    margin: 0;
    text-align: center;
    font-size: 13px;
}

.sidebar p {
    margin: 6px 0 18px;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
}

.doctor-card {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    margin-bottom: 16px;
}

.doctor-card strong,
.doctor-card small {
    display: block;
}

.doctor-card small {
    color: rgba(255, 255, 255, 0.72);
    margin-top: 5px;
}

.avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #1a75e8;
    background: linear-gradient(180deg, #f4f9ff, #cfe5ff);
    font-weight: 900;
    font-size: 18px;
}

.avatar.small {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 18px;
}

.side-nav {
    display: grid;
    gap: 7px;
}

.side-nav a,
.side-nav button {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 10px 8px;
    color: rgba(255, 255, 255, 0.88);
    background: transparent;
    font-weight: 800;
    text-align: right;
    cursor: pointer;
}

.side-nav form {
    margin: 0;
}

.side-nav a.active,
.side-nav button.active,
.side-nav a:hover,
.side-nav button:hover {
    background: linear-gradient(90deg, #176bd7, #0f55a7);
    color: #fff;
}

.side-nav .subscription-nav {
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #fff;
}

.side-nav .subscription-nav.subscribed,
.side-nav .subscription-nav.subscribed:hover {
    background: linear-gradient(90deg, #128244, #15964c);
}

.side-nav .subscription-nav.unsubscribed,
.side-nav .subscription-nav.unsubscribed:hover {
    background: linear-gradient(90deg, #c51f1f, #dc2626);
}

.subscription-nav strong {
    margin-inline-start: auto;
}

.subscription-countdown {
    display: grid;
    gap: 4px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #eaf9ef;
    background: rgba(21, 150, 76, 0.2);
    border: 1px solid rgba(182, 231, 199, 0.35);
    font-weight: 800;
}

.side-nav .subscription-countdown span {
    width: auto;
    color: rgba(255, 255, 255, 0.78);
    text-align: right;
}

.subscription-countdown.expired {
    color: #fff;
    background: rgba(220, 38, 38, 0.24);
    border-color: rgba(255, 198, 198, 0.42);
}

.side-nav span {
    width: 18px;
    text-align: center;
}

.logout-form {
    margin-top: 18px;
}

.logout-form button {
    width: 100%;
    border: 0;
    color: #ff6b64;
    background: transparent;
    padding: 10px 8px;
    text-align: right;
    font-weight: 900;
    cursor: pointer;
}

.main-area {
    flex: 1;
    min-width: 0;
    padding: 28px 34px 42px;
}

.main-area.narrow {
    max-width: 900px;
    margin-inline: auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.dashboard-page .main-area > .page-header {
    position: sticky;
    top: 0;
    z-index: 30;
    margin-inline: -6px;
    padding: 6px;
    background: #f4f9ff;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 3vw, 38px);
    color: #0b2854;
}

.page-header p {
    margin: 0;
    color: var(--muted);
}

.owner-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e8f4;
}

.owner-profile small {
    display: block;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    gap: 22px;
    margin-bottom: 26px;
}

.stats-grid.five {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.stats-grid.four {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.stats-grid.three {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    position: relative;
    min-height: 116px;
    padding: 20px 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(20, 60, 100, 0.06);
    overflow: hidden;
    text-align: right;
}

button.stat-card {
    width: 100%;
    cursor: pointer;
    font: inherit;
    appearance: none;
}

.stat-card.stat-filter:hover,
.stat-card.stat-filter.active {
    outline: 2px solid currentColor;
    outline-offset: -2px;
    box-shadow: 0 12px 28px rgba(20, 60, 100, 0.13);
    transform: translateY(-1px);
}

.stat-card p {
    margin: 0 0 8px;
    font-weight: 800;
}

.stat-card strong {
    display: block;
    font-size: 34px;
    line-height: 1;
}

.stat-card small {
    color: var(--muted);
}

.stat-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 26px;
    background: rgba(17, 103, 216, 0.12);
}

.stat-card.blue { color: var(--blue); background: linear-gradient(180deg, #fff, #f4f9ff); border-color: #b8d5fb; }
.stat-card.green { color: var(--green); background: linear-gradient(180deg, #fff, var(--green-soft)); border-color: #b8e6c7; }
.stat-card.red { color: var(--red); background: linear-gradient(180deg, #fff, var(--red-soft)); border-color: #ffcaca; }
.stat-card.amber { color: var(--amber); background: linear-gradient(180deg, #fff, var(--amber-soft)); border-color: #ffd596; }
.stat-card.violet { color: #7b35df; background: linear-gradient(180deg, #fff, #f5efff); border-color: #dfcaff; }

.panel,
.settings-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(20, 60, 100, 0.06);
    padding: 24px;
    margin-bottom: 24px;
}

.panel h2,
.settings-panel h1 {
    margin-top: 0;
    color: #0b2854;
}

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.panel-toolbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.toolbar-actions,
.button-strip,
.row-actions,
.action-cluster,
.modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.button-strip {
    margin-bottom: 24px;
}

.inline-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 180px;
    gap: 22px 28px;
    align-items: end;
}

.table-tools {
    display: flex;
    justify-content: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.table-tools.spaced {
    justify-content: space-between;
}

.audit-tools {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.audit-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fbff;
    color: #0b2854;
}

.audit-delete-form {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.audit-delete-form label {
    display: grid;
    gap: 4px;
}

.audit-delete-form input {
    min-width: 220px;
}

.search-input {
    max-width: 560px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
    background: #fff;
}

.data-table.compact {
    min-width: 1120px;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 15px 14px;
    border-bottom: 1px solid #e2eaf5;
    border-left: 1px solid #edf2f8;
    text-align: center;
    vertical-align: middle;
}

.data-table th {
    color: #0b2854;
    background: #f8fbff;
    font-weight: 900;
}

.data-table tbody tr:hover {
    background: #f9fcff;
}

.archive-table tbody tr {
    cursor: pointer;
}

.empty-state {
    padding: 34px !important;
    color: var(--muted);
    font-weight: 700;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    min-height: 30px;
    padding: 5px 11px;
    border-radius: 7px;
    border: 1px solid transparent;
    font-weight: 900;
}

.badge.success,
.badge.approved {
    color: var(--green);
    background: var(--green-soft);
    border-color: #b6e7c7;
}

.badge.danger,
.badge.rejected {
    color: var(--red);
    background: var(--red-soft);
    border-color: #ffc6c6;
}

.badge.warning,
.badge.pending {
    color: #bd6800;
    background: var(--amber-soft);
    border-color: #ffd59a;
}

.subscription-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    min-height: 32px;
    border-radius: 7px;
    border: 1px solid transparent;
    padding: 5px 12px;
    font-weight: 900;
}

button.subscription-pill {
    cursor: pointer;
}

.subscription-pill.subscribed {
    color: var(--green);
    background: var(--green-soft);
    border-color: #b6e7c7;
}

.subscription-pill.unsubscribed {
    color: var(--red);
    background: var(--red-soft);
    border-color: #ffc6c6;
}

.subscription-form {
    display: grid;
    gap: 8px;
    min-width: 130px;
}

.subscription-form label span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
}

.subscription-form input {
    min-height: 34px;
    padding: 6px 10px;
    text-align: center;
}

.subscription-days {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.count {
    font-weight: 900;
}

.green-text { color: var(--green); }
.red-text { color: var(--red); }

.icon-btn,
.icon-only {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    display: inline-grid;
    place-items: center;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    padding: 0;
    font-size: 10px !important;
    font-weight: 900;
    line-height: 1 !important;
}

.icon-btn.edit { color: var(--amber); border-color: #ffd7a1; }
.icon-btn.lock { color: var(--blue); border-color: #b8d5fb; }
.icon-btn.patient { color: #009c9a; border-color: #a6e6e3; }
.icon-btn.delete,
.icon-only.danger-outline {
    color: var(--red);
    border-color: #ffc2c2;
}

.final-status {
    color: #435169;
}

.transfer-error {
    display: block;
    margin-top: 5px;
    color: var(--red);
    font-size: 12px;
    font-weight: 900;
}

.transfer-error.neutral {
    color: var(--muted);
}

.archive-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.archive-head h1 {
    margin: 0 0 8px;
    color: #0b2854;
    font-size: 38px;
}

.archive-head p {
    margin: 0;
    color: var(--muted);
}

.pdf-icon {
    display: inline-grid;
    place-items: center;
    min-width: 46px;
    min-height: 38px;
    color: var(--red);
    border: 1px solid #ffc3c3;
    border-radius: 7px;
    font-weight: 900;
}

.info-note {
    margin-top: 22px;
    padding: 16px;
    color: var(--blue);
    background: #f3f8ff;
    border: 1px solid #bad6fb;
    border-radius: 8px;
    text-align: center;
    font-weight: 800;
}

.details-page {
    min-height: 100vh;
    padding: 28px;
    background: #f6f9fd;
}

.details-panel {
    max-width: 1400px;
    margin: 0 auto;
}

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

.details-header h1 {
    margin: 0;
    color: #0a377c;
    font-size: 36px;
}

.date-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fcff;
    margin-bottom: 22px;
}

.details-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
}

.settings-panel {
    padding: 0;
    overflow: hidden;
}

.settings-title {
    text-align: center;
    padding: 28px 30px;
    border-bottom: 1px solid var(--border);
}

.settings-title h1 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 10px 26px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(180deg, #1974e6, #0f55b8);
    font-size: 30px;
}

.settings-title p {
    margin: 18px 0 0;
    color: var(--muted);
}

.settings-form {
    padding: 30px 42px;
    display: grid;
    gap: 30px;
}

.settings-form label span {
    font-size: 22px;
    color: #0b2854;
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 8px;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(5, 18, 32, 0.62);
    backdrop-filter: blur(3px);
    z-index: 4000;
}

.modal.open {
    display: grid;
}

.modal-card {
    position: relative;
    width: min(680px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 32px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.3);
}

.modal-card.wide {
    width: min(900px, 100%);
}

.mission-card {
    padding: 0 36px 36px;
}

.modal-close {
    position: absolute;
    top: 16px;
    left: 18px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    z-index: 1;
}

.modal-card:not(.mission-card) .modal-close {
    color: var(--muted);
}

.modal-header-blue {
    margin: 0 -36px 28px;
    padding: 24px 54px;
    color: #fff;
    background: linear-gradient(180deg, #1974e6, #0f55b8);
    border-radius: 10px 10px 0 0;
    text-align: center;
}

.modal-header-blue h2 {
    margin: 0;
    font-size: 30px;
}

.full-label {
    display: block;
    margin-bottom: 26px;
}

.full-label textarea {
    min-height: 230px;
    font-size: 21px;
    line-height: 1.7;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    font-size: 22px;
}

.check-line input {
    width: 28px;
    height: 28px;
    accent-color: var(--blue);
}

.modal-actions {
    justify-content: flex-end;
    margin-top: 26px;
}

.modal-actions.split {
    justify-content: space-between;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.contact-text-form {
    display: grid;
    gap: 18px;
}

.contact-text-form textarea {
    width: 100%;
    min-height: 180px;
    resize: vertical;
}

.doctor-contact-note {
    display: block;
    width: calc((100% - 33px) / 4);
    margin: 0;
    padding: 6px 8px;
    border: 1px solid #ffd596;
    border-radius: 6px;
    background: #fffaf0;
    color: #0b2854;
    text-align: center;
    white-space: pre-line;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
}

.doctor-shell .page-header {
    align-items: flex-end;
}

.doctor-shell .stats-grid.four {
    gap: 11px;
    margin-bottom: 13px;
    align-items: start;
}

.doctor-shell .stats-grid.four .stat-card {
    min-height: 58px;
    padding: 8px 11px;
    align-self: start;
}

.doctor-shell .stats-grid.four .stat-card p {
    margin-bottom: 2px;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.doctor-shell .stats-grid.four .stat-card strong {
    font-size: 17px !important;
    line-height: 1 !important;
}

.doctor-shell .stats-grid.four .stat-icon {
    left: 10px;
    width: 24px;
    height: 24px;
    font-size: 13px;
}

.pending-stat-stack {
    display: grid;
    align-self: start;
}

@media (max-width: 1180px) {
    .doctor-contact-note {
        width: calc((100% - 11px) / 2);
    }
}

@media (max-width: 860px) {
    .doctor-shell .page-header {
        align-items: stretch;
    }

    .doctor-contact-note {
        width: 100%;
    }
}

.span-2 {
    grid-column: 1 / -1;
}

.patient-page {
    min-height: 100vh;
    background:
        linear-gradient(170deg, #005fc5 0 9%, transparent 9.2%),
        radial-gradient(circle at 0 0, #82c2ff 0 18%, transparent 18.4%),
        #fff;
}

.patient-wrap {
    min-height: 100vh;
    padding: 72px 22px 40px;
}

.patient-card {
    width: min(820px, 100%);
    margin: 0 auto;
}

.patient-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 34px;
    text-align: center;
    margin-bottom: 36px;
}

.patient-hero h1 {
    margin: 0;
    color: #0e4493;
    font-size: clamp(40px, 8vw, 62px);
    line-height: 1.1;
}

.patient-hero p {
    margin: 8px 0 0;
    color: #5d6778;
    font-size: clamp(22px, 4vw, 32px);
}

.heart-logo {
    color: #1264d4;
    font-size: 78px;
    line-height: 1;
}

.patient-info-card {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 26px;
    min-height: 132px;
    padding: 24px 34px;
    margin-bottom: 20px;
    border: 1px solid #bcd6f9;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 42px rgba(17, 103, 216, 0.08);
}

.patient-info-card .circle-icon {
    order: -1;
    width: 94px;
    height: 94px;
    flex: 0 0 94px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #1264d4;
    background: #ecf5ff;
    font-size: 42px;
}

.patient-info-card h2,
.patient-info-card h3 {
    margin: 0 0 12px;
    color: #0e4493;
    font-size: clamp(27px, 5vw, 40px);
}

.patient-info-card h3 {
    font-size: clamp(24px, 4vw, 32px);
}

.patient-info-card p {
    margin: 0;
    color: #111827;
    font-size: clamp(19px, 3.5vw, 27px);
    line-height: 1.7;
}

.patient-info-card.note,
.patient-info-card.mission-note {
    border-color: #ffc87b;
    background: linear-gradient(180deg, #fff, #fff9ef);
}

.patient-info-card.note .circle-icon,
.patient-info-card.mission-note .circle-icon {
    color: #d87800;
    background: #fff1da;
}

.patient-info-card.note h3,
.patient-info-card.mission-note h3 {
    color: #d87800;
}

.patient-form {
    display: grid;
    gap: 22px;
    margin-top: 30px;
}

.patient-form label span {
    font-size: 22px;
    color: #111827;
}

.patient-form input {
    min-height: 72px;
    font-size: 21px;
    border-radius: 12px;
}

.patient-submit {
    min-height: 82px;
    border-radius: 14px;
    font-size: 34px;
}

.patient-status {
    margin-top: 26px;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #bcd6f9;
    text-align: center;
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 900;
}

.patient-status.info {
    color: #1264d4;
    background: #f0f7ff;
}

.patient-status.success {
    color: var(--green);
    background: var(--green-soft);
    border-color: #afe5c1;
}

.patient-status.danger {
    color: var(--red);
    background: var(--red-soft);
    border-color: #ffc3c3;
}

.patient-status.warning {
    color: #b56400;
    background: var(--amber-soft);
    border-color: #ffd293;
}

@media (max-width: 1180px) {
    .stats-grid.five,
    .stats-grid.four {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 860px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        border-radius: 0 0 16px 16px;
    }

    .main-area {
        padding: 22px 16px 34px;
    }

    .page-header,
    .panel-toolbar,
    .archive-head,
    .details-header,
    .details-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .stats-grid.five,
    .stats-grid.four,
    .stats-grid.three,
    .date-strip,
    .inline-form,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .button-strip,
    .toolbar-actions {
        align-items: stretch;
    }

    .button-strip > *,
    .toolbar-actions > *,
    .button-strip .btn,
    .toolbar-actions .btn {
        width: 100%;
    }

    .auth-card {
        padding: 38px 24px;
    }

    .patient-wrap {
        padding-top: 48px;
    }

    .patient-hero {
        gap: 16px;
        flex-direction: column;
    }

    .patient-info-card {
        padding: 22px;
        gap: 16px;
    }

    .patient-info-card .circle-icon {
        width: 74px;
        height: 74px;
        flex-basis: 74px;
        font-size: 32px;
    }

    .patient-submit {
        font-size: 28px;
    }
}

@media (max-width: 560px) {
    .patient-page {
        background:
            linear-gradient(170deg, #005fc5 0 7%, transparent 7.2%),
            #fff;
    }

    .patient-wrap {
        padding-inline: 14px;
    }

    .patient-info-card {
        align-items: flex-start;
        flex-direction: column;
        text-align: right;
    }

    .patient-info-card .circle-icon {
        align-self: flex-start;
    }

    .flash-stack {
        top: 10px;
        left: 10px;
        width: calc(100vw - 20px);
    }
}

.meda-auth-wrap {
    align-items: center;
}

.meda-login-card {
    width: min(1360px, 100%);
    text-align: right;
}

.meda-unified-login-card {
    width: min(760px, 100%);
}

.meda-login-card > .auth-icon,
.meda-login-card > h1,
.meda-login-card > p {
    text-align: center;
}

.meda-login-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.meda-unified-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
    margin: 0 auto;
}

.meda-login-section {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fbff;
}

.meda-login-section.active {
    border-color: #5c9df2;
    box-shadow: 0 0 0 3px rgba(17, 103, 216, 0.08);
}

.meda-login-section h2 {
    margin: 0;
    color: #0b2854;
    text-align: center;
}

.meda-login-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.meda-login-actions .btn {
    min-height: 34px;
    padding-inline: 8px;
    font-size: 12px !important;
}

.meda-forgot-panel {
    margin-top: 18px;
}

.meda-support-identity-panel h2 {
    margin: 0 0 14px;
    text-align: center;
    color: #0b2854;
    font-size: 18px;
}

.meda-support-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.meda-support-form-grid label {
    margin-bottom: 0;
}

.meda-support-form-grid select,
.meda-support-form-grid input {
    min-height: 40px;
}

.meda-page-header {
    align-items: center;
    justify-content: flex-start;
    gap: 30px;
    margin-bottom: 12px;
}

.meda-work-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.meda-work-panel,
.meda-results-panel,
.owner-meda-panel {
    padding: 14px;
}

.meda-order-form,
.meda-update-form {
    display: grid;
    gap: 8px;
}

.meda-inline-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 8px;
}

.doctor-meda-page .main-area .btn:not(.wide) {
    width: max-content;
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 6px 10px;
    font-size: 12px !important;
    line-height: 1.15 !important;
}

.doctor-meda-page .meda-work-heading h2,
.doctor-meda-page .meda-results-toolbar h2 {
    margin: 0;
    font-size: 14px;
}

.doctor-meda-page .meda-order-form label {
    gap: 3px;
}

.doctor-meda-page .meda-order-form label span,
.doctor-meda-page .meda-update-form label span {
    font-size: 12px !important;
    line-height: 1.15 !important;
}

.doctor-meda-page .meda-order-form input,
.doctor-meda-page .meda-order-form select,
.doctor-meda-page .meda-update-form select {
    min-height: 0 !important;
    height: 26px !important;
    padding: 2px 7px !important;
    border-radius: 5px;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.doctor-meda-page .meda-order-form textarea,
.doctor-meda-page .meda-update-form textarea {
    min-height: 48px !important;
    padding: 5px 7px !important;
    border-radius: 5px;
    font-size: 12px !important;
    line-height: 1.35 !important;
}

.doctor-meda-page .meda-results-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.doctor-meda-page .meda-results-toolbar h2 {
    margin-inline-end: 12px;
}

.doctor-meda-page .meda-results-search {
    width: 280px;
    max-width: 100%;
    min-height: 0 !important;
    height: 26px !important;
    padding: 2px 7px !important;
    border-radius: 5px;
    font-size: 12px !important;
}

.meda-scroll-table {
    max-height: 58vh;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
    scrollbar-color: #4e77a6 #e8eef6;
}

.meda-staff-page .meda-staff-search {
    width: 180px;
    max-width: 50vw;
    min-height: 0 !important;
    height: 24px !important;
    padding: 2px 8px !important;
    border-radius: 5px;
    font-size: 11px !important;
}

.meda-staff-search-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pharmacy-page .meda-staff-search {
    width: 234px;
    max-width: 44vw;
    height: 36px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
}

.laboratory-page .meda-results-panel,
.pharmacy-page .meda-results-panel,
.warehouse-page .meda-results-panel {
    padding: 10px;
}

.pharmacy-page .meda-results-panel {
    padding: 8px;
}

.laboratory-page .meda-scroll-table,
.pharmacy-page .meda-scroll-table,
.warehouse-page .meda-scroll-table {
    max-height: 62vh;
}

.meda-staff-page .data-table.compact {
    width: 100%;
    min-width: 880px;
    table-layout: fixed;
}

.meda-staff-page .data-table.compact th,
.meda-staff-page .data-table.compact td {
    padding: 4px 6px;
    font-size: 11px !important;
    line-height: 1.2 !important;
    vertical-align: top;
}

.meda-staff-page .data-table.compact small,
.meda-staff-page .data-table.compact textarea,
.meda-staff-page .data-table.compact select,
.meda-staff-page .data-table.compact button {
    font-size: 11px !important;
    line-height: 1.2 !important;
}

.meda-staff-page .meda-update-form {
    gap: 4px;
}

.meda-staff-page .meda-update-form textarea {
    min-height: 38px !important;
    padding: 4px 6px !important;
}

.meda-staff-page .meda-update-form select {
    height: 24px !important;
    min-height: 0 !important;
    padding: 2px 6px !important;
}

.lab-group-row,
.pharmacy-doctor-row,
.warehouse-pharmacy-row,
.pharmacy-warehouse-row {
    cursor: pointer;
}

.pharmacy-doctors-table > tbody > tr.pharmacy-doctor-row > td,
.lab-groups-table > tbody > tr.lab-group-row > td,
.warehouse-pharmacies-table > tbody > tr.warehouse-pharmacy-row > td,
.pharmacy-warehouses-master-table > tbody > tr.pharmacy-warehouse-row > td {
    background: #f1dfcc !important;
    color: #3f2818 !important;
}

.pharmacy-doctors-table > tbody > tr.pharmacy-doctor-row strong,
.lab-groups-table > tbody > tr.lab-group-row strong,
.warehouse-pharmacies-table > tbody > tr.warehouse-pharmacy-row strong,
.pharmacy-warehouses-master-table > tbody > tr.pharmacy-warehouse-row strong {
    color: #3f2818 !important;
}

.pharmacy-doctors-table > tbody > tr.pharmacy-doctor-row:hover > td,
.lab-groups-table > tbody > tr.lab-group-row:hover > td,
.warehouse-pharmacies-table > tbody > tr.warehouse-pharmacy-row:hover > td,
.pharmacy-warehouses-master-table > tbody > tr.pharmacy-warehouse-row:hover > td {
    background: #ead6bf !important;
}

.pharmacy-doctors-table > tbody > tr.pharmacy-doctor-row[aria-expanded="true"] > td,
.lab-groups-table > tbody > tr.lab-group-row[aria-expanded="true"] > td,
.warehouse-pharmacies-table > tbody > tr.warehouse-pharmacy-row[aria-expanded="true"] > td,
.pharmacy-warehouses-master-table > tbody > tr.pharmacy-warehouse-row[aria-expanded="true"] > td {
    background: #ead6bf !important;
    color: #3f2818;
    border-top-color: #c79a70;
    border-bottom-color: #c79a70;
    box-shadow: inset 0 1px 0 #c79a70, inset 0 -1px 0 #c79a70;
}

.pharmacy-doctor-row[aria-expanded="true"] strong,
.lab-group-row[aria-expanded="true"] strong,
.warehouse-pharmacy-row[aria-expanded="true"] strong,
.pharmacy-warehouse-row[aria-expanded="true"] strong {
    color: #3f2818;
}

.pharmacy-doctor-row[aria-expanded="true"]:hover > td,
.lab-group-row[aria-expanded="true"]:hover > td,
.warehouse-pharmacy-row[aria-expanded="true"]:hover > td,
.pharmacy-warehouse-row[aria-expanded="true"]:hover > td {
    background: #e4c9ad !important;
}

.pharmacy-prescriptions-table > thead th,
.warehouse-request-table > thead th,
.pharmacy-warehouse-request-table > thead th,
.lab-detail-table > thead th {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
}

.lab-group-details > td,
.pharmacy-doctor-details > td,
.warehouse-pharmacy-details > td,
.pharmacy-warehouse-details > td {
    padding: 6px !important;
    background: #f8fbff;
}

.lab-group-detail-panel,
.pharmacy-doctor-detail-panel,
.pharmacy-warehouse-detail-panel {
    border: 1px solid #d7e4f2;
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}

.warehouse-child-scroll,
.lab-child-scroll {
    max-height: 42vh;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
    border: 1px solid #d7e4f2;
    border-radius: 6px;
}

.warehouse-child-scroll .warehouse-request-table > thead th,
.warehouse-child-scroll .pharmacy-prescriptions-table > thead th,
.warehouse-child-scroll .pharmacy-warehouse-request-table > thead th,
.lab-child-scroll .lab-detail-table > thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
}

.pharmacy-prescriptions-table,
.warehouse-request-table,
.pharmacy-warehouse-request-table,
.lab-detail-table {
    table-layout: auto !important;
}

.pharmacy-doctors-table,
.warehouse-pharmacies-table,
.lab-groups-table {
    min-width: 680px !important;
}

.pharmacy-prescriptions-table {
    min-width: 760px !important;
}

.pharmacy-warehouse-request-table {
    min-width: 640px !important;
}

.pharmacy-warehouses-master-table {
    min-width: 680px !important;
}

.warehouse-request-table {
    min-width: 640px !important;
}

.lab-detail-table {
    min-width: 760px !important;
}

.pharmacy-page .pharmacy-doctors-table > thead th,
.pharmacy-page .pharmacy-warehouses-master-table > thead th,
.warehouse-page .warehouse-pharmacies-table > thead th,
.laboratory-page .lab-groups-table > thead th {
    color: #fff;
    background: #2d80c9;
    border-color: #2a72b2;
}

.pharmacy-page .pharmacy-prescriptions-table > thead th,
.warehouse-page .warehouse-request-table > thead th,
.laboratory-page .lab-detail-table > thead th {
    color: #0b2854;
    background: #eaf4ff;
    border-color: #c7dcf4;
}

.pharmacy-doctors-table col.col-seq,
.pharmacy-warehouses-master-table col.col-seq,
.warehouse-pharmacies-table col.col-seq,
.lab-groups-table col.col-seq,
.pharmacy-prescriptions-table col.col-seq,
.warehouse-request-table col.col-seq,
.pharmacy-warehouse-request-table col.col-seq,
.lab-detail-table col.col-seq {
    width: 42px;
}

.pharmacy-doctors-table col.col-doctor,
.lab-groups-table col.col-doctor {
    width: 220px;
}

.pharmacy-doctors-table col.col-specialty,
.lab-groups-table col.col-specialty {
    width: 160px;
}

.pharmacy-doctors-table col.col-address,
.lab-groups-table col.col-address,
.warehouse-pharmacies-table col.col-address {
    width: auto;
}

.warehouse-pharmacies-table col.col-date,
.pharmacy-warehouses-master-table col.col-date,
.lab-detail-table col.col-date {
    width: 78px;
}

.pharmacy-prescriptions-table col.col-date {
    width: 70px;
}

.pharmacy-prescriptions-table col.col-patient,
.lab-detail-table col.col-patient {
    width: 112px;
}

.pharmacy-prescriptions-table col.col-prescription {
    width: 32%;
}

.pharmacy-prescriptions-table col.col-status-response,
.pharmacy-warehouse-request-table col.col-status-response {
    width: 112px;
}

.pharmacy-prescriptions-table col.col-decision {
    width: 58px;
}

.pharmacy-prescriptions-table col.col-procedure,
.pharmacy-warehouse-request-table col.col-procedure {
    width: 124px;
}

.warehouse-pharmacies-table col.col-pharmacy,
.pharmacy-warehouses-master-table col.col-warehouse {
    width: 170px;
}

.pharmacy-warehouse-request-table col.col-request {
    width: 34%;
}

.warehouse-request-table col.col-request {
    width: 34%;
}

.warehouse-request-table col.col-sent-time,
.pharmacy-warehouse-request-table col.col-sent-time {
    width: 98px;
}

.warehouse-request-table col.col-status-response {
    width: 112px;
}

.warehouse-request-table col.col-procedure {
    width: 124px;
}

.lab-detail-table col.col-time {
    width: 72px;
}

.lab-detail-table col.col-received-time {
    width: 78px;
}

.lab-detail-table col.col-age {
    width: 70px;
}

.lab-detail-table col.col-tests {
    width: auto;
}

.lab-detail-table col.col-status {
    width: 95px;
}

.pharmacy-prescriptions-table td,
.warehouse-request-table td,
.pharmacy-warehouse-request-table td,
.warehouse-pharmacies-table td,
.lab-detail-table td {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}

.pharmacy-prescriptions-table td:nth-child(3),
.warehouse-pharmacies-table td:nth-child(2),
.pharmacy-warehouses-master-table td:nth-child(2),
.lab-detail-table td:nth-child(4) {
    overflow: hidden;
    text-overflow: ellipsis;
}

.pharmacy-prescriptions-table th:first-child,
.pharmacy-prescriptions-table td:first-child,
.warehouse-request-table th:first-child,
.warehouse-request-table td:first-child,
.pharmacy-warehouse-request-table th:first-child,
.pharmacy-warehouse-request-table td:first-child {
    text-align: center;
}

.warehouse-request-table .datetime-cell,
.pharmacy-prescriptions-table .datetime-cell,
.pharmacy-warehouse-request-table .datetime-cell {
    white-space: nowrap;
}

.pharmacy-prescriptions-table .meda-text-cell,
.warehouse-request-table .meda-text-cell,
.pharmacy-warehouse-request-table .meda-text-cell,
.lab-detail-table .meda-text-cell {
    min-width: 0;
    max-width: none;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.35 !important;
}

.pharmacy-prescriptions-table .readonly-response,
.warehouse-request-table .readonly-response,
.pharmacy-warehouse-request-table .readonly-response {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.pharmacy-prescriptions-table .compact-response,
.warehouse-request-table .compact-response,
.pharmacy-warehouse-request-table .compact-response {
    min-height: 0;
    margin-bottom: 1px;
    padding: 3px 5px;
    line-height: 1.2 !important;
}

.sent-badge-tiny {
    display: inline-flex;
    margin-top: 1px;
    padding: 1px 3px;
    font-size: 6px !important;
    line-height: 1 !important;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid #b9cbe2;
    border-radius: 999px;
    background: #f4f8ff;
    color: #173f68;
    cursor: pointer;
}

.lab-status-in_progress {
    background: #fff7e6;
    border-color: #f2c46d;
    color: #8a5700;
}

.lab-status-completed {
    background: #eefaf1;
    border-color: #9fd5ad;
    color: #1d6b35;
}

.lab-status-sent {
    background: #eaf2ff;
    border-color: #9bbdf2;
    color: #1d4f91;
}

.lab-report-modal-card {
    position: relative;
    max-height: 92vh;
    overflow: auto;
}

.lab-report-modal-card > .modal-close {
    position: sticky;
    top: 8px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: auto;
    margin-bottom: -36px;
    margin-left: 0;
    border: 1px solid #cfe0f1;
    border-radius: 50%;
    color: #0b2854 !important;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 6px 16px rgba(25, 79, 130, 0.18);
}

.doctor-patient-record-page .lab-results-modal .doctor-lab-result-actions {
    display: none;
}

.lab-report-header {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2d80c9;
}

.lab-report-header div {
    border: 1px solid #d7e4f2;
    border-radius: 6px;
    padding: 8px;
    background: #f8fbff;
}

.lab-report-header span,
.lab-report-header strong,
.lab-report-header small {
    display: block;
}

.lab-report-greeting {
    margin: 10px 0;
    font-weight: 700;
}

.lab-report-body p {
    margin: 6px 0;
}

.lab-report-body pre {
    margin: 4px 0 8px;
    padding: 8px;
    border: 1px solid #d7e4f2;
    border-radius: 6px;
    background: #fff;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: inherit;
}

.lab-report-editor {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.lab-report-inline-editor {
    display: block;
    margin-top: 0;
}

.lab-result-textarea {
    width: 100%;
    min-height: 150px;
    margin: 0;
    padding: 12px;
    border: 1px solid #d7e4f2;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: inherit;
    line-height: 1.8;
    resize: vertical;
}

.lab-result-textarea::placeholder {
    color: #9aa6b2;
    opacity: 1;
}

.lab-report-button-row {
    display: flex;
    align-items: center;
    gap: 30px;
}

.print-source-hidden {
    display: none !important;
}

.lab-print-page,
.medical-a4-print-page {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(100%, 794px);
    margin: 0 auto;
    padding: 60px;
    color: #111827;
    background: #fff;
}

.lab-print-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
    align-items: center;
    gap: 28px;
    padding-bottom: 14px;
    border-bottom: 1.5px solid #8aa8c7;
}

.lab-print-identity {
    display: grid;
    gap: 4px;
    min-width: 0;
    font-size: 13px;
    line-height: 1.7;
}

.lab-print-identity.left {
    justify-self: start;
    text-align: right;
}

.lab-print-identity.right {
    justify-self: end;
    text-align: right;
}

.lab-print-identity b,
.lab-print-identity strong {
    font-weight: 800;
}

.lab-print-logo {
    min-width: 0;
    height: 96px;
    display: grid;
    place-items: center;
}

.lab-print-logo img {
    max-width: 120px;
    max-height: 92px;
    object-fit: contain;
}

.lab-print-logo span,
.generic-medical-logo {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border: 2px solid #1d4f91;
    border-radius: 50%;
    color: #1d4f91;
    font-weight: 900;
    font-size: 42px;
    line-height: 1;
    background: #eef7ff;
}

.lab-print-meta-row {
    display: grid;
    grid-template-columns: 1.6fr 0.8fr 1fr 0.8fr;
    align-items: center;
    gap: 14px;
    padding-top: 6px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.7;
}

.lab-print-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: min(300px, 22vw);
    line-height: 1.7;
    flex-wrap: wrap;
}

.lab-print-title {
    margin: 20px 0 8px;
    text-align: center;
    color: #111827;
    font-size: 22px;
    line-height: 1.25;
}

.lab-print-greeting {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.7;
}

.lab-print-content-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.lab-print-body {
    flex: 1;
}

.lab-print-body.single pre {
    min-height: 430px;
    border: 0;
    padding: 0 4px;
}

.lab-print-content-row .lab-print-section {
    min-width: 0;
}

.lab-print-section h3 {
    margin: 0 0 8px;
    color: #0b2854;
}

.lab-print-section pre {
    margin: 0;
    padding: 10px;
    border: 1px solid #d7e4f2;
    border-radius: 6px;
    background: #fff;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: inherit;
    line-height: 1.8;
}

.lab-print-content-row .lab-print-section pre,
.lab-print-content-row .lab-result-textarea {
    min-height: 190px;
}

.legacy-lab-note {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.lab-print-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: space-between;
    gap: 40px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1.5px solid #8aa8c7;
    font-weight: 800;
}

.lab-print-footer-column {
    display: grid;
    gap: 5px;
    min-width: 0;
    font-size: 13px;
    line-height: 1.65;
}

.medical-print-root {
    position: fixed;
    top: 0;
    left: -10000px;
    z-index: -1;
    width: 210mm;
    min-height: 297mm;
    overflow: hidden;
    color: #111827;
    background: #fff;
    direction: rtl;
    opacity: 0;
    pointer-events: none;
}

.medical-print-root .print-page-host {
    box-sizing: border-box;
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 25mm 13mm 18mm;
    background: #fff;
}

.medical-print-root .print-page-host > .lab-print-page,
.medical-print-root .print-page-host > .medical-a4-print-page {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    min-height: 254mm;
    margin: 0;
    padding: 0;
    background: #fff;
    box-shadow: none;
}

.medical-print-root .print-source-hidden {
    display: flex !important;
}

.medical-print-root .screen-only,
.medical-print-root .modal-actions,
.medical-print-root .modal-close,
.medical-print-root button {
    display: none !important;
}

.medical-print-root .lab-print-header {
    grid-template-columns: minmax(0, 1fr) 34mm minmax(0, 1fr);
    gap: 18mm;
    padding-bottom: 5mm;
    border-bottom: 1px solid #8aa8c7;
    direction: ltr;
}

.medical-print-root .lab-print-identity {
    direction: rtl;
    gap: 1.5mm;
    width: max-content;
    max-width: 64mm;
    font-size: 11pt;
    line-height: 1.65;
}

.medical-print-root .lab-print-identity.right {
    grid-column: 3;
    grid-row: 1;
    justify-self: right;
}

.medical-print-root .lab-print-identity.left {
    grid-column: 1;
    grid-row: 1;
    justify-self: left;
}

.medical-print-root .lab-print-logo {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    height: 28mm;
}

.medical-print-root .lab-print-logo img {
    max-width: 32mm;
    max-height: 26mm;
}

.medical-print-root .lab-print-logo span,
.medical-print-root .generic-medical-logo {
    width: 24mm;
    height: 24mm;
    border-width: 1.5px;
    font-size: 30pt;
}

.medical-print-root .lab-print-meta-row {
    grid-template-columns: 1.6fr 0.8fr 1fr 0.8fr;
    gap: 5mm;
    padding-top: 2mm;
    font-size: 11pt;
    line-height: 1.7;
}

.medical-print-root .lab-print-title {
    margin: 8mm 0 2mm;
    font-size: 18pt;
}

.medical-print-root .lab-print-greeting {
    margin: 0 0 2mm;
    font-size: 12pt;
    line-height: 1.7;
}

.medical-print-root .lab-print-content-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6mm;
}

.medical-print-root .lab-results-only-print {
    grid-template-columns: minmax(0, 1fr);
}

.medical-print-root .lab-requested-tests-print-section {
    display: none !important;
}

.medical-print-root .lab-print-section h3 {
    margin: 0 0 2mm;
    font-size: 12pt;
}

.medical-print-root pre {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: inherit;
    font-size: 11pt;
    line-height: 1.85;
}

.medical-print-root .lab-print-section pre {
    min-height: 52mm;
    padding: 3mm;
    border: 1px solid #d7e4f2;
    border-radius: 1.5mm;
}

.medical-print-root .lab-print-body {
    flex: 1;
}

.medical-print-root .lab-print-body.single pre {
    min-height: 116mm;
    padding: 0 1mm;
    border: 0;
}

.medical-print-root .lab-result-textarea {
    min-height: 52mm;
    padding: 3mm;
    border: 1px solid #d7e4f2;
    font-family: inherit;
    white-space: pre-wrap;
}

.medical-print-root .lab-print-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14mm;
    width: calc(100% + 10mm);
    margin-inline: -5mm;
    margin-top: auto;
    padding-top: 4mm;
    border-top: 1px solid #8aa8c7;
    direction: ltr;
}

.medical-print-root .lab-print-footer-column {
    direction: rtl;
    gap: 1.5mm;
    width: max-content;
    max-width: 76mm;
    font-size: 11pt;
    line-height: 1.65;
}

.medical-print-root .lab-print-footer-column:first-child {
    grid-column: 2;
    grid-row: 1;
    justify-self: right;
    text-align: right;
}

.medical-print-root .lab-print-footer-column:last-child {
    grid-column: 1;
    grid-row: 1;
    justify-self: left;
    text-align: right;
}

.readonly-response {
    display: block;
    min-height: 28px;
    margin-bottom: 5px;
    padding: 5px 7px;
    border: 1px solid #d7e4f2;
    border-radius: 6px;
    background: #f8fbff;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.procedure-history-cell {
    min-width: 0;
    white-space: normal;
}

.procedure-history-cell div {
    margin: 0 0 1px;
}

.warehouse-request-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(220px, 2fr) auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 10px;
}

.pharmacy-page .warehouse-request-form {
    grid-template-columns: 132px 300px 68px auto;
    gap: 6px;
    margin-bottom: 7px;
}

.pharmacy-page .warehouse-request-form label {
    margin: 0;
}

.pharmacy-page .warehouse-select-field select {
    width: 100%;
}

.pharmacy-page .warehouse-message-field textarea {
    width: 100%;
}

.pharmacy-page .send-warehouse-button {
    width: 68px;
    min-width: 68px;
    min-height: 24px !important;
    padding: 3px 5px !important;
    padding-inline: 6px !important;
    font-size: 9px !important;
}

.warehouse-request-form .span-2 {
    grid-column: span 2;
}

.warehouse-request-form textarea,
.warehouse-request-form select {
    min-height: 30px;
    font-size: 11px !important;
}

.pharmacy-page .pharmacy-warehouse-request-table th,
.pharmacy-page .pharmacy-warehouse-request-table td {
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    line-height: 1.08 !important;
}

.warehouse-message-form textarea {
    height: 30px;
    min-height: 30px !important;
    max-height: 96px;
    overflow-y: hidden;
    resize: vertical;
}

.warehouse-message-form label {
    display: grid;
    align-content: start;
    gap: 4px;
    margin: 0;
}

.warehouse-message-form label > span {
    min-height: 14px;
    line-height: 14px !important;
}

.warehouse-message-form select,
.warehouse-message-form textarea {
    height: 30px !important;
}

.collapsible-panel-heading {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #c7dcf4;
    border-radius: 7px;
    padding: 6px 10px;
    color: #0b2854;
    background: #eaf4ff;
    cursor: pointer;
    font-weight: 900;
    text-align: right;
}

.collapsible-panel-heading:hover {
    background: #dff0ff;
}

.collapsible-indicator {
    width: 22px;
    flex: 0 0 22px;
    display: inline-grid;
    place-items: center;
    color: #1d4f91;
    transition: transform 0.16s ease;
}

.collapsible-panel-heading[aria-expanded="true"] .collapsible-indicator {
    transform: rotate(180deg);
}

.collapsible-panel-content {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.unread-row {
    background: #fff5f5;
}

.unread-name {
    color: var(--red);
}

.attention-button,
.attention-button:hover {
    color: #fff !important;
    background: var(--red) !important;
    border-color: var(--red) !important;
}

.disabled-field {
    color: #6b7280;
    background: #eef2f7;
    cursor: not-allowed;
}

.owner-lab-logo-thumb {
    max-width: 42px;
    max-height: 28px;
    object-fit: contain;
}

.meda-notice {
    margin-bottom: 10px;
}

.meda-scroll-table thead th,
.owner-meda-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

.meda-scroll-table::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.meda-scroll-table::-webkit-scrollbar-track {
    background: #e8eef6;
}

.meda-scroll-table::-webkit-scrollbar-thumb {
    border: 3px solid #e8eef6;
    border-radius: 10px;
    background: #4e77a6;
}

.doctor-meda-page .meda-scroll-table .data-table.compact {
    width: 100%;
    min-width: max-content;
    table-layout: auto;
}

.doctor-meda-page .meda-scroll-table thead th {
    padding: 7px 8px;
    border-bottom-color: #9fb5cc;
    border-left-color: #b8c9dc;
    box-shadow: 0 1px 0 #d9e4f1;
    font-size: 12px !important;
    line-height: 1.25 !important;
    white-space: nowrap;
}

.doctor-meda-page .meda-scroll-table tbody td {
    padding: 5px 8px;
    border-bottom-color: #b8c9dc;
    border-left-color: #c4d2e1;
    white-space: nowrap;
    font-size: 12px !important;
}

.doctor-meda-page .meda-scroll-table tbody td,
.doctor-meda-page .meda-scroll-table tbody td * {
    line-height: 1.25 !important;
}

.meda-text-cell {
    min-width: 220px;
    max-width: 340px;
    white-space: pre-line;
    text-align: right;
}

.meda-decision-form {
    display: grid;
    gap: 5px;
    min-width: 150px;
}

.doctor-meda-page .meda-decision-form select {
    min-height: 0 !important;
    height: 24px !important;
    padding: 2px 6px !important;
    border-radius: 4px;
    font-size: 12px !important;
}

.meda-management-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.meda-management-form .span-2 {
    grid-column: span 2;
}

.owner-meda-management-page .main-area {
    overflow: hidden;
}

.owner-meda-table-panel {
    margin-bottom: 0;
}

.owner-meda-table-wrap {
    overflow: auto;
    scrollbar-gutter: stable both-edges;
    scrollbar-color: #4e77a6 #e8eef6;
}

.owner-meda-table-wrap::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.owner-meda-table-wrap::-webkit-scrollbar-track {
    background: #e8eef6;
}

.owner-meda-table-wrap::-webkit-scrollbar-thumb {
    border: 3px solid #e8eef6;
    border-radius: 10px;
    background: #4e77a6;
}

.owner-meda-table {
    min-width: 1040px;
}

.meda-update-form textarea,
.meda-update-form select {
    min-height: 34px;
    padding: 7px 9px;
}

@media (max-width: 1220px) {
    .meda-login-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .meda-login-grid,
    .meda-support-form-grid,
    .meda-work-grid,
    .meda-management-form,
    .meda-inline-fields,
    .warehouse-request-form,
    .review-meda-actions,
    .lab-report-header {
        grid-template-columns: 1fr;
    }

    .meda-management-form .span-2,
    .warehouse-request-form .span-2 {
        grid-column: auto;
    }
}

/* Requested global typography scale */
body,
button,
input,
textarea,
select {
    font-family: "SimplifiedArabicApp", "Simplified Arabic", Tahoma, Arial, sans-serif !important;
    font-weight: 700 !important;
}

h1,
.page-header h1,
.archive-head h1,
.details-header h1,
.settings-title h1,
.patient-hero h1,
.auth-card h1 {
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;
}

h2,
h3,
.panel h2,
.modal-card h2,
.patient-info-card h2,
.patient-info-card h3,
.settings-form label span,
.side-nav a,
.side-nav button,
.btn,
.patient-status,
.data-table th,
.stat-card p,
.stat-card strong,
.auth-card p,
.page-header p,
.panel-toolbar,
.panel-toolbar p {
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;
}

body,
p,
small,
label small,
input,
textarea,
.data-table td,
.data-table td *,
.badge,
.muted,
.muted-link,
.patient-info-card p,
.owner-profile,
.doctor-card,
.inline-error,
.alert {
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
}

.data-table th,
.data-table th * {
    font-size: 14px !important;
    font-weight: 700 !important;
}

.data-table td,
.data-table td * {
    font-size: 12px !important;
    font-weight: 700 !important;
}

.sidebar,
.sidebar h2,
.sidebar p,
.doctor-card,
.doctor-card strong,
.doctor-card small,
.side-nav a,
.side-nav button,
.logout-form button,
.subscription-countdown {
    font-size: 13px !important;
    line-height: 1.35 !important;
}

input,
textarea,
select {
    min-height: 42px;
}

button:disabled,
input:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.blocked-doctor-alert {
    margin-bottom: 22px;
    padding: 18px 20px;
    border: 2px solid var(--red);
    border-radius: 8px;
    color: var(--red);
    background: var(--red-soft);
    text-align: center;
    font-family: "SimplifiedArabicApp", "Simplified Arabic", Tahoma, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.public-doctors-wrap {
    min-height: 100vh;
    padding: 28px;
    background: #f6f9fd;
}

.public-doctors-wrap .panel {
    max-width: 1200px;
    margin: 0 auto;
}

.public-doctors-table {
    min-width: 980px;
}

.my-bookings-button {
    min-width: 130px;
    background: #fff;
}

.my-bookings-modal {
    width: min(1050px, 100%);
}

.my-bookings-header {
    margin-bottom: 18px;
    padding-inline-end: 44px;
}

.my-bookings-header h2 {
    margin: 0 0 6px;
    color: #0b2854;
    font-size: 30px;
}

.my-bookings-header p {
    margin: 0;
    color: var(--muted);
}

.my-bookings-table {
    min-width: 780px;
}

.my-bookings-delete {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #f1c7c7;
    border-radius: 12px;
    background: #fff8f8;
}

.my-bookings-delete label {
    display: grid;
    gap: 7px;
    color: #26364a;
    font-weight: 700;
}

.my-bookings-delete input {
    width: 100%;
}

.my-bookings-delete small {
    grid-column: 1 / -1;
    color: var(--muted);
    line-height: 1.7;
}

.booking-public-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
}

.booking-public-status.approved {
    color: var(--green);
    background: var(--green-soft);
    border-color: #b6e7c7;
}

.booking-public-status.rejected {
    color: var(--red);
    background: var(--red-soft);
    border-color: #ffc6c6;
}

.booking-public-status.pending {
    color: #8a5a00;
    background: #fff4d6;
    border-color: #f3d58a;
}

.booking-time-card {
    border-color: #9fd8bf;
    background: linear-gradient(180deg, #fff, #f3fff9);
}

.booking-time-card .circle-icon {
    color: #087c55;
    background: #def7eb;
}

.booking-time-card h3 {
    color: #087c55;
}

.booking-time-range {
    font-weight: 800;
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

@media (max-width: 640px) {
    .my-bookings-delete {
        grid-template-columns: 1fr;
    }

    .my-bookings-delete .btn {
        width: 100%;
    }
}

.doctor-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    min-height: 30px;
    border-radius: 7px;
    border: 1px solid transparent;
    font-size: 16px;
    font-weight: 700;
}

.doctor-status.here {
    color: var(--green);
    background: var(--green-soft);
    border-color: #b6e7c7;
}

.doctor-status.away {
    color: var(--red);
    background: var(--red-soft);
    border-color: #ffc6c6;
}

.doctor-status.unavailable {
    color: var(--red);
    background: var(--red-soft);
    border-color: #ffc6c6;
}

.totp-auth-wrap {
    padding-block: 32px;
}

.totp-setup-card,
.recovery-card {
    width: min(100%, 560px);
}

.totp-qr-box {
    display: flex;
    justify-content: center;
    margin: 18px 0;
}

.totp-qr-box img {
    width: min(264px, 100%);
    height: auto;
    border: 10px solid #fff;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(16, 51, 88, 0.14);
}

.totp-manual-box {
    margin: 14px 0 20px;
    padding: 12px;
    border: 1px solid #d7e2ef;
    border-radius: 10px;
    background: #f7faff;
}

.totp-manual-box summary {
    cursor: pointer;
    font-weight: 700;
}

.totp-manual-box code {
    display: block;
    margin-top: 12px;
    padding: 10px;
    overflow-wrap: anywhere;
    color: #123b65;
    background: #fff;
}

.recovery-code-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.recovery-code-grid code {
    padding: 10px 8px;
    border: 1px solid #ccd9e8;
    border-radius: 8px;
    color: #153d68;
    background: #f7faff;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
}

.security-note {
    display: block;
    margin-top: 14px;
    color: #6a7788;
    text-align: center;
}

.login-card > form:first-of-type {
    display: block;
}

.login-secondary-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.login-secondary-actions.two-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.login-secondary-actions form,
.login-secondary-actions .btn {
    width: 100%;
    margin: 0;
}

.forgot-code-panel {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #cbdced;
    border-radius: 12px;
    background: #f7fbff;
}

.forgot-code-panel[hidden] {
    display: none;
}

.forgot-code-panel label {
    margin-bottom: 14px;
}

.credential-reset-card {
    max-width: 600px;
}

.credential-reset-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.support-request-confirmation {
    display: grid;
    justify-items: center;
    gap: 18px;
    padding: 28px 10px 10px;
    text-align: center;
}

.support-request-confirmation h2 {
    margin: 0;
    color: #123b65;
}

.support-request-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    color: #fff;
    background: var(--green);
    font-size: 38px;
    font-weight: 900;
}

.compact-modal {
    width: min(470px, 100%);
}

.nav-count-badge {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    margin-inline-start: auto;
    padding: 0 7px;
    border-radius: 999px;
    color: #fff;
    background: #dc2626;
    font-size: 13px;
}

.support-requests-table {
    min-width: 1280px;
}

.support-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.support-actions form {
    margin: 0;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

@media (max-width: 520px) {
    .meda-login-actions {
        grid-template-columns: 1fr;
    }

    .recovery-code-grid {
        grid-template-columns: 1fr;
    }

    .login-secondary-actions.two-buttons,
    .credential-reset-actions {
        grid-template-columns: 1fr;
    }
}

.settings-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 860px) {
    .settings-mini-grid {
        grid-template-columns: 1fr;
    }
}

/* Patient account gateway and medical record */
.patient-portal-auth {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 15%, rgba(45, 150, 255, 0.22), transparent 30%),
        radial-gradient(circle at 88% 86%, rgba(22, 163, 116, 0.18), transparent 28%),
        linear-gradient(135deg, #f8fbff 0%, #edf6ff 50%, #f2fbf7 100%);
}

.patient-auth-shell {
    display: grid;
    grid-template-columns: minmax(330px, 0.9fr) minmax(420px, 1.1fr);
    width: min(1120px, calc(100% - 36px));
    min-height: 650px;
    margin: 40px auto;
    overflow: hidden;
    border: 1px solid rgba(195, 216, 239, 0.9);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 30px 80px rgba(23, 62, 108, 0.16);
}

.patient-auth-intro {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(38px, 6vw, 72px);
    overflow: hidden;
    color: #fff;
    background: linear-gradient(145deg, #082d55 0%, #0d5ba9 58%, #12826c 120%);
}

.patient-auth-intro::after {
    content: "";
    position: absolute;
    inset: auto -85px -110px auto;
    width: 300px;
    height: 300px;
    border: 42px solid rgba(255, 255, 255, 0.07);
    border-radius: 50%;
}

.patient-auth-brand {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 28px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.13);
    font-size: 42px;
    backdrop-filter: blur(8px);
}

.patient-auth-kicker {
    display: inline-block;
    margin-bottom: 7px;
    color: #1781e3;
    font-size: 15px;
    font-weight: 800;
}

.patient-auth-intro .patient-auth-kicker {
    color: #a9dcff;
}

.patient-auth-intro h1 {
    margin: 0 0 16px;
    font-size: clamp(34px, 4.4vw, 52px);
    line-height: 1.22;
}

.patient-auth-intro > p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 19px;
    line-height: 1.9;
}

.patient-auth-features {
    display: grid;
    gap: 12px;
    margin-top: 36px;
}

.patient-auth-features div {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.94);
    font-weight: 700;
}

.patient-auth-features span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #08335d;
    background: #d9f5e9;
    font-size: 14px;
}

.patient-auth-card {
    align-self: center;
    padding: clamp(32px, 5vw, 64px);
}

.patient-auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 28px;
    padding: 5px;
    border-radius: 13px;
    background: #eef4fb;
}

.patient-auth-tab {
    min-height: 46px;
    border: 0;
    border-radius: 9px;
    color: #5a6d86;
    background: transparent;
    cursor: pointer;
    font-weight: 800;
}

.patient-auth-tab.active {
    color: #0d61bd;
    background: #fff;
    box-shadow: 0 5px 18px rgba(22, 68, 119, 0.11);
}

.patient-auth-panel > h2 {
    margin: 0 0 5px;
    font-size: 27px;
}

.patient-auth-panel > p {
    margin: 0 0 24px;
    color: var(--muted);
}

.patient-auth-form {
    display: grid;
    gap: 18px;
}

.patient-register-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.patient-register-grid .span-2 {
    grid-column: 1 / -1;
}

.patient-auth-submit {
    min-height: 50px;
    margin-top: 4px;
}

.patient-guest-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 25px 0 18px;
    color: #8492a6;
}

.patient-guest-divider::before,
.patient-guest-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #dce6f2;
}

.patient-guest-form {
    text-align: center;
}

.patient-guest-form small {
    display: block;
    margin-top: 11px;
    color: var(--muted);
    line-height: 1.65;
}

.patient-portal-wrap {
    width: min(1180px, calc(100% - 34px));
    margin: 34px auto 60px;
}

.patient-portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(24px, 4vw, 42px);
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(125deg, #082d55, #1068bd 64%, #16846b);
    box-shadow: 0 18px 44px rgba(14, 75, 134, 0.2);
}

.patient-portal-header .patient-auth-kicker {
    color: #b9e2ff;
}

.patient-portal-header h1 {
    margin: 2px 0 5px;
    font-size: clamp(29px, 4vw, 42px);
}

.patient-portal-header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.83);
    font-size: 17px;
}

.patient-portal-actions,
.public-doctors-actions,
.patient-page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.patient-portal-actions form,
.public-doctors-actions form,
.patient-page-actions form {
    margin: 0;
}

.patient-portal-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 22px 0;
}

.patient-portal-stats article {
    display: grid;
    gap: 2px;
    min-height: 118px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(21, 61, 107, 0.07);
}

.patient-portal-stats span,
.patient-portal-stats b {
    color: var(--muted);
    font-size: 14px;
}

.patient-portal-stats strong {
    color: #0a5caf;
    font-size: 31px;
}

.patient-portal-section {
    margin-top: 22px;
    padding: clamp(20px, 3.5vw, 32px);
    border: 1px solid var(--border);
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 9px 30px rgba(22, 62, 106, 0.07);
}

.patient-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.patient-section-heading h2 {
    margin: 0 0 4px;
    color: #0b3f72;
}

.patient-section-heading p {
    margin: 0;
    color: var(--muted);
}

.patient-account-bookings {
    min-width: 760px;
}

.patient-review-table {
    min-width: 780px;
}

.patient-review-table th:first-child,
.patient-review-table td:first-child {
    width: 88px;
    text-align: center;
}

.patient-review-table-row {
    cursor: pointer;
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.patient-review-table-row:hover,
.patient-review-table-row:focus-visible {
    outline: none;
    background: #eef7ff;
    box-shadow: inset -4px 0 #1974c7;
}

.patient-review-table-row:active {
    background: #dfedfa;
}

.patient-review-modal-card {
    width: min(980px, 100%);
    padding: 0;
    overflow: hidden auto;
    border-radius: 17px;
}

.patient-review-modal-card .patient-review-card {
    border: 0;
    border-radius: 0;
}

.patient-review-modal-card .modal-close {
    color: #fff !important;
    background: rgba(4, 34, 61, 0.38);
}

.patient-review-modal-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 22px 22px;
}

.patient-review-list {
    display: grid;
    gap: 22px;
}

.patient-review-card {
    overflow: hidden;
    border: 1px solid #d7e5f3;
    border-radius: 17px;
    background: #fcfdff;
}

.patient-review-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 24px;
    color: #fff;
    background: linear-gradient(115deg, #0a477e, #146fbd);
}

.patient-review-card > header h3 {
    margin: 2px 0 0;
    font-size: 22px;
}

.review-number {
    color: #bfe3ff;
    font-size: 13px;
    font-weight: 700;
}

.review-doctor {
    display: grid;
    text-align: left;
}

.review-doctor small {
    color: rgba(255, 255, 255, 0.78);
}

.review-content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 22px;
}

.review-content-grid section {
    min-height: 130px;
    padding: 18px;
    border: 1px solid #dde8f4;
    border-radius: 13px;
    background: #fff;
}

.review-content-grid .prescription-text {
    border-color: #bae5cd;
    background: #f5fff9;
}

.review-content-grid h4,
.review-file-heading h4 {
    margin: 0;
    color: #0b477d;
}

.review-content-grid p {
    margin: 10px 0 0;
    white-space: pre-wrap;
    line-height: 1.85;
}

.review-file-section {
    margin: 0 22px 22px;
    padding: 18px;
    border: 1px solid #dbe7f3;
    border-radius: 14px;
    background: #fff;
}

.review-file-section.lab-section {
    border-color: #d7d1f5;
    background: #fbfaff;
}

.review-file-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.review-file-heading span {
    padding: 3px 10px;
    border-radius: 999px;
    color: #1761a8;
    background: #eaf4ff;
    font-size: 13px;
    font-weight: 700;
}

.medical-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.medical-image-grid > a {
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid #d8e4f0;
    border-radius: 11px;
    background: #f3f7fb;
}

.medical-image-grid img {
    display: block;
    width: 100%;
    height: 125px;
    object-fit: cover;
    transition: transform 0.2s;
}

.medical-image-grid a:hover img {
    transform: scale(1.03);
}

.medical-image-grid small {
    display: block;
    padding: 6px 8px;
    color: #53677f;
    text-align: center;
}

.medical-upload-form {
    margin: 0;
}

.medical-upload-form label {
    position: relative;
    overflow: hidden;
}

.medical-upload-form input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.medical-upload-form.is-uploading label {
    pointer-events: none;
    opacity: 0.65;
}

.patient-empty-reviews {
    display: grid;
    justify-items: center;
    padding: 48px 20px;
    border: 1px dashed #cbdbea;
    border-radius: 15px;
    color: var(--muted);
    text-align: center;
    background: #f9fbfe;
}

.patient-empty-reviews span {
    font-size: 45px;
}

.patient-empty-reviews h3 {
    margin: 10px 0 0;
    color: #154d7d;
}

.patient-empty-reviews p {
    margin: 5px 0 0;
}

.doctor-patient-header {
    align-items: center;
}

.doctor-patient-identity {
    display: grid;
    grid-template-columns: 2fr 1fr 1.3fr;
    gap: 14px;
    margin-bottom: 16px;
    padding: 18px 20px;
    border: 1px solid #dce7f3;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(35, 76, 119, 0.06);
}

.doctor-patient-identity div {
    display: grid;
    gap: 5px;
}

.doctor-patient-identity span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.doctor-patient-identity strong {
    color: #173f68;
    font-size: 17px;
}

.doctor-patient-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    position: sticky;
    top: 118px;
    z-index: 24;
    padding-block: 5px;
    background: #f4f9ff;
}

.doctor-review-create,
.doctor-record-bookings {
    margin-bottom: 22px;
}

.review-editor {
    display: grid;
    gap: 18px;
}

.review-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.review-editor-grid-compact {
    gap: 8px 10px;
}

.review-editor-grid-compact textarea {
    min-height: 66px;
}

.review-create-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.doctor-patient-actions .btn,
.doctor-review-create-save,
.doctor-review-save-button,
.doctor-review-print-button {
    min-height: 34px;
    width: auto;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.doctor-review-heading-inline {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.doctor-review-heading-inline h2 {
    margin: 0;
}

.doctor-review-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.review-editor-grid .span-2 {
    grid-column: 1 / -1;
}

.doctor-review-card {
    padding: 22px;
    background: #fff;
}

.doctor-review-files {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.review-meda-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.review-meda-card {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid #d7e4f2;
    border-radius: 8px;
    background: #f8fbff;
}

.review-decision-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.review-meda-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-meda-row-actions.split {
    justify-content: space-between;
}

.lab-results-button.unread {
    background: #d92d20;
    border-color: #d92d20;
    color: #fff;
}

.lab-results-button.read {
    background: #14863e;
    border-color: #14863e;
    color: #fff;
}

.medical-image-list {
    display: grid;
    gap: 5px;
}

.medical-image-item {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 28px;
    padding: 4px 7px;
    border: 1px solid #d7e4f2;
    border-radius: 6px;
    background: #fff;
    color: #173f68;
    text-align: right;
    cursor: pointer;
}

.medical-image-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.image-viewer-card {
    max-height: 92vh;
}

.image-viewer-stage {
    display: grid;
    place-items: center;
    min-height: 55vh;
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #d7e4f2;
    border-radius: 8px;
    background: #0f172a;
}

.image-viewer-stage img {
    max-width: 100%;
    max-height: 68vh;
    object-fit: contain;
}

.doctor-review-files .review-file-section {
    margin: 0;
}

.doctor-reviews-section {
    margin-top: 0;
}

.doctor-review-table-wrap {
    overflow-x: auto;
}

.doctor-review-table {
    min-width: 850px;
}

.doctor-review-table th:first-child,
.doctor-review-table td:first-child {
    width: 76px;
    text-align: center;
}

.doctor-review-table th:nth-child(2) {
    width: 150px;
}

.doctor-review-table th:nth-child(3) {
    width: 210px;
}

.doctor-review-table th:last-child {
    width: 160px;
}

.doctor-review-summary-row td {
    vertical-align: middle;
}

.review-notes-cell {
    min-width: 230px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.review-details-row > td {
    padding: 0 !important;
    border-top: 0;
    background: #f5f9fd;
}

.doctor-review-details {
    margin: 0 12px 18px;
    padding: 22px;
    border: 1px solid #cfe0f1;
    border-top: 3px solid #2d80c9;
    border-radius: 0 0 14px 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(31, 76, 120, 0.08);
}

input[readonly] {
    color: #53667f;
    background: #f3f6fa;
    cursor: default;
}

.booking-account-note {
    margin: 0 0 16px;
    padding: 12px 15px;
    border: 1px solid #b9d9f5;
    border-radius: 10px;
    color: #174f84;
    background: #f1f8ff;
    font-weight: 700;
    line-height: 1.7;
}

@media (max-width: 900px) {
    .patient-auth-shell {
        grid-template-columns: 1fr;
        width: min(700px, calc(100% - 26px));
        margin: 20px auto;
    }

    .patient-auth-intro {
        padding: 35px;
    }

    .patient-auth-intro h1 {
        font-size: 36px;
    }

    .patient-auth-brand,
    .patient-auth-features {
        display: none;
    }

    .patient-portal-stats,
    .doctor-review-files {
        grid-template-columns: 1fr;
    }

    .doctor-patient-identity {
        grid-template-columns: 1fr 1fr;
    }

    .doctor-patient-identity div:first-child {
        grid-column: 1 / -1;
    }

    .patient-portal-stats article {
        min-height: auto;
    }
}

@media (max-width: 680px) {
    .patient-auth-shell {
        width: calc(100% - 18px);
        margin: 9px auto;
        border-radius: 19px;
    }

    .patient-auth-intro,
    .patient-auth-card {
        padding: 25px 20px;
    }

    .patient-auth-intro > p {
        font-size: 16px;
    }

    .patient-register-grid,
    .review-content-grid,
    .review-editor-grid {
        grid-template-columns: 1fr;
    }

    .patient-register-grid .span-2,
    .review-editor-grid .span-2 {
        grid-column: auto;
    }

    .patient-portal-wrap {
        width: calc(100% - 18px);
        margin-top: 10px;
    }

    .patient-portal-header,
    .patient-review-card > header,
    .patient-section-heading,
    .doctor-patient-header {
        align-items: stretch;
        flex-direction: column;
    }

    .patient-portal-actions,
    .patient-portal-actions .btn,
    .patient-portal-actions form,
    .patient-portal-actions form .btn,
    .public-doctors-actions,
    .patient-page-actions {
        width: 100%;
    }

    .review-doctor {
        text-align: right;
    }

    .review-content-grid {
        padding: 14px;
    }

    .review-file-section {
        margin: 0 14px 14px;
        padding: 14px;
    }

    .doctor-review-card {
        padding: 14px;
    }

    .doctor-review-card .review-file-section {
        margin: 0;
    }

    .doctor-patient-identity {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .doctor-patient-identity div:first-child {
        grid-column: auto;
    }

    .doctor-patient-actions,
    .doctor-patient-actions .btn {
        width: 100%;
    }

    .doctor-review-details {
        margin: 0 8px 14px;
        padding: 15px;
    }

    .medical-image-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Owner dashboard: fixed chrome with an independently scrolling doctors table. */
.owner-dashboard-header {
    display: grid;
    grid-template-columns: max-content minmax(460px, 1fr);
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.owner-header-stats {
    grid-template-columns: repeat(5, minmax(82px, 1fr)) !important;
    gap: 6px;
    min-width: 0;
    margin: 0;
}

.owner-header-stats .stat-card {
    min-height: 58px;
    padding: 5px 7px;
    border-radius: 6px;
    box-shadow: 0 5px 13px rgba(20, 60, 100, 0.06);
}

.owner-header-stats .stat-card p {
    max-width: calc(100% - 22px);
    margin: 0 0 1px;
    font-size: 10px !important;
    line-height: 1.15 !important;
}

.owner-header-stats .stat-card strong {
    font-size: 15px !important;
    line-height: 1 !important;
}

.owner-header-stats .stat-card small {
    display: block;
    margin-top: 1px;
    font-size: 9px !important;
    line-height: 1.1 !important;
}

.owner-header-stats .stat-icon {
    left: 5px;
    top: 5px;
    width: 19px;
    height: 19px;
    font-size: 10px;
}

.owner-dashboard .main-area .btn:not(.wide),
.owner-dashboard .toolbar-actions > * {
    width: max-content;
    min-width: 0;
    min-height: 0;
    height: auto;
}

.owner-dashboard .main-area .btn:not(.wide) {
    padding: 6px 10px;
}

.owner-dashboard .owner-doctors-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.owner-dashboard .owner-doctors-toolbar h2 {
    margin: 0;
    margin-inline-end: 12px;
}

.owner-dashboard .owner-doctors-search {
    width: 280px;
    max-width: 100%;
    min-height: 0 !important;
    height: 26px !important;
    padding: 2px 7px !important;
    border-radius: 5px;
    font-size: 12px !important;
}

.owner-dashboard .owner-doctor-link-field {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.owner-dashboard .owner-doctor-link-field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.owner-dashboard .owner-doctor-link-input {
    width: clamp(145px, 16vw, 230px);
    max-width: 100%;
    min-height: 0 !important;
    height: 26px !important;
    padding: 2px 7px !important;
    border-radius: 5px;
    direction: ltr;
    text-align: left;
    font-size: 12px !important;
}

.owner-dashboard .owner-doctors-copy-button {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 24px !important;
    padding: 2px 8px !important;
    border-radius: 4px;
    font-size: 12px !important;
    line-height: 1 !important;
}

.owner-dashboard .owner-doctors-actions {
    flex-wrap: nowrap;
    gap: 5px;
}

.owner-dashboard .owner-doctors-toolbar .owner-doctors-compact-button {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 24px !important;
    padding: 2px 8px !important;
    border-radius: 4px;
    gap: 3px;
    font-size: 12px !important;
    line-height: 1 !important;
}

.owner-dashboard .notification-toggle-form {
    min-width: 0;
}

.owner-dashboard .notification-toggle-form .btn {
    width: max-content;
    min-height: 0;
}

.owner-dashboard #doctors-table {
    scrollbar-gutter: stable both-edges;
    scrollbar-color: #4e77a6 #e8eef6;
}

.owner-dashboard #doctors-table::-webkit-scrollbar {
    width: 12px;
    height: 14px;
}

.owner-dashboard #doctors-table::-webkit-scrollbar-track {
    background: #e8eef6;
}

.owner-dashboard #doctors-table::-webkit-scrollbar-thumb {
    border: 3px solid #e8eef6;
    border-radius: 10px;
    background: #4e77a6;
}

.owner-dashboard #doctors-table .data-table.compact {
    width: 100%;
    min-width: max-content;
    table-layout: auto;
}

.owner-dashboard #doctors-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: 0 1px 0 #d9e4f1;
}

.owner-dashboard #doctors-table thead th {
    padding: 7px 8px;
    border-bottom-color: #9fb5cc;
    border-left-color: #b8c9dc;
    font-size: 12px !important;
    line-height: 1.25 !important;
    white-space: nowrap;
}

.owner-dashboard #doctors-table tbody td {
    padding: 5px 8px;
    border-bottom-color: #b8c9dc;
    border-left-color: #c4d2e1;
    white-space: nowrap;
}

.owner-dashboard #doctors-table tbody td,
.owner-dashboard #doctors-table tbody td * {
    line-height: 1.25 !important;
}

.owner-dashboard #doctors-table .btn.mini {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 23px !important;
    padding: 2px 6px !important;
    border-radius: 4px;
    font-size: 10px !important;
}

.owner-dashboard #doctors-table .doctor-status-cell .badge {
    min-width: 35px;
    min-height: 15px;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 7px !important;
    line-height: 1 !important;
}

.owner-dashboard #doctors-table .doctor-subscription-cell .subscription-pill {
    min-width: 58px;
    min-height: 24px;
    height: 24px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px !important;
    line-height: 1 !important;
}

.owner-dashboard #doctors-table .doctor-subscription-cell .subscription-days {
    margin-top: 2px;
    font-size: 12px !important;
    line-height: 1.1 !important;
}

.owner-dashboard #doctors-table .doctor-subscription-cell .subscription-form {
    display: grid;
    grid-template-columns: 68px 58px;
    align-items: end;
    justify-content: center;
    gap: 4px;
    min-width: 130px;
}

.owner-dashboard #doctors-table .doctor-subscription-cell .subscription-form label {
    display: grid;
    gap: 1px;
}

.owner-dashboard #doctors-table .doctor-subscription-cell .subscription-form label span {
    margin: 0;
    font-size: 12px !important;
    line-height: 1 !important;
}

.owner-dashboard #doctors-table .doctor-subscription-cell .subscription-form input[type="number"] {
    width: 68px;
    min-height: 0 !important;
    height: 24px !important;
    padding: 2px 5px !important;
    border-radius: 4px;
    font-size: 12px !important;
}

.owner-dashboard .owner-meda-table-wrap .data-table.compact {
    width: 100%;
    min-width: max-content;
    table-layout: auto;
}

.owner-dashboard .owner-meda-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 7px 8px;
    border-bottom-color: #9fb5cc;
    border-left-color: #b8c9dc;
    box-shadow: 0 1px 0 #d9e4f1;
    font-size: 12px !important;
    line-height: 1.25 !important;
    white-space: nowrap;
}

.owner-dashboard .owner-meda-table-wrap tbody td {
    padding: 5px 8px;
    border-bottom-color: #b8c9dc;
    border-left-color: #c4d2e1;
    white-space: nowrap;
}

.owner-dashboard .owner-meda-table-wrap tbody td,
.owner-dashboard .owner-meda-table-wrap tbody td * {
    line-height: 1.25 !important;
}

.owner-dashboard #doctors-table .doctor-actions-column {
    position: sticky;
    right: 0;
    width: 68px;
    min-width: 68px;
    max-width: 68px;
    background: #fff;
    box-shadow: -1px 0 0 #d9e4f1;
}

.owner-dashboard #doctors-table thead .doctor-actions-column {
    z-index: 6;
    background: #f8fbff;
}

.owner-dashboard #doctors-table tbody .doctor-actions-column {
    z-index: 4;
    overflow: visible;
}

.owner-dashboard #doctors-table tbody tr:hover .doctor-actions-column {
    background: #f9fcff;
}

.owner-dashboard .owner-meda-table-wrap .doctor-actions-column {
    position: sticky;
    right: 0;
    width: 68px;
    min-width: 68px;
    max-width: 68px;
    background: #fff;
    box-shadow: -1px 0 0 #d9e4f1;
}

.owner-dashboard .owner-meda-table-wrap thead .doctor-actions-column {
    z-index: 6;
    background: #f8fbff;
}

.owner-dashboard .owner-meda-table-wrap tbody .doctor-actions-column {
    z-index: 4;
    overflow: visible;
}

.owner-dashboard .owner-meda-table-wrap tbody tr:hover .doctor-actions-column {
    background: #f9fcff;
}

.owner-dashboard #doctors-table tbody tr.selected {
    background: #f0f7ff;
}

.doctor-actions-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 54px;
    min-height: 23px;
    border: 1px solid #aac7e8;
    border-radius: 5px;
    padding: 2px 6px;
    color: #0b5eaa;
    background: #f5faff;
    cursor: pointer;
    font-size: 10px !important;
    line-height: 1 !important;
    white-space: nowrap;
}

.doctor-actions-trigger[aria-expanded="true"] {
    color: #fff;
    border-color: #0f61b7;
    background: #0f61b7;
}

.doctor-actions-menu {
    position: fixed;
    z-index: 3000;
    display: grid;
    width: 190px;
    overflow: hidden;
    border: 1px solid #c8d8eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(16, 51, 91, 0.22);
    direction: rtl;
    text-align: right;
}

.doctor-actions-menu[hidden] {
    display: none !important;
}

.doctor-actions-menu form {
    margin: 0;
}

.doctor-actions-menu a,
.doctor-actions-menu button {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 34px;
    border: 0;
    border-bottom: 1px solid #edf2f8;
    border-radius: 0;
    padding: 7px 10px;
    color: #263f5d;
    background: #fff;
    cursor: pointer;
    font-size: 12px !important;
    line-height: 1.3 !important;
    text-align: right;
}

.doctor-actions-menu a:hover,
.doctor-actions-menu button:hover,
.doctor-actions-menu a:focus,
.doctor-actions-menu button:focus {
    color: #0f61b7;
    background: #eef6ff;
    outline: none;
}

.doctor-actions-menu .doctor-action-danger {
    color: #c62828;
    border-bottom: 0;
}

.doctor-actions-menu .doctor-action-danger:hover,
.doctor-actions-menu .doctor-action-danger:focus {
    color: #fff;
    background: #d92f2f;
}

.legacy-actions-cell[hidden] {
    display: none !important;
}

/* Owner audit: fixed controls with only the log rows scrolling. */
.owner-audit-header {
    display: grid;
    grid-template-columns: max-content minmax(220px, 1fr) max-content;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.owner-audit-header h1,
.owner-audit-header p {
    margin: 0;
}

.owner-audit-header p {
    text-align: center;
}

.owner-audit-panel {
    min-height: 0;
    margin-bottom: 0;
}

.owner-audit-page .audit-tools {
    align-items: center;
    margin-bottom: 8px;
}

.owner-audit-page .audit-delete-form {
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.owner-audit-page .audit-delete-form label {
    display: block;
}

.owner-audit-page .audit-delete-form input {
    width: 55px;
    min-width: 55px;
    min-height: 0 !important;
    height: 29px !important;
    padding: 3px 5px !important;
    border-radius: 5px;
    font-size: 10px !important;
}

.owner-audit-page .main-area .owner-audit-delete-button {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 29px !important;
    padding: 4px 9px !important;
    border-radius: 5px;
    font-size: 11px !important;
    line-height: 1 !important;
}

.owner-audit-table-wrap {
    overflow: auto;
    scrollbar-gutter: stable both-edges;
    scrollbar-color: #4e77a6 #e8eef6;
}

.owner-audit-table-wrap::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.owner-audit-table-wrap::-webkit-scrollbar-track {
    background: #e8eef6;
}

.owner-audit-table-wrap::-webkit-scrollbar-thumb {
    border: 3px solid #e8eef6;
    border-radius: 10px;
    background: #4e77a6;
}

.owner-audit-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 7px 9px;
    box-shadow: 0 1px 0 #d9e4f1;
}

.owner-audit-table tbody td {
    padding: 5px 9px;
}

.owner-audit-table tbody td,
.owner-audit-table tbody td * {
    line-height: 1.2 !important;
}

/* Owner request pages: compact centered search in the title row. */
.owner-request-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(100px, 280px) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.owner-request-page-header h1 {
    justify-self: start;
    margin: 0;
    white-space: nowrap;
}

.owner-request-page-header > .btn {
    justify-self: end;
}

.owner-request-page-header .owner-request-search {
    justify-self: center;
    width: 280px;
    max-width: 100%;
    min-height: 0 !important;
    height: 29px !important;
    padding: 3px 8px !important;
    font-size: 12px !important;
}

.owner-request-panel {
    min-height: 0;
    margin-bottom: 0;
}

.owner-request-status-row {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-start;
    margin-bottom: 8px;
}

.owner-support-table-wrap {
    overflow: auto;
    scrollbar-gutter: stable both-edges;
    scrollbar-color: #4e77a6 #e8eef6;
}

.owner-support-table-wrap::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.owner-support-table-wrap::-webkit-scrollbar-track {
    background: #e8eef6;
}

.owner-support-table-wrap::-webkit-scrollbar-thumb {
    border: 3px solid #e8eef6;
    border-radius: 10px;
    background: #4e77a6;
}

.owner-support-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: 0 1px 0 #d9e4f1;
}

.owner-support-requests-page .meda-support-requests-panel {
    margin-top: 12px;
}

.owner-support-requests-page .support-actions .btn.mini {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 24px !important;
    padding: 2px 8px !important;
    border-radius: 4px;
    font-size: 12px !important;
    line-height: 1 !important;
}

/* Subscription requests: compact review controls and a rows-only scroll area. */
.subscription-requests-table-wrap {
    overflow: auto;
    scrollbar-gutter: stable both-edges;
    scrollbar-color: #4e77a6 #e8eef6;
}

.subscription-requests-table-wrap::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.subscription-requests-table-wrap::-webkit-scrollbar-track {
    background: #e8eef6;
}

.subscription-requests-table-wrap::-webkit-scrollbar-thumb {
    border: 3px solid #e8eef6;
    border-radius: 10px;
    background: #4e77a6;
}

.subscription-requests-table {
    min-width: 980px;
}

.subscription-requests-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: 0 1px 0 #d9e4f1;
}

.subscription-request-actions,
.subscription-approval-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    white-space: nowrap;
}

.subscription-approval-form input[type="number"] {
    width: 74px;
    min-height: 0;
    height: 30px;
    padding: 3px 7px;
    text-align: center;
}

.doctor-subscription-history-wrap {
    max-height: 58vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.doctor-subscription-history-modal {
    width: min(1100px, 100%) !important;
}

.data-table.compact.doctor-subscription-history-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.doctor-subscription-history-table th,
.doctor-subscription-history-table td {
    width: 1%;
    padding: 8px 7px;
    white-space: nowrap;
}

.doctor-subscription-history-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

.doctor-subscription-history-table .badge {
    margin-inline-start: 5px;
}

.doctor-actions-menu .doctor-action-notification.disabled {
    color: #b42318;
}

.doctor-actions-menu .doctor-action-notification.enabled {
    color: #147a4b;
}

.subscription-request-modal-card {
    max-width: 430px;
}

.subscription-request-form {
    display: grid;
    gap: 16px;
}

.subscription-request-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.subscription-request-form input[type="number"] {
    width: 100%;
}

/* Doctor pages only: keep their sidebar fixed and scroll current booking rows. */
.doctor-current-bookings-table-wrap {
    overflow: auto;
    scrollbar-gutter: stable both-edges;
    scrollbar-color: #4e77a6 #e8eef6;
}

.doctor-current-bookings-table-wrap::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.doctor-current-bookings-table-wrap::-webkit-scrollbar-track {
    background: #e8eef6;
}

.doctor-current-bookings-table-wrap::-webkit-scrollbar-thumb {
    border: 3px solid #e8eef6;
    border-radius: 10px;
    background: #4e77a6;
}

.doctor-current-bookings-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: 0 1px 0 #d9e4f1;
}

@media (min-width: 861px) {
    .doctor-page .doctor-shell > .sidebar {
        position: sticky;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    body.doctor-dashboard-page {
        overflow: hidden;
    }

    .doctor-dashboard-page .doctor-shell {
        height: 100vh;
        min-height: 0;
    }

    .doctor-dashboard-page .main-area {
        display: flex;
        flex-direction: column;
        height: 100vh;
        min-height: 0;
        padding: 18px 22px;
        overflow: hidden;
    }

    .doctor-dashboard-page .page-header,
    .doctor-dashboard-page .blocked-doctor-alert,
    .doctor-dashboard-page .stats-grid,
    .doctor-dashboard-page #manual-booking {
        flex: 0 0 auto;
    }

    .doctor-dashboard-page .page-header {
        margin-bottom: 12px;
    }

    .doctor-dashboard-page #manual-booking {
        margin-bottom: 12px;
    }

    .doctor-dashboard-page .doctor-current-bookings-panel {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        margin-bottom: 0;
        padding: 14px;
        overflow: hidden;
    }

    .doctor-dashboard-page .doctor-current-bookings-panel .panel-toolbar {
        flex: 0 0 auto;
        margin-bottom: 8px;
    }

    .doctor-dashboard-page .doctor-current-bookings-table-wrap {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        overscroll-behavior: contain;
    }

    body.owner-dashboard {
        overflow: hidden;
    }

    .owner-dashboard .app-shell {
        height: 100vh;
        min-height: 0;
    }

    .owner-dashboard .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    .owner-dashboard .main-area {
        display: flex;
        flex-direction: column;
        height: 100vh;
        min-height: 0;
        padding: 18px 22px;
        overflow: hidden;
    }

    .owner-dashboard .owner-doctors-panel {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        margin-bottom: 0;
        padding: 14px;
        overflow: hidden;
    }

    .owner-dashboard .owner-doctors-panel .panel-toolbar {
        flex: 0 0 auto;
        margin-bottom: 8px;
        position: relative;
        z-index: 8;
    }

.owner-dashboard #doctors-table {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
}

.owner-dashboard .owner-meda-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
}

    .owner-audit-page .owner-audit-panel {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        padding: 14px;
        overflow: hidden;
    }

    .owner-audit-page .audit-tools {
        flex: 0 0 auto;
    }

    .owner-audit-page .owner-audit-table-wrap {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        overscroll-behavior: contain;
    }

    .owner-support-requests-page .owner-support-requests-panel {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        padding: 14px;
        overflow: hidden;
    }

    .owner-support-requests-page .owner-support-table-wrap {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        overscroll-behavior: contain;
    }

    .owner-subscription-requests-page .owner-subscription-requests-panel {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        padding: 14px;
        overflow: hidden;
    }

    .owner-subscription-requests-page .subscription-requests-table-wrap {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        overscroll-behavior: contain;
    }
}

@media (max-width: 1100px) and (min-width: 861px) {
    .owner-dashboard-header {
        grid-template-columns: max-content minmax(390px, 1fr);
        gap: 8px;
    }

    .owner-header-stats {
        grid-template-columns: repeat(5, minmax(72px, 1fr)) !important;
    }

    .owner-dashboard-title p,
    .owner-header-stats .stat-card small {
        display: none;
    }
}

@media (max-width: 860px) {
    .owner-dashboard-header {
        grid-template-columns: 1fr;
        align-items: center;
    }

    .owner-header-stats {
        grid-column: 1 / -1;
        grid-row: 2;
        overflow-x: auto;
        grid-template-columns: repeat(5, minmax(88px, 1fr)) !important;
    }

    .owner-dashboard .owner-doctors-panel {
        padding: 12px;
    }

    .owner-audit-header {
        grid-template-columns: max-content minmax(0, 1fr);
        gap: 8px;
    }

    .owner-audit-header > .btn {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .owner-audit-page .owner-audit-panel {
        padding: 12px;
    }

    .owner-audit-page .owner-audit-table-wrap {
        max-height: 65vh;
    }

    .owner-request-page-header {
        grid-template-columns: max-content minmax(72px, 1fr);
        gap: 8px;
    }

    .owner-request-page-header .owner-request-search {
        width: min(280px, 100%);
        min-width: 72px;
    }

    .owner-request-page-header > .btn {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .owner-support-requests-page .owner-support-table-wrap {
        max-height: 65vh;
    }

    .owner-subscription-requests-page .subscription-requests-table-wrap {
        max-height: 65vh;
    }

    .doctor-dashboard-page .doctor-current-bookings-table-wrap {
        max-height: 65vh;
    }

    .owner-dashboard .owner-doctors-toolbar {
        gap: 6px;
        overflow-x: visible;
    }

    .owner-dashboard .owner-doctors-toolbar h2 {
        font-size: 16px;
        white-space: nowrap;
        margin-inline-end: 0;
    }

    .owner-dashboard .owner-doctors-search {
        width: 100%;
        min-width: 72px;
        height: 26px !important;
        padding: 2px 7px !important;
        font-size: 12px !important;
    }

    .owner-dashboard .owner-doctors-toolbar .owner-doctors-compact-button {
        height: 24px !important;
        padding: 2px 8px !important;
        font-size: 12px !important;
    }

    .owner-dashboard .owner-doctor-link-field {
        flex: 1 1 180px;
    }

    .owner-dashboard .owner-doctor-link-input {
        width: 100%;
    }

    .owner-dashboard #doctors-table {
        max-height: 62vh;
        overflow: auto;
    }

    .owner-dashboard .owner-meda-table-wrap {
        max-height: 62vh;
        overflow: auto;
    }

    .owner-dashboard .toolbar-actions,
    .owner-dashboard .toolbar-actions > *,
    .owner-dashboard .toolbar-actions .btn {
        width: max-content;
        align-items: center;
    }
}

.notification-toggle-form {
    min-width: 108px;
}

.notification-toggle-form .btn {
    width: 100%;
    min-height: 38px;
}

.doctor-notification-disabled {
    min-height: 42px;
    padding: 11px 14px;
}

.doctor-notification-panel {
    margin-bottom: 22px;
}

.doctor-notification-form {
    display: grid;
    gap: 14px;
    padding: 0 22px 22px;
}

.doctor-notification-form label {
    display: grid;
    gap: 7px;
    color: #344a60;
    font-weight: 800;
}

.doctor-notification-form textarea {
    min-height: 130px;
    resize: vertical;
}

.doctor-notification-form .btn {
    justify-self: start;
    min-width: 170px;
}

.patient-notifications-table {
    min-width: 1000px;
}

.patient-notifications-table .notification-message-cell {
    min-width: 300px;
    max-width: 520px;
    white-space: pre-wrap;
    line-height: 1.8;
}

.patient-notification-unread td {
    background: #f0fbf6;
}

@media (max-width: 680px) {
    .doctor-notification-form {
        padding: 0 14px 16px;
    }

    .doctor-notification-form .btn {
        width: 100%;
    }
}

.patient-forgot-password {
    min-height: 44px;
    margin-top: 12px;
    color: #0f61b7;
}

.patient-recovery-panel {
    margin-top: 14px;
    text-align: right;
}

.patient-recovery-panel p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.7;
}

.patient-recovery-security-note {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid #bcd8f5;
    border-radius: 10px;
    color: #174f84;
    background: #f1f8ff;
    font-weight: 700;
}

.patient-recovery-requests-table {
    min-width: 1500px;
}

.patient-recovery-requests-table td:last-child {
    min-width: 470px;
}

.patient-recovery-reset-form {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1fr);
    gap: 10px;
    align-items: end;
}

.patient-recovery-reset-form label:first-of-type,
.patient-recovery-reset-form button[type="submit"] {
    grid-column: 1 / -1;
}

.patient-recovery-reset-form label span {
    margin-bottom: 4px;
    color: #52677e;
    font-size: 13px;
}

.patient-recovery-reset-form input {
    padding: 9px 10px;
}

.patient-recovery-reset-form .password-toggle {
    min-width: 62px;
}

@media (max-width: 680px) {
    .patient-recovery-reset-form {
        grid-template-columns: 1fr;
    }

    .patient-recovery-reset-form label:first-of-type,
    .patient-recovery-reset-form button[type="submit"] {
        grid-column: auto;
    }
}

/* Owner account: keep every credential field reachable on desktop screens. */
.owner-account-page .main-area.narrow {
    align-self: stretch;
    margin-block: 0;
    padding-top: 6px;
    padding-bottom: 18px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.owner-account-page .settings-panel {
    flex: 0 0 auto;
    width: 100%;
    margin-top: 0;
}

.owner-account-page .settings-title {
    padding: 14px 24px;
}

.owner-account-page .settings-title h1 {
    min-height: 42px;
    margin-bottom: 0;
    padding: 5px 20px;
}

.owner-account-page .settings-title p {
    margin-top: 7px;
}

.owner-account-page .settings-form {
    gap: 8px;
    padding: 10px 30px 14px;
}

.owner-account-page .settings-form label span {
    margin-bottom: 2px;
}

.owner-account-page .settings-form label small {
    margin-top: 2px;
}

.owner-account-page .settings-form input:not([type="checkbox"]) {
    height: 44px;
    padding-block: 7px;
}

.owner-account-page .settings-form .form-footer {
    padding-top: 2px;
}

/* Doctor dashboard: compact header statistics and manual-booking controls. */
.doctor-dashboard-page .doctor-dashboard-header {
    display: grid;
    grid-template-columns: minmax(145px, max-content) minmax(300px, 1fr) minmax(140px, 220px);
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.doctor-dashboard-page .doctor-dashboard-header.no-contact {
    grid-template-columns: minmax(145px, max-content) minmax(300px, 1fr);
}

.doctor-dashboard-page .doctor-welcome {
    min-width: 0;
}

.doctor-dashboard-page .doctor-welcome h1 {
    margin: 0;
}

.doctor-dashboard-page .doctor-header-stats {
    grid-template-columns: repeat(4, minmax(66px, 1fr)) !important;
    align-items: stretch;
    gap: 5px !important;
    min-width: 0;
    margin: 0 !important;
}

.doctor-dashboard-page .doctor-header-stats .stat-card {
    min-height: 30px !important;
    padding: 2px 5px !important;
    border-radius: 5px;
    box-shadow: 0 3px 7px rgba(20, 60, 100, 0.05);
}

.doctor-dashboard-page .doctor-header-stats .stat-card p {
    max-width: calc(100% - 15px);
    margin: 0 !important;
    font-size: 8px !important;
    line-height: 1.1 !important;
}

.doctor-dashboard-page .doctor-header-stats .stat-card strong {
    margin-top: 1px;
    font-size: 11px !important;
    line-height: 1 !important;
}

.doctor-dashboard-page .doctor-header-stats .stat-icon {
    left: 3px !important;
    width: 14px !important;
    height: 14px !important;
    font-size: 8px !important;
}

.doctor-dashboard-page .doctor-header-stats .pending-stat-stack,
.doctor-dashboard-page .doctor-header-stats .pending-stat-stack .stat-card {
    height: 100%;
}

.doctor-dashboard-page .doctor-dashboard-header .doctor-contact-note {
    width: 100%;
    max-width: 220px;
    padding: 4px 6px;
    font-size: 10px !important;
    line-height: 1.2 !important;
}

.doctor-dashboard-page #manual-booking {
    padding: 9px 14px;
    margin-bottom: 6px;
}

.doctor-dashboard-page .doctor-manual-booking-form {
    width: 60%;
    max-width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 108px;
    column-gap: 8px;
    row-gap: 6px;
    margin-inline-end: auto;
}

.doctor-dashboard-page .doctor-manual-booking-form label span {
    margin-bottom: 2px;
    font-size: 12px !important;
    line-height: 1.15 !important;
}

.doctor-dashboard-page .doctor-manual-booking-form input {
    height: 38px;
    padding: 5px 8px;
}

.doctor-dashboard-page .doctor-manual-booking-form .btn {
    width: 108px;
    min-height: 34px;
    height: 34px;
    padding: 3px 8px;
    font-size: 12px !important;
}

.doctor-dashboard-page .doctor-current-bookings-table-wrap .data-table th,
.doctor-dashboard-page .doctor-current-bookings-table-wrap .data-table td {
    padding-top: 7px;
    padding-bottom: 7px;
}

@media (max-width: 860px) {
    .doctor-dashboard-page .doctor-dashboard-header,
    .doctor-dashboard-page .doctor-dashboard-header.no-contact {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .doctor-dashboard-page .doctor-dashboard-header .doctor-contact-note {
        max-width: none;
    }

    .doctor-dashboard-page .doctor-manual-booking-form {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .doctor-dashboard-page .doctor-manual-booking-form .btn {
        width: 100%;
    }
}

/* Doctor patient details: title, booking identity, and return action share one compact row. */
.doctor-patient-record-page .doctor-patient-header {
    display: grid;
    grid-template-columns: 120px minmax(420px, 1fr) 120px;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.doctor-patient-record-page .doctor-patient-header h1 {
    margin: 0;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

.doctor-patient-record-page .doctor-patient-identity {
    grid-template-columns: minmax(180px, 2fr) minmax(80px, 0.7fr) minmax(150px, 1.2fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 8px 12px;
    border-radius: 10px;
}

.doctor-patient-record-page .doctor-patient-identity div {
    gap: 2px;
    min-width: 0;
}

.doctor-patient-record-page .doctor-patient-identity span {
    font-size: 11px !important;
    line-height: 1.15 !important;
}

.doctor-patient-record-page .doctor-patient-identity strong {
    overflow: hidden;
    font-size: 14px !important;
    line-height: 1.25 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doctor-patient-record-page .doctor-patient-identity div:nth-child(3) {
    justify-items: left;
    text-align: left;
}

.doctor-patient-record-page .doctor-patient-identity div:nth-child(3) span,
.doctor-patient-record-page .doctor-patient-identity div:nth-child(3) strong {
    width: 100%;
    text-align: left;
}

.doctor-patient-record-page .doctor-patient-back {
    justify-self: end;
    width: max-content;
    height: 26px;
    min-height: 26px;
    padding: 0 18px;
    border-color: #8dcaf1;
    border-radius: 10px;
    color: #11639b;
    background: #dff2ff;
    box-shadow: 0 5px 12px rgba(56, 145, 205, 0.14);
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
}

.doctor-patient-record-page .doctor-patient-actions .btn {
    align-self: center;
    min-height: 30px;
    padding: 5px 13px;
    font-size: 11px !important;
    line-height: 1.2 !important;
}

.doctor-patient-record-page .review-meda-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.doctor-patient-record-page .review-main-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.doctor-patient-record-page .review-meda-card {
    display: grid;
    gap: 7px;
    align-content: start;
    padding: 10px;
    border: 1px solid #c4d2e1;
    border-radius: 6px;
    background: #f8fbff;
}

.doctor-patient-record-page .review-meda-card h4 {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.2;
}

.doctor-patient-record-page .review-meda-card label {
    gap: 3px;
}

.doctor-patient-record-page .review-meda-card label span {
    font-size: 12px !important;
    line-height: 1.15 !important;
}

.doctor-patient-record-page .review-meda-card select {
    min-height: 0 !important;
    height: 26px !important;
    padding: 2px 7px !important;
    border-radius: 5px;
    font-size: 12px !important;
}

.doctor-patient-record-page .review-meda-card textarea {
    min-height: 54px !important;
    padding: 5px 7px !important;
    border-radius: 5px;
    font-size: 12px !important;
    line-height: 1.35 !important;
}

.doctor-patient-record-page .pharmacy-response-display textarea {
    white-space: pre-wrap;
}

.doctor-lab-result-card {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid #d7e4f2;
    border-radius: 8px;
    background: #fff;
}

.doctor-lab-result-title {
    margin: 0;
    text-align: center;
    color: #0b2854;
}

.doctor-lab-result-people {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 200px;
    flex-wrap: wrap;
    font-weight: 800;
}

.doctor-lab-result-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.doctor-lab-result-meta div {
    min-width: 0;
    padding: 6px 7px;
    border: 1px solid #d7e4f2;
    border-radius: 6px;
    background: #f8fbff;
}

.doctor-lab-result-meta span,
.doctor-lab-result-meta strong {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.doctor-lab-result-meta span {
    color: var(--muted);
    font-size: 11px !important;
}

.doctor-lab-result-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.doctor-lab-result-row > strong {
    padding-top: 7px;
    color: #0b2854;
}

.doctor-lab-result-row pre {
    margin: 0;
    padding: 8px;
    border: 1px solid #d7e4f2;
    border-radius: 6px;
    background: #fff;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: inherit;
    line-height: 1.6;
}

.doctor-lab-results-list {
    display: grid;
    gap: 0;
}

.doctor-lab-result-card.lab-print-page {
    gap: 10px;
    width: 100%;
    padding: 14px;
}

.doctor-lab-result-card .lab-print-header {
    grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr);
    gap: 14px;
    padding-bottom: 10px;
}

.doctor-lab-result-card .lab-print-identity {
    gap: 3px;
    font-size: 12px;
    line-height: 1.35;
}

.doctor-lab-result-card .lab-print-logo {
    height: 64px;
}

.doctor-lab-result-card .lab-print-logo img {
    max-width: 78px;
    max-height: 60px;
}

.doctor-lab-result-card .lab-print-logo span {
    width: 54px;
    height: 54px;
}

.doctor-lab-result-card .lab-print-row {
    gap: min(300px, 18vw);
    line-height: 1.45;
}

.doctor-lab-result-card .lab-print-meta-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding-top: 0;
    font-size: 11px;
    line-height: 1.45;
}

.doctor-lab-result-card .lab-print-title {
    margin: 6px 0 0;
    font-size: 17px;
}

.doctor-lab-result-card .lab-print-greeting {
    margin: 0;
    font-size: 12px;
}

.doctor-lab-result-card .lab-print-section pre {
    padding: 8px;
    line-height: 1.55;
}

.doctor-lab-result-times {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex-wrap: wrap;
}

.doctor-lab-time-chip {
    width: max-content;
    max-width: 100%;
    min-width: 170px;
    padding: 5px 8px;
    border: 1px solid #d7e4f2;
    border-radius: 6px;
    background: #f8fbff;
}

.doctor-lab-time-chip span,
.doctor-lab-time-chip strong {
    display: block;
    white-space: nowrap;
}

.doctor-lab-time-chip span {
    color: var(--muted);
    font-size: 10px !important;
}

.doctor-lab-result-separator {
    height: 5px;
    width: 100%;
    margin: 10px 0 14px;
    border-radius: 5px;
    background: #e7c3ca;
}

.doctor-lab-result-actions .btn {
    min-height: 24px !important;
    height: 24px !important;
    padding: 2px 9px !important;
    font-size: 10px !important;
    line-height: 1 !important;
}

.doctor-patient-record-page .review-meda-card .btn {
    justify-self: start;
    min-height: 0 !important;
    height: 24px !important;
    padding: 2px 8px !important;
    border-radius: 4px;
    font-size: 12px !important;
    line-height: 1 !important;
}

.doctor-patient-record-page .data-table th,
.doctor-patient-record-page .data-table td {
    padding-top: 6px;
    padding-bottom: 6px;
}

@media (max-width: 900px) and (min-width: 681px) {
    .doctor-patient-record-page .doctor-patient-header {
        grid-template-columns: 95px minmax(0, 1fr) 95px;
        gap: 8px;
    }

    .doctor-patient-record-page .doctor-patient-identity {
        grid-template-columns: minmax(110px, 1.5fr) minmax(55px, 0.6fr) minmax(105px, 1fr);
        gap: 5px;
        padding-inline: 8px;
    }

    .doctor-patient-record-page .doctor-patient-identity div:first-child {
        grid-column: auto;
    }

    .doctor-patient-record-page .review-meda-actions {
        grid-template-columns: 1fr;
    }

    .doctor-patient-record-page .review-main-fields,
    .doctor-lab-result-meta {
        grid-template-columns: 1fr;
    }

    .doctor-lab-result-people {
        gap: 14px;
    }
}

@media (max-width: 680px) {
    .doctor-patient-record-page .doctor-patient-header {
        grid-template-columns: 1fr max-content;
        align-items: center;
        gap: 8px;
    }

    .doctor-patient-record-page .doctor-patient-identity {
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: 1fr 0.7fr 1fr;
        width: 100%;
        padding: 8px;
    }

    .doctor-patient-record-page .doctor-patient-identity div:first-child {
        grid-column: auto;
    }

    .doctor-patient-record-page .review-main-fields,
    .doctor-lab-result-meta,
    .doctor-lab-result-row {
        grid-template-columns: 1fr;
    }

    .doctor-lab-result-people {
        gap: 8px;
    }

    .lab-print-content-row {
        grid-template-columns: 1fr;
    }

    .lab-print-meta-row {
        grid-template-columns: 1fr 1fr;
        gap: 6px 10px;
    }

}

/* Latest compact review and staff-table refinements. */
.doctor-patient-record-page .doctor-reviews-section {
    max-height: calc(100vh - 205px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.doctor-patient-record-page .doctor-review-create {
    margin-bottom: 10px;
    padding: 10px;
}

.doctor-patient-record-page .doctor-review-create .review-editor {
    gap: 8px;
}

.doctor-patient-record-page .review-create-grid textarea {
    min-height: 33px !important;
    height: 33px !important;
    padding: 3px 7px !important;
    line-height: 1.2 !important;
    resize: vertical;
}

.doctor-patient-record-page .doctor-review-create-actions {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.doctor-patient-record-page .doctor-review-create-actions .btn,
.doctor-patient-record-page .doctor-review-create-save {
    align-self: center;
    width: auto;
    min-height: 30px !important;
    height: 30px !important;
    padding: 5px 13px !important;
    border-radius: 7px;
    font-size: 11px !important;
    line-height: 1.2 !important;
}

.pharmacy-prescriptions-table td,
.warehouse-request-table td,
.pharmacy-warehouse-request-table td {
    height: auto !important;
    vertical-align: top !important;
}

.pharmacy-prescriptions-table .datetime-cell,
.warehouse-request-table .datetime-cell,
.pharmacy-warehouse-request-table .datetime-cell,
.pharmacy-prescriptions-table td:nth-child(5),
.warehouse-request-table td:nth-child(4),
.pharmacy-warehouse-request-table td:nth-child(4) {
    vertical-align: top !important;
    padding-top: 1px !important;
}

.pharmacy-prescriptions-table .readonly-response,
.warehouse-request-table .readonly-response,
.pharmacy-warehouse-request-table .readonly-response {
    margin: 0 !important;
}

.pharmacy-prescriptions-table .compact-response,
.warehouse-request-table .compact-response,
.pharmacy-warehouse-request-table .compact-response {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 1px 3px !important;
    line-height: 1.08 !important;
}

.pharmacy-prescriptions-table .sent-badge-tiny,
.warehouse-request-table .sent-badge-tiny,
.pharmacy-warehouse-request-table .sent-badge-tiny {
    display: inline-flex;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 3px !important;
    font-size: 6px !important;
    line-height: 1 !important;
    vertical-align: top;
}

.warehouse-page .meda-page-header {
    align-items: end;
    justify-content: flex-start;
    gap: 20px;
    flex-wrap: nowrap;
}

.warehouse-page .meda-page-header > div:first-child {
    flex: 0 0 auto;
}

.warehouse-header-tools {
    display: flex;
    align-items: end;
    gap: 6px;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
}

.warehouse-page .warehouse-header-tools .meda-staff-search {
    flex: 0 0 150px;
    width: 150px;
    min-width: 120px;
    height: 26px !important;
    min-height: 0 !important;
    padding: 2px 7px !important;
    font-size: 11px !important;
}

.warehouse-header-send-form {
    display: grid;
    grid-template-columns: 96px 170px 76px auto;
    align-items: end;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
}

.warehouse-header-send-form label {
    min-width: 0;
    margin: 0;
}

.warehouse-header-send-form label > span {
    display: none;
}

.warehouse-header-send-form select,
.warehouse-header-send-form textarea {
    width: 100%;
    height: 24px !important;
    min-height: 0 !important;
    padding: 2px 6px !important;
    border-radius: 5px;
    font-size: 10px !important;
    line-height: 1.15 !important;
}

.warehouse-header-send-form textarea {
    resize: none;
    overflow: hidden;
}

.warehouse-header-send-form .warehouse-send-pharmacy-button {
    width: 76px;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 24px !important;
    padding: 2px 5px !important;
    border-radius: 5px;
    font-size: 9px !important;
    line-height: 1 !important;
}

.warehouse-header-send-form .warehouse-no-pharmacies-note {
    align-self: center;
    padding: 2px 5px;
    white-space: nowrap;
    font-size: 9px !important;
    line-height: 1 !important;
}

@media (max-width: 1180px) and (min-width: 861px) {
    .warehouse-page .warehouse-header-tools .meda-staff-search {
        flex-basis: 128px;
        width: 128px;
    }

    .warehouse-header-send-form {
        grid-template-columns: 82px 135px 70px auto;
        gap: 4px;
    }

    .warehouse-header-send-form select,
    .warehouse-header-send-form textarea {
        padding-inline: 4px !important;
        font-size: 9px !important;
    }

    .warehouse-header-send-form .warehouse-send-pharmacy-button {
        width: 70px;
        font-size: 8px !important;
    }
}

/* Patient record spacing and staff header sizing requested after the compact pass. */
.doctor-patient-record-page .doctor-patient-header {
    margin-bottom: 4px;
}

.doctor-patient-record-page .doctor-patient-actions {
    margin-bottom: 6px;
    padding-block: 2px;
    transform: translateY(-10px);
}

.doctor-patient-record-page .doctor-notification-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px !important;
    height: 30px !important;
    padding: 5px 13px !important;
    border-radius: 7px;
    font-size: 11px !important;
    line-height: 1.2 !important;
}

.doctor-patient-record-page .doctor-reviews-section {
    margin-top: 20px;
    padding: 5px 14px 14px !important;
}

.doctor-patient-record-page .doctor-reviews-section .patient-section-heading {
    margin-bottom: 5px;
}

.doctor-patient-record-page .doctor-review-details .review-editor {
    gap: 5px;
}

.doctor-patient-record-page .doctor-review-details {
    display: grid;
    grid-template-areas:
        "review-fields review-fields"
        "pharmacy-card lab-card"
        "pharmacy-card review-files";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 5px;
    align-items: start;
    align-content: start;
    margin-bottom: 5px;
    padding-bottom: 2px;
}

.doctor-patient-record-page .doctor-review-details > .review-editor {
    display: contents;
}

.doctor-patient-record-page .review-main-fields {
    grid-area: review-fields;
    gap: 5px 8px;
}

.doctor-patient-record-page .review-main-fields textarea {
    min-height: 33px !important;
    height: 33px !important;
    padding: 3px 7px !important;
    line-height: 1.2 !important;
    resize: vertical;
}

.doctor-patient-record-page .review-meda-actions {
    display: contents;
    align-items: start;
    gap: 5px;
    margin: 5px 0;
}

.doctor-patient-record-page .review-meda-card {
    gap: 4px;
    min-height: 0;
    padding: 5px 8px;
}

.doctor-patient-record-page .pharmacy-meda-card {
    grid-area: pharmacy-card;
    align-self: start;
    height: auto;
    align-content: start;
    gap: 2px;
    padding-bottom: 3px;
}

.doctor-patient-record-page .review-meda-card-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
}

.doctor-patient-record-page .pharmacy-controls-stack {
    display: grid;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.doctor-patient-record-page .review-meda-card-header h4 {
    margin: 0;
    color: #0b477d;
    font-size: 12px !important;
    line-height: 1.15 !important;
    white-space: nowrap;
}

.doctor-patient-record-page .pharmacy-action-time-display {
    display: grid;
    gap: 2px;
    flex: 0 0 29%;
    width: 29%;
    min-width: 0;
    margin: 0;
}

.doctor-patient-record-page .pharmacy-action-time-display span {
    font-size: 9px !important;
    line-height: 1 !important;
    text-align: right;
}

.doctor-patient-record-page .pharmacy-action-time-field {
    min-height: 26px !important;
    padding: 2px 5px !important;
    border: 1px solid #c4d2e1;
    border-radius: 5px;
    color: #53667f;
    background: #f3f6fa;
    font-size: 9px !important;
    line-height: 1.1 !important;
    white-space: normal;
    overflow-wrap: anywhere;
}

.doctor-patient-record-page .pharmacy-response-display {
    display: grid;
    gap: 2px;
    margin: 0;
}

.doctor-patient-record-page .pharmacy-response-display > span {
    margin-bottom: 0 !important;
}

.doctor-patient-record-page .pharmacy-controls-stack .review-meda-select-field > span {
    display: none;
}

.doctor-patient-record-page .review-meda-inline-row {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: nowrap;
}

.doctor-patient-record-page .review-meda-select-field {
    flex: 0 0 25%;
    max-width: 25%;
    min-width: 0;
    margin: 0;
}

.doctor-patient-record-page .review-meda-inline-row .review-meda-row-actions {
    flex: 0 0 auto;
    margin: 0;
}

.doctor-patient-record-page .review-meda-inline-row .btn {
    flex: 0 0 auto;
}

.doctor-patient-record-page .lab-meda-card {
    grid-area: lab-card;
    align-content: start;
}

.doctor-patient-record-page .lab-meda-card .review-meda-inline-row {
    min-height: 0;
}

.doctor-patient-record-page .doctor-review-files {
    grid-area: review-files;
    display: grid;
    grid-template-rows: repeat(2, minmax(66px, max-content)) auto;
    gap: 5px;
    align-self: start;
    height: auto;
    min-height: 0;
    margin: 0;
}

.doctor-patient-record-page .doctor-review-form-actions {
    grid-area: auto;
    align-self: start;
    justify-self: left;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
}

.doctor-patient-record-page .doctor-review-files .review-file-section {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-items: stretch;
    align-self: start;
    gap: 5px;
    height: auto;
    min-height: 66px;
    margin: 0;
    padding: 5px 7px;
    border-radius: 6px;
}

.doctor-patient-record-page .doctor-review-files .review-file-heading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
    text-align: center;
}

.doctor-patient-record-page .doctor-review-files .review-file-heading h4 {
    margin: 0;
    font-size: 11px !important;
    line-height: 1.1 !important;
    white-space: nowrap;
}

.doctor-patient-record-page .doctor-review-files .review-file-heading span {
    min-width: 18px;
    padding: 1px 5px;
    font-size: 9px !important;
    line-height: 1 !important;
    text-align: center;
}

.doctor-patient-record-page .doctor-review-files .medical-image-list {
    display: flex;
    align-items: center;
    align-content: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    flex-wrap: wrap;
}

.doctor-patient-record-page .doctor-review-files .medical-image-item {
    flex: 0 0 auto;
    justify-content: center;
    width: 32px;
    min-height: 28px;
    padding: 2px;
    border-radius: 4px;
}

.doctor-patient-record-page .doctor-review-files .medical-image-item span {
    font-size: 14px !important;
    line-height: 1 !important;
}

.doctor-patient-record-page .doctor-review-files .medical-image-item strong {
    display: none;
}

.doctor-patient-record-page .doctor-review-files .muted {
    font-size: 9px !important;
    line-height: 1.1 !important;
}

.doctor-patient-record-page .doctor-review-files .muted {
    margin: 0;
}

.doctor-patient-record-page .doctor-review-files .medical-upload-form label {
    min-height: 0 !important;
    height: 22px !important;
    padding: 2px 6px !important;
    border-radius: 4px;
    font-size: 9px !important;
    line-height: 1 !important;
    white-space: nowrap;
}

.doctor-patient-record-page .doctor-review-files .medical-upload-form {
    justify-self: left;
    align-self: end;
}

@media (max-width: 900px) {
    .doctor-patient-record-page .doctor-review-details {
        display: block;
    }

    .doctor-patient-record-page .doctor-review-details > .review-editor {
        display: grid;
    }

    .doctor-patient-record-page .review-meda-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .doctor-patient-record-page .doctor-review-files {
        grid-template-rows: none;
        margin-top: 8px;
    }

    .doctor-patient-record-page .doctor-review-files .review-file-section {
        grid-template-columns: 1fr;
    }
}

.laboratory-page .meda-page-header,
.pharmacy-page .meda-page-header {
    align-items: end;
    justify-content: flex-start;
    gap: 20px;
    flex-wrap: nowrap;
}

.laboratory-page .meda-page-header > div:first-child,
.pharmacy-page .meda-page-header > div:first-child {
    flex: 0 0 auto;
}

.laboratory-page .meda-staff-search {
    width: 234px;
    max-width: 44vw;
    height: 31px !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
}

.pharmacy-page .meda-staff-search-group {
    align-self: end;
}

.warehouse-page .warehouse-header-tools .meda-staff-search {
    height: 35px !important;
    padding: 5px 9px !important;
    font-size: 12px !important;
}

.warehouse-header-send-form {
    grid-template-columns: 96px 255px 95px auto;
}

.warehouse-header-send-form select,
.warehouse-header-send-form textarea {
    height: 35px !important;
    padding: 5px 8px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
}

.warehouse-header-send-form .warehouse-send-pharmacy-button {
    width: 95px;
    height: 30px !important;
    padding: 3px 7px !important;
    font-size: 11px !important;
}

@media (max-width: 1180px) and (min-width: 861px) {
    .warehouse-header-send-form {
        grid-template-columns: 82px 200px 88px auto;
    }

    .warehouse-header-send-form .warehouse-send-pharmacy-button {
        width: 88px;
        font-size: 10px !important;
    }
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    .lab-report-editor,
    .modal-actions,
    .modal-close {
        display: none !important;
    }

    .lab-print-page {
        padding: 0;
        box-shadow: none;
    }

    .lab-print-section,
    .doctor-lab-result-row {
        break-inside: auto;
    }

    .lab-print-header,
    .doctor-lab-result-meta {
        break-inside: avoid;
    }

    body.medical-printing {
        margin: 0 !important;
        color: #111827 !important;
        background: #fff !important;
    }

    body.medical-printing > :not(.medical-print-root) {
        display: none !important;
    }

    body.medical-printing .medical-print-root {
        position: static !important;
        display: block !important;
        width: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    body.medical-printing .medical-print-root .print-page-host {
        width: 210mm !important;
        min-height: 297mm !important;
        margin: 0 !important;
        padding: 25mm 13mm 18mm !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    body.medical-printing .medical-print-root .print-page-host > .lab-print-page,
    body.medical-printing .medical-print-root .print-page-host > .medical-a4-print-page {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        min-height: 254mm !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 14px !important;
        box-shadow: none !important;
    }

    body.medical-printing .medical-print-root .screen-only,
    body.medical-printing .medical-print-root .modal-actions,
    body.medical-printing .medical-print-root .modal-close,
    body.medical-printing .medical-print-root button {
        display: none !important;
    }
}
