:root {
    --background: #f7f9fb;
    --surface: #ffffff;
    --surface-soft: #f2f4f6;
    --surface-muted: #e0e3e5;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f2f4f6;
    --surface-container: #eceef0;
    --surface-container-high: #e6e8ea;
    --surface-container-highest: #e0e3e5;
    --text: #191c1e;
    --muted: #3d494d;
    --outline: #bcc9ce;
    --primary: #00677d;
    --primary-strong: #03045e;
    --primary-bright: #00b4d8;
    --primary-soft: #b3ebff;
    --on-primary-container: #00414f;
    --success: #00664a;
    --success-soft: #9feffe;
    --danger: #ba1a1a;
    --danger-soft: #ffdad6;
    --warning: #835400;
    --warning-soft: #fff1c4;
    --radius: 16px;
    --radius-control: 8px;
    --shadow-soft: 0 4px 20px rgba(3, 4, 94, 0.05);
    --shadow-card: 0 4px 24px rgba(3, 4, 94, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

.material-symbols-outlined {
    display: inline-block;
    font-size: 21px;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
    line-height: 1;
    vertical-align: middle;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    color: var(--primary-strong);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 6px;
}

h2 {
    color: var(--primary-strong);
    font-size: 24px;
    font-weight: 700;
    margin: 24px 0 12px;
}

h3 {
    color: var(--primary-strong);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1.5px solid var(--outline);
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-bright);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.16);
    outline: none;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

label input,
label select,
label textarea {
    margin-top: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--outline);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.install-page,
.login-page {
    display: block;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    background: var(--background);
}

.public-topnav {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(188, 201, 206, 0.55);
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: space-between;
    min-height: 72px;
    padding: 14px 28px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.public-topnav .brand-row {
    margin-bottom: 0;
}

.public-topnav nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.public-topnav a {
    border-radius: 999px;
    color: var(--muted);
    font-weight: 800;
    padding: 9px 12px;
}

.public-topnav a:hover {
    background: rgba(0, 180, 216, 0.12);
    color: var(--primary);
    text-decoration: none;
}

.public-topnav a.primary-link {
    background: var(--primary-bright);
    color: #fff;
}

.public-shell {
    width: min(1280px, calc(100% - 40px));
    margin: 32px auto;
}

.installer,
.login-shell {
    width: min(1200px, 100%);
}

.login-experience {
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
    gap: 24px;
    align-items: start;
}

.login-product {
    position: sticky;
    top: 96px;
}

.login-product-card {
    min-height: 640px;
    border: 1px solid rgba(188, 201, 206, 0.35);
    border-radius: 24px;
    background:
        radial-gradient(circle at 20% 18%, rgba(0, 180, 216, 0.24), transparent 30%),
        radial-gradient(circle at 92% 82%, rgba(159, 239, 254, 0.44), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f2f4f6 100%);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    padding: 32px;
}

.login-product-card h1 {
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.02;
    margin: 10px 0 14px;
}

.eyebrow {
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.login-bento {
    display: grid;
    gap: 12px;
    margin-top: 36px;
}

.login-bento div {
    display: grid;
    gap: 4px;
    border: 1px solid rgba(188, 201, 206, 0.35);
    border-left: 4px solid var(--primary-bright);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-soft);
    padding: 16px;
}

.login-bento span {
    color: var(--primary);
}

.login-bento small {
    color: var(--muted);
    font-weight: 600;
}

.login-access-stack {
    display: grid;
    gap: 16px;
}

.auth-hero {
    background: #fff;
    overflow: hidden;
    position: relative;
}

.auth-hero::after {
    background: linear-gradient(90deg, var(--primary) 0%, rgba(0, 103, 125, 0) 100%);
    bottom: 0;
    content: "";
    height: 8px;
    left: 0;
    opacity: 0.5;
    position: absolute;
    right: 0;
}

.panel {
    background: var(--surface);
    border: 1px solid rgba(188, 201, 206, 0.45);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 24px;
}

.panel + .panel {
    margin-top: 16px;
}

.panel.wide {
    padding: 32px;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.brand-mark,
.avatar {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-control);
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.brand-logo {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-control);
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--outline);
    padding: 4px;
}

.brand-logo.large {
    width: 92px;
    height: 92px;
}

.sidebar .brand-logo {
    width: 48px;
    height: 48px;
}

.sidebar .brand-row {
    margin-bottom: 0;
}

.doctor-profile-card {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.doctor-photo {
    width: 250px;
    height: 250px;
    border: 2px solid var(--primary-soft);
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-soft);
}

.avatar-neutral {
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 54px;
    font-weight: 900;
}

.patient-profile-inline {
    display: flex;
    align-items: center;
    gap: 16px;
}

.patient-photo {
    width: 110px;
    height: 110px;
    border: 1px solid var(--outline);
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-soft);
    flex: 0 0 auto;
}

.modal-card {
    width: min(760px, calc(100% - 28px));
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    box-shadow: 0 24px 80px rgba(3, 4, 94, 0.22);
    padding: 24px;
}

.modal-card::backdrop {
    background: rgba(5, 20, 38, 0.45);
}

.layout {
    display: block;
    min-height: 100vh;
    background: var(--background);
}

.app-topnav,
.sidebar {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(188, 201, 206, 0.55);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 76px;
    box-shadow: var(--shadow-soft);
}

.app-topnav .brand-row,
.sidebar .brand-row {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.app-nav,
.sidebar nav {
    display: flex;
    flex: 1;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.app-nav::-webkit-scrollbar {
    display: none;
}

.app-nav a,
.sidebar nav a,
.sidebar nav button {
    display: flex;
    width: auto;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
}

.app-nav a.active,
.app-nav a:hover,
.sidebar nav a.active,
.sidebar nav a:hover,
.sidebar nav button:hover {
    background: var(--primary-bright);
    color: var(--on-primary-container);
    text-decoration: none;
}

.app-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.app-actions form {
    margin: 0;
}

.app-search {
    align-items: center;
    background: var(--surface-container-low);
    border-radius: 999px;
    display: flex;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    width: min(280px, 24vw);
}

.app-search .material-symbols-outlined {
    color: var(--outline);
}

.app-search input {
    min-height: 0;
    border: 0;
    background: transparent;
    padding: 0;
}

.app-search input:focus {
    box-shadow: none;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.icon-button:hover {
    background: var(--surface-container-low);
    color: var(--primary);
    text-decoration: none;
}

.app-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 2px solid var(--surface-container-high);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-bright), var(--primary));
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.content {
    padding: 32px 24px 48px;
    max-width: 1440px;
    margin: 0 auto;
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.grid {
    display: grid;
    gap: 16px;
}

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

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

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

.grid-form h2,
.grid-form .full {
    grid-column: 1 / -1;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    cursor: pointer;
    font-weight: 800;
    padding: 10px 14px;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.button.primary {
    background: var(--primary-bright);
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 180, 216, 0.18);
}

.button.secondary {
    border-color: var(--primary-strong);
    background: var(--surface);
    color: var(--primary-strong);
}

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

.button.success {
    background: var(--success);
    color: #fff;
}

.button.full {
    width: 100%;
}

.button.small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.notice {
    border-radius: var(--radius);
    margin-bottom: 14px;
    padding: 12px 14px;
    font-weight: 700;
}

.notice.success {
    background: var(--success-soft);
    color: #002116;
}

.notice.error {
    background: var(--danger-soft);
    color: #93000a;
}

.notice.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    padding: 3px 9px;
}

.badge.active,
.badge.confirmed,
.badge.success {
    background: var(--success-soft);
    color: #002116;
}

.badge.pending,
.badge.requested {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge.blocked,
.badge.cancelled,
.badge.rejected,
.badge.error {
    background: var(--danger-soft);
    color: #93000a;
}

.metric {
    background: var(--surface);
    border: 1px solid rgba(188, 201, 206, 0.5);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 18px;
}

.metric strong {
    display: block;
    font-size: 28px;
    line-height: 1;
}

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

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

.inline-password-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inline-password-form input {
    min-height: 32px;
    max-width: 190px;
    padding: 6px 8px;
}

details.panel summary.button {
    width: fit-content;
    list-style: none;
    margin-bottom: 16px;
}

details.panel summary::-webkit-details-marker {
    display: none;
}

.tabbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.tabbar a {
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    padding: 9px 12px;
}

.tabbar a.active,
.tabbar a:hover {
    background: var(--primary-soft);
    color: var(--primary);
    text-decoration: none;
}

.review-flag {
    align-self: end;
    background: var(--surface-soft);
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    color: var(--muted);
    min-height: 42px;
    padding: 10px 12px;
}

.review-flag input,
label input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin-right: 6px;
}

.record-card {
    border: 1px solid rgba(188, 201, 206, 0.45);
    border-left: 4px solid var(--primary-bright);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.file-drop-zone {
    display: grid;
    gap: 8px;
    place-items: center;
    min-height: 180px;
    border: 2px dashed #73a9d8;
    border-radius: var(--radius);
    background: #f7fbff;
    color: var(--primary);
    cursor: pointer;
    padding: 22px;
    text-align: center;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.file-drop-zone.is-dragging {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.file-drop-zone input[type="file"] {
    max-width: 360px;
    border: 0;
    background: transparent;
}

.file-drop-zone output {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.medication-rows {
    display: grid;
    gap: 14px;
}

.medication-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    background: #fbfdff;
    padding: 14px;
}

.medication-row .full {
    grid-column: 1 / -1;
}

.print-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 16px;
}

.qr {
    width: 156px;
    height: 156px;
    border: 1px solid var(--outline);
}

.calcom-embed {
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    margin-bottom: 18px;
    min-height: 620px;
    overflow: hidden;
}

.calcom-embed iframe,
.calcom-embed cal-inline {
    display: block;
    width: 100%;
    min-height: 620px;
    border: 0;
}

.rx-sheet {
    background: #fff;
    border: 1px solid rgba(188, 201, 206, 0.45);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    color: var(--text);
    overflow: hidden;
    position: relative;
}

.rx-sheet::before {
    content: "";
    display: block;
    height: 8px;
    background: var(--primary);
}

.rx-header {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.85fr) 200px;
    gap: 24px;
    align-items: center;
    border-bottom: 1px solid rgba(188, 201, 206, 0.45);
    background: #fff;
    padding: 24px;
}

.rx-logo-group {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.rx-logo-slot {
    display: grid;
    place-items: center;
    width: min(200px, 100%);
    max-width: 200px;
    max-height: 200px;
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(188, 201, 206, 0.55);
    border-radius: 16px;
    background: #f7f9fb;
    padding: 12px;
}

.rx-logo-slot img {
    width: 100%;
    height: 100%;
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
}

.rx-doctor-heading {
    text-align: left;
}

.rx-doctor-heading h2 {
    color: var(--primary-strong);
    font-size: 28px;
    margin: 0 0 8px;
}

.rx-doctor-heading p {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 8px;
}

.rx-doctor-heading strong {
    display: inline-flex;
    border-radius: 999px;
    background: rgba(0, 180, 216, 0.12);
    color: var(--primary);
    font-size: 18px;
    padding: 6px 12px;
    text-transform: uppercase;
}

.rx-meta {
    border-left: 4px solid var(--primary-bright);
    border-radius: 16px;
    background: #f2f4f6;
    font-size: 13px;
    padding: 14px;
}

.rx-meta p {
    margin-bottom: 5px;
}

.rx-patient-line {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 1fr 1fr;
    gap: 12px;
    border-bottom: 1px solid rgba(188, 201, 206, 0.45);
    background:
        linear-gradient(90deg, rgba(0, 103, 125, 0.08) 0%, rgba(0, 103, 125, 0) 100%),
        #f2f4f6;
    padding: 14px 24px;
}

.rx-patient-line span {
    display: grid;
    gap: 4px;
}

.rx-patient-line strong {
    color: var(--primary);
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.rx-body {
    min-height: 460px;
    padding: 24px;
}

.rx-body h3 {
    color: var(--primary-strong);
    border-bottom: 1px solid rgba(188, 201, 206, 0.45);
    padding-bottom: 6px;
}

.rx-medication {
    display: grid;
    gap: 6px;
    border-bottom: 0;
    border-left: 4px solid var(--primary);
    border-radius: 16px;
    background: rgba(242, 244, 246, 0.75);
    margin-bottom: 12px;
    padding: 14px;
}

.rx-medication strong {
    color: var(--primary-strong);
    font-size: 18px;
}

.rx-medication em {
    color: var(--muted);
}

.rx-footer {
    display: grid;
    grid-template-columns: 1fr 1.4fr 170px;
    gap: 18px;
    align-items: end;
    border-top: 1px solid rgba(188, 201, 206, 0.45);
    background: #f7f9fb;
    padding: 20px 24px;
}

.signature-line {
    border-top: 2px solid var(--primary);
    margin: 44px 0 8px;
    width: min(260px, 100%);
}

.rx-contact {
    font-size: 12px;
}

.rx-qr {
    display: grid;
    justify-items: center;
    gap: 6px;
    font-size: 11px;
    text-align: center;
}

.rx-qr img {
    max-width: 160px;
    max-height: 160px;
}

@media (max-width: 900px) {
    .login-experience {
        grid-template-columns: 1fr;
    }

    .login-product {
        position: static;
    }

    .login-product-card {
        min-height: auto;
    }

    .app-topnav {
        flex-wrap: wrap;
    }

    .app-nav {
        justify-content: flex-start;
        order: 3;
        width: 100%;
    }

    .app-search {
        display: none;
    }

    .sidebar {
        position: static;
        height: auto;
        display: block;
    }

    .sidebar nav {
        justify-content: flex-start;
        margin-top: 12px;
    }

    .grid.two,
    .grid.three,
    .grid-form,
    .doctor-profile-card,
    .medication-row,
    .rx-header,
    .rx-patient-line,
    .rx-footer {
        grid-template-columns: 1fr;
    }

    .topbar {
        display: block;
    }

    .doctor-photo {
        width: 180px;
        height: 180px;
    }

    .doctor-profile-card {
        justify-items: center;
        text-align: center;
    }

    .rx-logo-slot {
        width: 100%;
    }

    .rx-doctor-heading {
        text-align: left;
    }
}

@media (max-width: 700px) {
    body {
        padding-bottom: 92px;
        font-size: 14px;
    }

    .install-page,
    .login-page {
        align-items: stretch;
        padding-bottom: 0;
        padding: 0;
    }

    .public-topnav {
        align-items: flex-start;
        display: grid;
        gap: 12px;
        padding: 14px;
    }

    .public-topnav nav {
        justify-content: flex-start;
        overflow-x: auto;
        width: 100%;
    }

    .public-shell {
        width: calc(100% - 24px);
        margin: 16px auto 24px;
    }

    .content,
    .panel,
    .panel.wide {
        padding: 14px;
    }

    .app-topnav {
        min-height: 68px;
        padding: 10px 14px;
    }

    .app-topnav .brand-logo {
        width: 42px;
        height: 42px;
    }

    .app-topnav .brand-row {
        gap: 10px;
        margin: 0;
    }

    .app-topnav .brand-row strong {
        font-size: 14px;
    }

    .app-topnav .brand-row .muted {
        font-size: 12px;
    }

    .app-actions {
        margin-left: auto;
    }

    .app-actions .icon-button:first-child {
        display: none;
    }

    .app-avatar,
    .icon-button {
        width: 38px;
        height: 38px;
    }

    .app-nav {
        align-items: center;
        background: rgba(255, 255, 255, 0.98);
        border-radius: 24px 24px 0 0;
        bottom: 0;
        box-shadow: 0 -4px 20px rgba(3, 4, 94, 0.05);
        display: flex;
        gap: 4px;
        justify-content: flex-start;
        left: 0;
        min-height: auto;
        overflow-x: auto;
        padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
        position: fixed;
        right: 0;
        top: auto;
        width: 100%;
        z-index: 55;
    }

    .app-nav a {
        flex: 0 0 auto;
        font-size: 12px;
        justify-content: center;
        min-height: 44px;
        padding: 8px 10px;
        white-space: nowrap;
    }

    .sidebar {
        border-radius: 24px 24px 0 0;
        bottom: 0;
        box-shadow: 0 -4px 20px rgba(3, 4, 94, 0.05);
        left: 0;
        min-height: auto;
        padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
        position: fixed;
        right: 0;
        top: auto;
    }

    .sidebar .brand-row {
        display: none;
    }

    .sidebar nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
        justify-content: space-around;
        margin: 0;
        overflow-x: auto;
    }

    .sidebar nav a,
    .sidebar nav button {
        flex: 0 0 auto;
        font-size: 12px;
        justify-content: center;
        min-height: 44px;
        padding: 8px 10px;
        white-space: nowrap;
    }

    h1 {
        font-size: 23px;
    }

    .brand-row {
        align-items: flex-start;
    }

    .brand-logo.large {
        width: 72px;
        height: 72px;
    }

    .actions,
    .topbar .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .button,
    .actions .button,
    .actions form,
    .actions button {
        width: 100%;
    }

    .tabbar {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .tabbar a {
        white-space: nowrap;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th,
    td {
        padding: 8px;
    }

    .calcom-embed,
    .calcom-embed iframe,
    .calcom-embed cal-inline {
        min-height: 540px;
    }

    .rx-header,
    .rx-body,
    .rx-footer {
        padding: 14px;
    }

    .rx-logo-group {
        justify-items: start;
    }

    .rx-logo-slot {
        max-width: 160px;
        max-height: 160px;
    }

    .rx-doctor-heading h2 {
        font-size: 22px;
    }
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .app-topnav,
    .topbar,
    .print-toolbar,
    .no-print,
    .button {
        display: none !important;
    }

    .rx-sheet {
        border-radius: 0;
    }

    .rx-logo-slot,
    .rx-logo-slot img {
        max-width: 200px !important;
        max-height: 200px !important;
    }

    .layout {
        display: block;
    }

    .content,
    .panel {
        border: 0;
        padding: 0;
    }
}

/* =========================================================
   Medical Assistance visual alignment overrides
   Applied to bring the PHP app closer to the provided new design.
   ========================================================= */
:root {
    --background: #f7f9fb;
    --surface: #ffffff;
    --surface-soft: #f2f4f6;
    --surface-muted: #e0e3e5;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f2f4f6;
    --surface-container: #eceef0;
    --surface-container-high: #e6e8ea;
    --surface-container-highest: #e0e3e5;
    --text: #191c1e;
    --muted: #3d494d;
    --outline: #bcc9ce;
    --outline-soft: rgba(188, 201, 206, 0.38);
    --primary: #00677d;
    --primary-strong: #03045e;
    --primary-bright: #00b4d8;
    --primary-soft: #b3ebff;
    --secondary: #5157a6;
    --tertiary: #006875;
    --tertiary-soft: #9feffe;
    --radius: 16px;
    --radius-control: 8px;
    --radius-xl: 24px;
    --shadow-soft: 0 4px 20px rgba(3, 4, 94, 0.05);
    --shadow-card: 0 4px 24px rgba(3, 4, 94, 0.08);
    --shadow-floating: 0 18px 45px rgba(3, 4, 94, 0.10);
}

html {
    background: var(--background);
}

body {
    background:
        radial-gradient(circle at 12% -8%, rgba(0, 180, 216, 0.10), transparent 30%),
        radial-gradient(circle at 100% 8%, rgba(159, 239, 254, 0.20), transparent 28%),
        var(--background);
    color: var(--text);
    letter-spacing: -0.005em;
}

h1,
h2,
h3 {
    color: var(--primary-strong);
    letter-spacing: -0.02em;
}

h1 {
    font-weight: 800;
}

h2,
h3 {
    font-weight: 750;
}

.public-topnav,
.app-topnav,
.sidebar {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(188, 201, 206, 0.38);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.app-topnav {
    min-height: 72px;
    padding: 12px 28px;
}

.brand-logo {
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.brand-row strong {
    color: var(--primary-strong);
    letter-spacing: -0.02em;
}

.app-nav a,
.sidebar nav a,
.sidebar nav button,
.public-topnav a {
    border-radius: 10px;
    color: var(--muted);
    font-weight: 700;
    transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.app-nav a.active,
.sidebar nav a.active,
.public-topnav a.primary-link {
    background: transparent;
    color: var(--primary);
    box-shadow: inset 0 -2px 0 var(--primary);
}

.app-nav a:hover,
.sidebar nav a:hover,
.sidebar nav button:hover,
.public-topnav a:hover {
    background: var(--surface-container-low);
    color: var(--primary);
    text-decoration: none;
}

.content,
.public-shell {
    width: min(1440px, calc(100% - 40px));
}

.content {
    padding-top: 36px;
}

.topbar {
    margin-bottom: 32px;
}

.topbar > div:first-child::before {
    content: "Medical Assistance";
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.panel,
.metric,
.record-card,
.rx-sheet,
.calcom-embed,
.login-product-card {
    background: var(--surface-container-lowest);
    border: 1px solid rgba(188, 201, 206, 0.36);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

.panel {
    padding: 24px;
}

.panel.wide {
    padding: 32px;
}

.panel:hover,
.metric:hover,
.record-card:hover {
    box-shadow: var(--shadow-card);
}

.metric,
.record-card {
    position: relative;
    overflow: hidden;
}

.metric::before,
.record-card::before,
.panel.accent::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--primary-bright);
}

.metric strong {
    color: var(--primary);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.grid.two > .metric:nth-child(2n)::before,
.grid.three > .metric:nth-child(2n)::before,
.record-card:nth-of-type(2n)::before {
    background: var(--tertiary-soft);
}

.grid.three > .metric:nth-child(3n)::before,
.record-card:nth-of-type(3n)::before {
    background: #a4a9ff;
}

.button {
    border-radius: var(--radius-control);
    font-weight: 800;
    letter-spacing: -0.01em;
    box-shadow: none;
}

.button.primary {
    background: var(--primary-bright);
    color: #fff;
    box-shadow: 0 10px 22px rgba(0, 180, 216, 0.20);
}

.button.secondary {
    border: 2px solid var(--primary-strong);
    background: transparent;
    color: var(--primary-strong);
}

.button.primary:hover,
.button.secondary:hover {
    transform: translateY(-1px) scale(1.01);
}

.icon-button {
    border-radius: 12px;
}

.app-avatar,
.avatar,
.brand-mark {
    background: linear-gradient(135deg, var(--primary-bright), var(--primary));
    box-shadow: 0 8px 18px rgba(0, 103, 125, .16);
}

.app-search {
    background: var(--surface-container-low);
    border: 0;
    box-shadow: inset 0 0 0 1px rgba(188, 201, 206, 0.26);
}

input,
select,
textarea {
    border-color: rgba(188, 201, 206, 0.78);
    border-radius: var(--radius-control);
    background: #fff;
}

label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.badge {
    background: var(--primary-soft);
    color: var(--primary-strong);
    border: 1px solid rgba(0, 180, 216, 0.18);
}

.tabbar {
    gap: 10px;
    margin: 20px 0 24px;
}

.tabbar a {
    border: 0;
    border-radius: 999px;
    background: var(--surface-container-low);
    color: var(--muted);
    padding: 10px 14px;
}

.tabbar a.active,
.tabbar a:hover {
    background: var(--primary-soft);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(0, 180, 216, .20);
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background: var(--surface-container-low);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .05em;
}

th:first-child {
    border-top-left-radius: 14px;
}

th:last-child {
    border-top-right-radius: 14px;
}

td,
th {
    border-bottom-color: rgba(188, 201, 206, 0.45);
    padding: 13px 12px;
}

tr:hover td {
    background: rgba(242, 244, 246, .55);
}

.login-product-card {
    background:
        radial-gradient(circle at 18% 12%, rgba(0, 180, 216, .18), transparent 26%),
        radial-gradient(circle at 86% 82%, rgba(159, 239, 254, .36), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f2f4f6 100%);
}

.login-bento div {
    border: 1px solid rgba(188, 201, 206, 0.36);
    border-left: 4px solid var(--primary-bright);
    border-radius: 18px;
    background: rgba(255,255,255,.78);
}

.rx-sheet {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.rx-logo-slot {
    max-height: 120px;
}

.rx-logo-slot img,
.rx-logo-group img,
img.rx-logo,
.prescription-logo img {
    max-width: 100%;
    max-height: 112px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.file-drop-zone {
    background: rgba(179, 235, 255, 0.22);
    border-color: rgba(0, 180, 216, 0.45);
}

@media (max-width: 860px) {
    .app-topnav {
        align-items: center;
        min-height: 68px;
        padding: 10px 16px;
    }

    .content,
    .public-shell {
        width: min(100% - 24px, 1440px);
        padding-left: 0;
        padding-right: 0;
    }

    .app-nav {
        background: rgba(255,255,255,.96);
        border: 1px solid rgba(188, 201, 206, .45);
        border-radius: 18px;
        bottom: 12px;
        box-shadow: var(--shadow-floating);
        left: 12px;
        margin: 0;
        padding: 8px;
        position: fixed;
        right: 12px;
        z-index: 60;
    }

    .app-nav a {
        flex: 1 0 auto;
        justify-content: center;
        padding: 9px 10px;
    }

    .app-nav a.active {
        background: var(--primary-soft);
        box-shadow: none;
    }

    .content {
        padding-bottom: 110px;
    }

    .panel,
    .panel.wide {
        border-radius: 20px;
        padding: 18px;
    }

    h1 {
        font-size: 28px;
    }
}


/* === HOTFIX FIX3: layout médico nuevo diseño === */
html, body { margin: 0 !important; width: 100% !important; min-height: 100% !important; }
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background: linear-gradient(135deg, #f7fbff 0%, #eef8fb 50%, #f8fbff 100%) !important;
    color: #0f172a !important;
}
.layout {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    background: transparent !important;
}
.app-topnav {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    min-height: 78px !important;
    padding: 14px 28px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 18px !important;
    background: rgba(255,255,255,.94) !important;
    border-bottom: 1px solid rgba(203,213,225,.65) !important;
    box-shadow: 0 18px 50px rgba(15,23,42,.06) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
}
.app-topnav .brand-row {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    min-width: 238px !important;
}
.brand-logo, .app-topnav .brand-logo {
    width: 44px !important;
    height: 44px !important;
    object-fit: contain !important;
    border-radius: 14px !important;
    background: #fff !important;
    border: 1px solid rgba(226,232,240,.9) !important;
    box-shadow: 0 10px 24px rgba(15,23,42,.08) !important;
}
.app-topnav .brand-row strong { font-size: 15px !important; color: #0f172a !important; }
.app-topnav .brand-row .muted { font-size: 13px !important; color: #64748b !important; }
.app-nav {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 0 !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    scrollbar-width: none !important;
}
.app-nav::-webkit-scrollbar { display: none !important; }
.app-nav a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    width: auto !important;
    min-width: max-content !important;
    padding: 10px 13px !important;
    border-radius: 999px !important;
    border: 1px solid transparent !important;
    color: #334155 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    background: transparent !important;
}
.app-nav a:hover, .app-nav a.active {
    color: #0369a1 !important;
    background: #e0f2fe !important;
    border-color: #bae6fd !important;
    box-shadow: none !important;
}
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-size: 22px !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    display: inline-block !important;
    white-space: nowrap !important;
    word-wrap: normal !important;
    direction: ltr !important;
    -webkit-font-feature-settings: 'liga' !important;
    -webkit-font-smoothing: antialiased !important;
}
.app-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
}
.app-actions form { margin: 0 !important; }
.icon-button {
    width: 42px !important;
    height: 42px !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: 14px !important;
    border: 1px solid rgba(203,213,225,.8) !important;
    background: #fff !important;
    color: #0369a1 !important;
}
.app-avatar {
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
    display: grid !important;
    place-items: center !important;
    background: linear-gradient(135deg,#0ea5e9,#14b8a6) !important;
    color: #fff !important;
    font-weight: 800 !important;
    font-size: 13px !important;
    box-shadow: 0 12px 26px rgba(14,165,233,.22) !important;
}
.content {
    width: min(1180px, calc(100% - 48px)) !important;
    margin: 38px auto 56px !important;
    padding: 0 !important;
}
.topbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
    margin-bottom: 28px !important;
}
.topbar h1 { font-size: clamp(30px,4vw,44px) !important; line-height: 1.05 !important; margin: 0 0 8px !important; letter-spacing: -.04em !important; }
.card, .stat-card, .panel, .empty-state, .table-card {
    background: rgba(255,255,255,.94) !important;
    border: 1px solid rgba(203,213,225,.72) !important;
    border-radius: 24px !important;
    box-shadow: 0 18px 50px rgba(15,23,42,.07) !important;
}
.card, .panel, .empty-state, .table-card { padding: 26px !important; }
.stat-card { padding: 22px !important; max-width: 320px !important; }
.btn, button, .button {
    border-radius: 14px !important;
    font-weight: 800 !important;
}
@media (max-width: 980px) {
    .app-topnav { align-items: flex-start !important; flex-direction: column !important; padding: 14px 18px !important; }
    .app-topnav .brand-row { min-width: 0 !important; }
    .app-nav { justify-content: flex-start !important; width: 100% !important; }
    .app-actions { width: 100% !important; margin-left: 0 !important; justify-content: flex-start !important; }
    .content { width: min(100% - 28px, 1180px) !important; margin-top: 24px !important; }
}

.register-details summary{cursor:pointer;display:inline-flex;align-items:center;gap:8px;margin-bottom:18px}
.legal-page{max-width:920px;margin:40px auto;line-height:1.65}
.legal-page h1{margin-top:8px}
.legal-page h2{margin-top:24px}

/* FIX5 receta carta compacta */
.rx-letter {
    width: min(100%, 816px);
    min-height: 1056px;
    margin: 0 auto;
    border-radius: 0;
    box-shadow: none;
    border: 0;
    padding: 18px 20px 14px;
    display: flex;
    flex-direction: column;
}
.rx-letter::before { display: none; }
.rx-letter-header {
    display: grid;
    grid-template-columns: 92px 1fr 190px;
    gap: 14px;
    align-items: start;
    border-bottom: 2px solid #1b2b66;
    padding-bottom: 6px;
    color: #1b2b66;
}
.rx-letter-title { text-align: center; }
.rx-letter-title h2 { font-size: 20px; margin: 0 0 3px; color: #1b2b66; }
.rx-letter-title p { margin: 0; font-weight: 600; color: #1b2b66; }
.rx-letter-title strong { display: block; font-size: 12px; margin-top: 3px; color: #1b2b66; }
.rx-letter-meta { font-size: 13px; color: #1b2b66; text-align: right; }
.rx-letter-meta p { margin: 0 0 4px; }
.rx-letter .rx-logo-slot {
    width: 92px;
    height: 92px;
    max-width: 200px;
    max-height: 200px;
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
}
.rx-letter .rx-logo-slot img { width: 100%; height: 100%; max-width: 200px; max-height: 200px; object-fit: contain; }
.rx-letter-patient {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 18px;
    align-items: end;
    color: #1b2b66;
    font-size: 14px;
    margin-top: 8px;
}
.rx-letter-patient span:first-child { border-bottom: 1px solid #1b2b66; padding-bottom: 2px; }
.rx-vitals { margin-top: 10px; font-size: 12px; color: #1b2b66; border-bottom: 1px solid #d9dee8; padding-bottom: 6px; }
.rx-letter-body { flex: 1; padding-top: 16px; color: #111827; }
.rx-letter-body h3 { color: #1b2b66; font-size: 15px; margin: 0 0 8px; border-bottom: 1px solid #d9dee8; padding-bottom: 3px; }
.rx-letter .rx-medication { border: 0; border-left: 3px solid #1b2b66; border-radius: 0; padding: 8px 10px; margin-bottom: 8px; background: transparent; }
.rx-letter-footer {
    display: grid;
    grid-template-columns: 1fr 110px 260px;
    gap: 18px;
    align-items: end;
    color: #1b2b66;
    font-size: 12px;
    margin-top: 24px;
}
.rx-letter .signature-line { width: 260px; border-top: 2px solid #1b2b66; margin-bottom: 6px; }
.rx-letter .rx-qr { text-align: center; }
.rx-letter .rx-qr .qr { width: 88px; height: 88px; }
.rx-letter .rx-contact { text-align: right; }
.rx-letter .muted { color: #1b2b66; word-break: break-all; }
@media print {
    @page { size: Letter; margin: 8mm; }
    html, body { width: 100%; margin: 0; padding: 0; }
    .rx-letter { width: 100%; min-height: calc(279mm - 16mm); padding: 0; page-break-after: avoid; }
    .rx-letter-footer { break-inside: avoid; }
}

/* FIX6: receta/prescripcion sin pantalla del sistema */
.rx-standalone{background:#f5fbff;margin:0;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#06143f}.rx-page-shell{max-width:960px;margin:24px auto;padding:0 16px}.rx-standalone .rx-sheet{background:#fff}.rx-standalone .rx-letter{width:8.5in;min-height:11in;max-width:100%;margin:0 auto;padding:.38in .52in;border:1px solid #d9e2ec;border-radius:18px;box-shadow:0 18px 45px rgba(15,23,42,.10)}.rx-letter-header{display:grid;grid-template-columns:145px 1fr 190px;gap:18px;align-items:start;border-bottom:2px solid #0a185f;padding-bottom:10px}.rx-logo-slot img{max-width:140px;max-height:140px;object-fit:contain}.rx-letter-title h2{font-size:22px;line-height:1.1;margin:0 0 6px;color:#07156b}.rx-letter-title p,.rx-letter-title strong{display:block;margin:0 0 5px;font-size:14px}.rx-letter-meta{text-align:left;font-size:13px}.rx-letter-meta p{margin:0 0 5px}.rx-letter-patient{display:grid;grid-template-columns:1fr 90px 120px;gap:10px;margin-top:10px;padding-bottom:8px;border-bottom:1px solid #c8d3df;font-size:14px}.rx-vitals{font-size:12px;margin:8px 0;padding:7px 10px;border:1px solid #d6e4ef;border-radius:10px;background:#f8fcff}.rx-letter-body{min-height:5.25in;padding:10px 0}.rx-letter-body h3{font-size:16px;margin:8px 0 8px;color:#07156b}.rx-letter-body p{font-size:14px;line-height:1.35}.rx-medication{padding:9px 12px;margin:8px 0;border-left:4px solid #0b8793;border-radius:10px;background:#fbfeff;border-top:1px solid #dce8ef;border-right:1px solid #dce8ef;border-bottom:1px solid #dce8ef}.rx-medication strong{display:block;font-size:15px;color:#07156b;margin-bottom:4px}.rx-medication span,.rx-medication em{display:block;font-style:normal;font-size:14px}.rx-letter-footer{display:grid;grid-template-columns:1fr 170px 1.3fr;gap:16px;align-items:end;border-top:1px solid #c8d3df;padding-top:12px;font-size:12px}.signature-line{width:230px;border-top:3px solid #0b8793;margin-bottom:8px}.rx-letter-footer .muted{word-break:break-all;font-size:10px}.rx-qr{text-align:center}.rx-qr .qr{width:130px;height:130px;object-fit:contain}.rx-qr span{display:block;font-size:11px}.rx-contact p{margin:2px 0}.print-toolbar{max-width:8.5in;margin:0 auto 12px;display:flex;gap:8px;justify-content:flex-end}.print-toolbar .button{font-size:13px}
@page{size:letter;margin:0}.rx-standalone .notice{max-width:8.5in;margin:12px auto}@media print{html,body{width:8.5in;height:11in;background:#fff}.no-print,.print-toolbar{display:none!important}.rx-page-shell{margin:0;padding:0;max-width:none}.rx-standalone .rx-letter{width:8.5in;min-height:11in;border:0;border-radius:0;box-shadow:none;margin:0;padding:.35in .5in;page-break-after:avoid}.rx-logo-slot img{max-width:120px;max-height:120px}.rx-letter-body{min-height:5.1in}.rx-letter-footer{break-inside:avoid}.rx-qr .qr{width:115px;height:115px}}


/* FIX7 receta compacta carta: optimizada para 1 hoja con 2-6 medicamentos */
.rx-standalone{background:#eef7fb!important}.rx-page-shell{max-width:8.5in!important;margin:10px auto!important;padding:0!important}.rx-standalone .rx-letter{width:8.5in!important;min-height:10.98in!important;max-height:10.98in!important;box-sizing:border-box!important;padding:.28in .38in!important;border-radius:10px!important;box-shadow:none!important;overflow:hidden!important}.rx-letter-header{grid-template-columns:92px 1fr 155px!important;gap:10px!important;padding-bottom:6px!important;border-bottom:1.5px solid #1b2b66!important}.rx-letter .rx-logo-slot,.rx-logo-slot{width:84px!important;height:84px!important;padding:0!important}.rx-letter .rx-logo-slot img,.rx-logo-slot img{max-width:84px!important;max-height:84px!important;object-fit:contain!important}.rx-letter-title h2{font-size:17px!important;line-height:1.05!important;margin:0 0 2px!important}.rx-letter-title p,.rx-letter-title strong{font-size:11px!important;line-height:1.15!important;margin:0 0 2px!important}.rx-letter-meta{font-size:10.5px!important;line-height:1.15!important}.rx-letter-meta p{margin:0 0 2px!important}.rx-letter-patient{margin-top:6px!important;padding-bottom:4px!important;font-size:11.5px!important;grid-template-columns:1fr 72px 86px!important;gap:6px!important}.rx-vitals{margin:5px 0!important;padding:4px 6px!important;font-size:10.5px!important;line-height:1.2!important}.rx-letter-body{min-height:auto!important;padding:5px 0!important;line-height:1.18!important}.rx-letter-body h3{font-size:12px!important;margin:4px 0 3px!important;padding-bottom:2px!important}.rx-letter-body p{font-size:11.5px!important;line-height:1.22!important;margin:3px 0!important}.rx-medication{padding:5px 7px!important;margin:4px 0!important;border-radius:6px!important;border-left-width:3px!important}.rx-medication strong{font-size:12.2px!important;margin-bottom:1px!important}.rx-medication span,.rx-medication em{font-size:11.3px!important;line-height:1.2!important}.rx-letter-footer{grid-template-columns:1.15fr 95px 1fr!important;gap:8px!important;padding-top:5px!important;font-size:10px!important;align-items:end!important;border-top:1px solid #c8d3df!important}.signature-line{width:180px!important;border-top-width:2px!important;margin-bottom:3px!important}.rx-letter-footer .muted{font-size:8.5px!important;line-height:1.1!important}.rx-qr .qr{width:82px!important;height:82px!important}.rx-qr span{font-size:9px!important}.rx-contact p{font-size:9.5px!important;line-height:1.12!important;margin:1px 0!important}.print-toolbar{margin:0 auto 8px!important}
.dictation-button{border:1px solid #cbd5e1;background:#fff;border-radius:999px;padding:7px 10px;font-weight:700;cursor:pointer}.chip-grid{display:flex;flex-wrap:wrap;gap:8px}.chip-grid label{display:inline-flex;align-items:center;gap:6px;border:1px solid #d6e4ef;border-radius:999px;padding:8px 10px;background:#fff}.compact-admin-form{margin:10px 0 18px}.compact-admin-form summary{display:inline-flex;cursor:pointer}
@media print{@page{size:letter;margin:0}html,body{width:8.5in!important;height:11in!important;background:#fff!important}.no-print,.print-toolbar{display:none!important}.rx-page-shell{margin:0!important;padding:0!important}.rx-standalone .rx-letter{width:8.5in!important;height:11in!important;min-height:11in!important;max-height:11in!important;padding:.25in .35in!important;border:0!important;border-radius:0!important;overflow:hidden!important}.rx-letter-header{grid-template-columns:82px 1fr 145px!important}.rx-letter .rx-logo-slot,.rx-logo-slot{width:76px!important;height:76px!important}.rx-logo-slot img{max-width:76px!important;max-height:76px!important}.rx-letter-footer{break-inside:avoid!important;page-break-inside:avoid!important}.rx-qr .qr{width:78px!important;height:78px!important}}


/* FIX10 - branding institucional */
body { --brand-primary: #0f766e; --brand-secondary: #2563eb; }
.app-topnav, .public-topnav { border-top: 4px solid var(--brand-primary) !important; }
.button.primary, button.button.primary, .nav-link.active { background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)) !important; border-color: var(--brand-primary) !important; }
.app-nav a:hover, .public-topnav a:hover { color: var(--brand-primary) !important; }
.brand-logo, .app-topnav .brand-logo { object-fit: contain !important; background: #fff !important; }
.institution-logo-preview { max-width: 160px; max-height: 110px; object-fit: contain; border: 1px solid #dbe7ef; border-radius: 14px; padding: 8px; background: #fff; }
.rx-letter-header { border-bottom-color: var(--brand-primary) !important; }
.rx-medication { border-left-color: var(--brand-primary) !important; }
.signature-line { border-top-color: var(--brand-primary) !important; }
.rx-letter-title h2, .rx-letter-body h3, .rx-medication strong { color: var(--brand-secondary) !important; }

/* FIX12: notas en ventana, formularios compactos y acciones de cita */
.note-date-list { display: grid; gap: 10px; }
dialog.note-dialog { width: min(760px, 94vw); border: 0; border-radius: 22px; padding: 24px; box-shadow: 0 24px 80px rgba(15,23,42,.22); }
dialog.note-dialog::backdrop { background: rgba(15,23,42,.35); }
.psoap-note.compact p { margin: 0 0 10px; }
.inline-reschedule { display: inline-block; }
.inline-reschedule summary { cursor: pointer; list-style: none; }
.inline-reschedule summary::-webkit-details-marker { display: none; }
.mini-form { display: grid; gap: 8px; min-width: 240px; margin-top: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.mini-form input { width: 100%; }


/* FIX13 - Aviso de cookies y aceptacion de privacidad */
.cookie-consent[hidden] {
    display: none !important;
}

.cookie-consent {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(5px);
}

.cookie-consent__card {
    width: min(940px, 100%);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: center;
    background: var(--surface, #fff);
    color: var(--text, #111827);
    border: 1px solid var(--outline, #d7dee3);
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 24px 80px rgba(3, 4, 94, 0.22);
}

.cookie-consent__card h2 {
    margin-bottom: 8px;
    font-size: 22px;
}

.cookie-consent__card p {
    margin-bottom: 8px;
}

.cookie-consent__links {
    font-weight: 700;
}

.cookie-consent-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .cookie-consent {
        padding: 12px;
    }
    .cookie-consent__card {
        grid-template-columns: 1fr;
        padding: 18px;
    }
    .cookie-consent__card .button {
        width: 100%;
    }
}

/* Expemedic landing publica + panel SEO */
.public-home-page{font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;background:linear-gradient(180deg,#f4fbff 0%,#eefaf8 52%,#ffffff 100%);color:#0f172a;margin:0}
.landing-nav{position:sticky;top:0;z-index:20;background:rgba(255,255,255,.92);backdrop-filter:blur(16px);border-bottom:1px solid rgba(15,118,110,.16)}
.landing-nav nav{display:flex;gap:18px;align-items:center;flex-wrap:wrap}.landing-nav nav a{text-decoration:none;color:#0f172a;font-weight:800}.landing-nav .primary-link{background:#0f766e;color:#fff;padding:10px 16px;border-radius:999px}
.landing-shell{max-width:1180px;margin:0 auto;padding:56px 24px}.landing-hero{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr);gap:34px;align-items:center;min-height:520px}.landing-hero h1{font-size:clamp(40px,6vw,74px);line-height:.95;margin:0 0 20px;color:#08015f;letter-spacing:-.06em}.landing-lead{font-size:20px;line-height:1.6;color:#334155;max-width:720px}.landing-actions{display:flex;gap:14px;flex-wrap:wrap;margin-top:26px}.landing-visual{border-radius:34px;background:linear-gradient(135deg,#dff8ff,#fff);box-shadow:0 30px 80px rgba(8,1,95,.12);padding:28px;min-height:340px;display:flex;align-items:center;justify-content:center}.landing-visual img{max-width:100%;border-radius:24px;box-shadow:0 20px 50px rgba(15,23,42,.12)}.screen-mock{width:100%;background:#fff;border:1px solid #dbeafe;border-radius:26px;padding:28px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.7)}.mock-bar{height:12px;width:44%;background:#0f766e;border-radius:20px;margin-bottom:28px}.screen-mock h3{font-size:32px;color:#08015f;margin:0 0 8px}.mock-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-top:22px}.mock-grid span{height:76px;border-radius:20px;background:linear-gradient(135deg,#eef9ff,#e0f2fe)}
.landing-section{padding:64px 0}.landing-section h2,.landing-cta h2{font-size:clamp(30px,4vw,50px);color:#08015f;line-height:1.05;margin:0 0 18px}.feature-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-top:28px}.feature-grid article{background:#fff;border:1px solid #dbeafe;border-radius:24px;padding:24px;box-shadow:0 18px 40px rgba(15,23,42,.06)}.feature-grid .material-symbols-outlined{font-size:34px;color:#0f766e}.feature-grid h3{color:#08015f;margin:14px 0 8px}.feature-grid p{color:#475569;line-height:1.55}.split{display:grid;grid-template-columns:1fr 1fr;gap:32px;align-items:center}.institution-types{display:flex;gap:12px;flex-wrap:wrap}.institution-types span{background:#fff;border:1px solid #bfe7f3;border-radius:999px;padding:14px 18px;font-weight:800;color:#075985}.landing-cta{text-align:center;background:#08015f;color:#fff;border-radius:34px;padding:46px 24px;margin:30px 0}.landing-cta h2{color:#fff}.landing-cta p{color:#dbeafe}.landing-footer{max-width:1180px;margin:0 auto;padding:24px;display:flex;gap:18px;flex-wrap:wrap;border-top:1px solid #e2e8f0;color:#475569}.landing-footer a{color:#0f766e;font-weight:800;text-decoration:none}.span-2{grid-column:1/-1}
@media(max-width:860px){.landing-hero,.feature-grid,.split{grid-template-columns:1fr}.landing-shell{padding:34px 16px}.landing-nav{position:relative}.landing-nav nav{justify-content:flex-start}.landing-hero{min-height:0}.landing-visual{min-height:240px}.landing-actions .button{width:100%;justify-content:center}}
