﻿@import url('lib/tailwindcss/dist/preflight.css');

/* ============================================================================
   MEDIHUB GLOBAL CSS
   ============================================================================ */

/* ============================================================================
   1) GLOBAL LAYOUT & BASE RESET
   ============================================================================ */

html {
    min-height: 100vh;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Segoe UI, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f2f2f2;
    color: #827f8F;
}

/* Thin accent line pinned to the very top of the viewport */
html::after {
    content: '';
    position: fixed;
    inset: 0 0 auto 0;
    height: 2px;
    background-image: linear-gradient(to right, #7f7f7f, #595959);
    z-index: 1000;
}

h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 600;
}

    h1:focus {
        outline: none;
    }

.page-width {
    max-width: 1024px;
    margin: 0 auto;
}

/* ============================================================================
   2) DESIGN TOKENS (COLORS, SHADOWS, RADII)
   ============================================================================ */

:root {
    /* App / shared (Medihub "single source of truth") */
    --mh-bg: #f2f2f2;
    --mh-card: #ffffff;
    --mh-text: #404040;
    --mh-muted: #7a7a7a;
    --mh-border: #e3e3e3;
    --mh-border-strong: #d0d0d0;
    --mh-shadow: 0 6px 18px rgba(0,0,0,0.08);
    --mh-shadow-soft: 0 2px 10px rgba(0,0,0,0.06);
    --mh-radius: 16px;
    --mh-radius-sm: 12px;
    --mh-danger: #cc0000;
    /* WhatsApp-style page variables (aliased to Medihub tokens) */
    --bg: var(--mh-bg);
    --card: var(--mh-card);
    --border: #e7e7e7;
    --divider: #f0f0f0;
    --text: #111;
    --muted: #666;
    --muted2: #777;
    --shadow: 0 6px 18px rgba(0,0,0,0.05);
    --radius: 18px;
    --radius2: 14px;
    --wa-green: #128C7E;
    --badge-green: #25D366;
}

/* ============================================================================
   3) FORMS & VALIDATION (Blazor)
   ============================================================================ */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* ============================================================================
   4) BLAZOR ERROR BOUNDARY UI
   ============================================================================ */

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: #ffffff;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ============================================================================
   5) GENERIC BUTTONS (Used outside chat)
   ============================================================================ */

.btn-default, .btn-subtle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-default {
    border: 1px solid #9ca3af;
    background-color: #d1d5db;
}

    .btn-default:hover {
        background-color: #e5e7eb;
    }

.btn-subtle {
    border: 1px solid #d1d5db;
    background-color: #f5f5f5;
    font-weight: 500;
}

    .btn-subtle:hover {
        border-color: #a3a3a3;
        background-color: #eaeaea;
    }

/* ============================================================================
   6) HOME / LOGIN / SIGNUP
   ============================================================================ */

.home-root {
    max-width: 1024px;
    margin: 0 auto;
    padding: 2rem;
}

.home-title {
    margin: 0;
    color: #111827;
}

.home-intro {
    margin: 0;
    color: #4b5563;
}

.home-disclaimer {
    font-size: 0.8rem;
    line-height: 1.25rem;
    color: #6b7280;
    margin-top: 0.75rem;
    font-style: italic;
}

.home-spacer-10 {
    height: 10px;
}

.home-spacer-12 {
    height: 12px;
}

.home-spacer-16 {
    height: 16px;
}

.home-spacer-18 {
    height: 18px;
}

/* ----------------------------- Login ----------------------------- */

.login-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f3f4f6;
    max-width: 520px;
}

.login-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #111827;
}

.login-alert {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid transparent;
}

.login-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.login-alert-info {
    background: #eff6ff;
    color: #1e3a8a;
    border-color: #bfdbfe;
}

.login-label {
    display: block;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 6px;
}

.login-input {
    background-color: #ffffff;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    outline: none;
}

.login-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #374151;
    margin: 0;
}

.login-showhide {
    margin-left: auto;
    font-size: 0.85rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
}

.login-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.login-btn-primary {
    padding: 0.55rem 1rem;
    border-radius: 10px;
    border: none;
    background: #898989;
    color: #f2f2f2;
    cursor: pointer;
}

    .login-btn-primary:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.login-btn-secondary {
    padding: 0.55rem 1rem;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
}

.login-footnote {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #6b7280;
}

/* ----------------------------- Signup ----------------------------- */

.signup-shell {
    max-width: 1024px;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 640px) {
    .home-root, .signup-shell {
        padding: 1.25rem;
    }
}

.signup-subtitle {
    margin: 0.25rem 0 1rem 0;
    font-size: 0.95rem;
    color: #6b7280;
    letter-spacing: 0.02em;
}

.signup-panel {
    width: 100%;
    border: 1px solid #e0e0e0;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 14px;
}

.signup-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 760px) {
    .signup-grid {
        grid-template-columns: 1fr 1fr;
    }

    .signup-grid-span-2 {
        grid-column: span 2;
    }
}

.field-hint {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #6b7280;
}

.signup-footer {
    margin-top: 14px;
    border-top: 1px solid #eeeeee;
    padding-top: 12px;
}

.signup-note {
    font-size: 0.65rem;
    color: #6b7280;
    line-height: 1.35rem;
    margin-top: 5px;
    margin-bottom: 10px;
}

.signup-success-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #111827;
}

.signup-success-text {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.45rem;
    margin-bottom: 14px;
}

.signup-field {
    margin: 0.25rem 0 1rem 0;
}

.signup-input {
    width: 100%;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px;
}

.signup-panel .valid.modified:not([type=checkbox]) {
    outline: none !important;
}

.actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
    min-height: 44px;
}

.btn-primary {
    background-color: #7f7f7f;
    color: #ffffff;
    border-color: #7f7f7f;
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

    .btn-primary:hover {
        background-color: #6b6b6b;
        border-color: #6b6b6b;
    }

    .btn-primary:active {
        transform: scale(0.98);
    }

.btn-secondary {
    background-color: #ffffff;
    color: #111827;
    border-color: #d1d5db;
}

    .btn-secondary:hover {
        border-color: #9ca3af;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }

    .btn-secondary:active {
        transform: scale(0.98);
    }

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ============================================================================
   7) CHAT UI LAYOUT
   ============================================================================ */

.chat-root {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   8) CHAT HEADER
   ============================================================================ */

.chat-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #e0e0e0;
    background-color: #ffffff;
    overflow: visible;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.chat-header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    overflow: visible;
}

/* MENU */
.menu-inline {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    z-index: 5000;
}

.menu-button {
    width: 20px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: #ffffff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #111827;
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 5999;
}

.menu-dropdown {
    position: absolute;
    left: 0;
    top: 46px;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    padding: 6px;
    z-index: 6000;
}

.menu-item, .menu-item-logout {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.menu-item {
    color: #111827;
}

    .menu-item:hover {
        background: #f3f4f6;
    }

.menu-item-logout {
    color: #e50000;
}

    .menu-item-logout:hover {
        background: #fef2f2;
    }

.menu-divider {
    height: 1px;
    background: #e3e3e3;
    margin: 8px 0;
}

/* LOGO */
.chat-logo-wrap {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.chat-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* TITLE + SUBTITLE */
.chat-title-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 0 1 auto;
}

.chat-title {
    font-size: 20px;
    text-transform: lowercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #111827;
}

.chat-subtitle-main {
    font-size: 11px;
    text-transform: uppercase;
    color: #7f7f7f;
    letter-spacing: 0.11em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-spacer {
    flex: 1 1 auto;
}

/* DRAFT ICON BUTTON */
.draft-icon-button {
    position: relative;
    width: 56px;
    height: 56px;
    margin-left: auto;
    border: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    border-radius: 999px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

    .draft-icon-button:focus,
    .draft-icon-button:focus-visible {
        outline: none;
        box-shadow: none;
    }

    .draft-icon-button:disabled {
        opacity: 0.4;
        cursor: default;
    }

.draft-icon {
    font-size: 34px;
    line-height: 1;
}

.draft-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e02424;
    color: #ffffff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pharmacy picker */
.chat-header-bottom {
    margin-top: 0.35rem;
    display: flex;
    justify-content: flex-end;
}

.pharmacy-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.pharmacy-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #7f7f7f;
    letter-spacing: 0.09em;
}

.pharmacy-select {
    min-width: 260px;
    padding: 4px 4px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #cccccc;
    background-color: #f9f9f9;
}

/* ============================================================================
   9) CHAT BODY / MESSAGES
   ============================================================================ */

.chat-body {
    flex: 1;
    padding: 0.75rem 1.5rem;
    overflow-y: auto;
    font-size: 13px;
}

.chat-text {
    white-space: pre-line;
}

.chat-empty {
    text-align: center;
    margin-top: 3rem;
    color: #777777;
    font-size: 0.9rem;
}

.chat-empty-example {
    display: block;
    margin-top: 0.5rem;
    font-style: italic;
    color: #999999;
}

.chat-message-row {
    display: flex;
    margin-bottom: 0.75rem;
}

    .chat-message-row.from-user {
        justify-content: flex-end;
    }

    .chat-message-row.from-assistant {
        justify-content: flex-start;
    }

.chat-bubble {
    max-width: 75%;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.chat-message-row.from-user .chat-bubble {
    background-color: #595959;
    border-color: #595959;
    color: #ffffff;
}

.chat-meta {
    margin-top: 0.25rem;
    font-size: 0.7rem;
    opacity: 0.8;
}

/* ============================================================================
   10) CHAT FOOTER
   ============================================================================ */

.chat-footer {
    border-top: 1px solid #e0e0e0;
    padding: 0.75rem 1.5rem 0.4rem 1.5rem;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-footer-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.chat-input {
    flex: 1;
    min-height: 60px;
    max-height: 60px;
    resize: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #cccccc;
    font-size: 0.9rem;
    background-color: #f9f9f9;
    box-sizing: border-box;
}

.chat-input-mic .stt-status,
.chat-input-mic .stt-hint {
    display: none !important;
}

.chat-mic-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
}

    .chat-mic-wrap button,
    .chat-input-mic button,
    .chat-action-btn {
        height: 60px;
        width: 60px;
        border-radius: 10px;
        border: 2px solid #cccccc;
        background: #f9f9f9;
        color: #111827;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        font-size: 26px;
        user-select: none;
    }

        .chat-mic-wrap button:hover,
        .chat-input-mic button:hover,
        .chat-action-btn:hover {
            border-color: #9a9a9a;
            background: #ffffff;
        }

        .chat-mic-wrap button:active,
        .chat-input-mic button:active,
        .chat-action-btn:active {
            transform: scale(0.98);
        }

        .chat-mic-wrap button:disabled,
        .chat-input-mic button:disabled,
        .chat-action-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
            transform: none;
        }

        /* SEND mode */
        .chat-action-btn.send-mode {
            background: #404040;
            border-color: #404040;
            color: #ffffff;
        }

            .chat-action-btn.send-mode .send-arrow {
                color: #ffffff;
                font-size: 28px;
                font-weight: 900;
                line-height: 1;
            }

            .chat-action-btn.send-mode svg {
                stroke: #ffffff;
                stroke-width: 3;
            }

.chat-disclaimer {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #888888;
    font-style: italic;
    text-align: center;
    width: 100%;
}

/* ============================================================================
   11) DRAFT MODAL
   ============================================================================ */

.draft-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.30);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 7000;
    padding: 18px;
}

.draft-modal {
    width: min(980px, 96vw);
    max-height: 92vh;
    background: var(--mh-card);
    border-radius: 18px;
    box-shadow: var(--mh-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.draft-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--mh-border);
    font-weight: 700;
    color: var(--mh-text);
    background: #ffffff;
}

.draft-modal-close {
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--mh-muted);
    padding: 6px 10px;
    border-radius: 10px;
}

    .draft-modal-close:hover {
        background: rgba(0,0,0,0.04);
    }

.draft-modal-body {
    padding: 14px;
    background: var(--mh-bg);
    overflow: auto;
    flex: 1;
}

.draft-empty {
    background: var(--mh-card);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    padding: 18px;
    color: var(--mh-muted);
}

/* Warning bar */
.draft-modal-error-bar {
    padding: 10px 12px;
    margin: 10px 14px 0;
    border-radius: 12px;
    background: rgba(255, 59, 48, 0.12);
    border: 1px solid rgba(255, 59, 48, 0.28);
    color: #3a3a3a;
    font-size: 13px;
    line-height: 1.3;
}

/* Patient container */
.patient-block {
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 14px;
    padding: 14px;
    margin: 12px 0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 8px 24px rgba(0,0,0,0.06);
}

    .patient-block.patient-reviewed {
        border-color: #bfe7c6;
        box-shadow: 0 0 0 3px rgba(112, 197, 132, 0.16);
    }

.patient-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    width: 100%;
}

.patient-name-edit {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.draft-patient-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.draft-patient-input,
.draft-dob-input,
.patient-pharmacy-select,
.draft-drug-input,
.draft-number-input,
.draft-sig-input,
.draft-notes-input,
.draft-pin-input {
    background: #ffffff;
    color: var(--mh-text);
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
    font: inherit;
    box-sizing: border-box;
}

.draft-patient-input {
    width: 100%;
    font-weight: 700;
}

.draft-dob-input {
    width: 100%;
    flex: 0 0 140px;
    min-width: 0;
    color: var(--mh-muted);
}

.draft-number-input {
    max-width: 220px;
}

.draft-sig-input,
.draft-notes-input {
    resize: vertical;
    min-height: 44px;
}

    .draft-patient-input:focus,
    .draft-dob-input:focus,
    .patient-pharmacy-select:focus,
    .draft-drug-input:focus,
    .draft-number-input:focus,
    .draft-sig-input:focus,
    .draft-notes-input:focus,
    .draft-pin-input:focus {
        border-color: #cfcfcf;
        box-shadow: 0 0 0 4px rgba(0,0,0,0.06);
    }

.draft-patient-input.is-invalid {
    background: rgba(255, 59, 48, 0.10);
    border: 1px solid rgba(255, 59, 48, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.10);
}

.draft-field-error {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.2;
    color: #d92d20;
    letter-spacing: 0.2px;
}

/* Remove buttons */
.remove-draft-btn, .remove-item-btn {
    background: transparent;
    border: none;
    color: #c40000;
    font-weight: 800;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

    .remove-draft-btn:hover, .remove-item-btn:hover {
        background: rgba(204, 0, 0, 0.06);
    }

    .remove-item-btn:disabled, .remove-draft-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Pharmacy picker */
.patient-pharmacy-row {
    margin: 8px 0 12px 0;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--mh-border);
}

.patient-pharmacy-picker.full-width {
    width: 100%;
}

.patient-pharmacy-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--mh-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.patient-pharmacy-select {
    width: 100%;
}

/* Reviewed toggle + count row */
.patient-review-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 6px;
    border-top: 1px solid #efefef;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    margin: 10px 0 12px 0;
}

.review-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-label {
    font-size: 13px;
    color: #444;
}

.review-count {
    font-size: 12px;
    color: #666;
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d0d0d0;
    transition: 0.15s;
    border-radius: 999px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 20px;
        width: 20px;
        left: 3px;
        top: 3px;
        background: white;
        transition: 0.15s;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

.switch input:checked + .slider {
    background: #34c759;
}

    .switch input:checked + .slider:before {
        transform: translateX(20px);
    }

.switch input:disabled + .slider {
    cursor: not-allowed;
    opacity: 0.55;
}

/* Individual medication card */
.draft-item {
    margin-top: 12px;
    background: var(--mh-card);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    box-shadow: var(--mh-shadow-soft);
    padding: 12px;
}

.draft-item-toprow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.draft-item-number {
    font-weight: 800;
    color: var(--mh-text);
}

/* Two-column form rows */
.draft-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px;
    align-items: start;
    margin: 10px 0;
}

.draft-label {
    color: var(--mh-muted);
    font-weight: 700;
    font-size: 13px;
    padding-top: 10px;
}

.draft-label-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

/* Match pill */
.match-pill {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

    .match-pill.matched {
        background: rgba(52,199,89,0.12);
        color: #1b6b35;
    }

    .match-pill.not-matched {
        background: rgba(255,59,48,0.10);
        color: #8b1a13;
    }

/* Actions */
.draft-actions-spacer {
    height: 12px;
}

.draft-actions {
    margin-top: 10px;
}

/* Primary Sign button */
.sign-button {
    width: 100%;
    min-height: 48px;
    padding: 14px 18px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 12px;
    background: linear-gradient(to bottom, #0A84FF 0%, #007AFF 100%);
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.30) inset, 0 10px 22px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.10);
    transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

    .sign-button:hover:not(:disabled) {
        filter: brightness(1.05);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.32) inset, 0 12px 26px rgba(0, 0, 0, 0.16), 0 3px 8px rgba(0, 0, 0, 0.12);
    }

    .sign-button:active:not(:disabled) {
        transform: translateY(1px);
        filter: brightness(0.98);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 7px 16px rgba(0, 0, 0, 0.14), 0 2px 5px rgba(0, 0, 0, 0.10);
    }

    .sign-button:focus-visible {
        outline: none;
        box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.35), 0 1px 0 rgba(255, 255, 255, 0.30) inset, 0 10px 22px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.10);
    }

    .sign-button:disabled {
        background: linear-gradient(to bottom, #E5E5EA 0%, #D1D1D6 100%);
        color: #8E8E93;
        border-color: rgba(0, 0, 0, 0.10);
        cursor: not-allowed;
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
        transform: none;
        filter: none;
    }

/* Footer PIN */
.draft-modal-footer {
    border-top: 1px solid var(--mh-border);
    padding: 12px 14px;
    background: var(--mh-card);
}

.draft-pin-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.draft-pin-label {
    color: var(--mh-muted);
    font-weight: 700;
}

.draft-shake {
    animation: draftShake 0.32s ease;
}

@keyframes draftShake {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }

    100% {
        transform: translateX(0);
    }
}

/* ============================================================================
   12) PATIENT MATCH BANNER
   ============================================================================ */

.pm-banner-white {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    margin: 10px 0 6px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 8px 24px rgba(0,0,0,0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pmw-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.pmw-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #6b7280;
    line-height: 1.1;
}

.pmw-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pmw-name {
    font-size: 14px;
    font-weight: 600;
    color: #0b0b0f;
    line-height: 1.15;
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pmw-pill {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    color: #374151;
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.pmw-chip {
    width: fit-content;
    max-width: 100%;
    font-size: 16px;
    font-weight: 700;
    color: #eb5050;
    background: #ffffff;
    border: none;
    padding: 6px 10px;
    border-radius: 0px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pmw-btn {
    flex: 0 0 auto;
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.08);
    color: #111827;
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .06s ease, background-color .15s ease, box-shadow .15s ease;
}

    .pmw-btn:hover {
        background: rgba(0,0,0,0.06);
        box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    }

    .pmw-btn:active {
        transform: translateY(1px);
    }

    .pmw-btn:disabled {
        opacity: .55;
        cursor: not-allowed;
        box-shadow: none;
    }

@media (max-width: 520px) {
    .pm-banner-white {
        flex-direction: column;
        align-items: stretch;
    }

    .pmw-btn {
        width: 100%;
        text-align: center;
    }
}

/* ============================================================================
   13) RESPONSIVE TWEAKS (Draft + Chat)
   ============================================================================ */

@media (max-width: 640px) {
    .draft-row {
        grid-template-columns: 1fr;
    }

    .draft-label {
        padding-top: 0;
    }

    .draft-number-input {
        max-width: 100%;
    }

    .draft-pin-input {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 900px) {
    .chat-header-bottom {
        justify-content: flex-start;
    }

    .pharmacy-section {
        width: 100%;
        align-items: flex-start;
        margin-top: 6px;
    }

    .pharmacy-select {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .chat-bubble {
        max-width: 100%;
    }
}

/* ============================================================================
   14) PRESCRIPTION HISTORY (RX)
   ============================================================================ */

.rx-history-root {
    background: #f2f2f2;
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    color: rgba(15, 23, 42, 0.92);
    font-size: 14px;
}

.rx-history-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: nowrap;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg, #f2f2f2);
    padding-top: 10px;
    padding-bottom: 10px;
}

.rx-back {
    width: auto;
    height: auto;
    border: none;
    background: transparent;
    padding: 6px;
    border-radius: 0;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    flex: 0 0 auto;
}

.rx-search {
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    font-size: 15px;
    background: #fff;
}

.rx-muted {
    color: rgba(15, 23, 42, 0.60);
    font-weight: 500;
    padding: 10px 2px;
}

/* List wrapper */
.rx-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ============================================================================
   RX TILE GRID (FINAL, SINGLE SOURCE OF TRUTH)
   Your markup must use: rx-tile rx-clickable + rx-tile-grid + rx-row1/2a/3 etc.
   ============================================================================ */

.rx-tile {
    width: 100%;
    border-radius: 14px;
    border: 1px solid #ffffff;
    background: #fff;
    padding: 10px 12px;
    text-align: left;
}

.rx-clickable {
    cursor: pointer;
}

.rx-tile-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* Row 1 */
.rx-row1 {
    display: flex;
    align-items: center;
    min-width: 0;
}

.rx-row1-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

/* Mugshot circle */
.rx-mugshot {
    width: 50px;
    height: 50px;
    border-radius: 999px;
    overflow: hidden;
    background: #2f2f2f;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    flex: 0 0 34px;
}

    .rx-mugshot img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Patient name */
.rx-patient-name2 {
    font-size: 18px;
    font-weight: 600;
    color: #404040;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
    padding-bottom: 10px;
}
/* Patient dob */
.rx-patient-dob2 {
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}


/* Row 2: Pharmacy left, Status right */
.rx-row2a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.rx-pharmacy-name2 {
    font-size: 12.5px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

/* Status pill */
.rx-status-pill {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #d9d9d9;
    background: #f7f7f7;
    color: #333;
    white-space: nowrap;
}

.rx-status-pill-pending {
    background: #f7f7f7;
    border-color: #d9d9d9;
    color: #333;
}

.rx-status-pill-ack {
    background: #eef6ff;
    border-color: #bcdcff;
    color: #144a7a;
}

.rx-status-pill-revoked {
    background: #fbecec;
    border-color: #f2b2b2;
    color: #b10000;
}

/* Row 3: meta line */
.rx-row3 {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    padding-top: 5px;
}

.rx-meta2line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.rx-meta-dot {
    opacity: 0.6;
}

/* Tile states */
.rx-tile-revoked {
    background: #f8eeee;
    border-color: #f2b2b2;
}

.rx-tile-ack {
    background: #f3f8ff;
    border-color: #bcdcff;
}

.rx-clickable:hover {
    background: #ffffff;
    border-color: #ffffff;
}

.rx-clickable {
    -webkit-tap-highlight-color: transparent;
}

/* Year bar */
.rx-yearbar {
    position: sticky;
    bottom: 0;
    margin-top: 14px;
    padding: 10px 6px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(242,242,242,0.92);
    backdrop-filter: blur(6px);
    border-top: 1px solid rgba(15, 23, 42, 0.10);
}

.rx-year-pill {
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #ffffff;
    color: rgba(15, 23, 42, 0.70);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

    .rx-year-pill:hover {
        border-color: rgba(15, 23, 42, 0.22);
    }

    .rx-year-pill.is-active {
        background: rgba(15, 23, 42, 0.92);
        border-color: rgba(15, 23, 42, 0.92);
        color: #ffffff;
    }

@media (max-width: 640px) {
    .rx-history-root {
        padding: 12px;
    }

    .rx-back {
        padding: 4px;
        font-size: 22px;
    }

    .rx-search {
        font-size: 14px;
    }
}

/* ============================================================================
   15) PATIENT LIST (WhatsApp-style list)
   ============================================================================ */

.wa-page, .wa-shell {
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
}

.wa-shell {
    padding: 0 0 24px;
}

.wa-topbar, .wa-header {
    background: var(--wa-green);
    color: #fff;
    padding: 14px 14px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.wa-topbar-title, .wa-title {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.wa-topbar-actions, .wa-actions {
    display: flex;
    gap: 6px;
}

.wa-icon, .wa-icon-btn {
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    padding: 6px 8px;
    border-radius: 10px;
    transition: background-color 0.12s ease;
}

    .wa-icon:hover, .wa-icon-btn:hover {
        background: rgba(255,255,255,0.12);
    }

.wa-search-row {
    background: var(--card);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.wa-search-wrap {
    background: var(--card);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
}

.wa-search {
    width: 100%;
    flex: 1;
    border: 1px solid var(--border);
    background: #fafafa;
    border-radius: 999px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    color: var(--text);
}

    .wa-search:focus {
        background: #fff;
        border-color: #d9d9d9;
    }

.wa-new {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,0);
    border-radius: 999px;
    background: #eef7f5;
    color: var(--wa-green);
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    transition: background-color 0.12s ease, transform 0.05s ease;
}

    .wa-new:hover {
        background: #e6f3ef;
    }

    .wa-new:active {
        transform: translateY(1px);
    }

.wa-state {
    margin: 12px;
    padding: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--muted);
    font-size: 14px;
}

.wa-error {
    border-color: #f0caca;
    background: #fff7f7;
}

.wa-state-title {
    font-weight: 900;
    color: var(--text);
    margin-bottom: 4px;
}

.wa-state-text {
    font-size: 13px;
    color: var(--muted);
}

.wa-list {
    background: var(--card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-left: none;
    border-right: none;
    border-radius: 0;
    box-shadow: none;
    margin-top: 0;
    overflow: hidden;
}

.wa-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    cursor: pointer;
    border-bottom: 1px solid var(--divider);
    transition: background-color 0.12s ease;
    border: none;
    text-align: left;
}

    .wa-row:hover {
        background: #fafafa;
    }

    .wa-row:last-child {
        border-bottom: none;
    }

.wa-avatar {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    overflow: hidden;
    flex: 0 0 46px;
    background: #f4f4f4;
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
}

.wa-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wa-avatar-fallback {
    font-weight: 900;
    color: #666;
    font-size: 13px;
}

.wa-body {
    flex: 1;
    min-width: 0;
}

.wa-line1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wa-name {
    font-weight: 900;
    color: var(--text);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-line2 {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-badge {
    background: var(--badge-green);
    color: #fff;
    font-weight: 900;
    font-size: 12px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

@media (max-width: 520px) {
    .wa-page, .wa-shell {
        max-width: 100%;
    }
}

/* ============================================================================
   16) PATIENT MUGSHOT (Shared components)
   ============================================================================ */

.mh-mugshot-card {
    display: flex;
    gap: 12px;
    align-items: center;
}

.mh-mugshot-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

    .mh-mugshot-image img {
        width: 96px;
        height: 96px;
        border-radius: 18px;
        object-fit: cover;
        background: #f2f2f2;
        border: 1px solid rgba(0,0,0,0.08);
    }

/* Full placeholder (square) */
.mh-mugshot-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fafafa, #f0f0f0);
    border: 1px solid rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .mh-mugshot-placeholder span {
        font-weight: 800;
        font-size: 22px;
        color: #666;
        letter-spacing: 0.02em;
    }

/* Actions */
.mh-mugshot-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mh-mugshot-btn {
    position: relative;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.12);
    background: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.05s ease, box-shadow 0.15s ease;
    user-select: none;
}

    .mh-mugshot-btn:hover {
        box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    }

    .mh-mugshot-btn:active {
        transform: translateY(1px);
    }

.mh-mugshot-secondary {
    background: #f7f7f7;
}

.mh-mugshot-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.mh-mugshot-file {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.mh-mugshot-error {
    margin-left: 12px;
    color: #8a1f1f;
    font-size: 12px;
}

/* Compact mode (circle) */
.mh-mugshot-card.mh-mugshot-compact .mh-mugshot-image img,
.mh-mugshot-card.mh-mugshot-compact .mh-mugshot-placeholder {
    width: 60px !important;
    height: 60px !important;
    border-radius: 999px !important;
    overflow: hidden !important;
}

/* Your requested compact placeholder look */
.mh-mugshot-card.mh-mugshot-compact .mh-mugshot-placeholder {
    background: #f2f2f2 !important;
    border: 0px solid rgba(255,255,255,0.18) !important;
    box-shadow: none !important;
}

    .mh-mugshot-card.mh-mugshot-compact .mh-mugshot-placeholder span {
        color: #404040 !important;
        font-size: 25px;
        font-weight: 550;
        letter-spacing: 0.08em;
        text-shadow: none !important;
    }

/* ============================================================================
   PHYSICIAN PROFILE + PATIENT EDIT (shared “profile-*” UI)
   ============================================================================ */

.profile-shell {
    min-height: 100vh;
    background: #f5f5f7;
}

.profile-root {
    max-width: 760px;
    margin: 0 auto;
    padding: 18px 16px 28px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #1c1c1e;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.profile-back {
    border: none;
    background: transparent;
    padding: 6px 8px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #1c1c1e;
}

    .profile-back:hover {
        background: rgba(0,0,0,0.05);
    }

.profile-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.profile-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1c1c1e;
    color: rgba(28, 28, 30, 0.75);
}

.profile-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: rgba(28, 28, 30, 0.55);
}

.profile-muted {
    color: rgba(28, 28, 30, 0.55);
    font-weight: 600;
    padding: 10px 2px;
}

.profile-error {
    background: rgba(255, 59, 48, 0.10);
    border: 1px solid rgba(255, 59, 48, 0.25);
    color: rgba(120, 20, 15, 0.95);
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 700;
}

.profile-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 10px 25px rgba(0,0,0,0.06);
    margin: 12px 0;
    align-items: center;
}

.profile-section-title {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(28, 28, 30, 0.55);
    margin-bottom: 10px;
    text-align: center;
}

.profile-field {
    margin: 0 0 12px 0;
}

.profile-label {
    font-weight: 500;
    letter-spacing: 0.6px;
    font-size: 12px;
    color: rgba(28, 28, 30, 0.55);
    margin-bottom: 6px;
}

.profile-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(0,0,0,0.12);
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 12px;
    font-size: 14px;
    color: #1c1c1e;
    outline: none;
}

    .profile-input:disabled {
        background: rgba(0,0,0,0.03);
        color: rgba(28, 28, 30, 0.65);
    }

    .profile-input:focus {
        border-color: rgba(10, 132, 255, 0.45);
        box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.18);
    }

.profile-divider {
    height: 1px;
    background: #ffffff;
    margin: 14px 2px;
    margin-bottom: 20px;
}

.profile-hint {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(28, 28, 30, 0.55);
    font-weight: 600;
}

.profile-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.profile-primary {
    border: 1px solid rgba(0,0,0,0.18);
    background: linear-gradient(to bottom, #7f7f7f 0%, #595959 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 10px 22px rgba(0,0,0,0.12);
    transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

    .profile-primary:hover:not(:disabled) {
        filter: brightness(1.03);
        box-shadow: 0 1px 0 rgba(255,255,255,0.28) inset, 0 12px 26px rgba(0,0,0,0.14);
    }

    .profile-primary:active:not(:disabled) {
        transform: translateY(1px);
        filter: brightness(0.98);
    }

    .profile-primary:disabled {
        opacity: 0.55;
        cursor: not-allowed;
        transform: none;
        box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset;
    }

.profile-field .validation-message {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(220, 38, 38, 0.95);
}

/* ============================================================================
   RX DETAILS MODAL (SINGLE SOURCE OF TRUTH)
   ============================================================================ */

body.rx-modal-open {
    overflow: hidden;
}

.rx-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9000;
}

.rx-modal-shell {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    z-index: 9001;
}

.rx-modal {
    width: min(1100px, 96vw);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.18);
    border: 1px solid rgba(0,0,0,0.06);
}

.rx-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.rx-modal-title {
    font-weight: 600;
    font-size: 14px;
    color: #222;
}

.rx-modal-close {
    border: 0;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.65;
}

    .rx-modal-close:hover {
        opacity: 1;
    }

.rx-modal-body {
    padding: 16px;
}

.rx-detail-split {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 14px;
}

@media (max-width: 900px) {
    .rx-detail-split {
        grid-template-columns: 1fr;
    }
}

.rx-panel {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 12px;
}

.rx-panel-inner {
    display: grid;
    gap: 10px;
}

.rx-row2 {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    align-items: start;
}

.rx-label {
    font-size: 12px;
    font-weight: 800;
    color: rgba(15, 23, 42, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-top: 2px;
}

.rx-value {
    color: rgba(15, 23, 42, 0.90);
    font-weight: 600;
}

.rx-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(15, 23, 42, 0.03);
    color: rgba(15, 23, 42, 0.78);
}

.rx-chip-ack {
    border-color: rgba(59,130,246,0.25);
    background: rgba(59,130,246,0.07);
    color: rgba(30,64,175,0.92);
}

.rx-chip-revoked {
    border-color: rgba(220,38,38,0.25);
    background: rgba(220,38,38,0.07);
    color: rgba(185,28,28,0.92);
}

.rx-section {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.55);
    margin-bottom: 10px;
}

.rx-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rx-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 14px;
    padding: 12px;
}

.rx-card-head {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.rx-pill {
    font-size: 11px;
    font-weight: 900;
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: rgba(15, 23, 42, 0.70);
    flex: 0 0 auto;
}

.rx-drug {
    font-weight: 800;
    color: rgba(15, 23, 42, 0.92);
    min-width: 0;
}

.rx-sig {
    white-space: pre-line;
    color: rgba(15, 23, 42, 0.85);
    font-weight: 600;
    margin-top: 6px;
}

.rx-meta2 {
    margin-top: 8px;
    color: rgba(15, 23, 42, 0.60);
    font-size: 12.5px;
    font-weight: 600;
}

.draft-password-input {
    width: 100%;
}

/* ============================================================================
   END OF FILE
   ============================================================================ */

/* Put this in your CSS that loads AFTER app.css */
.mh-icon-btn {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
}

.mh-icon-pill {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
}

.rx-pill-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rx-actions-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 25px; /* adjust: 10–18px */
}

/* The collapsing tray wrapper */
.rx-actions-tray {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height 220ms ease, opacity 180ms ease, transform 220ms ease;
    will-change: max-height, opacity, transform;
}


    /* When open */
    .rx-actions-tray.is-open {
        max-height: 90px; /* big enough for the icons row */
        opacity: 1;
        transform: translateY(0);
    }

        /* Optional: add a little top spacing only when visible */
        .rx-actions-tray.is-open .rx-actions-row {
            padding-top: 10px;
        }

.rx-call-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
}

.mh-invite-img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    display: block;
}

/* =========================================================
   INVITE PATIENT ICON PANEL (matches screenshot)
   ========================================================= */

.mh-invite-card {
    background: #fff;
    border: 2px solid #d9d9d9;
    border-radius: 26px;
    padding: 18px 18px 16px;
    margin-bottom: 14px;
}

.mh-invite-title {
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 12px;
    color: rgba(28, 28, 30, 0.55);
    margin-bottom: 10px;
}

.mh-invite-title-2 {
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 11px;
    color: rgba(28, 28, 30, 0.55);
    margin-bottom: 10px;
}

.mh-invite-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
    justify-items: center;
    padding: 8px 6px 2px;
}

/* each tile behaves like a clean icon button */
.mh-invite-tile {
    appearance: none;
    border: none;
    background: transparent;
    padding: 6px 4px;
    width: 100%;
    max-width: 180px;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    color: rgba(28, 28, 30, 0.55);
    font-weight: 600;
}

    .mh-invite-tile:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

/* big circular icon container */
.mh-invite-icon {
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: #ffffff;
    display: grid;
    place-items: center;
    margin: 0 auto 10px;
}

/* icon image inside circle */
.mh-invite-img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    display: block;
}

/* label under icon */
.mh-invite-label {
    font-weight: 600;
    letter-spacing: 0.6px;
    font-size: 12px;
    color: rgba(28, 28, 30, 0.55);
    margin-top: 2px;
}


/* pressed */
.mh-invite-tile:not(:disabled):active .mh-invite-icon {
    transform: scale(0.98);
}

/* responsive: 2x2 on smaller screens */
@media (max-width: 780px) {
    .mh-invite-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .mh-invite-icon {
        width: 110px;
        height: 110px;
    }

    .mh-invite-img {
        width: 88px;
        height: 88px;
    }

    /* Make the displayed mugshot circular */
    #mhMugshotHost img {
        width: 128px;
        height: 128px;
        border-radius: 999px;
        object-fit: cover;
        display: block;
        margin: 0 auto;
        box-shadow: 0 10px 22px rgba(0,0,0,0.10);
    }

    /* If PatientMugshot wraps the image in a container, make that circular too */
    #mhMugshotHost > * {
        margin-left: auto;
        margin-right: auto;
    }

}

/*------------------------*/
/* Stop the browser page from scrolling */
html, body {
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
}

/* Your whole chat screen */
.chat-root {
    height: 100vh;
    height: 100svh; /* better on phones */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* KEY: prevents header/footer from scrolling away */
}

/* Fixed areas (always visible) */
.chat-header,
.chat-footer {
    flex: 0 0 auto;
}

/* Red-square area (ONLY this scrolls) */
.chat-body {
    flex: 1 1 auto;
    min-height: 0; /* KEY: allows it to shrink so scrolling works */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* common Blazor template containers. keep the ones that exist in your app */
#app, .page, .main, .content {
    height: 100%;
    overflow: hidden;
}

.chat-root {
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header, .chat-footer {
    flex: 0 0 auto;
}

.chat-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}


/*--------------------------*/

/* =========================================================
   GLOBAL SCROLL FIX (undo the "overflow:hidden" lockdown)
   Put this at the VERY BOTTOM of app.css
   ========================================================= */

/* Let the browser scroll pages again */
html, body {
    height: auto !important;
    min-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Blazor template containers: stop trapping scroll */
#app, .page, .main, .content, .container, .layout, .app, .shell {
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
}

/* If you have a main layout wrapper that was forced to 100% + hidden */
main {
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
}

/* Blinking “Listening” */
.mh-blink {
    animation: mhBlink 1s steps(2, start) infinite;
}

@keyframes mhBlink {
    to {
        visibility: hidden;
    }
}

/* Optional: helps you style the active mic state */
.mh-listening-on {
    font-weight: 600;
}

/* ================================
   LISTENING / DICTATION UI (CHAT)
   ================================ */

/* Container that holds the mic button + indicator */
.mh-dictation-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

/* Mic button */
.mh-dictation-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid #dedede;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

    .mh-dictation-btn:hover {
        border-color: #cfcfcf;
        box-shadow: 0 2px 8px rgba(0,0,0,.10);
    }

    .mh-dictation-btn:active {
        transform: scale(0.98);
    }

    .mh-dictation-btn:disabled {
        opacity: .55;
        cursor: not-allowed;
        box-shadow: none;
    }

    /* Optional icon inside the mic button (SVG/img/font icon) */
    .mh-dictation-btn .mh-dictation-icon {
        font-size: 18px;
        line-height: 1;
    }

    /* When recording, make the button feel “live” */
    .mh-dictation-btn.is-listening {
        border-color: #bdbdbd;
        box-shadow: 0 6px 18px rgba(0,0,0,.14);
    }

/* Little square/stop indicator style (if you’re using a square) */
.mh-dictation-stop {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #111;
}

/* Status pill */
.mh-listening-pill {
    height: 44px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #e3e3e3;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #6b6b6b;
    font-size: 14px;
    letter-spacing: .2px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* Label text (optional) */
.mh-listening-text {
    font-weight: 600;
    color: #5f5f5f;
}

/* Animated “audio dots” */
.mh-audio-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 14px;
}

    .mh-audio-dots span {
        width: 4px;
        height: 4px;
        border-radius: 999px;
        background: #7a7a7a;
        opacity: .35;
        transform: translateY(0);
        animation: mhDotPulse 1.05s infinite ease-in-out;
    }

        .mh-audio-dots span:nth-child(2) {
            animation-delay: .12s;
        }

        .mh-audio-dots span:nth-child(3) {
            animation-delay: .24s;
        }

        .mh-audio-dots span:nth-child(4) {
            animation-delay: .36s;
        }

@keyframes mhDotPulse {
    0%, 100% {
        opacity: .30;
        transform: translateY(0);
    }

    50% {
        opacity: .95;
        transform: translateY(-6px);
    }
}

/* “Recording” state: slightly darker */
.mh-listening-pill.is-listening {
    border-color: #d2d2d2;
}

    .mh-listening-pill.is-listening .mh-listening-text {
        color: #444;
    }

/* Make sure it aligns nicely with the input row */
.mh-chat-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

    /* Put the dictation UI at far right if needed */
    .mh-chat-input-row .mh-dictation-wrap {
        margin-left: auto;
    }

/* Mobile: tighten spacing */
@media (max-width: 640px) {
    .mh-listening-pill {
        padding: 0 10px;
        gap: 8px;
        font-size: 13px;
    }

    .mh-dictation-btn {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .mh-listening-pill {
        height: 42px;
    }
}

.stt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
}

.stt-svg {
    width: 20px;
    height: 20px;
    fill: currentColor; /* inherits text color */
}

.chat-action-btn {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.mh-holdmic {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.mh-listening-text {
    pointer-events: none;
}

/* ============================================================
   HOLD-TO-RECORD (WhatsApp-ish) UI
   ============================================================ */

.chat-mic-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Recording pill that replaces the mic while holding */
.mh-rec-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e6e6e6;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    max-width: 260px;
    overflow: hidden;
}

.mh-rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff3b30;
    box-shadow: 0 0 0 3px rgba(255,59,48,.14);
    flex: 0 0 auto;
}

.mh-rec-time {
    font-size: 14px;
    color: #444;
    letter-spacing: .4px;
    min-width: 44px;
    flex: 0 0 auto;
}

.mh-rec-hint {
    font-size: 12px;
    color: #777;
    white-space: nowrap;
    flex: 0 0 auto;
}

/* Animated "wave dots" */
.mh-rec-wave {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 14px;
    flex: 1 1 auto;
    min-width: 70px;
}

    .mh-rec-wave i {
        display: block;
        width: 4px;
        height: 6px;
        border-radius: 4px;
        background: #8c8c8c;
        opacity: .85;
        transform-origin: bottom;
        animation: mhWave 900ms infinite ease-in-out;
    }

        .mh-rec-wave i:nth-child(1) {
            animation-delay: 0ms;
        }

        .mh-rec-wave i:nth-child(2) {
            animation-delay: 80ms;
            height: 9px;
        }

        .mh-rec-wave i:nth-child(3) {
            animation-delay: 160ms;
            height: 12px;
        }

        .mh-rec-wave i:nth-child(4) {
            animation-delay: 240ms;
            height: 9px;
        }

        .mh-rec-wave i:nth-child(5) {
            animation-delay: 320ms;
            height: 6px;
        }

        .mh-rec-wave i:nth-child(6) {
            animation-delay: 400ms;
            height: 8px;
        }

        .mh-rec-wave i:nth-child(7) {
            animation-delay: 480ms;
            height: 11px;
        }

        .mh-rec-wave i:nth-child(8) {
            animation-delay: 560ms;
            height: 9px;
        }

        .mh-rec-wave i:nth-child(9) {
            animation-delay: 640ms;
            height: 6px;
        }

        .mh-rec-wave i:nth-child(10) {
            animation-delay: 720ms;
            height: 8px;
        }

@keyframes mhWave {
    0%,100% {
        transform: scaleY(.55);
        opacity: .55;
    }

    50% {
        transform: scaleY(1.25);
        opacity: 1;
    }
}

/* Optional: make the mic button feel more "press-and-hold" */
.mh-holdmic {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* If you still have this in CSS somewhere, it’s now useless.
   You can delete it to avoid accidental resurrection. */
/*
.mh-listening-text { ... }
*/

/* Keep mic in DOM so pointerup/touchend still fires, but hide it visually */
.mh-mic-hidden {
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: auto;
}

.mh-invite-wrap-1 {
    display: inline-flex;
    flex-direction: column;
    align-items: center; /* centers icon + label */
    justify-content: center;
    text-align: center;
}

    /* center the icon inside the button (even if rx-action has weird padding/width elsewhere) */
    .mh-invite-wrap-1 .rx-action {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0; /* prevents lopsided padding */
        line-height: 0; /* removes baseline spacing */
        background: transparent; /* optional, keeps it clean */
        border: 0; /* optional */
    }

    /* make the image center properly */
    .mh-invite-wrap-1 .mh-icon-btn {
        display: block;
    }

/* your label style */
.mh-invite-label-1 {
    font-weight: 600;
    letter-spacing: 0.6px;
    font-size: 10px;
    color: rgba(28, 28, 30, 0.55);
    margin-top: 2px;
    white-space: nowrap;
}

/* stack icon over label inside the pill */
.rx-pill-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
}

/* keep icon centered and kill baseline spacing */
.rx-pill-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

/* label under icon (match your style) */
.rx-pill-label {
    font-weight: 600;
    letter-spacing: 0.6px;
    font-size: 10px;
    color: rgba(28, 28, 30, 0.55);
    margin-top: 6px;
    white-space: nowrap;
}

/* helps images center consistently */
.mh-icon-pill {
    display: block;
}

/* make the button content stack vertically */
.mh-facephoto-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 0;
}

/* stack icon over label */
.mh-facephoto-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
}

/* ensure icon centers nicely */
.mh-facephoto-icon {
    display: block;
}

/* label under icon */
.mh-facephoto-label {
    font-weight: 600;
    letter-spacing: 0.6px;
    font-size: 12px;
    color: rgba(28, 28, 30, 0.55);
    margin-top: 2px;
    white-space: nowrap;
}

/* ===== Success modal look (match screenshot) ===== */

.mh-success-photo-modal {
    width: min(920px, calc(100vw - 48px));
    max-width: 920px;
}

.mh-success-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mh-success-title-left {
    font-weight: 700;
    white-space: nowrap;
}

.mh-success-header-msg {
    flex: 1;
    color: #6b6b6b;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mh-success-photo-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 18px;
    padding-bottom: 14px;
}

    /* Make the mugshot area breathe like the screenshot */
    .mh-success-photo-body #mhMugshotHost {
        margin-top: 10px;
        margin-bottom: 10px;
    }

/* Footer buttons stacked full width */
.mh-success-footer {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
}

.mh-success-fullbtn {
    width: 100%;
}

/* If your draft modal footer has its own flex row rules, force it */
.draft-modal.mh-success-photo-modal .draft-actions {
    display: contents; /* harmless if not present */
}

.patients-search-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #f2f2f2;
    padding: 10px 16px;
}

/* Push content down so it doesn't hide under the fixed bar */
.patients-list-wrap {
    padding-top: 72px; /* adjust to your search bar height */
}

.patients-page {
    height: 100vh;
    overflow-y: auto; /* this becomes the scroll container */
}

/* ============================================================
   RX HISTORY - STATUS COLORING (FAINT)
   Cancelled/Revoked  = faint red
   Dispensed/Filled   = faint green
   Pending            = neutral
   ============================================================ */

/* Tile backgrounds */
.rx-tile.rx-status-revoked {
    background: rgba(255, 0, 0, 0.06);
    border: 1px solid rgba(255, 0, 0, 0.12);
}

.rx-tile.rx-status-ack {
    background: rgba(0, 160, 0, 0.06);
    border: 1px solid rgba(0, 160, 0, 0.12);
}

.rx-tile.rx-status-pending {
    background: #fff;
}

/* Optional: slightly “disabled” look for cancelled rows */
.rx-tile.rx-status-revoked .rx-patient-name2,
.rx-tile.rx-status-revoked .rx-patient-dob2,
.rx-tile.rx-status-revoked .rx-pharmacy-name2,
.rx-tile.rx-status-revoked .rx-meta2line {
    opacity: 0.85;
}

/* Status pill coloring (matches GetStatusKind => pending/ack/revoked) */
.rx-status-pill-revoked {
    background: rgba(255, 0, 0, 0.10);
    border: 1px solid rgba(255, 0, 0, 0.18);
    color: #7a2b2b;
}

.rx-status-pill-ack {
    background: rgba(0, 160, 0, 0.10);
    border: 1px solid rgba(0, 160, 0, 0.18);
    color: #1f5a1f;
}

.rx-status-pill-pending {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #333;
}

/* ============================================================
   RX HISTORY: STICKY HEADER + STICKY YEAR BAR
   ============================================================ */

.rx-history-root {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* critical: body becomes the scroll container */
}

/* header stays at top */
.rx-history-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #f2f2f2;
    padding: 10px 12px;
    flex: 0 0 auto;
}

/* list scrolls */
.rx-history-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* keeps the last tile from hiding behind the year bar */
    padding-bottom: 84px;
}

/* year bar stays at bottom */
.rx-yearbar {
    position: sticky;
    bottom: 0;
    z-index: 50;
    background: #f2f2f2;
    border-top: 1px solid #e6e6e6;
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    flex: 0 0 auto;
}

/* make sure modal always sits above sticky bars */
.rx-modal-overlay {
    z-index: 2000;
}

.rx-modal-shell {
    z-index: 2001;
}

/* Patient Match tile tweaks (reuses rx-tile look) */
.mh-pm-wrap {
    margin-top: 10px;
}

.mh-pm-tile {
    background: #fff; /* your screenshot is white card */
    border-radius: 16px;
}

/* Make the avatar align with your tile layout */
.mh-pm-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fallback initials (if not linked) */
.mh-pm-avatar-fallback {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #efefef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #666;
}

/* Street wraps nicely */
.mh-street-line {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Note line styling (match info / errors) */
.mh-pm-note {
    margin-top: 4px;
}

/* Tray buttons: make them feel like your pills but full-width-ish */
.mh-pm-actions {
    gap: 10px;
    flex-wrap: wrap;
}

.mh-pm-pill {
    flex: 1 1 220px; /* lets them sit side-by-side or stack on narrow screens */
}

/* Patient Match tile should look like your other tiles but stay white */
.mh-pm-wrap {
    margin-top: 10px;
}

.mh-pm-tile {
    background: #fff;
    border-radius: 16px;
}

/* Same fallback avatar style */
.mh-pm-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mh-pm-avatar-fallback {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #efefef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #666;
}

/* ✅ DOB and street under name (same behavior as picker/list) */
.mh-pm-sub {
    font-size: 13px;
    color: #6b6b6b;
    line-height: 1.25;
    margin-top: 2px;
}

.mh-wrap {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Optional: keep note text aligned and not screaming */
.mh-pm-note {
    margin-top: 4px;
}

/* =========================================================
   PATIENT MATCH TILE - LINK STATUS TINT
   Unlinked  = very faint red
   Linked    = very faint green
   ========================================================= */

.mh-pm-tile.mh-pm-unlinked {
    background: rgba(255, 59, 48, 0.05);
    border: 1px solid rgba(255, 59, 48, 0.10);
}

.mh-pm-tile.mh-pm-linked {
    background: rgba(52, 199, 89, 0.06);
    border: 1px solid rgba(52, 199, 89, 0.12);
}

/* Keep tint on hover (your global hover forces white) */
.mh-pm-tile.mh-pm-unlinked:hover {
    background: rgba(255, 59, 48, 0.06);
    border-color: rgba(255, 59, 48, 0.12);
}

.mh-pm-tile.mh-pm-linked:hover {
    background: rgba(52, 199, 89, 0.07);
    border-color: rgba(52, 199, 89, 0.14);
}

/* Row 1: allow name to shrink and ellipsis instead of crashing into anything */
.rx-row1-left {
    min-width: 0;
}

.rx-patient-line {
    min-width: 0;
}

.rx-patient-name2 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Row 3 becomes a left/right bar */
.rx-row3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Meta should be allowed to shrink */
.rx-meta2line {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status pill should never shrink or wrap */
.rx-status-pill {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Responsive: make label column a bit tighter on small screens */
@media (max-width: 420px) {
    .rx-row2 {
        grid-template-columns: 96px 1fr;
    }

    .rx-modal {
        border-radius: 16px;
    }

    .rx-modal-header {
        padding: 12px 12px;
    }

    .rx-modal-body {
        padding: 12px 12px 14px 12px;
    }
}

.medihub-logo {
    width: 250px;
}

.mh-shell {
    align-items: center;
}

/* =====================
   CENTER ACTION ICONS/TRAY
   ===================== */

/* Make the tray itself a centering container */
.rx-actions-tray {
    display: flex;
    justify-content: center;
}

/* Center the row contents and make it span full width */
.rx-actions-row {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px; /* adjust spacing if you want tighter/looser */
}

/* =========================================================
   DRAFT MODAL: CENTER the patient-match tray buttons
   (Add as new + Link to existing)
   ========================================================= */

.draft-modal .mh-pm-wrap .rx-actions-tray {
    display: flex;
    justify-content: center;
}

/* Row should center its children, not stretch them */
.draft-modal .mh-pm-wrap .rx-actions-row {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap; /* behaves on small screens */
}

    /* Stop the buttons from pretending they’re full-width rows */
    .draft-modal .mh-pm-wrap .rx-actions-row .rx-call-pill {
        flex: 0 0 auto;
        width: 190px; /* tweak if you want wider/narrower */
        justify-content: center;
        text-align: center;
    }

    /* Center icon + label stack inside each button */
    .draft-modal .mh-pm-wrap .rx-actions-row .rx-pill-stack {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

/* =========================================================
   DRAFT MODAL: FORCE center the tray icons
   ========================================================= */

.draft-modal .rx-actions-tray {
    display: flex !important;
    justify-content: center !important;
}

.draft-modal .rx-actions-row {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 26px !important;
}

    /* Optional: keep the two buttons from stretching weirdly */
    .draft-modal .rx-actions-row .rx-call-pill {
        flex: 0 0 auto !important;
    }
