.patients-page {
    --ink: #202c49;
    --muted: #77829a;
    --teal: #5c60df;
    --line: #e2e5f0;
    color: var(--ink);
    background: radial-gradient(ellipse at 90% 0, #e9eaff 0, transparent 45%), #f4f5fa;
}
.patients-page .sidebar { background: linear-gradient(165deg, #171e36, #242b48 70%, #2d3054); }
.patients-page .sidebar::after { border-color: #9993ff08; }
.patients-page .brand-symbol, .patients-page .avatar { background: linear-gradient(145deg, #8d88ff, #5252c5); box-shadow: 0 9px 25px #6256b930; }
.patients-page .eyebrow { color: #8273b5; }
.patients-page .nav-group { --nav-tone: #ada9ff; }
.patients-page .main-nav a.active { box-shadow: inset 3px 0 #a6a2ff; }
.patients-page .submenu a.submenu-item.is-current { background: #a6a2ff22; color: #e3e1ff; }
.patients-page .sidebar-label, .patients-page .sidebar-user span { color: #939cbd; }
.patients-page .system-orbit { border-color: #aeaaff55; }
.patients-page .system-orbit span { background: #b1abff; box-shadow: 0 0 12px #9790ff; }
.patients-page .patient-button.primary { background: linear-gradient(110deg, #5156cf, #7370e6); box-shadow: 0 7px 20px #5156cf25; }
.patients-page .patient-button { color: #424d70; border-color: #dfe2ee; }
.patients-page .patient-button.primary { color: white; }
.patients-page .patient-button.danger { color: #ad4359; }
.patients-page .patient-button:disabled { opacity: .65; cursor: wait; transform: none; }
.patients-page .patient-open, .patients-page .title-dot { color: #625bd4; }
.patients-page .patient-avatar, .patients-page .stat-symbol { background: #eceafd; color: #6960c9; }
.patients-page .patient-badge:not(.archived) { background: #eeedff; color: #6760ca; }
.patients-page .patient-stats .stat-note { background: linear-gradient(120deg, #303957, #55558e); }
.patients-page .patient-stats .stat-note span { color: #d0d1ef; }
.patients-page .patient-field input:focus, .patients-page .patient-field select:focus, .patients-page .patient-field textarea:focus,
.patients-page .patient-search input:focus, .patients-page .patient-search select:focus { outline: 3px solid #7470df20; border-color: #8680de; }
.patients-page .patient-alert.success { background: #eeedff; border-color: #d8d5fa; color: #51469c; }
.patient-profile-app [hidden] { display: none !important; }
.profile-hero { position: relative; overflow: hidden; padding: 27px 34px 0; border-radius: 24px; color: white; background: radial-gradient(ellipse at 100% 0, #746bc486, transparent 60%), linear-gradient(115deg, #242d4c, #3a416a); box-shadow: 0 18px 48px #242d4c16; }
.profile-hero::after { content: ''; position: absolute; width: 350px; height: 350px; border: 1px solid #ffffff0c; border-radius: 50%; top: -190px; right: -90px; box-shadow: 0 0 0 55px #ffffff03, 0 0 0 110px #ffffff02; pointer-events: none; }
.profile-topline { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 15px; color: #bbbfd9; font-size: 10px; letter-spacing: 1.4px; }
.profile-topline a { color: #e4e3f7; text-decoration: none; font-size: 12px; letter-spacing: 0; }
.profile-identity { display: flex; align-items: center; gap: 23px; padding: 30px 0; }
.profile-monogram { display: grid; place-items: center; flex-shrink: 0; width: 82px; height: 86px; border-radius: 24px; background: linear-gradient(140deg, #a7a1f733, #ffffff0b); border: 1px solid #b6b0ff40; color: #e2ddff; font-size: 34px; font-weight: 800; box-shadow: inset 0 1px #ffffff15; }
.profile-kicker { color: #8783b5; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; margin: 0 0 8px; }
.profile-hero .profile-kicker { color: #bcb5f7; }
.profile-identity h1 { margin: 0 0 11px; font: 800 clamp(25px, 2.6vw, 37px)/1.2 'Manrope', sans-serif; letter-spacing: -1px; overflow-wrap: anywhere; }
.profile-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 8px; background: #ffffff10; color: #d1d0ee; font-size: 11px; }
.profile-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #bab0ff; }
.profile-facts { display: grid; grid-template-columns: 1fr 1fr .8fr 1.3fr; border-top: 1px solid #ffffff16; padding: 22px 0; gap: 20px; }
.profile-facts div { min-width: 0; }
.profile-facts span { display: block; color: #b0b5d2; font-size: 10px; margin-bottom: 8px; }
.profile-facts strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.profile-facts small { font-size: 10px; font-weight: 400; color: #bdc0da; }
.profile-tabs { display: flex; gap: 7px; padding: 8px; margin: 24px 0 28px; background: #e9eaf3; border: 1px solid #e2e4f0; border-radius: 15px; overflow-x: auto; }
.profile-tabs a { display: flex; justify-content: center; align-items: center; flex: 1; gap: 10px; white-space: nowrap; padding: 13px 17px; border-radius: 10px; color: #777f9a; font-size: 12px; font-weight: 700; text-decoration: none; transition: background .15s; }
.profile-tabs a>span { color: #a4a7bf; font-size: 10px; font-weight: 500; }
.profile-tabs a>b { border-radius: 6px; padding: 2px 6px; font-size: 10px; background: #dddff0; }
.profile-tabs a.selected { background: white; color: #5750b8; box-shadow: 0 3px 12px #39396b09; }
.profile-tabs a.selected>span { color: #8277d7; }
.profile-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.profile-section-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.6px; }
.profile-section-heading>p { color: #8a8fa6; font-size: 12px; }
.profile-form-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 23px; align-items: start; }
.profile-group-nav { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; }
.profile-group-nav button { padding: 15px; text-align: left; background: transparent; border: 1px solid transparent; color: #8289a2; font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.4; cursor: pointer; border-radius: 11px; }
.profile-group-nav button.selected { background: #eeecfd; color: #6254bc; border-color: #dfdaf7; box-shadow: inset 3px 0 #8a7de2; }
.profile-group-nav button:hover { background: #eae9f7; }
.profile-fields { min-width: 0; padding: 0; border: 0; margin: 0; }
.patient-profile-app .patient-panel { border-color: #e1e3ef; border-radius: 18px; box-shadow: 0 7px 26px #26315904; }
.patient-profile-app .patient-form-section { padding: 28px 30px 34px; margin-bottom: 18px; min-height: 345px; }
.patient-profile-app .patient-form-section h2 { font-size: 17px; color: #30395b; padding-bottom: 22px; border-bottom: 1px solid #eff0f7; margin-bottom: 25px; }
.patient-profile-app .patient-form-section h2>span { color: #8b7acc; background: #f0ebfd; font-size: 11px; border-radius: 9px; }
.patient-profile-app .patient-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 23px; }
.patient-profile-app .patient-field label { color: #6b7391; font-size: 11px; }
.patient-profile-app .patient-field input, .patient-profile-app .patient-field select, .patient-profile-app .patient-field textarea { border-color: #e0e3ef; background: #fcfcff; color: #303b5a; padding: 13px 14px; border-radius: 9px; }
.patient-profile-app .patient-field [aria-invalid=true] { border-color: #ca657a; background: #fff9fa; }
.patient-profile-app .patient-save-bar { margin-left: 223px; border-color: #e1e3ef; border-radius: 14px; bottom: 14px; z-index: 3; box-shadow: 0 10px 35px #27295212; }
.patient-save-bar>div strong, .patient-save-bar>div span { display: block; }
.patient-save-bar>div strong { color: #67617f; font-size: 12px; font-weight: 600; }
.patient-save-bar>div span { color: #9796aa; font-size: 10px; margin-top: 5px; }
.patient-profile-app .history-panel { margin-top: 0; }
.patient-profile-app .history-layout { grid-template-columns: 235px minmax(0, 1fr); }
.patient-profile-app .history-nav { background: #fbfaff; border-color: #e9e7f2; }
.patient-profile-app .history-nav a { color: #83859f; }
.patient-profile-app .history-nav a.selected { background: #ece9fb; color: #6954ae; }
.patient-profile-app .history-nav a b { background: #e9e6f4; color: #87819e; }
.patient-profile-app .history-record { border-color: #e6e4f0; border-left: 3px solid #c1b5ef; background: linear-gradient(105deg, #fcfbff, white); }
.patient-profile-app .history-record dt { color: #8a85a2; }
.patient-profile-app .history-record dd { color: #444661; }
.profile-feedback { padding: 14px 18px; margin-bottom: 20px; background: #eeecfd; color: #6a5aa9; border: 1px solid #dcd7f7; border-radius: 12px; font-size: 13px; }
.profile-feedback.is-error { background: #fff1f3; border-color: #efd3db; color: #a44360; }
.profile-panels[aria-busy=true] { opacity: .55; pointer-events: none; }
.patient-save-dialog { width: min(440px, calc(100vw - 36px)); padding: 36px; border: 1px solid #e2dff5; border-radius: 24px; text-align: center; color: #34364e; box-shadow: 0 28px 120px #17143555; }
.patient-save-dialog::backdrop { background: #191b385c; backdrop-filter: blur(5px); }
.save-dialog-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 22px; color: #7665cb; background: #f0ebff; border: 1px solid #e1d8fa; border-radius: 22px; font-size: 28px; }
.patient-save-dialog h2 { margin: 0 0 12px; font-size: 26px; letter-spacing: -.7px; }
.patient-save-dialog>p:not(.profile-kicker) { color: #868299; font-size: 14px; line-height: 1.7; margin-bottom: 25px; }
.patient-save-dialog .patient-button { width: 100%; }
.patient-profile-app :focus-visible { outline: 3px solid #a49bdd; outline-offset: 3px; }
@media(max-width:1200px) {
    .profile-facts { grid-template-columns: 1fr 1fr; }
    .profile-form-layout { grid-template-columns: 165px minmax(0, 1fr); gap: 18px; }
    .patient-profile-app .patient-save-bar { margin-left: 183px; }
    .profile-section-heading { align-items: flex-start; flex-direction: column; gap: 0; }
}
@media(max-width:820px) {
    .patients-page .submenu { background: #252b46; }
    .profile-form-layout { grid-template-columns: 1fr; gap: 12px; }
    .profile-group-nav { flex-direction: row; overflow-x: auto; padding: 0 0 8px; }
    .profile-group-nav button { flex-shrink: 0; padding: 12px 14px; }
    .patient-profile-app .patient-save-bar { margin-left: 0; }
    .patient-profile-app .history-layout { grid-template-columns: 1fr; }
    .profile-hero { padding: 24px 25px 0; }
    .profile-tabs a { padding: 12px; }
    .profile-tabs a>span { display: none; }
}
@media(max-width:520px) {
    .profile-hero { border-radius: 19px; padding: 21px 21px 0; }
    .profile-topline { align-items: flex-start; flex-direction: column; gap: 13px; font-size: 8px; }
    .profile-identity { gap: 15px; padding: 25px 0; }
    .profile-monogram { width: 53px; height: 62px; border-radius: 17px; font-size: 25px; }
    .profile-identity h1 { font-size: 24px; }
    .profile-kicker { font-size: 8px; letter-spacing: 1.1px; }
    .profile-facts { gap: 20px 15px; }
    .profile-facts strong { font-size: 12px; }
    .profile-facts small { display: block; margin-top: 3px; }
    .profile-tabs { margin-top: 18px; gap: 3px; }
    .profile-tabs a { font-size: 11px; }
    .patient-profile-app .patient-form-grid { grid-template-columns: 1fr; }
    .patient-profile-app .patient-form-section { padding: 23px 20px; }
    .patient-profile-app .patient-save-bar { flex-direction: column; padding: 14px; }
    .patient-save-bar>div span { display: none; }
    .patient-save-bar>div strong { font-size: 11px; }
}
@media(prefers-reduced-motion:reduce) { .patient-profile-app * { transition: none !important; scroll-behavior: auto !important; } }
