/* ==========================================================================
   WENN ICH FORT BIN - HAUPT-STYLESHEET
   Architektur: Variables -> Globals -> Layout -> Components -> Page Styles -> Media Queries
   ========================================================================= */

/* ==========================================================================
   1. DESIGN TOKENS & CORE RESETS
   ========================================================================== */
:root {
    --bg-main: #f3f4f6;
    --bg-card: #ffffff;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --dark-bg: #0f172a;
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --border-color: #e5e7eb;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --radius: 12px;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    text-decoration: none;
}

/* ==========================================================================
   2. GLOBAL TYPOGRAPHY & ELEMENTS
   ========================================================================== */
button span { margin-right: 5px; }

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-stack);
    font-size: 14px;
    outline: none;
    background: #ffffff;
}

input:focus, textarea:focus { border-color: var(--primary); }

/* ==========================================================================
   3. MAIN LAYOUT (DESKTOP FIRST)
   ========================================================================== */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background-color: var(--dark-bg);
    border-right: none;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: sticky;
    top: 0;                
    height: 100vh;
    z-index: 100;
}

.main-content {
    flex: 1;
    padding: 40px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;        
}

/* Topbar für Mobile - auf Desktop versteckt */
.top-bar { display: none; }
.hamburger-btn, .close-sidebar-btn, #indexlogo { display: none; }

.app-footer {
    display: flex;
    justify-content: space-between;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 40px;
}

.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* ==========================================================================
   4. SIDEBAR COMPONENTS (DARK MODE)
   ========================================================================== */
.sidebar-logo, .sidebar-profile { 
    padding: 0 24px 24px 24px;
    border-bottom: 1px solid #1e293b; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

.sidebar-logo-icon, .topbar-logo-icon { 
    width: 40px;
    height: 40px; 
    background-color: var(--primary); 
    color: #ffffff; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 700; 
    font-size: 20px;
}

.sidebar-logo-text h3 { 
    font-size: 18px; 
    font-weight: 600; 
    color: #ffffff;
}

.topbar-logo-text h3 { 
    font-size: 18px; 
    font-weight: 600; 
    color: var(--dark-bg); 
}

.topbar-logo { padding-left: 14px; display: flex; align-items: center; gap: 12px; }

.profile-avatar { 
    width: 40px; 
    height: 40px; 
    background-color: #1e293b; 
    color: var(--primary); 
    border-radius: 5px;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 700; 
    font-size: 14px; 
}

.profile-info h3 { font-size: 14px; font-weight: 600; color: #ffffff; }
.profile-info p { font-size: 12px; color: #94a3b8; }

.sidebar-nav { padding: 24px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 12px 16px; 
    color: #94a3b8; 
    text-decoration: none;
    font-size: 14px; 
    font-weight: 500; 
    border-radius: 8px; 
    transition: all 0.2s ease; 
}

.nav-item:hover, .nav-item.active { 
    background-color: #1e293b;
    color: #ffffff; 
}

.nav-item.active { 
    font-weight: 600; 
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
}

.nav-item .nav-icon { 
    font-size: 16px;
    width: 20px; 
    text-align: center; 
    color: #64748b; 
    transition: color 0.2s ease; 
}

.nav-item:hover .nav-icon, .nav-item.active .nav-icon { color: var(--primary); }

.sidebar-footer { 
    padding: 0 12px; 
    border-top: 1px solid #1e293b; 
    padding-top: 16px;
}

.logout-link:hover { 
    background-color: rgba(239, 68, 68, 0.1); 
    color: var(--danger);
}

/* ==========================================================================
   5. UI COMPONENTS (CARDS, BUTTONS, FORMS, TOASTS, EMPTY STATES)
   ========================================================================== */
.card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 32px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.dashboard-header h1 { font-size: 32px; font-weight: 700; margin-bottom: 8px; color: var(--dark-bg); }
.dashboard-header p { color: var(--text-muted); font-size: 15px; margin-bottom: 32px; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; font-family: var(--font-stack); font-size: 14px; font-weight: 500; border-radius: 8px; border: none; cursor: pointer; transition: background 0.2s ease; text-decoration: none;}
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-outline-logout { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline-logout:hover { background: #f1f5f9; }
.btn-block { width: 100%; padding: 14px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-main); }
.form-link { display: inline-block; font-size: 13px; color: var(--text-muted); text-decoration: none; margin-bottom: 24px; }
.form-link:hover { text-decoration: underline; color: var(--primary); }

.alert-message { background-color: var(--danger-bg); color: #b91c1c; padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 20px; border: 1px solid #fca5a5; }
.alert-message.success-message { background-color: #ecfdf5; color: #065f46; border-color: #a7f3d0; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; color: #e2e8f0; margin-bottom: 16px; }
.empty-state h4 { color: var(--dark-bg); font-size: 16px; margin-bottom: 6px; }

/* Toasts */
#toast-container { position: fixed; bottom: 32px; right: 32px; z-index: 10000; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.toast { background: #ffffff; border-left: 4px solid var(--primary); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); padding: 16px 24px; border-radius: 8px; color: var(--text-main); font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 12px; transform: translateX(120%); opacity: 0; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease; pointer-events: auto; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast.error { border-left-color: var(--danger); }
.toast.error .toast-icon { color: var(--danger); font-size: 18px; }
.toast.success { border-left-color: #10b981; }
.toast.success .toast-icon { color: #10b981; font-size: 18px; }

/* ==========================================================================
   6. TABLES & CRUD
   ========================================================================== */
.data-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.data-table th, .data-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.data-table th { background-color: #f8fafc; color: var(--text-muted); font-weight: 600; }
.text-right { text-align: right; }
.action-btn { background: transparent; border: none; cursor: pointer; padding: 4px 8px; font-size: 14px; border-radius: 4px; }
.action-btn:hover { background-color: #f1f5f9; color: var(--primary); }

/* ==========================================================================
   7. WYSIWYG RICH-TEXT EDITOR
   ========================================================================== */
.editor-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #ffffff;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.editor-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background-color: #f9fafb;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #374151 !important;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    margin: 0;
}
.tool-btn i { color: inherit !important; }
.tool-btn:hover { background-color: #e5e7eb; color: var(--primary) !important; }
.tool-btn:active { background-color: #d1d5db; }
.tool-btn:focus, .tool-btn:focus-visible { outline: none !important; background-color: #e5e7eb; }
.tool-btn small { font-size: 9px; font-weight: bold; margin-left: 2px; color: inherit !important; }

div.editor-textarea {
    background-color: transparent;
    border: none !important;
    padding: 20px 24px;
    font-family: var(--font-stack);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
    min-height: 220px;
    max-height: 450px;
    overflow-y: auto;
    outline: none;
    text-align: left;
}
div.editor-textarea ul, div.editor-textarea ol { margin: 8px 0 16px 0; padding-left: 24px; }
div.editor-textarea li { margin-bottom: 6px; color: var(--text-main); line-height: 1.6; }
div.editor-textarea h3 { font-family: var(--font-stack); font-size: 18px; font-weight: 700; margin: 20px 0 8px 0; color: var(--dark-bg); }
div.editor-textarea:empty:before { content: "Hier kannst du deine persönliche Nachricht an deine Liebsten verfassen und formatieren..."; color: var(--text-muted); font-style: italic; }

/* ==========================================================================
   8. DOCUMENT VIEW (LETTER / READ-ONLY)
   ========================================================================== */
.druck-bar { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border-color); border-radius: 5px; margin-bottom: 24px; padding: 14px; background-color: #ffffff; }
.document-actions-bar { display: flex; justify-content: flex-end; margin-bottom: 16px; }

.letter-sheet { background: #ffffff; padding: 60px 50px; border: 1px solid var(--border-color); border-radius: 4px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); font-family: Georgia, Cambria, "Times New Roman", Times, serif; color: #111827; }
.letter-date { text-align: right; font-size: 14px; color: var(--text-muted); font-family: var(--font-stack); }
.letter-header h1 { font-size: 36px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.letter-header h2 { font-size: 16px; font-weight: 400; letter-spacing: 1px; color: var(--text-muted); font-family: var(--font-stack); margin-bottom: 16px; }
.letter-intro { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.letter-divider { border: none; border-top: 1px solid var(--border-color); margin: 24px 0; }
.letter-section { margin-bottom: 36px; }
.letter-section h3 { font-family: var(--font-stack); font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.letter-text-content { font-size: 16px; line-height: 1.6; }
.letter-text-content ul, .letter-text-content ol { margin: 16px 0 24px 0; padding-left: 24px; }
.letter-text-content li { margin-bottom: 8px; line-height: 1.6; font-family: Georgia, Cambria, "Times New Roman", Times, serif; font-size: 16px; }
.letter-appendix-title { text-align: center; font-size: 12px; letter-spacing: 2px; color: var(--text-muted); font-family: var(--font-stack); font-weight: 600; }

.appendix-item-box { border: 1px solid var(--border-color); border-radius: 6px; padding: 20px; margin-bottom: 16px; font-family: var(--font-stack); }
.item-badge { display: inline-block; background: #f1f5f9; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; float: right; color: var(--dark-bg); }
.appendix-item-box label { font-size: 11px; color: var(--text-muted); font-weight: 600; display: block; margin-bottom: 2px; }
.appendix-item-box p { font-size: 14px; color: var(--text-main); }
.item-row-triple, .item-row-double { display: grid; gap: 16px; margin-top: 12px; border-top: 1px solid #f3f4f6; padding-top: 12px; }
.item-row-triple { grid-template-columns: repeat(3, 1fr); }
.item-row-double { grid-template-columns: repeat(2, 1fr); }

.static-text-box { background-color: #f8fafc; border: 1px solid var(--border-color); padding: 16px; border-radius: 6px; font-size: 14px; line-height: 1.5; }
.letter-footer { text-align: center; margin-top: 60px; font-size: 11px; color: var(--text-muted); font-family: var(--font-stack); }

/* ==========================================================================
   9. MODALS, OVERLAYS & WARNING BANNERS
   ========================================================================== */
.close-modal-btn {font-weight: 700; font-size: 16px; border: none; background-color: #ffffff;}
.close-modal-btn:hover {color: red; cursor: pointer; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(4px); display: none; justify-content: center; overflow-y: auto; padding: 40px 16px; z-index: 9999; }
.modal-box { background: var(--bg-card); width: 100%; max-width: 500px; border-radius: var(--radius); padding: 32px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); margin: auto; animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.security-notice { font-size: 12px; color: #b45309; background: #fef3c7; padding: 10px 12px; border-radius: 6px; margin: 16px 0; font-weight: 500; }
@keyframes modalSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(2px); z-index: 9999; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.sidebar-overlay.show { opacity: 1; visibility: visible; }

.emergency-warning-banner { background-color: var(--danger-bg); border: 2px solid var(--danger); border-radius: var(--radius); padding: 24px; margin-bottom: 32px; display: flex; justify-content: space-between; align-items: center; gap: 20px; box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1); }
.warning-text strong { color: #991b1b; font-size: 16px; display: block; margin-bottom: 4px; }
.warning-text p { color: #7f1d1d; font-size: 14px; }
.emergency-warning-banner .btn-danger { background-color: var(--danger); color: white; white-space: nowrap; }
.emergency-warning-banner .btn-danger:hover { background-color: #b91c1c; }

/* ==========================================================================
   10. SYSTEM PAGES (LOGIN, EMERGENCY, PRICING, CHECKOUT)
   ========================================================================== */
.split-screen { display: flex; min-height: 100vh; width: 100%; }
.left-side { flex: 1; background: linear-gradient(rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.65)), url('../hintergrund-home.jpg') no-repeat center center; background-size: cover; display: flex; align-items: center; justify-content: center; padding: 40px; color: #ffffff; }
.brand-overlay { text-align: center; max-width: 500px; }

/* Angepasstes Hero Icon - Kreisrund und zentriert */
.hero-icon { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    background-color: var(--primary);
    color: #ffffff;
    border-radius: 50%;
    font-size: 48px;
    margin-bottom: 24px;
}

.brand-overlay h1 { font-size: 36px; font-weight: 700; margin-bottom: 16px; }
.brand-overlay p { font-size: 16px; opacity: 0.85; line-height: 1.6; }
.right-side { flex: 1; display: flex; align-items: center; justify-content: center; background-color: #ffffff; padding: 40px; }
.auth-wrapper { width: 100%; max-width: 400px; }
.tab-navigation { display: flex; background-color: #f1f5f9; padding: 4px; border-radius: 8px; margin-bottom: 32px; }
.tab-btn { flex: 1; padding: 10px; background: transparent; border: none; font-family: var(--font-stack); font-size: 14px; font-weight: 500; color: var(--text-muted); cursor: pointer; border-radius: 6px; transition: all 0.2s ease; }
.tab-btn.active { background-color: #ffffff; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content h2 { font-size: 24px; margin-bottom: 24px; font-weight: 700; color: var(--dark-bg); }
.tab-description { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; }

/* Emergency Helpers */
.emergency-container { width: 100%; max-width: 800px; margin: 0 auto; padding: 60px 20px; }
.countdown-card { text-align: center; padding: 40px; background: #ffffff; border: 1px solid var(--border-color); }
.clock-icon, .check-icon { font-size: 40px; color: var(--primary); margin-bottom: 12px; }
.countdown-title { font-weight: 600; font-size: 16px; margin-bottom: 24px; color: var(--dark-bg); }
.countdown-grid { display: flex; justify-content: center; gap: 16px; }
.success-unlock-card { text-align: center; padding: 40px; }
.time-box { background: #f8fafc; border: 1px solid var(--border-color); padding: 16px; border-radius: 8px; min-width: 90px; }
.time-box span { display: block; font-size: 32px; font-weight: 700; color: var(--dark-bg); }
.time-box label { font-size: 11px; color: var(--primary); text-transform: uppercase; font-weight: 600; }

/* Checkout & Legal */
.checkout-summary-box { background: #f8fafc; border: 1px solid var(--border-color); border-radius: 8px; padding: 16px; margin-bottom: 24px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; }
.summary-row.total { border-top: 1px solid var(--border-color); margin-top: 8px; padding-top: 12px; font-weight: 700; font-size: 16px; color: var(--dark-bg); }
.legal-checkbox-group { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; font-size: 12px; color: var(--text-muted); line-height: 1.5; text-align: left; }
.legal-checkbox-group input[type="checkbox"] { width: auto; margin-top: 3px; cursor: pointer; }
.legal-checkbox-group a { color: var(--primary); text-decoration: underline; }
.checkout-page-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 60px 20px; background-color: var(--bg-main); }
.checkout-card-box { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 580px; box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05); text-align: left; }
.checkout-brand-header { text-align: center; font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 24px; }
.checkout-card-box h2 { font-size: 24px; font-weight: 700; color: var(--dark-bg); margin-bottom: 8px; }
.checkout-card-box .checkout-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; line-height: 1.5; }

/* ==========================================================================
   11. PRICING GRID (WITH DESKTOP VIEW)
   ========================================================================== */
.pricing-container { width: 100%; max-width: 1000px; margin: 0 auto; padding: 60px 20px; text-align: center; }
@media (min-width: 769px) {
    .pricing-container { max-width: 1150px; }
    .pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
}
.pricing-header h1 { font-size: 32px; font-weight: 700; color: var(--dark-bg); margin-bottom: 12px; }
.pricing-header p { color: var(--text-muted); font-size: 16px; margin-bottom: 48px; }
.pricing-grid { display: flex; justify-content: center; gap: 32px; align-items: stretch; }
.price-card { background: #ffffff; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 40px 32px; flex: 1; max-width: 400px; display: flex; flex-direction: column; position: relative; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.price-card:hover { transform: translateY(-4px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05); }
.price-card.bestseller { border: 2px solid var(--primary); }
.price-card.premium-lifetime { border: 2px solid var(--dark-bg); background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); }
.badge-bestseller, .badge-lifetime { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); color: #ffffff; padding: 4px 16px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.badge-bestseller { background: var(--primary); }
.badge-lifetime { background: var(--dark-bg); }
.price-card h3 { font-size: 20px; margin-bottom: 8px; color: var(--dark-bg); }
.price-card .plan-desc { font-size: 13px; color: var(--text-muted); min-height: 40px; margin-bottom: 24px; }
.price-box { margin-bottom: 32px; }
.price-box .currency-amount { font-size: 36px; font-weight: 800; color: var(--dark-bg); }
.price-box .period { font-size: 14px; color: var(--text-muted); }
.plan-features { text-align: left; list-style: none; margin-bottom: 40px; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.plan-features li { font-size: 14px; color: var(--text-main); display: flex; align-items: center; gap: 10px; }
.plan-features li i { color: var(--primary); font-size: 14px; }

/* ==========================================================================
   12. PAGE SPECIFIC STYLES (DASHBOARD, ABO, SETUP, VAULT)
   ========================================================================== */

/* Abo & Upgrade Banner */
.upgrade-banner-card, .upsell-banner { background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%); border: 1px dashed var(--primary); position: relative; overflow: hidden; margin-top: 24px; border-radius: var(--radius); padding: 24px; }
.upsell-banner { margin-bottom: 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px dashed var(--primary); }
.upgrade-badge { position: absolute; top: 16px; right: 16px; background: var(--primary); color: white; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
.upgrade-feature-list { list-style: none; padding: 0; margin: 20px 0 28px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.upgrade-feature-item { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: #334155; line-height: 1.4; }
.upgrade-feature-item i { color: var(--primary); font-size: 14px; margin-top: 3px; flex-shrink: 0; }
.upgrade-feature-item strong { color: var(--dark-bg); }
.lifetime-safe-box { background: #f8fafc; border: 1px solid var(--dark-bg); padding: 20px; border-radius: 8px; margin-top: 16px; display: flex; align-items: center; gap: 14px; }
.upsell-content h3 { font-size: 18px; color: var(--dark-bg); margin-bottom: 8px; }
.upsell-content p { font-size: 14px; color: var(--text-muted); margin: 0; max-width: 600px; }

/* Dashboard Status Grid */
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin-bottom: 32px; }
.status-card { background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.status-card-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.status-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.icon-success { background: #ecfdf5; color: #10b981; }
.icon-warning { background: #fff7ed; color: #f59e0b; }
.icon-info { background: #f1f5f9; color: #64748b; }
.icon-premium { background: #f5f3ff; color: var(--primary); }
.status-card h3 { font-size: 16px; margin: 0; color: var(--dark-bg); }
.status-card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; margin-bottom: 24px; flex-grow: 1; }

/* Notfallkontakt Setup Grid & Sidebar */
.setup-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.explanation-sidebar { background: #ffffff; border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; }
.explanation-sidebar h4 { margin-top: 0; margin-bottom: 16px; color: var(--dark-bg); font-size: 16px; display: flex; align-items: center; gap: 8px; }
.timeline-steps { display: flex; flex-direction: column; gap: 16px; position: relative; }
.timeline-item { display: flex; gap: 12px; font-size: 13px; line-height: 1.5; color: #475569; }
.timeline-icon { color: var(--primary); font-size: 14px; margin-top: 2px; width: 20px; text-align: center; flex-shrink: 0; }
.timeline-text strong { display: block; color: var(--dark-bg); margin-bottom: 2px; }
.status-container { background: #ffffff; border: 1px solid #10b981; padding: 16px; border-radius: 6px; margin-top: 16px; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.premium-upgrade-box { background: #ffffff; border: 1px dashed var(--primary); padding: 20px; border-radius: 6px; margin-top: 12px; display: flex; gap: 16px; align-items: flex-start; }
.upgrade-icon-wrapper { background: #f5f3ff; color: var(--primary); padding: 10px; border-radius: 50%; font-size: 18px; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.upgrade-text-wrapper p { margin: 0; font-size: 13px; color: #475569; line-height: 1.5; }
.upgrade-link-hint { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--primary); }
.radio-group-delivery { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.radio-label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

/* Text-Tresor */
.key-card-container { display: none; background: #fff; border: 2px dashed #cbd5e1; border-radius: 8px; padding: 40px; text-align: center; margin: 24px 0; }
.master-key-display { font-family: monospace; font-size: 28px; font-weight: bold; color: var(--dark-bg); letter-spacing: 3px; background: #f8fafc; padding: 16px 24px; border-radius: 6px; display: inline-block; margin: 20px 0; border: 1px solid #e2e8f0; }
#vault-editor-section { display: none; }
.vault-locked { background: #ffffff; border: 1px solid var(--border-color); border-radius: 8px; padding: 60px 20px; text-align: center; }
.vault-textarea { min-height: 400px; font-family: monospace; font-size: 14px; background: var(--dark-bg); color: #38bdf8; padding: 24px; resize: vertical; line-height: 1.6; border: none; border-radius: 0 0 8px 8px; }

/* ==========================================================================
   13. MEDIA QUERIES (RESPONSIVE & PRINT)
   ========================================================================== */

/* KORREKTUR: Alle mobilen Breakpoints zwingend an den Medientyp "screen" binden, 
   damit sie sich niemals mit den Layouts der Druckansichten ("print") überlagern! */

@media screen and (max-width: 900px) {
    .setup-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 768px) {
    .app-container { flex-direction: column; }
    .app-footer { display: block; }
    #indexlogo { display: flex; }
    .footer-links { display: flex; gap: 16px; font-size: 12px; margin-top: 10px; }
    
    .top-bar { 
        display: flex;
        justify-content: space-between; 
        align-items: center; 
        border-bottom: 1px solid #1e293b; 
        margin-bottom: 24px; 
        padding: 16px 0; 
        background-color: var(--dark-bg); 
        color: #ffffff;
        position: sticky;
        top: 0; 
        z-index: 99; 
    }
    .top-bar .welcome-text { flex: 1; margin-left: 12px; font-weight: 500; }    
    .sidebar-logo { display: none; }

    .hamburger-btn { 
        display: block; 
        background: transparent; 
        border: none;
        font-size: 24px; 
        cursor: pointer; 
        padding: 4px 8px; 
        color: #ffffff; 
        margin-right: 10px;
    }
    .close-sidebar-btn { 
        display: block; 
        position: absolute; 
        top: 20px;
        right: 20px; 
        background: transparent; 
        border: none; 
        font-size: 22px; 
        cursor: pointer; 
        color: #94a3b8; 
        z-index: 10001;
    }

    .sidebar { 
        position: fixed; 
        top: 0; 
        right: 0;
        left: auto; 
        width: 280px; 
        height: 100vh; 
        background: var(--dark-bg); 
        box-shadow: -4px 0 25px rgba(15, 23, 42, 0.5); 
        border-left: 1px solid #1e293b;
        border-right: none; 
        z-index: 10000; 
        padding: 32px 24px; 
        display: flex; 
        flex-direction: column; 
        transform: translateX(100%); 
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .sidebar.open { transform: translateX(0); }
    .sidebar-nav { flex-direction: column !important; overflow-x: visible !important; padding: 32px 0 0 0 !important; gap: 6px !important; }
    .sidebar-profile { padding: 12px 0 24px 0 !important; border-bottom: 1px solid #1e293b; }
    
    .main-content { margin-left: 0; padding: 0 16px 40px 16px; }
    .left-side { display: none; }
    .card { padding: 20px; }
    .card-header { flex-direction: column; gap: 12px; }
    .card-header .btn { width: 100%; }

    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr { margin-bottom: 16px; border: 1px solid var(--border-color); border-radius: 8px; padding: 8px; background: #f8fafc; }
    .data-table td { text-align: left; border-bottom: none; padding: 12px 16px !important; }
    .data-table td::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; letter-spacing: 0.5px; }
    .data-table td.text-right { text-align: left !important; border-top: 1px solid var(--border-color); margin-top: 8px; padding-top: 12px; }

    .emergency-warning-banner { flex-direction: column; align-items: stretch; text-align: center; }
    .modal-box { padding: 20px; }
    .item-row-triple, .item-row-double { grid-template-columns: 1fr; }
    .countdown-grid { flex-wrap: wrap; }
    .letter-sheet { padding: 30px 20px; }
    
    .upgrade-feature-list { grid-template-columns: 1fr; gap: 10px; }
    .upgrade-badge { position: static; display: inline-block; margin-bottom: 12px; }
    .upsell-banner { flex-direction: column; text-align: center; }
    .upsell-banner .btn { width: 100%; }
    
    #toast-container { bottom: 24px; right: 16px; left: 16px; }
}

@media screen and (max-width: 640px) {
    .pricing-grid { flex-direction: column; align-items: center; }
    .price-card { width: 100%; }
}

@media screen and (max-width: 480px) {
    .checkout-card-box { padding: 24px 16px; }
}

/* Print Styles */
@media print {
    body, .app-container, .main-content { 
        background: white !important; 
        display: block !important; 
        height: auto !important; 
        min-height: auto !important; 
    }
    
    .developer-time-box, 
    .document-actions-bar, 
    .emergency-page-header, 
    .druck-bar, 
    .sidebar, 
    .top-bar, 
    .app-footer, 
    .no-print, 
    .emergency-warning-banner, 
    .sidebar-overlay { 
        display: none !important; 
    }
    
    .main-content { 
        margin: 0 !important; 
        padding: 0 !important; 
        max-width: 100% !important; 
        width: 100% !important; 
    }
    
    .emergency-container { 
        max-width: 100%; 
        padding: 0; 
        margin: 0; 
    }
    
    .letter-sheet { 
        border: none; 
        box-shadow: none; 
        padding: 0; 
        margin: 0; 
    }
    
    .print-only { 
        display: block !important; 
    }
    
    #key-card { 
        border: none; 
        padding: 0; 
        margin: 0; 
    }
}

@media screen {
    .print-only { display: none !important; }
}

/* Greift exakt im mobilen Breakpoint bis 768px */
@media screen and (max-width: 768px) {
    .sidebar {
        height: 100vh !important;
        max-height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important; /* Verhindert, dass die ganze Sidebar ausbricht */
    }

    .sidebar-nav {
        flex: 1 !important;          /* Nimmt den gesamten verfügbaren Platz ein */
        overflow-y: auto !important;   /* Erlaubt das Scrollen NUR in diesem Bereich */
        -webkit-overflow-scrolling: touch; /* Butterweiches Scrollen auf iPhones/iOS */
    }

    .sidebar-footer {
        flex-shrink: 0 !important;    /* Verhindert, dass das Profil zusammengedrückt wird */
        margin-top: auto !important;  /* Schiebt den Footer immer ans untere Ende */
    }
}
