.patient-portal {
    --bs-primary: #166b53;
    --bs-primary-rgb: 22, 107, 83;
    --bs-link-color: #166b53;
    --bs-link-hover-color: #104e3d;
    --bs-body-color: #203c36;
    --bs-border-color: #dce7e2;
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(ellipse at top right, #e6f3ed, transparent 55%), #f5f8f6;
    font-family: "Segoe UI", system-ui, sans-serif;
}
.portal-header { background: #fff; border-bottom: 1px solid #dce7e2; }
.portal-nav-container { max-width: 1440px; }
.portal-brand { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: #164e3d; }
.portal-brand img { object-fit: contain; }
.portal-brand strong { display: block; font-size: 1.25rem; letter-spacing: -.04em; }
.portal-brand small { display: block; color: #62766e; font-size: .7rem; }
.patient-portal .nav-link { color: #52675f; font-size: .8rem; font-weight: 600; border-radius: 8px; margin: 2px; padding: 10px 8px; }
.patient-portal .nav-link:hover, .patient-portal .nav-link.active { color: #12543f; background: #e8f3ed; }
.portal-main { padding-top: 32px; padding-bottom: 40px; }
.portal-skip-link { position: fixed; top: -100px; left: 16px; z-index: 1100; background: #fff; color: #104e3d; padding: 12px; }
.portal-skip-link:focus { top: 8px; }
.patient-portal :focus-visible { outline: 3px solid #b67c26; outline-offset: 4px; }
.portal-welcome { position: relative; overflow: hidden; display: flex; justify-content: space-between; gap: 24px; padding: 38px; border-radius: 24px; color: #fff; background: linear-gradient(115deg, #104d3c, #1e7761); box-shadow: 0 12px 30px #174e3e14; }
.portal-eyebrow { display: block; font-size: .7rem; letter-spacing: .16em; font-weight: 700; color: #ceecdd; margin-bottom: 12px; }
.portal-welcome h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -.04em; overflow-wrap: anywhere; }
.portal-welcome p { max-width: 540px; color: #e1eee7; margin: 12px 0; line-height: 1.7; }
.portal-patient-id { color: #d3e8de; font-size: .8rem; }
.portal-welcome .btn { color: #134d3b; font-weight: 700; padding: 12px 20px; }
.portal-welcome-mark { align-self: center; text-align: center; min-width: 170px; padding: 18px; border-radius: 50%; background: #ffffff0c; }
.portal-welcome-mark > span { display: block; font-size: 5rem; font-weight: 300; line-height: 1; color: #cae8d8; }
.portal-welcome-mark small { display: block; color: #e1eee7; margin-top: 12px; line-height: 1.6; }
.patient-portal .card { border: 1px solid #e0e9e3; border-radius: 18px; box-shadow: 0 5px 18px #163b2d04; overflow: hidden; }
.patient-portal .card-body { padding: 24px; }
.patient-portal .card-header { padding: 20px 24px; background: #fff; border-bottom: 1px solid #edf1ee; }
.portal-section-label { font-size: .65rem; letter-spacing: .14em; font-weight: 700; color: #60776b; }
.portal-appointment { border-top: 3px solid #328469 !important; }
.portal-billing { border-top: 3px solid #c49a4c !important; }
.portal-date-tile { flex-shrink: 0; padding: 10px 14px; border-radius: 12px; background: #eaf4ee; color: #175c46; text-align: center; }
.portal-date-tile strong { display: block; font-size: 1.7rem; }
.portal-date-tile span { font-size: .7rem; }
.portal-stat { font-size: 2rem; font-weight: 700; letter-spacing: -.04em; color: #164e3d; overflow-wrap: anywhere; }
.portal-amount { font-size: clamp(1.35rem, 3vw, 2rem); }
.portal-text-link { color: #16664e; font-weight: 600; text-decoration: none; }
.portal-text-link:hover { color: #104d3c; text-decoration: underline; }
.portal-quick-link { display: flex; flex-direction: column; height: 100%; gap: 9px; padding: 22px; background: #fff; border: 1px solid #e0e9e3; border-radius: 16px; color: #203c36; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
.portal-quick-link:hover { color: #104d3c; border-color: #6eaa8d; box-shadow: 0 6px 18px #174e3e0d; }
.portal-quick-link strong { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.portal-quick-link small { color: #62766e; font-size: .78rem; line-height: 1.6; }
.portal-quick-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-size: 1.1rem; font-weight: 700; margin-bottom: 5px; }
.portal-quick-icon.mint { background: #e1f2e7; color: #166447; }
.portal-quick-icon.blue { background: #e5eef9; color: #315f98; }
.portal-quick-icon.lavender { background: #eee8f7; color: #705097; }
.portal-quick-icon.peach { background: #faeddf; color: #94612b; }
.patient-portal .table { --bs-table-color: #3d554b; font-size: .8rem; }
.patient-portal .table th { padding: 13px 20px; background: #f6f9f7; color: #60766a; font-size: .7rem; font-weight: 600; white-space: nowrap; }
.patient-portal .table td { padding: 16px 20px; vertical-align: middle; border-color: #edf1ee; }
.portal-status { display: inline-block; padding: 5px 9px; border-radius: 7px; background: #ecf2ef; color: #476457; font-size: .7rem; font-weight: 600; text-transform: capitalize; white-space: nowrap; }
.patient-portal .table td.portal-empty { padding: 36px 24px; text-align: center; white-space: normal; }
.portal-empty strong { display: block; margin-bottom: 8px; color: #486354; font-weight: 600; }
.portal-empty span { color: #687d71; line-height: 1.7; }
.patient-portal .btn-primary { --bs-btn-bg: #166b53; --bs-btn-border-color: #166b53; --bs-btn-hover-bg: #104e3d; --bs-btn-hover-border-color: #104e3d; --bs-btn-active-bg: #104e3d; --bs-btn-active-border-color: #104e3d; --bs-btn-disabled-bg: #166b53; --bs-btn-disabled-border-color: #166b53; }
.patient-portal .btn-outline-primary { --bs-btn-color: #166b53; --bs-btn-border-color: #166b53; --bs-btn-hover-bg: #166b53; --bs-btn-hover-border-color: #166b53; --bs-btn-active-bg: #104e3d; --bs-btn-active-border-color: #104e3d; }
.patient-portal .form-control:focus, .patient-portal .form-select:focus { border-color: #63a38b; box-shadow: 0 0 0 .2rem #166b5320; }
.portal-footer { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #dce7e2; padding-top: 22px; padding-bottom: 28px; color: #62766e; font-size: .75rem; }
.portal-auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.portal-auth-shell { width: 100%; max-width: 620px; padding: 32px 18px; }
.portal-auth-shell > .portal-brand { justify-content: center; text-decoration: none; }
.patient-portal .portal-auth-shell .card-body { padding: clamp(22px, 5vw, 38px); }
.portal-auth .form-control { font-size: 1rem; }
.portal-auth .btn-lg { font-size: 1rem; min-height: 48px; }
.portal-auth-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: #62766e; font-size: .8rem; }
.portal-auth-divider::before, .portal-auth-divider::after { content: ''; height: 1px; background: #dce7e2; flex: 1; }
.portal-auth-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.portal-auth-roles label { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 8px; border: 1px solid #dce7e2; border-radius: 10px; cursor: pointer; font-size: .9rem; }
.portal-auth-roles label:has(input:checked) { background: #eaf4ee; border-color: #166b53; color: #104e3d; }
.portal-auth-roles input { accent-color: #166b53; }
.booking-heading, #booking-wizard { max-width: 920px; margin-inline: auto; }
.booking-progress { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; padding: 0; gap: 16px; }
.booking-progress li { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid #dce7e2; border-radius: 14px; background: #fff; color: #62766e; }
.booking-progress li > span { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: #edf2ee; font-weight: 700; }
.booking-progress strong, .booking-progress small { display: block; }
.booking-progress strong { font-size: .85rem; }
.booking-progress small { font-size: .7rem; margin-top: 3px; }
.booking-progress [aria-current="step"] { border-color: #166b53; background: #eaf4ee; color: #104e3d; }
.booking-progress [aria-current="step"] > span, .booking-progress .is-complete > span { background: #166b53; color: white; }
.patient-portal .booking-card > .card-body { padding: 32px; }
.booking-actions { display: flex; align-items: center; gap: 16px; padding: 22px 32px; border-top: 1px solid #e0e9e3; background: #fbfcfb; }
.booking-actions .btn { min-height: 46px; padding-inline: 20px; }
.booking-availability { color: #526b60; font-size: .9rem; padding: 14px 16px; background: #f0f6f2; border-radius: 10px; }
.booking-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 14px; }
.booking-slot { cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid #cadcd1; border-radius: 10px; background: white; font-size: .9rem; }
.booking-slot input { accent-color: #166b53; width: 18px; height: 18px; flex-shrink: 0; }
.booking-slot:has(input:checked) { background: #e3f2e9; border-color: #166b53; color: #104e3d; box-shadow: inset 0 0 0 1px #166b53; }
.booking-slot:focus-within { outline: 3px solid #b67c26; outline-offset: 2px; }
.booking-review { padding: 22px; border: 1px solid #dce7e2; border-radius: 14px; background: #f8fbf9; }
.booking-review dt { font-weight: 500; color: #62766e; font-size: .9rem; }
.booking-review dd { overflow-wrap: anywhere; }
.booking-review-reason { white-space: pre-wrap; }
@media (max-width: 1199.98px) {
    .portal-header .navbar-collapse { padding: 12px 0 20px; }
    .patient-portal .nav-link { padding: 10px 14px; }
}
@media (max-width: 575.98px) {
    .booking-progress { gap: 6px; }
    .booking-progress li { flex-direction: column; text-align: center; gap: 8px; padding: 12px 5px; }
    .booking-progress strong { font-size: .72rem; }
    .booking-progress small { display: none; }
    .patient-portal .booking-card > .card-body { padding: 22px 18px; }
    .booking-actions { padding: 18px; gap: 10px; }
    .booking-actions .btn { padding-inline: 12px; }
    .portal-main { padding-top: 20px; }
    .portal-welcome { padding: 26px 22px; border-radius: 18px; }
    .portal-welcome-mark { display: none; }
    .patient-portal .card-body { padding: 20px; }
    .portal-footer { flex-direction: column; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    .portal-quick-link { transition: none; }
}
