:root{--sp-purple:#6947e8;--sp-purple2:#a88de9;--sp-pink:#ef466d;--sp-green:#12cca0;--sp-bg:#e8ecf2;--sp-text:#171a31;--sp-muted:#98a0b6;--sp-border:#edf0f5;--sp-shadow:0 26px 70px rgba(39,44,76,.13)}
.student-app-shell{min-height:100vh;background:var(--sp-bg);padding:36px;display:grid;grid-template-columns:245px minmax(0,1fr) 330px;color:var(--sp-text);font-family:Inter,Roboto,sans-serif}
.student-referral-nav-btn {
    border-color: rgba(255, 124, 24, .22) !important;
    background: rgba(255, 124, 24, .08) !important;
    color: #d85e08 !important;
}

/* =========================================================
   Student dashboard referral feature
   Place beside StudentDashboard.razor as:
   StudentDashboard.razor.css
   ========================================================= */

.student-referral-feature {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 24px 0 28px;
    padding: 22px 24px;
    border: 1px solid rgba(133, 92, 230, 0.15);
    border-radius: 20px;
    background: radial-gradient(circle at 92% 18%, rgba(145, 101, 230, 0.18), transparent 28%), linear-gradient(135deg, #ffffff 0%, #fbf8ff 58%, #f5efff 100%);
    box-shadow: 0 14px 34px rgba(67, 45, 116, 0.08);
}

    .student-referral-feature::after {
        position: absolute;
        right: -54px;
        bottom: -72px;
        width: 190px;
        height: 190px;
        border: 24px solid rgba(146, 100, 229, 0.07);
        border-radius: 50%;
        content: "";
        pointer-events: none;
    }

.student-referral-feature-copy {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
}

.student-referral-feature-icon {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: linear-gradient(145deg, #9d6be7, #7648cf);
    box-shadow: 0 10px 22px rgba(118, 72, 207, 0.23);
    color: #ffffff;
    font-size: 18px;
}

.student-referral-feature-copy > div:last-child {
    min-width: 0;
}

.student-referral-feature .student-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #8a5bd0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.student-referral-feature h2 {
    margin: 0;
    color: #1f2233;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.student-referral-feature p {
    max-width: 760px;
    margin: 7px 0 0;
    color: #777f92;
    font-size: 13px;
    line-height: 1.6;
}

.student-referral-feature-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.student-referral-count {
    min-width: 82px;
    text-align: right;
}

    .student-referral-count strong {
        display: block;
        color: #25293a;
        font-size: 24px;
        font-weight: 800;
        line-height: 1;
    }

    .student-referral-count span {
        display: block;
        margin-top: 5px;
        color: #8a92a3;
        font-size: 11px;
        font-weight: 700;
    }

.student-referral-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(145deg, #8f60dd, #7446ca);
    box-shadow: 0 9px 20px rgba(116, 70, 202, 0.22);
    color: #ffffff;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

    .student-referral-open-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 12px 24px rgba(116, 70, 202, 0.28);
        filter: brightness(1.03);
    }

/* Sidebar referral button */

.student-referral-nav-btn {
    width: 100%;
}

.student-nav .student-referral-nav-btn .bi {
    color: #8c5ada;
}

/* =========================================================
   Referral modal
   ========================================================= */

.student-referral-backdrop {
    position: fixed;
    z-index: 5000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(28, 24, 42, 0.56);
    backdrop-filter: blur(5px);
}

.student-referral-modal {
    width: min(100%, 760px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 32px 90px rgba(23, 18, 38, 0.3);
}

.student-referral-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-bottom: 1px solid #eceef4;
}

    .student-referral-modal-header > div > span {
        display: block;
        margin-bottom: 3px;
        color: #9361d8;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .student-referral-modal-header h2 {
        margin: 0;
        color: #222638;
        font-size: 21px;
        font-weight: 800;
    }

.student-referral-close {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid #e2e5ed;
    border-radius: 11px;
    background: #ffffff;
    color: #7f8798;
    cursor: pointer;
}

    .student-referral-close:hover {
        border-color: #cab8eb;
        background: #faf8ff;
        color: #7646ca;
    }

.student-referral-loading {
    min-height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #777f90;
    font-size: 13px;
}

.student-referral-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #eadff9;
    border-top-color: #8551d2;
    border-radius: 50%;
    animation: student-referral-spin 0.8s linear infinite;
}

.student-referral-error {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 22px;
    padding: 15px 16px;
    border: 1px solid #f0c8cd;
    border-radius: 13px;
    background: #fff4f5;
    color: #ab3f4a;
}

    .student-referral-error > .bi {
        margin-top: 2px;
        font-size: 18px;
    }

    .student-referral-error strong {
        display: block;
        font-size: 13px;
    }

    .student-referral-error p {
        margin: 4px 0 0;
        font-size: 12px;
        line-height: 1.5;
    }

.student-referral-modal-body {
    padding: 22px;
}

.student-referral-intro {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid #e9e3f5;
    border-radius: 14px;
    background: #faf8ff;
}

.student-referral-badge {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #eee6fb;
    color: #7950c7;
    font-size: 17px;
}

.student-referral-intro strong {
    display: block;
    color: #33384a;
    font-size: 13px;
}

.student-referral-intro span {
    display: block;
    margin-top: 4px;
    color: #7e8798;
    font-size: 11px;
    line-height: 1.5;
}

.student-referral-url-block {
    margin-bottom: 18px;
}

    .student-referral-url-block > label {
        display: block;
        margin-bottom: 7px;
        color: #4e5567;
        font-size: 11px;
        font-weight: 800;
    }

.student-referral-url-row {
    display: flex;
    align-items: stretch;
    gap: 9px;
}

    .student-referral-url-row input {
        width: 100%;
        min-width: 0;
        padding: 11px 12px;
        border: 1px solid #dfe3eb;
        border-radius: 11px;
        outline: 0;
        background: #fbfcfe;
        color: #525a6c;
        font: inherit;
        font-size: 12px;
    }

        .student-referral-url-row input:focus {
            border-color: #9b76dc;
            box-shadow: 0 0 0 3px rgba(139, 91, 212, 0.11);
        }

    .student-referral-url-row button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-width: 96px;
        padding: 10px 13px;
        border: 0;
        border-radius: 11px;
        background: #8150d0;
        color: #ffffff;
        font-size: 12px;
        font-weight: 750;
        cursor: pointer;
    }

.student-referral-qr-card {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid #e7e9f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(31, 35, 53, 0.045);
}

.student-referral-qr-frame {
    display: grid;
    place-items: center;
    width: 170px;
    height: 170px;
    padding: 12px;
    border: 1px solid #e2e5ed;
    border-radius: 15px;
    background: #ffffff;
}

    .student-referral-qr-frame img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.student-referral-qr-copy > span {
    display: block;
    margin-bottom: 4px;
    color: #9261d6;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.student-referral-qr-copy strong {
    display: block;
    color: #272b3d;
    font-size: 17px;
    font-weight: 800;
}

.student-referral-qr-copy p {
    margin: 7px 0 13px;
    color: #7b8495;
    font-size: 12px;
    line-height: 1.55;
}

.student-referral-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 39px;
    padding: 9px 13px;
    border: 1px solid #ddd1f1;
    border-radius: 10px;
    background: #faf7ff;
    color: #7047bf;
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
}

    .student-referral-download:hover {
        background: #f2ebff;
        color: #6034ae;
    }

.student-referral-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

    .student-referral-metrics > div {
        padding: 13px 14px;
        border: 1px solid #e8eaf0;
        border-radius: 12px;
        background: #fafbfe;
    }

    .student-referral-metrics span {
        display: block;
        margin-bottom: 4px;
        color: #8a93a4;
        font-size: 10px;
        font-weight: 750;
        text-transform: uppercase;
    }

    .student-referral-metrics strong {
        display: block;
        color: #303547;
        font-size: 17px;
        font-weight: 800;
    }

.student-referral-active {
    color: #27835d !important;
}

.student-referral-warning {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 13px;
    border: 1px solid #f0dfb7;
    border-radius: 11px;
    background: #fffaf0;
    color: #8d6d2f;
}

    .student-referral-warning .bi {
        margin-top: 2px;
    }

    .student-referral-warning p {
        margin: 0;
        font-size: 11px;
        line-height: 1.55;
    }

.student-referral-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 16px 22px 20px;
    border-top: 1px solid #eceef4;
}

.student-referral-secondary,
.student-referral-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 9px 15px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.student-referral-secondary {
    border: 1px solid #dfe3ea;
    background: #ffffff;
    color: #5d6576;
}

.student-referral-danger {
    border: 1px solid #d94d59;
    background: #d94d59;
    color: #ffffff;
}

    .student-referral-secondary:disabled,
    .student-referral-danger:disabled {
        cursor: not-allowed;
        opacity: 0.58;
    }

@keyframes student-referral-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .student-referral-feature {
        align-items: stretch;
        flex-direction: column;
    }

    .student-referral-feature-actions {
        justify-content: space-between;
    }
}

@media (max-width: 680px) {
    .student-referral-feature {
        padding: 18px;
        border-radius: 16px;
    }

    .student-referral-feature-copy {
        flex-direction: column;
    }

    .student-referral-feature-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .student-referral-count {
        text-align: left;
    }

    .student-referral-open-btn {
        width: 100%;
    }

    .student-referral-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .student-referral-modal {
        width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
    }

    .student-referral-qr-card {
        grid-template-columns: 1fr;
    }

    .student-referral-qr-frame {
        width: min(100%, 220px);
        height: auto;
        aspect-ratio: 1;
        margin: 0 auto;
    }

    .student-referral-metrics {
        grid-template-columns: 1fr;
    }

    .student-referral-url-row {
        flex-direction: column;
    }

        .student-referral-url-row button {
            width: 100%;
        }

    .student-referral-modal-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .student-referral-secondary,
    .student-referral-danger {
        width: 100%;
    }
}
.student-sidebar-panel,.student-main-panel,.student-right-panel{background:#fff}.student-sidebar-panel{border-radius:24px 0 0 24px;border-right:1px solid var(--sp-border);padding:28px 22px;display:flex;flex-direction:column;min-height:calc(100vh - 72px)}
.student-main-panel{padding:42px 44px;min-width:0}.student-right-panel{border-radius:0 24px 24px 0;border-left:1px solid var(--sp-border);padding:42px 30px}.student-app-shell>aside,.student-app-shell>main{box-shadow:var(--sp-shadow)}
.student-brand,.student-user-card{display:flex;align-items:center;gap:12px}.student-brand-mark{width:38px;height:38px;border-radius:14px;background:linear-gradient(135deg,var(--sp-pink),var(--sp-purple));color:#fff;display:grid;place-items:center;font-weight:900}.student-brand span,.student-user-card span{display:block;color:var(--sp-muted);font-size:12px;margin-top:2px}
.student-user-card{margin:38px 0 28px}.student-avatar-lg,.student-avatar-sm,.student-avatar-xl{display:grid;place-items:center;font-weight:900;background:linear-gradient(135deg,#ffd8e4,#d9cdfc);color:#4c357f}.student-avatar-lg{width:58px;height:58px;border-radius:50%}.student-avatar-sm{width:44px;height:44px;border-radius:15px}.student-avatar-xl{width:76px;height:76px;border-radius:24px}
.student-nav{display:grid;gap:9px}.student-nav button,.student-signout{border:0;background:transparent;color:#9199b1;border-radius:12px;padding:12px 14px;text-align:left;font-weight:700;display:flex;align-items:center;gap:12px}.student-nav button.active,.student-nav button:hover{background:#fff1f5;color:var(--sp-pink)}.student-nav b{margin-left:auto;background:var(--sp-pink);color:#fff;border-radius:8px;padding:2px 7px;font-size:11px}.student-signout{margin-top:auto;cursor:pointer}.student-signout:hover{color:var(--sp-pink)}
.student-page-header,.student-section-heading,.student-card-heading,.student-profile-header,.student-right-heading{display:flex;align-items:center;justify-content:space-between;gap:20px}.student-page-header h1,.student-section-heading h2,.student-right-heading h2,.student-profile-title h1{margin:0;font-weight:900}.student-page-header p,.student-section-heading p,.student-card-heading p,.student-profile-title p{margin:6px 0 0;color:var(--sp-muted)}.student-progress-box{min-width:200px;font-size:12px;color:#7d859c}.student-progress-track{height:7px;background:#e7e4ee;border-radius:999px;margin-top:8px;overflow:hidden}.student-progress-track i{display:block;height:100%;background:var(--sp-pink);border-radius:inherit}
.student-feature-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:38px 0}.student-feature-card{min-height:220px;border-radius:18px;padding:24px;color:#fff;position:relative;overflow:hidden;box-shadow:0 18px 40px rgba(86,58,158,.18)}.student-feature-card:after{content:"";position:absolute;width:250px;height:250px;border-radius:50%;right:-70px;bottom:-130px;background:rgba(255,255,255,.12)}.student-feature-card.pink{background:linear-gradient(135deg,#ef3e69,#f06d8d)}.student-feature-card.purple{background:linear-gradient(135deg,#8b71db,#ae96ee)}.student-feature-icon{width:42px;height:42px;border-radius:13px;background:rgba(61,31,103,.18);display:grid;place-items:center}.student-eyebrow{display:block;margin-top:24px;font-size:12px;opacity:.8}.student-feature-card h2{margin:8px 0 6px;font-size:24px;color:#fff}.student-feature-card p{margin:0;opacity:.85}.student-feature-actions{display:flex;gap:10px;margin-top:18px;position:relative;z-index:1}.student-feature-actions button,.student-feature-actions a{border:0;background:#fff;color:#49337b;border-radius:999px;padding:9px 14px;font-weight:800;text-decoration:none;font-size:12px}
.student-patients-section{margin-top:18px}.student-list-tools{display:flex;align-items:center;gap:16px;flex-wrap:wrap}.student-tabs{display:flex;gap:4px}.student-tabs button{border:0;background:transparent;padding:10px;color:#a0a6b7;font-weight:800;border-bottom:2px solid transparent}.student-tabs button.active{color:var(--sp-purple);border-color:var(--sp-purple)}.student-search{display:flex;align-items:center;gap:8px;background:#f8f9fc;border-radius:12px;padding:9px 12px}.student-search input{border:0;outline:0;background:transparent;width:140px}
.student-patient-list{display:grid;margin-top:20px}.student-patient-row{display:grid;grid-template-columns:44px minmax(0,1fr) 105px auto 72px;gap:14px;align-items:center;padding:14px 0;border-bottom:1px solid var(--sp-border);cursor:pointer}.student-patient-row:hover{background:#fbfaff}.student-patient-primary strong,.student-patient-primary span,.student-patient-meta span,.student-patient-meta strong{display:block}.student-patient-primary span,.student-patient-meta span{font-size:12px;color:var(--sp-muted);margin-top:4px}.student-patient-meta strong{font-size:12px;margin-top:3px}.student-status-pill{font-size:11px;font-weight:900;padding:7px 10px;border-radius:999px;background:#f1effa;color:var(--sp-purple)}.student-status-pill.completed{background:#e8faf5;color:#079b76}.student-row-actions{display:flex;gap:7px}.student-row-actions a,.student-row-actions button{width:32px;height:32px;border:0;border-radius:10px;background:#f6f4fb;color:var(--sp-purple);display:grid;place-items:center;text-decoration:none}
.student-right-heading{margin-bottom:28px}.student-schedule-list{display:grid;gap:12px}.student-schedule-item{border:0;background:#f9fafc;border-radius:14px;padding:14px;text-align:left;display:grid;gap:4px}.student-schedule-item time{font-size:11px;color:var(--sp-pink);font-weight:800}.student-schedule-item span{font-size:12px;color:var(--sp-muted)}.student-quick-card{margin-top:28px;border-top:1px solid var(--sp-border);padding-top:25px}.student-quick-card button{width:100%;border:0;background:#f8f7fc;border-radius:12px;padding:12px;margin-top:9px;text-align:left;color:#5f6680;font-weight:700}.student-quick-card button span{margin-right:9px;color:var(--sp-purple)}
.student-loading,.student-error,.student-simple-page{margin:40px;padding:30px;background:#fff;border-radius:18px;box-shadow:var(--sp-shadow)}.student-error{color:#a61b3a}.student-empty{padding:24px;text-align:center;color:var(--sp-muted)}.student-empty.compact{padding:10px}
.student-profile-page{min-height:100vh;background:var(--sp-bg);padding:34px}.student-profile-header{max-width:1380px;margin:auto;background:#fff;border-radius:24px;padding:24px 28px;box-shadow:var(--sp-shadow)}.student-back{border:0;background:#f4f2fa;color:var(--sp-purple);width:42px;height:42px;border-radius:14px}.student-profile-title{margin-right:auto}.student-profile-actions{display:flex;gap:10px}.student-profile-actions a,.student-profile-actions button,.student-form-actions button,.student-modal-actions button{border:0;border-radius:999px;padding:11px 16px;font-weight:800;text-decoration:none}.student-profile-actions .primary,.student-form-actions button{background:var(--sp-purple);color:#fff}.student-profile-actions .danger,.student-modal-actions .danger{background:#fff0f3;color:#c12b4a}.student-profile-grid{max-width:1380px;margin:20px auto;display:grid;grid-template-columns:1fr 1fr;gap:18px}.student-profile-card{background:#fff;border-radius:20px;padding:24px;box-shadow:0 15px 40px rgba(39,44,76,.08)}.student-profile-card h2{margin-top:0}.student-profile-span{grid-column:1/-1}.student-profile-card dl{margin:0}.student-profile-card dl div{display:grid;grid-template-columns:150px 1fr;padding:11px 0;border-bottom:1px solid var(--sp-border)}.student-profile-card dt{color:var(--sp-muted)}.student-profile-card dd{margin:0;font-weight:800}
.student-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:20px}.student-form-grid label,.student-modal label{display:grid;gap:7px;font-weight:800;font-size:13px}.student-form-span{grid-column:1/-1}.student-input{width:100%;border:1px solid #e6e8ef;border-radius:12px;padding:11px 12px;background:#fbfcfe;outline:0}.student-input:focus{border-color:var(--sp-purple);box-shadow:0 0 0 4px rgba(105,71,232,.1)}.student-input.textarea{min-height:100px}.student-form-actions{display:flex;justify-content:flex-end;align-items:center;gap:15px;margin-top:18px}.student-form-actions span{color:#25866d;font-size:13px}.student-history-list article{display:grid;grid-template-columns:14px 1fr;gap:14px;padding:14px 0}.student-history-dot{width:10px;height:10px;border-radius:50%;background:var(--sp-pink);margin-top:5px}.student-history-list span{display:block;color:var(--sp-muted);font-size:12px;margin-top:4px}.student-history-list p{margin:8px 0 0}
.student-modal-backdrop{position:fixed;inset:0;background:rgba(24,23,40,.45);display:grid;place-items:center;padding:20px;z-index:2000}.student-modal{width:min(520px,100%);background:#fff;border-radius:22px;padding:26px;box-shadow:var(--sp-shadow);display:grid;gap:16px}.student-modal h2,.student-modal p{margin:0}.student-modal p{color:var(--sp-muted)}.student-modal-actions{display:flex;justify-content:flex-end;gap:10px}.student-modal-actions .secondary{background:#f3f4f7;color:#5f6680}
@media(max-width:1180px){.student-app-shell{grid-template-columns:90px minmax(0,1fr)}.student-right-panel{grid-column:2;border-radius:0 0 24px 0}.student-sidebar-panel{grid-row:1/3}.student-brand>div:last-child,.student-user-card>div:last-child,.student-nav button:not(.active){font-size:0}.student-nav button span{font-size:18px}.student-nav b{display:none}}
@media(max-width:800px){.student-app-shell{display:block;padding:0}.student-sidebar-panel{display:none}.student-main-panel,.student-right-panel{border-radius:0;padding:24px;box-shadow:none}.student-feature-grid,.student-profile-grid,.student-form-grid{grid-template-columns:1fr}.student-profile-span,.student-form-span{grid-column:auto}.student-patient-row{grid-template-columns:44px 1fr auto}.student-patient-meta,.student-status-pill{display:none}.student-page-header,.student-section-heading,.student-profile-header{align-items:flex-start;flex-direction:column}.student-profile-actions{width:100%;flex-wrap:wrap}.student-profile-page{padding:14px}.student-list-tools{align-items:flex-start;flex-direction:column}.student-tabs{overflow:auto;width:100%}}
