﻿/* ============================================================
   Patientenbereich – theme-aware (Dark / Light)
   Funktioniert im Kontext von _Layout.cshtml mit hero-banner oder app-like im _PatientLayout
   ============================================================ */

/* ── App-Like Layout (für _PatientLayout) ──────────────────── */
.patient-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #0f172a !important; /* Override base background gradient */
    color: #f8fafc;
    margin: 0;
}

:root[data-theme='light'] .patient-body {
    background: #f8faff !important;
    color: #0f172a;
}

.patient-header {
    background: rgba(30, 41, 59, 0.85); /* semi-transparent Dark theme */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

:root[data-theme='light'] .patient-header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.patient-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.patient-header-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-500);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

:root[data-theme='light'] .patient-header-brand {
    color: var(--brand-600);
}

.patient-header-brand:hover {
    opacity: 0.8;
    color: var(--brand-500); /* override bootstrap link text */
    text-decoration: none;
}

:root[data-theme='light'] .patient-header-brand:hover {
    color: var(--brand-600);
}

.patient-logout-btn {
    background: none;
    border: none;
    color: rgba(248, 250, 252, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
}

.patient-logout-btn:hover {
    color: #ef4444; /* danger */
    background: rgba(239, 68, 68, 0.1);
}

:root[data-theme='light'] .patient-logout-btn {
    color: rgba(15, 23, 42, 0.7);
}

:root[data-theme='light'] .patient-logout-btn:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.patient-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.patient-footer {
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    padding: 1.5rem 1rem;
    color: rgba(148, 163, 184, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
}

.patient-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    font-size: 0.85rem;
}

.patient-footer-copy {
    color: rgba(148, 163, 184, 0.7);
}

.patient-footer-separator {
    color: rgba(255, 255, 255, 0.15);
}

.patient-footer-links {
    display: flex;
    gap: 1.25rem;
}

.patient-footer a {
    color: rgba(148, 163, 184, 0.9);
    text-decoration: none;
    transition: color 0.2s, opacity 0.2s;
    font-weight: 500;
}

.patient-footer a:hover {
    color: var(--brand-500);
}

:root[data-theme='light'] .patient-footer {
    color: rgba(100, 116, 139, 0.8);
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

:root[data-theme='light'] .patient-footer-copy {
    color: rgba(100, 116, 139, 0.8);
}

:root[data-theme='light'] .patient-footer-separator {
    color: rgba(148, 163, 184, 0.4);
}

:root[data-theme='light'] .patient-footer a {
    color: rgba(71, 85, 105, 1);
}

:root[data-theme='light'] .patient-footer a:hover {
    color: var(--brand-600);
}

/* ── Seiten-Wrapper ─────────────────────────────────────────── */
.patient-page {
    display: flex;
    justify-content: center;
    padding: 2.5rem 1rem 4rem;
    width: 100%;
}

.layout-body-compact-hero .patient-page {
    padding-top: 1.5rem;
}

.patient-page-auth {
    align-items: flex-start;
}

.patient-page-shell {
    width: 100%;
}

.patient-page-shell-auth {
    max-width: 560px;
}

.patient-page-header {
    margin-bottom: 1.25rem;
}

.patient-page-header-auth {
    text-align: center;
}

.patient-page-kicker {
    display: inline-block;
    margin-bottom: 0.45rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #93c5fd;
}

.patient-page-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #f8fafc;
}

.patient-page-subtitle {
    margin: 0.45rem 0 0;
    color: rgba(148, 163, 184, 0.92);
    line-height: 1.65;
}

:root[data-theme='light'] .patient-page-kicker {
    color: #2563eb;
}

:root[data-theme='light'] .patient-page-title {
    color: #0f172a;
}

:root[data-theme='light'] .patient-page-subtitle {
    color: #64748b;
}

/* ── Auth-Karte (Login & Registrierung) ─────────────────────── */
.patient-auth-card {
    width: 100%;
    max-width: 480px;
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
}

.patient-page-shell-auth .patient-auth-card {
    max-width: none;
}

.patient-auth-card--wide {
    max-width: 540px;
}

:root[data-theme='light'] .patient-auth-card {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
}

/* ── Icon ────────────────────────────────────────────────────── */
.patient-auth-icon {
    font-size: 2.25rem;
    color: var(--brand-500);
    text-align: center;
    margin-bottom: 1rem;
}

/* ── Title / Sub ─────────────────────────────────────────────── */
.patient-auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    color: #f8fafc;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

:root[data-theme='light'] .patient-auth-title {
    color: #0f172a;
}

.patient-auth-sub {
    font-size: 0.9rem;
    color: rgba(148, 163, 184, 0.9);
    text-align: center;
    margin-bottom: 1.75rem;
}

:root[data-theme='light'] .patient-auth-sub {
    color: #64748b;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.patient-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.patient-alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

:root[data-theme='light'] .patient-alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* ── Form ────────────────────────────────────────────────────── */
.patient-form-group {
    margin-bottom: 1rem;
}

.patient-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 480px) {
    .patient-form-row {
        grid-template-columns: 1fr;
    }
}

.patient-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.9);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

:root[data-theme='light'] .patient-label {
    color: #64748b;
}

.patient-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.6rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    color: #f1f5f9;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.patient-input:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
    background: rgba(255, 255, 255, 0.09);
}

.patient-input::placeholder {
    color: rgba(148, 163, 184, 0.45);
}

.patient-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color-scheme: dark;
    background-image: linear-gradient(45deg, transparent 50%, rgba(148, 163, 184, 0.8) 50%), linear-gradient(135deg, rgba(148, 163, 184, 0.8) 50%, transparent 50%);
    background-position: calc(100% - 1.15rem) calc(50% - 0.15rem), calc(100% - 0.8rem) calc(50% - 0.15rem);
    background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
    background-repeat: no-repeat;
    padding-right: 2.4rem;
}

.patient-select option {
    background: #1e293b;
    color: #f8fafc;
}

.patient-select:invalid {
    color: rgba(148, 163, 184, 0.8);
}

:root[data-theme='light'] .patient-input {
    background: #f8faff;
    border-color: #dbeafe;
    color: #1e3a5f;
}

:root[data-theme='light'] .patient-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #ffffff;
}

:root[data-theme='light'] .patient-input::placeholder {
    color: #b0c4de;
}

:root[data-theme='light'] .patient-select {
    color-scheme: light;
    background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
}

:root[data-theme='light'] .patient-select option {
    background: #ffffff;
    color: #0f172a;
}

:root[data-theme='light'] .patient-select:invalid {
    color: #94a3b8;
}

/* Passwort-Wrap */
.patient-pw-wrap {
    position: relative;
}

.patient-pw-wrap .patient-input {
    padding-right: 2.75rem;
}

.patient-pw-toggle {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(148, 163, 184, 0.7);
    cursor: pointer;
    padding: 0.2rem;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s;
}

.patient-pw-toggle:hover {
    color: var(--brand-500);
}

:root[data-theme='light'] .patient-pw-toggle {
    color: #94a3b8;
}

:root[data-theme='light'] .patient-pw-toggle:hover {
    color: #2563eb;
}

/* ── Button ─────────────────────────────────────────────────── */
.patient-btn-primary {
    display: block;
    width: 100%;
    background: var(--brand-600);
    color: #ffffff;
    border: none;
    border-radius: 0.6rem;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    margin-top: 1.25rem;
    font-family: inherit;
}

.patient-btn-primary:hover {
    background: var(--brand-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.patient-btn-primary:active {
    transform: translateY(0);
}

:root[data-theme='light'] .patient-btn-primary {
    background: #2563eb;
}

:root[data-theme='light'] .patient-btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.28);
}

/* ── Link unter der Form ────────────────────────────────────── */
.patient-auth-link {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: rgba(148, 163, 184, 0.8);
}

.patient-auth-link a {
    color: var(--brand-500);
    font-weight: 600;
    text-decoration: none;
}

.patient-auth-link a:hover {
    text-decoration: underline;
}

:root[data-theme='light'] .patient-auth-link {
    color: #64748b;
}

:root[data-theme='light'] .patient-auth-link a {
    color: #2563eb;
}

.patient-auth-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.25rem;
}

.patient-auth-secondary-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.86);
    text-decoration: none;
}

.patient-auth-secondary-link:hover {
    color: #cbd5e1;
    text-decoration: underline;
}

:root[data-theme='light'] .patient-auth-secondary-link {
    color: #64748b;
}

:root[data-theme='light'] .patient-auth-secondary-link:hover {
    color: #1d4ed8;
}

/* ── Dashboard ──────────────────────────────────────────────── */
.patient-dashboard {
    width: 100%;
    max-width: 720px;
}

.patient-dashboard-header {
    margin-bottom: 1.5rem;
}

.patient-welcome-card,
.patient-info-card {
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    padding: 2rem;
    backdrop-filter: blur(10px);
    margin-bottom: 1.5rem;
}

:root[data-theme='light'] .patient-welcome-card,
:root[data-theme='light'] .patient-info-card {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.07);
}

.patient-welcome-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
}

.patient-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.patient-quick-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.patient-quick-link:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.12);
    color: #eef2ff;
}

:root[data-theme='light'] .patient-quick-link {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.18);
    color: #334155;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

:root[data-theme='light'] .patient-quick-link:hover {
    border-color: rgba(37, 99, 235, 0.3);
    background: #eff6ff;
    color: #1d4ed8;
}

.patient-welcome-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
    user-select: none;
}

.patient-welcome-text {
    flex: 1;
    min-width: 0;
}

.patient-welcome-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

:root[data-theme='light'] .patient-welcome-title {
    color: #0f172a;
}

.patient-welcome-sub {
    color: rgba(148, 163, 184, 0.85);
    font-size: 0.95rem;
    margin: 0;
}

:root[data-theme='light'] .patient-welcome-sub {
    color: #64748b;
}

.patient-info-card h2 {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(148, 163, 184, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
}

:root[data-theme='light'] .patient-info-card h2 {
    color: #64748b;
}

.patient-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.patient-card-copy {
    margin: 0.35rem 0 0;
    color: rgba(148, 163, 184, 0.88);
    line-height: 1.6;
}

:root[data-theme='light'] .patient-card-copy {
    color: #64748b;
}

.patient-info-table {
    width: 100%;
    border-collapse: collapse;
}

.patient-info-table td {
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.95rem;
    vertical-align: top;
}

:root[data-theme='light'] .patient-info-table td {
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

.patient-info-table tr:last-child td {
    border-bottom: none;
}

.patient-info-table td:first-child {
    font-weight: 600;
    color: rgba(148, 163, 184, 0.75);
    width: 40%;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-right: 1rem;
}

:root[data-theme='light'] .patient-info-table td:first-child {
    color: #64748b;
}

.patient-info-table td:last-child {
    color: #e2e8f0;
}

:root[data-theme='light'] .patient-info-table td:last-child {
    color: #1e3a5f;
}

/* ── Success-Alert ──────────────────────────────────────────── */
.patient-alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
}

:root[data-theme='light'] .patient-alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
}

/* ── Textarea ───────────────────────────────────────────────── */
.patient-textarea {
    resize: vertical;
    min-height: 3.5rem;
}

/* ── Profil-Meta (z.B. "Registriert seit") ──────────────────── */
.patient-form-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 0.5rem;
}

:root[data-theme='light'] .patient-form-meta {
    border-top-color: rgba(148, 163, 184, 0.15);
}

.patient-meta-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

:root[data-theme='light'] .patient-meta-label {
    color: #64748b;
}

.patient-meta-value {
    font-size: 0.95rem;
    color: #e2e8f0;
}

:root[data-theme='light'] .patient-meta-value {
    color: #1e3a5f;
}

/* ── Rezeptanfragen-Liste ───────────────────────────────────── */
.patient-rx-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.patient-rx-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    transition: border-color 0.2s;
}

:root[data-theme='light'] .patient-rx-item {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, 0.15);
}

.patient-rx-item.patient-rx-pending {
    border-left: 3px solid #f59e0b;
}

.patient-rx-item.patient-rx-approved {
    border-left: 3px solid #22c55e;
}

.patient-rx-item.patient-rx-rejected {
    border-left: 3px solid #ef4444;
}

.patient-rx-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.patient-rx-medication {
    font-weight: 700;
    font-size: 1rem;
    color: #f1f5f9;
}

:root[data-theme='light'] .patient-rx-medication {
    color: #0f172a;
}

.patient-rx-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
}

.patient-rx-pending .patient-rx-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.patient-rx-approved .patient-rx-badge {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.patient-rx-rejected .patient-rx-badge {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

:root[data-theme='light'] .patient-rx-pending .patient-rx-badge {
    background: #fffbeb;
    color: #d97706;
}

:root[data-theme='light'] .patient-rx-approved .patient-rx-badge {
    background: #f0fdf4;
    color: #16a34a;
}

:root[data-theme='light'] .patient-rx-rejected .patient-rx-badge {
    background: #fef2f2;
    color: #dc2626;
}

.patient-rx-notes {
    font-size: 0.9rem;
    color: rgba(148, 163, 184, 0.85);
    margin: 0.25rem 0 0.5rem;
}

:root[data-theme='light'] .patient-rx-notes {
    color: #64748b;
}

.patient-rx-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.patient-rx-date {
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.65);
}

:root[data-theme='light'] .patient-rx-date {
    color: #94a3b8;
}

.patient-rx-comment {
    margin-top: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 0.5rem;
    font-size: 0.88rem;
    color: #c7d2fe;
}

:root[data-theme='light'] .patient-rx-comment {
    background: #eff6ff;
    color: #1e40af;
}

/* ── Prescription History Stats ── */
.patient-rx-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.patient-rx-stat {
    font-size: 0.85rem;
    color: #94a3b8;
    white-space: nowrap;
}

.patient-rx-stat-pending i { color: #f59e0b; }
.patient-rx-stat-approved i { color: #22c55e; }
.patient-rx-stat-rejected i { color: #ef4444; }

:root[data-theme='light'] .patient-rx-stats {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

:root[data-theme='light'] .patient-rx-stat {
    color: #64748b;
}

.patient-rx-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    align-items: center;
}

/* Re-request button */
.patient-rx-reorder-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(99, 102, 241, 0.45);
    border-radius: 0.45rem;
    background: rgba(99, 102, 241, 0.08);
    color: #a5b4fc;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.patient-rx-reorder-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.7);
    color: #e0e7ff;
}

:root[data-theme='light'] .patient-rx-reorder-btn {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.06);
    color: #4f46e5;
}

:root[data-theme='light'] .patient-rx-reorder-btn:hover {
    background: rgba(99, 102, 241, 0.14);
    border-color: #4f46e5;
    color: #3730a3;
}

/* ── Einklappbare Profil-Karte ──────────────────────────────── */
.patient-card-collapsible {
    padding: 0;
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.patient-card-collapsible.is-open {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.patient-card-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1.1rem 1.5rem;
    background: none;
    border: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
    gap: 1rem;
    border-radius: 1.25rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.patient-card-collapsible.is-open .patient-card-toggle {
    border-radius: 1.25rem 1.25rem 0 0;
}

.patient-card-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
}

.patient-card-collapsible.is-open .patient-card-toggle:hover {
    transform: translateY(0);
}

.patient-card-toggle-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.patient-card-toggle-title {
    font-weight: 600;
    font-size: 1rem;
    color: #e2e8f0;
    white-space: nowrap;
}

.patient-card-toggle-left i {
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), color 0.24s ease;
}

.patient-card-collapsible.is-open .patient-card-toggle-left i {
    transform: scale(1.08);
    color: #ffffff;
}

.patient-card-toggle-sub {
    font-size: 0.82rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 32ch;
}

.patient-card-chevron {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: #64748b;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), color 0.24s ease;
}

.patient-card-collapsible.is-open .patient-card-chevron {
    color: #cbd5e1;
    transform: rotate(180deg) scale(1.08);
}

.patient-card-body {
    display: block;
    max-height: 0;
    overflow: hidden;
    padding: 0 1.5rem;
    opacity: 0;
    transform: translateY(-0.35rem);
    pointer-events: none;
    transition: max-height 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease, transform 0.24s ease, padding 0.26s ease;
}

.patient-card-collapsible.is-open .patient-card-body {
    padding: 0 1.5rem 1.5rem;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}


@media (prefers-reduced-motion: reduce) {
    .patient-card-collapsible,
    .patient-card-toggle,
    .patient-card-chevron,
    .patient-card-toggle-left i,
    .patient-card-body {
        transition: none !important;
    }
}

@media (max-width: 768px) {
    .patient-page {
        padding-top: 1.75rem;
    }

    .layout-body-compact-hero .patient-page {
        padding-top: 1rem;
    }

    .patient-page-title {
        font-size: 1.55rem;
    }

    .patient-welcome-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    .patient-quick-links {
        flex-direction: column;
    }

    .patient-quick-link {
        width: 100%;
        justify-content: center;
    }
}

/* Light theme */
:root[data-theme='light'] .patient-card-toggle:hover {
    background: rgba(0, 0, 0, 0.03);
}

:root[data-theme='light'] .patient-card-toggle-title {
    color: #1e293b;
}

:root[data-theme='light'] .patient-card-toggle-sub {
    color: #64748b;
}

:root[data-theme='light'] .patient-card-chevron {
    color: #94a3b8;
}

/* ── Modal: Versicherungsart ─────────────────────────────────── */
.patient-modal {
    border: none;
    padding: 0;
    margin: auto;
    background: transparent;
    color: inherit;
}

.patient-modal::backdrop {
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

:root[data-theme='light'] .patient-modal::backdrop {
    background: rgba(226, 232, 240, 0.58);
}

.patient-insurance-modal {
    width: min(34rem, calc(100% - 2rem));
    max-width: 34rem;
    opacity: 0;
    transform: translateY(1.2rem) scale(0.97);
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.patient-insurance-modal[open] {
    display: block;
}

.patient-insurance-modal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.patient-insurance-modal.is-closing {
    opacity: 0;
    transform: translateY(1rem) scale(0.965);
}

.patient-insurance-modal__panel {
    position: relative;
    overflow: hidden;
    padding: 1.75rem;
    border-radius: 1.6rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
    box-shadow: 0 34px 80px rgba(2, 8, 23, 0.48), 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.patient-insurance-modal__glow {
    position: absolute;
    top: -4.5rem;
    right: -3.25rem;
    width: 12rem;
    height: 12rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.24) 0%, rgba(59, 130, 246, 0) 72%);
    pointer-events: none;
}

:root[data-theme='light'] .patient-insurance-modal__panel {
    border-color: rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(37, 99, 235, 0.06);
}

.patient-insurance-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    z-index: 1;
}

.patient-insurance-modal__close:hover {
    transform: translateY(-1px) rotate(90deg);
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.28);
    color: #eff6ff;
}

:root[data-theme='light'] .patient-insurance-modal__close {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.9);
    color: #475569;
}

:root[data-theme='light'] .patient-insurance-modal__close:hover {
    background: rgba(219, 234, 254, 0.95);
    border-color: rgba(37, 99, 235, 0.18);
    color: #1e40af;
}

.patient-insurance-modal__header {
    position: relative;
    display: grid;
    gap: 0.7rem;
    margin-bottom: 1.4rem;
    padding-right: 3.25rem;
}

.patient-insurance-modal__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

:root[data-theme='light'] .patient-insurance-modal__eyebrow {
    background: rgba(219, 234, 254, 0.88);
    border-color: rgba(96, 165, 250, 0.24);
    color: #1d4ed8;
}

.patient-insurance-modal__title {
    margin: 0;
    font-size: clamp(1.45rem, 2.5vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #f8fafc;
}

.patient-insurance-modal__description {
    margin: 0;
    color: rgba(226, 232, 240, 0.78);
    line-height: 1.65;
}

:root[data-theme='light'] .patient-insurance-modal__title {
    color: #0f172a;
}

:root[data-theme='light'] .patient-insurance-modal__description {
    color: #64748b;
}

.patient-insurance-modal__options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: stretch;
    grid-auto-rows: 1fr;
}

.patient-insurance-option {
    display: flex;
    cursor: pointer;
    height: 100%;
}

.patient-insurance-option__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.patient-insurance-option__card {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 0.65rem;
    min-height: 11rem;
    width: 100%;
    height: 100%;
    padding: 1.15rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(15, 23, 42, 0.22) 100%);
    color: #e2e8f0;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.patient-insurance-option:hover .patient-insurance-option__card {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.26);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
}

.patient-insurance-option__input:focus-visible + .patient-insurance-option__card {
    border-color: rgba(96, 165, 250, 0.72);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

.patient-insurance-option__input:checked + .patient-insurance-option__card {
    border-color: rgba(96, 165, 250, 0.5);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.18) 0%, rgba(30, 64, 175, 0.16) 100%);
    box-shadow: 0 18px 36px rgba(30, 58, 138, 0.2);
    transform: translateY(-2px);
}

:root[data-theme='light'] .patient-insurance-option__card {
    border-color: rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.88) 100%);
    color: #1e293b;
}

:root[data-theme='light'] .patient-insurance-option:hover .patient-insurance-option__card {
    border-color: rgba(96, 165, 250, 0.28);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

:root[data-theme='light'] .patient-insurance-option__input:checked + .patient-insurance-option__card {
    border-color: rgba(96, 165, 250, 0.34);
    background: linear-gradient(180deg, rgba(219, 234, 254, 0.96) 0%, rgba(239, 246, 255, 0.92) 100%);
    box-shadow: 0 18px 38px rgba(37, 99, 235, 0.12);
}

.patient-insurance-option__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.08);
    color: #93c5fd;
    font-size: 1.1rem;
    transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease;
}

.patient-insurance-option__input:checked + .patient-insurance-option__card .patient-insurance-option__icon {
    background: rgba(239, 246, 255, 0.18);
    color: #eff6ff;
    transform: scale(1.04);
}

:root[data-theme='light'] .patient-insurance-option__icon {
    background: rgba(219, 234, 254, 0.68);
    color: #1d4ed8;
}

:root[data-theme='light'] .patient-insurance-option__input:checked + .patient-insurance-option__card .patient-insurance-option__icon {
    background: rgba(255, 255, 255, 0.86);
    color: #1e3a8a;
}

.patient-insurance-option__title {
    font-size: 1.08rem;
    font-weight: 800;
    color: inherit;
}

.patient-insurance-option__copy {
    color: rgba(203, 213, 225, 0.8);
    line-height: 1.55;
    font-size: 0.92rem;
}

:root[data-theme='light'] .patient-insurance-option__copy {
    color: #64748b;
}

.patient-insurance-modal__validation {
    margin: 0.9rem 0 0;
    min-height: 1.35rem;
    color: #93c5fd;
    font-size: 0.88rem;
    opacity: 0;
    transform: translateY(-0.2rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.patient-insurance-modal__validation.is-visible {
    opacity: 1;
    transform: translateY(0);
}

:root[data-theme='light'] .patient-insurance-modal__validation {
    color: #1d4ed8;
}

.patient-insurance-modal__info-wrap {
    margin-top: 0.35rem;
}

.patient-insurance-modal__info-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
    color: #f8fafc;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.patient-insurance-modal__info-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.08);
}

.patient-insurance-modal__info-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    flex-shrink: 0;
}

.patient-insurance-modal__info-chevron {
    margin-left: auto;
    font-size: 0.9rem;
    color: rgba(226, 232, 240, 0.7);
    transition: transform 0.22s ease;
}

.patient-insurance-modal__info-toggle[aria-expanded='true'] .patient-insurance-modal__info-chevron {
    transform: rotate(180deg);
}

:root[data-theme='light'] .patient-insurance-modal__info-toggle {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.74);
    color: #0f172a;
}

:root[data-theme='light'] .patient-insurance-modal__info-toggle:hover {
    border-color: rgba(96, 165, 250, 0.2);
    background: rgba(239, 246, 255, 0.84);
}

:root[data-theme='light'] .patient-insurance-modal__info-toggle-icon {
    background: rgba(219, 234, 254, 0.86);
    color: #1d4ed8;
}

:root[data-theme='light'] .patient-insurance-modal__info-chevron {
    color: #64748b;
}

.patient-insurance-modal__info {
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    padding: 0 1rem;
    border-radius: 1rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(226, 232, 240, 0.82);
    line-height: 1.65;
    transition: max-height 0.28s cubic-bezier(0.16, 1, 0.3, 1), margin-top 0.28s ease, padding 0.28s ease, border-color 0.28s ease;
}

.patient-insurance-modal__info.is-open {
    max-height: 12rem;
    margin-top: 0.75rem;
    padding: 0.95rem 1rem;
    border-color: rgba(59, 130, 246, 0.12);
}

:root[data-theme='light'] .patient-insurance-modal__info {
    background: rgba(255, 255, 255, 0.78);
    color: #475569;
}

:root[data-theme='light'] .patient-insurance-modal__info.is-open {
    border-color: rgba(96, 165, 250, 0.18);
}

.patient-insurance-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.85rem;
    margin-top: 1.35rem;
}

.patient-insurance-modal__secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 8rem;
    padding: 0.8rem 1.1rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.patient-insurance-modal__secondary:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

:root[data-theme='light'] .patient-insurance-modal__secondary {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.92);
    color: #475569;
}

:root[data-theme='light'] .patient-insurance-modal__secondary:hover {
    border-color: rgba(148, 163, 184, 0.28);
    background: #ffffff;
    color: #0f172a;
}

.patient-insurance-modal__submit {
    width: auto;
    margin-top: 0;
    padding-inline: 1.4rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.32);
}

.patient-insurance-modal__submit:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: 0 18px 36px rgba(29, 78, 216, 0.3);
}

:root[data-theme='light'] .patient-insurance-modal__submit {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.2);
}

:root[data-theme='light'] .patient-insurance-modal__submit:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.22);
}

.patient-insurance-modal__submit:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
    box-shadow: none;
}

.patient-insurance-modal__submit:disabled:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transform: none;
    box-shadow: none;
}

:root[data-theme='light'] .patient-insurance-modal__submit:disabled:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

@media (max-width: 576px) {
    .patient-insurance-modal__panel {
        padding: 1.2rem;
        border-radius: 1.35rem;
    }

    .patient-insurance-modal__header {
        padding-right: 2.8rem;
    }

    .patient-insurance-modal__options {
        grid-template-columns: 1fr;
    }

    .patient-insurance-option__card {
        min-height: 0;
    }

    .patient-insurance-modal__actions {
        flex-direction: column-reverse;
    }

    .patient-insurance-modal__secondary,
    .patient-insurance-modal__submit {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .patient-insurance-modal,
    .patient-insurance-option__card,
    .patient-insurance-option__icon,
    .patient-insurance-modal__close,
    .patient-insurance-modal__validation,
    .patient-insurance-modal__info,
    .patient-insurance-modal__info-toggle,
    .patient-insurance-modal__info-chevron,
    .patient-insurance-modal__secondary,
    .patient-insurance-modal__submit {
        transition: none !important;
    }
}

/* ── Modal: Konto gesperrt ──────────────────────────────────── */
.patient-locked-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.patient-locked-modal {
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 1.5rem;
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(239, 68, 68, 0.1);
    animation: dpSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.patient-locked-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #ef4444;
    margin: 0 auto 1.25rem;
}

.patient-locked-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 0.75rem;
}

.patient-locked-desc {
    font-size: 0.92rem;
    color: #94a3b8;
    line-height: 1.65;
    margin-bottom: 1.75rem;
}

.patient-locked-call-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 0.75rem;
    text-decoration: none;
}

.patient-locked-close {
    display: block;
    width: 100%;
    padding: 0.65rem;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.patient-locked-close:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.18);
    color: #94a3b8;
}

/* Light theme */
:root[data-theme='light'] .patient-locked-modal {
    background: #ffffff;
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}

:root[data-theme='light'] .patient-locked-title {
    color: #0f172a;
}

:root[data-theme='light'] .patient-locked-desc {
    color: #64748b;
}

:root[data-theme='light'] .patient-locked-close {
    border-color: #e2e8f0;
    color: #94a3b8;
}

:root[data-theme='light'] .patient-locked-close:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

/* ── Toggler (Bootstrap Switch) ─────────────────────────────── */
.patient-form-group-switch {
    display: flex;
    align-items: center;
}

.custom-switch {
    width: 2.5rem !important;
    height: 1.25rem !important;
    cursor: pointer;
}

.custom-switch:checked {
    background-color: var(--brand-500) !important;
    border-color: var(--brand-500) !important;
}

:root[data-theme='light'] .patient-form-group-switch .form-check-label {
    color: #334155 !important;
}
