/**
 * Patienten-Portal Styles
 * Praxis Diana Perske - Florales Design
 */

:root {
    /* Farbpalette - konsistent mit hypnosysmed.de */
    --sage: #8a9a8e;
    --sage-light: #a8b5ab;
    --sage-lighter: #c5d1c8;
    --sage-dark: #6b7d6f;
    --sage-darker: #5a6b5e;
    --sage-pale: #e8f0ea;
    --sage-bg: #f4f7f5;

    --cream: #f9f7f4;
    --cream-dark: #f0ede8;
    --cream-warm: #faf6ed;

    --gold: #c9a55a;
    --gold-light: #d4b76a;

    /* Kompatibilität */
    --primary: var(--sage);
    --primary-dark: var(--sage-dark);
    --primary-light: var(--sage-pale);
    --success: #5a8a5e;
    --success-light: #d4edda;
    --danger: #c75050;
    --danger-light: #f8d7da;
    --warning: #b8935a;
    --warning-light: #fff3cd;

    --text: #4a5548;
    --text-light: #6b7d6f;
    --text-muted: #6b7d6f;
    --text-dark: #3a4338;

    --bg: var(--cream);
    --bg-white: #fff;
    --border: rgba(138, 154, 142, 0.15);
    --shadow: 0 4px 20px rgba(106, 125, 111, 0.12);
    --shadow-soft: 0 4px 20px rgba(106, 125, 111, 0.08);
    --radius: 12px;

    /* Typografie */
    --font-display: Georgia, 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* Karten-Akzentfarben (Dashboard-Modernisierung) */
    --accent-appointment: #7a9e8e;
    --accent-appointment-bg: rgba(122, 158, 142, 0.10);
    --accent-messages: #7a8fa0;
    --accent-messages-bg: rgba(122, 143, 160, 0.10);
    --accent-forms: #b8935a;
    --accent-forms-bg: rgba(184, 147, 90, 0.10);
    --accent-documents: #8a7e9e;
    --accent-documents-bg: rgba(138, 126, 158, 0.10);

    /* Geschichtete Schatten für Karten */
    --shadow-card: 0 1px 3px rgba(106, 125, 111, 0.06), 0 4px 16px rgba(106, 125, 111, 0.08);
    --shadow-card-hover: 0 2px 6px rgba(106, 125, 111, 0.10), 0 8px 24px rgba(106, 125, 111, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-y: scroll;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--cream);
    position: relative;
}

/* Floraler Hintergrund */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('images/logo_background.png') center center / 40% auto no-repeat;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

/* Subtile florale Eckverzierungen */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 300px 300px at 0% 0%, rgba(138, 154, 142, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 300px 300px at 100% 100%, rgba(201, 165, 90, 0.03) 0%, transparent 70%),
        radial-gradient(ellipse 200px 200px at 100% 0%, rgba(138, 154, 142, 0.02) 0%, transparent 60%),
        radial-gradient(ellipse 200px 200px at 0% 100%, rgba(201, 165, 90, 0.02) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* =====================================================
   LOGIN PAGE - Florales Design
   ===================================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--cream);
    position: relative;
    z-index: 1;
}

.portal-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.portal-box {
    background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
    border-radius: 20px;
    box-shadow:
        0 4px 24px rgba(90, 115, 96, 0.12),
        0 1px 3px rgba(90, 115, 96, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 1.75rem 1.75rem 1.5rem;
    position: relative;
    border: 1px solid rgba(90, 115, 96, 0.1);
    animation: fadeInUp 0.5s ease;
}

/* Dekorativer innerer Rahmen */
.portal-box::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px dashed rgba(90, 115, 96, 0.08);
    border-radius: 14px;
    pointer-events: none;
}

/* Gold-Akzentlinie am oberen Rand */
.portal-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--sage-lighter) 30%, var(--gold) 50%, var(--sage-lighter) 70%, transparent);
    border-radius: 0 0 3px 3px;
    opacity: 0.5;
}

.portal-header {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.portal-logo {
    margin-bottom: 0.5rem;
    text-align: center;
}

.portal-logo-img {
    height: 65px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(90, 115, 96, 0.15));
}

.portal-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    margin-bottom: 0.5rem;
}

.portal-brand-signature {
    height: 45px;
    width: auto;
}

.portal-brand-sub {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-light);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.portal-title-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0 auto 0.5rem;
    opacity: 0.6;
}

.portal-header h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--sage);
    margin-bottom: 0;
    letter-spacing: 0.08em;
}

.portal-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-text {
    text-align: center;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--sage-pale) 0%, var(--cream) 100%);
    border-radius: var(--radius);
    border-left: 3px solid var(--gold);
    position: relative;
}

.welcome-text p {
    margin: 0;
}

.welcome-text .hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Forms - Florales Design */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border: 2px solid rgba(90, 115, 96, 0.15);
    border-radius: 10px;
    background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
    transition: all 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 4px rgba(90, 115, 96, 0.12);
    background: #fff;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* PIN Input - einzelnes Feld (Legacy) */
.pin-form input#pin {
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    text-align: center;
    font-family: monospace;
}

/* PIN Input - 6 einzelne Felder */
.pin-input-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 1rem 0;
}

.pin-input {
    width: 48px;
    height: 54px;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    border: 2px solid rgba(90, 115, 96, 0.2);
    border-radius: 10px;
    transition: all 0.25s ease;
    background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
}

.pin-input:focus {
    border-color: var(--sage);
    outline: none;
    box-shadow: 0 0 0 4px rgba(90, 115, 96, 0.12);
    background: #fff;
    transform: translateY(-2px);
}

.pin-input::-webkit-outer-spin-button,
.pin-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pin-hint {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

/* "Dieses Gerät merken" Checkbox */
.remember-device {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    user-select: none;
}

.remember-device input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8a9a8e;
    cursor: pointer;
    flex-shrink: 0;
}

.remember-device span {
    line-height: 1.3;
}

/* Responsive PIN-Felder */
@media (max-width: 480px) {
    .portal-logo-img {
        height: 55px;
    }
    .portal-brand-signature {
        height: 34px;
    }
    .portal-brand-sub {
        font-size: 0.6rem;
        letter-spacing: 0.15em;
    }
    .portal-header h1 {
        font-size: 1.15rem;
    }
}

@media (max-width: 400px) {
    .pin-input-group {
        gap: 6px;
    }
    .pin-input {
        width: 42px;
        height: 52px;
        font-size: 20px;
    }
}

/* Buttons - konsistent mit hypnosysmed.de */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.8rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary,
.btn-sage {
    background: var(--sage);
    color: white;
    border-color: var(--sage);
}

.btn-primary:hover,
.btn-sage:hover {
    background: var(--sage-dark);
    border-color: var(--sage-dark);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-success:hover {
    background: #4a7a4e;
    border-color: #4a7a4e;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--sage);
    border-color: var(--sage);
}

.btn-outline:hover {
    background: var(--sage);
    color: white;
}

.btn-white {
    background: white;
    color: var(--sage-dark);
    border-color: white;
}

.btn-white:hover {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn:disabled {
    background: var(--sage-lighter);
    border-color: var(--sage-lighter);
    color: rgba(255, 255, 255, 0.7);
    cursor: not-allowed;
    transform: none;
}

/* Alerts - Florales Design */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    position: relative;
    border-left: 4px solid;
}

.alert-success {
    background: linear-gradient(135deg, var(--sage-pale) 0%, var(--cream) 100%);
    color: var(--sage);
    border-left-color: var(--sage);
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, var(--cream) 100%);
    color: var(--danger);
    border-left-color: var(--danger);
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, var(--cream) 100%);
    color: var(--warning);
    border-left-color: var(--gold);
}

/* Portal Info */
.portal-info {
    text-align: center;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.portal-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    position: relative;
}

/* Dekorative Linie */
.portal-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.5;
}

.back-link {
    color: var(--sage);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease, letter-spacing 0.2s ease;
}

.back-link:hover {
    color: var(--sage-dark);
    letter-spacing: 0.02em;
}

/* =====================================================
   PORTAL PAGE (MAIN VIEW) - Florales Design
   ===================================================== */

.portal-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, var(--sage-bg) 0%, #f0f4f1 50%, var(--sage-pale) 100%);
}

/* Subtile florale Eckverzierungen für Portal-Page */
.portal-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 400px 400px at 0% 0%, rgba(138, 154, 142, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 400px 400px at 100% 100%, rgba(138, 154, 142, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 300px 300px at 100% 0%, rgba(201, 165, 90, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 300px 300px at 0% 100%, rgba(201, 165, 90, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Header Bar - Helles Design */
.portal-header-bar {
    background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(106, 125, 111, 0.08);
    color: var(--text);
    overflow: hidden;
    border-bottom: 1px solid rgba(138, 154, 142, 0.12);
}

/* Subtile florale Akzente */
.portal-header-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 10% 90%, rgba(138, 154, 142, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 90% 10%, rgba(201, 165, 90, 0.04) 0%, transparent 40%);
    pointer-events: none;
}

/* Goldene Unterkante */
.portal-header-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, var(--gold) 50%, transparent 90%);
    opacity: 0.4;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header-brand {
    display: flex;
    align-items: center;
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.header-logo-link:hover {
    opacity: 0.9;
}

/* Yin-Yang Logo Icon - gleiche Größe wie hypnosysmed.de */
.header-logo-icon {
    height: 70px;
    width: auto;
    object-fit: contain;
    opacity: 0.95;
}

.header-logo-img {
    height: 38px;
    width: auto;
    opacity: 0.95;
}

.header-logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

/* Script-Schrift als Bild wie auf der Website - gleiche Größe wie hypnosysmed.de */
.brand-name-img {
    height: 55px;
    width: auto;
    opacity: 0.95;
    display: block;
}

.brand-name-script {
    font-family: 'Brush Script MT', 'Segoe Script', 'Bradley Hand', cursive;
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--sage);
    line-height: 1.1;
    letter-spacing: 0.02em;
}

/* Kapitälchen-Untertitel - gleiche Größe wie hypnosysmed.de */
.brand-sub-caps {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-light);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.brand-name {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 500;
    color: var(--sage);
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.7rem;
    color: var(--text-light);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-text {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 500;
    color: var(--sage);
    font-size: 1.1rem;
    letter-spacing: 0.01em;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--text);
    font-size: 0.9rem;
}

.logout-btn {
    color: var(--sage);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(138, 154, 142, 0.3);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--sage);
    color: white;
    border-color: var(--sage);
}

/* Settings-Button im Header */
.settings-btn {
    background: transparent;
    color: var(--sage);
    border: 1px solid rgba(138, 154, 142, 0.3);
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: var(--sage);
    color: white;
    border-color: var(--sage);
}

/* PIN-Change Button im Header */
.pin-change-btn {
    background: transparent;
    color: var(--sage);
    border: 1px solid rgba(138, 154, 142, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.pin-change-btn:hover {
    background: var(--sage);
    color: white;
    border-color: var(--sage);
}

/* Main Content */
.portal-main {
    flex: 1;
    padding: 2rem 1rem;
    position: relative;
}

.portal-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Cards - konsistent mit hypnosysmed.de */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(138, 154, 142, 0.1);
    position: relative;
}

.card-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, rgba(138, 154, 142, 0.06) 0%, transparent 100%);
    border-bottom: 1px solid rgba(138, 154, 142, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.card-header h2 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 400;
    margin: 0;
    color: var(--text-dark);
}

.card-header .date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.sort-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #fff 0%, var(--cream) 100%);
    border: 1px solid rgba(90, 115, 96, 0.15);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}

.sort-toggle-btn:hover {
    background: linear-gradient(135deg, var(--sage-pale) 0%, var(--cream) 100%);
    border-color: var(--sage);
    color: var(--sage);
}

.card-body {
    padding: 1.25rem;
    position: relative;
}

/* Contact Details */
.contact-details {
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    width: 100px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detail-row .value {
    flex: 1;
}

.contact-message {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.contact-message .label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.message-text {
    background: linear-gradient(135deg, var(--cream) 0%, #fff 100%);
    padding: 1rem;
    border-radius: var(--radius);
    white-space: pre-wrap;
    border-left: 3px solid var(--gold);
}

.contact-status {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.status-confirmed {
    background: var(--success-light);
    color: #155724;
}

/* Messages - konsistent mit hypnosysmed.de */
.no-messages {
    text-align: center;
    padding: 2.5rem 2rem;
    color: var(--text-light);
}

.no-messages .hint {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.messages-list {
    max-height: 60vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.message {
    padding: 1rem 1.15rem;
    margin-bottom: 0.85rem;
    border-radius: 12px;
    text-align: left;
    max-width: 85%;
    position: relative;
    animation: fadeInUp 0.3s ease;
}

.message:last-child {
    margin-bottom: 0;
}

.message-practice {
    background: white;
    margin-left: 0;
    margin-right: auto;
    border-left: 3px solid var(--sage);
    box-shadow: var(--shadow-soft);
}

.message-patient {
    background: var(--cream-dark);
    margin-left: auto;
    margin-right: 0;
    border-right: 3px solid var(--sage-light);
    box-shadow: var(--shadow-soft);
}

.message-system {
    background: #fff8e6;
    margin: 0.5rem 2rem;
    text-align: left;
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--gold);
    border-radius: 8px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
}

.message-header .sender {
    font-weight: 500;
}

.message-header .time {
    color: var(--text-light);
}

.message-body {
    word-wrap: break-word;
    text-align: left;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Appointment Box */
.appointment-box {
    margin-top: 1rem;
    padding: 1.25rem;
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(138, 154, 142, 0.2);
    position: relative;
    box-shadow: var(--shadow-soft);
}

.appointment-header {
    font-family: var(--font-display);
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.appointment-details {
    margin-bottom: 1rem;
}

.appointment-date {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.appointment-duration {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.appointment-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.appointment-status .badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.badge-success {
    background: var(--success-light);
    color: #155724;
}

.badge-warning {
    background: var(--warning-light);
    color: #856404;
}

/* New Message Form */
.message-form textarea {
    min-height: 100px;
    resize: vertical;
}

/* Info Box */
.info-box {
    background: white;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--sage);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-soft);
}

.info-box h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.info-box ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.info-box li {
    margin-bottom: 0.35rem;
}

/* =====================================================
   CHAT-EINGABE (INLINE, ÜBER NACHRICHTEN)
   ===================================================== */

.chat-input-inline {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid rgba(138, 154, 142, 0.12);
    background: rgba(249, 247, 244, 0.5);
}

.chat-form {
    margin: 0;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border-radius: 28px;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    border: 1px solid rgba(138, 154, 142, 0.2);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-input-wrapper:focus-within {
    border-color: var(--sage);
    box-shadow: 0 4px 20px rgba(106, 125, 111, 0.15);
}

.chat-input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-family: var(--font-body);
    line-height: 1.5;
    resize: none;
    min-height: 28px;
    max-height: 120px;
    padding: 0.4rem 0;
    outline: none;
    vertical-align: middle;
    color: var(--text);
}

.chat-input-wrapper textarea::placeholder {
    color: var(--text-light);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--sage);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: var(--sage-dark);
    transform: scale(1.05);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn svg {
    margin-left: 2px;
}

/* Footer - Fixiert */
footer.portal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(249, 247, 244, 0.98);
    border-top: 1px solid rgba(138, 154, 142, 0.1);
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
    z-index: 99;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

footer.portal-footer a {
    color: var(--sage-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer.portal-footer a:hover {
    color: var(--sage);
}

/* Main Content Padding für fixierten Footer */
main.portal-main {
    padding-bottom: 50px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 600px) {
    .portal-box {
        padding: 1.25rem 1.25rem 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .header-logo-icon {
        height: 60px;
        width: auto;
    }

    .header-logo-img {
        height: 32px;
    }

    .brand-name-img {
        height: 40px;
    }

    .brand-name-script {
        font-size: 1.3rem;
    }

    .brand-sub-caps {
        font-size: 0.6rem;
        letter-spacing: 0.15em;
    }

    .brand-name {
        font-size: 0.95rem;
    }

    .brand-sub {
        font-size: 0.65rem;
    }

    .header-user {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .user-name {
        font-size: 0.85rem;
    }

    .settings-btn,
    .pin-change-btn,
    .logout-btn {
        font-size: 0.8rem;
        padding: 0.35rem 0.6rem;
    }

    .message-practice {
        margin-right: 0.5rem;
        max-width: 95%;
    }

    .message-patient {
        margin-left: 0.5rem;
        max-width: 95%;
    }

    .appointment-actions {
        flex-direction: column;
    }

    .inline-form {
        flex-direction: column;
        width: 100%;
    }
    
    .inline-form button {
        width: 100%;
    }
    
    /* Chat-Eingabe Mobile */
    .chat-input-inline {
        padding: 0.5rem 0.75rem;
    }

    .chat-input-wrapper {
        padding: 0.35rem 0.35rem 0.35rem 0.75rem;
    }

    .chat-send-btn {
        width: 38px;
        height: 38px;
    }

    main.portal-main {
        padding-bottom: 50px;
    }
}

/* PIN-Sektion */
.pin-section .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pin-section .card-body {
    text-align: left;
}

.pin-section .card-body input[type="text"],
.pin-section .card-body input[type="password"] {
    border: 2px solid var(--border);
    border-radius: var(--radius);
}

.pin-section .card-body input[type="text"]:focus,
.pin-section .card-body input[type="password"]:focus {
    border-color: var(--primary);
    outline: none;
}

.pin-section .card-body input[type="radio"],
.pin-section .card-body input[type="checkbox"] {
    flex-shrink: 0;
}

/* ========================================
   Einklappbare Anfrage-Kachel
   ======================================== */

.collapsible .card-header.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.collapsible .card-header.collapsible-header:hover {
    background-color: rgba(0,0,0,0.02);
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.collapsible-header .header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.collapsible-header .header-left h2 {
    margin: 0;
    white-space: nowrap;
}

.collapsible-header .header-summary {
    color: #888;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collapsible-header .header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.collapse-icon {
    font-size: 0.75rem;
    color: #888;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.collapsible:not(.collapsed) .collapse-icon {
    transform: rotate(90deg);
}

/* Status-Badge Mini (im Header) */
.status-badge-mini {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge-mini.status-confirmed {
    background: #d4edda;
    color: #155724;
}

.status-badge-mini.status-pending {
    background: #fff3cd;
    color: #856404;
}

/* Einklappbarer Inhalt */
.collapsible-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.collapsible.collapsed .collapsible-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* Status-Detail unten (klein) */
.contact-status-detail {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
    color: #888;
}

.contact-status-detail small {
    font-size: 0.8rem;
}

/* Header-Summary ausblenden wenn aufgeklappt */
.collapsible:not(.collapsed) .header-summary {
    display: none;
}

/* Mobile Anpassungen */
@media (max-width: 600px) {
    .collapsible-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .collapsible-header .header-right {
        width: 100%;
        justify-content: space-between;
        margin-top: 0.25rem;
    }
    
    .collapsible-header .header-summary {
        display: none;
    }
}

/* ========================================
   Ungelesene Nachrichten & Verbesserungen
   ======================================== */

/* Kommunikation Header mit Badge */
.messages-section .card-header .header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.messages-section .card-header .header-title h2 {
    margin: 0;
}

/* Ungelesene Badge */
.unread-badge {
    background: #dc3545;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Neue Nachricht Badge */
.message-unread {
    border-left: 3px solid #dc3545;
    background: linear-gradient(to right, #fff5f5 0%, #ffffff 100%);
}

.message .new-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #dc3545;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.message {
    position: relative;
}

/* Gelesen-Status unter Nachrichten */
.read-status {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
    text-align: right;
}

.read-status small {
    color: #888;
    font-size: 0.75rem;
}

/* Zeit mit Hover-Tooltip */
.message-header .time {
    cursor: help;
}

/* Push-Notification Button */
.notification-prompt {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.notification-prompt p {
    margin: 0;
    color: #004085;
    font-size: 0.9rem;
}

.notification-prompt .btn-notify {
    background: #004085;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
}

.notification-prompt .btn-notify:hover {
    background: #003060;
}

.notification-prompt .btn-dismiss {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Smooth Scroll Animation */
.scroll-highlight {
    animation: highlight-flash 1.5s ease;
}

@keyframes highlight-flash {
    0% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}

/* Mobile Anpassungen */
@media (max-width: 600px) {
    .notification-prompt {
        flex-direction: column;
        text-align: center;
    }
    
    .notification-prompt .btn-notify {
        width: 100%;
    }
}

/* ========================================
   Toast Notifications
   ======================================== */

#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-size: 0.85rem;
    min-width: 250px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    pointer-events: auto;
}

.toast-show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: #d4edda;
    color: #155724;
}

.toast-error .toast-icon {
    background: #f8d7da;
    color: #721c24;
}

.toast-info .toast-icon {
    background: #d1ecf1;
    color: #0c5460;
}

.toast-message {
    flex: 1;
    color: #333;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    margin-left: 0.5rem;
}

.toast-close:hover {
    color: #666;
}

@media (max-width: 480px) {
    #toast-container {
        left: 0.5rem;
        right: 0.5rem;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* ========================================
   Info/Hinweise Modal
   ======================================== */

.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.info-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.info-modal-content {
    position: relative;
    background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    box-shadow:
        0 20px 60px rgba(90, 115, 96, 0.25),
        0 8px 24px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(90, 115, 96, 0.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.info-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 1.25rem;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1;
}

.info-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.info-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--sage-pale) 0%, #fff 100%);
    border-bottom: 1px solid rgba(90, 115, 96, 0.1);
}

.info-modal-icon {
    font-size: 1.5rem;
}

.info-modal-header h3 {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--sage);
}

.info-modal-body {
    padding: 1.25rem 1.5rem;
}

.info-item {
    display: flex;
    gap: 0.875rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--sage-pale) 0%, var(--cream) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(90, 115, 96, 0.1);
}

.info-item-text {
    flex: 1;
}

.info-item-text strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.info-item-text p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.info-modal-footer {
    padding: 1rem 1.5rem;
    background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
    border-top: 1px solid rgba(90, 115, 96, 0.1);
    text-align: center;
}

.info-modal-footer .btn {
    min-width: 140px;
}

@media (max-width: 480px) {
    .info-modal {
        padding: 0.5rem;
    }
    
    .info-modal-content {
        border-radius: 12px;
    }
    
    .info-modal-header {
        padding: 1rem 1.25rem;
    }
    
    .info-modal-body {
        padding: 1rem 1.25rem;
    }
    
    .info-item {
        padding: 0.75rem 0;
    }
    
    .info-item-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* ========================================
   Nächster Termin Card
   ======================================== */

.next-appointment-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    border: 1px solid rgba(138, 154, 142, 0.2);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.next-appointment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--sage);
}

.appointment-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.appointment-content {
    flex: 1;
}

.appointment-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.appointment-datetime {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.apt-day {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-dark);
}

.apt-date {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text);
}

.apt-time {
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--cream-dark);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

.appointment-type {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.appointment-notes {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--cream);
    border-radius: 6px;
    border-left: 2px solid var(--sage-light);
}

.appointment-status {
    text-align: right;
    flex-shrink: 0;
}

.appointment-status .status-confirmed {
    display: inline-block;
    background: var(--sage);
    color: white;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.appointment-status .status-pending {
    display: block;
    color: var(--warning);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.appointment-status .status-cancel-requested {
    display: inline-block;
    background: #fff3e0;
    color: #e65100;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.appointment-actions-mini {
    margin-top: 0.5rem;
}

.btn-confirm-apt {
    background: var(--sage);
    color: white;
    border: none;
    padding: 0.45rem 1.1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-confirm-apt:hover {
    background: var(--sage-dark);
    transform: translateY(-2px);
}

/* Kompakte Buttons für "Weitere Termine"-Liste */
.apt-list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-confirm-sm,
.btn-cancel-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

@media (max-width: 600px) {
    .next-appointment-card {
        flex-direction: column;
        text-align: center;
    }

    .next-appointment-card::before {
        width: 100%;
        height: 3px;
        top: 0;
        left: 0;
    }

    .appointment-datetime {
        justify-content: center;
    }
    
    .appointment-status {
        text-align: center;
        margin-top: 0.5rem;
    }
}

/* ========================================
   PORTAL DOKUMENTE
   ======================================== */

.portal-docs-section .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.docs-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 12px;
    background: var(--sage-pale);
    color: var(--sage-dark);
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.docs-toggle-icon {
    font-size: 0.85rem;
    color: var(--text-light);
    transition: transform 0.2s;
}

.portal-docs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.portal-doc-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--cream);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.portal-doc-item:hover {
    border-color: var(--sage-light);
}

.portal-doc-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.portal-doc-info {
    flex: 1;
    min-width: 0;
}

.portal-doc-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.portal-doc-source {
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.portal-doc-source-praxis {
    background: rgba(122, 143, 160, 0.12);
    color: #5a7a8a;
}

.portal-doc-source-eigen {
    background: rgba(138, 126, 158, 0.12);
    color: #7a6e9e;
}

.portal-doc-category {
    background: var(--sage-pale);
    color: var(--sage-dark);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.portal-doc-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-doc {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.btn-doc-preview {
    background: var(--sage-pale);
    color: var(--sage-dark);
}

.btn-doc-preview:hover {
    background: var(--sage-lighter);
    color: var(--sage-darker);
}

.btn-doc-download {
    background: var(--sage);
    color: #fff;
}

.btn-doc-download:hover {
    background: var(--sage-dark);
    color: #fff;
}

.btn-doc-delete {
    background: var(--danger-light);
    color: var(--danger);
    border: none;
    cursor: pointer;
}

.btn-doc-delete:hover {
    background: var(--danger);
    color: #fff;
}

@media (max-width: 600px) {
    .portal-doc-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .portal-doc-icon {
        display: none;
    }

    .portal-doc-actions {
        width: 100%;
    }

    .btn-doc {
        flex: 1;
        justify-content: center;
    }
}

/* ========================================
   DOKUMENT ENTFERNEN MODAL
   ======================================== */

.delete-doc-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.delete-doc-modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
}

.delete-doc-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: deleteDocModalSlideIn 0.3s ease;
}

@keyframes deleteDocModalSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.delete-doc-modal-header {
    background: linear-gradient(135deg, var(--danger) 0%, #b04040 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

.delete-doc-modal-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

.delete-doc-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
}

.delete-doc-modal-body {
    padding: 25px;
    text-align: center;
}

.delete-doc-modal-body p {
    color: var(--text-dark);
    margin: 0 0 10px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.delete-doc-modal-actions {
    display: flex;
    gap: 15px;
    padding: 20px 25px 25px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.btn-delete-doc-cancel {
    flex: 1;
    padding: 12px;
    background: white;
    border: 2px solid #ccc;
    border-radius: 8px;
    color: #666;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-delete-doc-cancel:hover {
    border-color: #999;
    color: #333;
}

.btn-delete-doc-confirm {
    flex: 1;
    padding: 12px;
    background: var(--danger);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-delete-doc-confirm:hover {
    background: #b04040;
}

.btn-delete-doc-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .delete-doc-modal-content {
        max-width: 95%;
    }
    .delete-doc-modal-actions {
        flex-direction: column;
    }
}

/* ========================================
   PORTAL UPLOAD
   ======================================== */

.portal-upload-area {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e8e8e8;
}

.portal-upload-dropzone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.portal-upload-dropzone:hover,
.portal-upload-dropzone.dragover {
    border-color: var(--sage);
    background: var(--sage-lighter, #f0f5f1);
}

.portal-upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.portal-upload-text {
    font-size: 1rem;
    color: #555;
    margin-bottom: 0.25rem;
}

.portal-upload-hint {
    font-size: 0.8rem;
    color: #999;
}

.portal-upload-progress {
    margin-top: 1rem;
}

.portal-upload-progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.portal-upload-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--sage, #7c9885);
    border-radius: 3px;
    transition: width 0.3s;
}

.portal-upload-progress-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    text-align: center;
}

.portal-upload-result {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.portal-upload-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.portal-upload-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 600px) {
    .portal-upload-dropzone {
        padding: 1.5rem 1rem;
    }

    .portal-upload-icon {
        font-size: 2rem;
    }

    .portal-upload-text {
        font-size: 0.9rem;
    }
}

/* Handy-Upload Button */
.btn-mobile-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    border: 1px dashed var(--sage-light);
    border-radius: 8px;
    background: var(--sage-pale);
    color: var(--sage-dark);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-mobile-upload:hover {
    background: var(--sage-lighter);
    border-color: var(--sage);
    color: var(--sage-darker);
}

/* QR-Code / Handy-Upload Modal */
.portal-mobile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.portal-mobile-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
.portal-mobile-modal-content {
    position: relative;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
}
.portal-mobile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.portal-mobile-modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-dark);
    margin: 0;
}
.portal-mobile-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}
.portal-mobile-modal-close:hover {
    color: var(--danger);
}
.portal-mobile-modal-body {
    padding: 1.5rem;
}

/* QR-Code Anzeige im Modal */
.portal-qr-display {
    text-align: center;
}
.portal-qr-display img {
    width: 250px;
    height: 250px;
    border: 3px solid var(--sage-pale);
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}
.portal-qr-timer {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text);
}
.portal-qr-timer strong {
    font-variant-numeric: tabular-nums;
    color: var(--sage-dark);
}
.portal-qr-hint {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.portal-qr-url {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--sage-pale);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-all;
    font-family: monospace;
}

@media (max-width: 600px) {
    .portal-mobile-modal-content {
        width: 95%;
    }
    .portal-qr-display img {
        width: 200px;
        height: 200px;
    }
}

/* ========================================
   PORTAL FORMULARE
   ======================================== */

.forms-pending-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    background: var(--warning-light);
    color: var(--warning);
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.portal-forms-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.portal-form-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.portal-form-pending {
    background: var(--cream);
}

.portal-form-done {
    background: var(--bg-white);
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.portal-form-done:hover {
    opacity: 1;
}

.portal-form-card:hover {
    border-color: var(--sage-light);
}

.portal-form-card-info {
    flex: 1;
    min-width: 0;
}

.portal-form-card-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.portal-form-priority {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.portal-form-priority.priority-1 {
    background: var(--warning-light);
    color: var(--warning);
}

.portal-form-priority.priority-2 {
    background: var(--danger-light);
    color: var(--danger);
}

.portal-form-card-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}

.portal-form-card-due {
    font-size: 0.8rem;
    color: var(--warning);
    margin-top: 0.25rem;
}

.portal-form-card-action {
    flex-shrink: 0;
}

.btn-form-open {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    background: var(--sage);
    color: #fff;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-form-open:hover {
    background: var(--sage-dark);
}

.portal-form-status-done {
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 500;
}

.portal-forms-verifying {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.portal-forms-verifying-title {
    font-size: 0.85rem;
    color: var(--warning, #c88a00);
    margin: 0 0 0.75rem;
    font-weight: 600;
}

.portal-form-verify {
    background: #fffbf0;
    border-color: #e8d5a0;
    cursor: pointer;
    transition: opacity 0.15s ease, border-color 0.2s;
}

.portal-form-verify:hover {
    border-color: var(--warning, #c88a00);
    opacity: 0.9;
}

.portal-form-status-verify {
    color: var(--warning, #c88a00);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.portal-forms-completed {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.portal-forms-completed-title {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0 0 0.75rem;
    font-weight: 500;
}

/* ========================================
   VERIFIZIERUNGS-ANSICHT (QR-Code Modal)
   ======================================== */

.verification-view {
    padding: 1.5rem 1rem;
    text-align: center;
}

.verification-status-info {
    margin-bottom: 1.5rem;
}

.verification-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.verification-status-info h4 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    color: var(--text-dark, #333);
}

.verification-date {
    font-size: 0.85rem;
    color: var(--text-light, #888);
    margin: 0;
}

.verification-qr-section {
    margin-top: 1rem;
}

.verification-instruction {
    font-size: 0.9rem;
    color: var(--text-dark, #333);
    margin: 0 0 1.25rem;
    line-height: 1.5;
    text-align: center;
}

.verification-qr-code {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.verification-qr-code img {
    width: 250px;
    height: 250px;
    border: 3px solid var(--border, #e0ddd5);
    border-radius: 12px;
    padding: 8px;
    background: #fff;
}

.verification-hint {
    font-size: 0.8rem;
    color: var(--text-light, #888);
    margin: 0 0 0.5rem;
}

.verification-link {
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
    font-size: 0.75rem;
    color: var(--sage, #5a7360);
    text-decoration: underline;
    padding: 0.5rem 0.75rem;
    background: var(--cream, #f8f6f0);
    border-radius: 6px;
}

.verification-expired {
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--cream, #f8f6f0);
    border-radius: 10px;
}

.verification-expired-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.verification-expired p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--text-light, #666);
}

/* ========================================
   EINREICHUNG READ-ONLY ANSICHT
   ======================================== */

.submission-view {
    padding: 1rem 0;
}

.submission-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    background: var(--cream, #f8f6f0);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-light, #666);
}

.submission-fields {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.submission-heading {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--sage, #5a7360);
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border, #e0ddd5);
}

.submission-paragraph {
    font-size: 0.9rem;
    color: var(--text-light, #666);
    margin: 0.25rem 0 0.5rem;
    line-height: 1.5;
}

.submission-separator {
    border: none;
    border-top: 1px solid var(--border, #e0ddd5);
    margin: 0.75rem 0;
}

.submission-field {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light, #f0ede5);
}

.submission-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light, #888);
    margin-bottom: 0.15rem;
}

.submission-value {
    font-size: 0.95rem;
    color: var(--text-dark, #333);
    word-break: break-word;
}

.submission-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-light, #f0ede5);
}

.submission-check {
    font-size: 1.1rem;
    line-height: 1.3;
    flex-shrink: 0;
}

.submission-signature {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border, #e0ddd5);
}

.submission-sig-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light, #666);
    margin-bottom: 0.5rem;
}

.submission-sig-image {
    background: transparent;
    padding: 0.75rem;
    border-radius: 8px;
    display: inline-block;
}

.submission-sig-image img {
    max-width: 280px;
    max-height: 100px;
    display: block;
}

/* ========================================
   FORMULAR MODAL (Fullscreen)
   ======================================== */

.portal-form-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.portal-form-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.portal-form-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-dark);
    font-family: var(--font-display);
    font-weight: 400;
}

.portal-form-modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.portal-form-modal-close:hover {
    color: var(--danger);
}

.portal-form-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

@media (max-width: 600px) {
    .portal-form-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .portal-form-card-action {
        width: 100%;
    }

    .btn-form-open {
        width: 100%;
        justify-content: center;
    }

    .portal-form-modal-body {
        padding: 1rem;
    }
}
