/* ========================================
   Mieterselbstauskunft - Vermieter-Seite
   MarktLinse Design System v1.0.0
   ======================================== */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --color-primary: #0077b6;
    --color-primary-dark: #003566;
    --color-primary-light: #00b8d9;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;

    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;

    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* ========================================
   Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    color: var(--gray-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Header Override - Immer sichtbar (kein Hero)
   ======================================== */
.main-header {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-logo {
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.header-logo .logo-text {
    color: var(--gray-800);
}

.header-logo .logo-accent {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--gray-800);
    background: rgba(0, 0, 0, 0.04);
}

.nav-link.active {
    color: var(--color-primary);
    background: rgba(0, 119, 182, 0.08);
}

/* Profile Dropdown */
.header-profile {
    position: relative;
}

.profile-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.profile-button:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.profile-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-info {
    padding: 16px;
}

.profile-name {
    display: block;
    font-weight: 600;
    color: var(--gray-800);
    font-size: 15px;
}

.profile-email {
    display: block;
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
}

.dropdown-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ========================================
   Main Content
   ======================================== */
.page-main {
    padding: 100px 24px 64px; /* 100px top für fixed header */
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-title-section {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--gray-500);
}

/* ========================================
   Properties Section
   ======================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
}

/* ========================================
   Buttons
   ======================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 50%, var(--color-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 119, 182, 0.35);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-small {
    padding: 8px 14px;
    font-size: 13px;
}

/* ========================================
   Properties Grid
   ======================================== */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

/* Property Card */
.property-card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.property-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 119, 182, 0.2);
}

/* Property Card Header (Address + Listing Button) */
.property-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.property-address {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.property-address svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--color-primary);
}

.address-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.property-address-street {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.property-address-city {
    font-size: 14px;
    font-weight: 400;
    color: var(--gray-500);
}

/* Listing Button (Icon only, 44×44px touch target) */
.property-listing-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    color: var(--gray-400);
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.property-listing-btn:hover {
    background: rgba(0, 119, 182, 0.1);
    color: var(--color-primary);
}

.property-stats {
    display: flex;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-600);
}

.stat-value {
    font-weight: 600;
    color: var(--gray-800);
}

.stat-pending {
    color: var(--color-warning);
}

.stat-submitted {
    color: var(--color-success);
}

.stat-reviewing {
    color: #3b82f6; /* Blue */
}

.stat-viewing {
    color: #a855f7; /* Purple */
}

.stat-accepted {
    color: #059669; /* Dark Green */
}

/* ========================================
   Loading & Empty States
   ======================================== */
.loading-state,
.empty-state {
    grid-column: 1 / -1;
    padding: 64px 24px;
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.loading-state p,
.empty-state p {
    color: var(--gray-500);
    font-size: 15px;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state .btn-primary {
    margin-top: 24px;
}

/* ========================================
   Modals
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    opacity: 1;
    visibility: visible;
    transition: all 0.2s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-container {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.3s ease;
}

.modal-large {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
}

/* Fullscreen modal: Remove overlay padding */
.modal-overlay:has(.modal-large) {
    padding: 0;
    background: white;
}

.modal-small {
    max-width: 400px;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close,
.modal-back {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover,
.modal-back:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* 3-Column Modal Header (Property Detail) */
.modal-header-3col {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    min-width: 96px; /* Match header-right width (2 buttons × 44px + 8px gap) for true centering */
}

/* Favorite Button in Application Detail Header */
.favorite-header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.favorite-header-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.favorite-header-btn.active {
    color: var(--color-danger);
}

.favorite-header-btn.active svg {
    fill: currentColor;
}

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

/* 2-Line Address Display in Header */
.header-address {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    line-height: 1.3;
}

.address-street {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.address-city {
    font-size: 14px;
    font-weight: 400;
    color: var(--gray-500);
}

.header-right {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Header Action Buttons (Icon-only) - 44×44px touch target */
.header-action-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    text-decoration: none;
}

.header-action-btn svg {
    width: 20px;
    height: 20px;
}

/* Listing Link (Blue) */
.header-action-btn.listing-link {
    color: var(--color-primary);
}

.header-action-btn.listing-link:hover {
    background: rgba(0, 119, 182, 0.1);
    transform: scale(1.1);
}

/* Delete Button (Gray → Red on hover) */
.header-action-btn.delete-btn {
    color: var(--gray-400);
}

.header-action-btn.delete-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.15);
}

/* Hide listing link if no URL */
.header-action-btn.listing-link.hidden {
    display: none;
}

/* PDF Button (Blue) */
.header-action-btn.pdf-btn {
    color: var(--color-primary);
}

.header-action-btn.pdf-btn:hover {
    background: rgba(0, 119, 182, 0.1);
    transform: scale(1.1);
}

/* Small Loading Spinner for Buttons */
.loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Address Name Styling (Application Detail) */
.header-address .address-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

.header-address .address-property {
    font-size: 13px;
    font-weight: 400;
    color: var(--gray-500);
}

/* ========================================
   Status Stepper
   ======================================== */
.status-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 16px 24px;
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.stepper-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
}

.stepper-pill:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.pill-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    background: transparent;
    transition: all 0.2s ease;
}

/* Completed State */
.stepper-pill.completed .pill-indicator {
    background: var(--color-success);
    border-color: var(--color-success);
}

.stepper-pill.completed .pill-indicator::after {
    content: '';
    display: block;
    width: 4px;
    height: 7px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin: 0 auto;
    margin-top: -1px;
}

.stepper-pill.completed {
    color: var(--color-success);
}

/* Current/Active State */
.stepper-pill.active .pill-indicator {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.2);
}

.stepper-pill.active {
    color: var(--color-primary);
    font-weight: 600;
}

/* Connector Line */
.stepper-connector {
    width: 24px;
    height: 2px;
    background: var(--gray-300);
    transition: background 0.2s ease;
}

.stepper-connector.completed {
    background: var(--color-success);
}

/* Reject Pill (Separate) */
.stepper-pill.reject-pill {
    margin-left: 16px;
    padding: 8px 16px;
    background: transparent;
    color: var(--gray-400);
    border: 1px solid var(--gray-200);
}

.stepper-pill.reject-pill:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.stepper-pill.reject-pill.active {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
    font-weight: 600;
}

.stepper-pill.reject-pill .pill-indicator {
    display: none;
}

/* Mobile Status Dropdown */
.mobile-status-dropdown {
    padding: 12px 16px;
    background: var(--gray-50);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-status-dropdown label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    white-space: nowrap;
}

.mobile-status-dropdown .status-select {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: white;
}

/* Sticky Footer for Mobile */
.modal-footer-sticky {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: white;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.btn-full-width {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Hide on Desktop */
.hidden-desktop {
    display: none;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: var(--font-primary);
    color: var(--gray-800);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
}

/* ========================================
   Detail Sections
   ======================================== */
.detail-section {
    margin-bottom: 28px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

/* Property Info Card */
.property-info-card {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.property-info-address {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.property-info-address svg {
    color: var(--color-primary);
}

.property-info-url {
    font-size: 14px;
    color: var(--color-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.property-info-url:hover {
    text-decoration: underline;
}

.property-info-notes {
    font-size: 14px;
    color: var(--gray-600);
    font-style: italic;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    margin-top: 12px;
}

/* Generate Link Form */
.generate-link-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.generate-link-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.generate-link-form .btn-primary {
    height: 46px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Links List */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all 0.2s ease;
}

.link-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

/* Favorite Button */
.favorite-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--gray-300);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-right: 8px;
}

.favorite-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.favorite-btn.active {
    color: var(--color-danger);
}

.favorite-btn.active:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Link Card with Favorite - keine spezielle Border */
.link-card.is-favorite {
    /* Kein rötlicher Rand bei Favorit */
}

.link-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.link-card-info {
    flex: 1;
}

.link-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.link-card-email {
    font-size: 13px;
    color: var(--gray-500);
}

.link-card-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.status-submitted {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.status-reviewing {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

.status-viewing {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.status-accepted {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.status-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.status-deleted {
    background: rgba(156, 163, 175, 0.1);
    color: var(--gray-400);
}

/* Deleted Link Card Styling */
.link-card.is-deleted {
    background: var(--gray-50);
    border-color: var(--gray-200);
    opacity: 0.85;
}

.link-card.is-deleted:hover {
    border-color: var(--gray-300);
    box-shadow: none;
    background: var(--gray-50);
}

.link-card.is-deleted .link-card-name {
    text-decoration: line-through;
    color: var(--gray-400);
}

.link-card.is-deleted .link-card-header {
    opacity: 0.8;
}

/* DSGVO Info Message */
.deleted-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(156, 163, 175, 0.08);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.4;
}

.deleted-info svg {
    flex-shrink: 0;
    color: var(--gray-400);
    margin-top: 1px;
}

/* Clickable Link Cards */
.link-card.clickable {
    cursor: pointer;
}

.link-card.clickable:hover {
    border-color: var(--color-primary);
    background: rgba(0, 119, 182, 0.02);
    box-shadow: 0 2px 8px rgba(0, 119, 182, 0.08);
}

/* Status Group (Status Badge + Favorite Button) */
.link-card-status-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Move favorite button margin-right to 0 when inside status group */
.link-card-status-group .favorite-btn {
    margin-right: 0;
}

/* Link Card Metrics (4 Kennzahlen in einer Zeile) */
.link-card-metrics {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-500);
    padding: 10px 0 0 0;
    border-top: 1px solid var(--gray-100);
    margin-top: 12px;
}

.metric-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    color: var(--gray-500);
}

.metric-item svg {
    flex-shrink: 0;
    color: var(--gray-500);
}

.metric-separator {
    color: var(--gray-300);
}

.link-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.link-card-meta-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.link-card-meta svg {
    width: 14px;
    height: 14px;
}

/* Favorite button in meta row */
.link-card-meta .favorite-btn {
    margin-left: auto;
}

.link-card-actions {
    display: flex;
    gap: 8px;
}

.link-card-actions button {
    padding: 8px 12px;
    font-size: 13px;
}

/* Link Empty State */
.links-empty {
    text-align: center;
    padding: 32px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    color: var(--gray-500);
    font-size: 14px;
}

/* ========================================
   Quick Overview Card
   ======================================== */
.quick-overview-card {
    background: transparent;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.quick-overview-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.quick-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.quick-overview-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 12px 14px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-100);
    transition: all 0.2s ease;
}

.quick-overview-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 119, 182, 0.1);
}

.quick-overview-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
}

.quick-overview-icon svg {
    width: 16px;
    height: 16px;
}

.quick-overview-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.quick-overview-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.2;
    margin-bottom: 2px;
}

.quick-overview-label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Positive (neutral - same as other items) */
.quick-overview-positive .quick-overview-icon {
    background: var(--gray-100);
    color: var(--gray-800);
    font-weight: 700;
    font-size: 16px;
}

.quick-overview-positive .quick-overview-value {
    color: var(--gray-800);
}

/* Negative (red) */
.quick-overview-negative .quick-overview-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    font-weight: 700;
    font-size: 16px;
}

.quick-overview-negative .quick-overview-value {
    color: var(--color-danger);
}

/* Neutral (gray, for "none") */
.quick-overview-neutral {
    opacity: 0.6;
}

.quick-overview-neutral .quick-overview-icon {
    background: var(--gray-100);
    color: var(--gray-400);
}

/* ========================================
   Section Styles (Flat Headers - No Accordion)
   Issue 2: Accordion entfernt - alles immer expandiert
   ======================================== */
.accordion-section {
    margin-bottom: 16px;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-md);
    overflow: visible;
}

/* Flat Section Header (no background, no cursor, no hover) */
.section-header-flat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: transparent;
    border: none;
}

.section-header-flat .application-section-title {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.section-header-flat-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.section-header-flat-content .application-section-title {
    margin: 0;
    padding: 0;
    border: none;
}

/* Content always visible (no max-height toggle) */
.accordion-content {
    display: block;
}

.accordion-content-inner {
    padding: 16px;
}

/* ========================================
   Household Members Section
   Issue 4: Kompakteres Layout, "Mitbewohner" statt "Person 1"
   ======================================== */
.household-members-section {
    margin-top: 12px;
    padding: 12px 16px 0 16px;  /* 16px Padding wie andere Grids */
    border-top: 1px solid var(--gray-100);
}

.household-members-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}

/* Mitbewohner Section - normales Layout wie Interessent */
.household-member-section {
    margin-bottom: 16px;
}

.household-member-section:last-child {
    margin-bottom: 0;
}

/* Flat header for household member (matches section style) */
.household-member-section .section-header-flat {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    padding: 0 0 8px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

/* Issue 4: Mitbewohner-Grid bündig mit Überschrift (kein extra padding) */
.household-member-section .application-grid {
    padding: 0;  /* Kein zusätzliches Padding - bündig mit Überschrift */
}

/* Legacy card style (fallback) */
.household-member-card {
    background: transparent;
    border-radius: var(--radius-md);
    padding: 0;
    margin-bottom: 12px;
}

.household-member-card:last-child {
    margin-bottom: 0;
}

.household-member-header {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.no-household-members {
    color: var(--gray-400);
    font-style: italic;
    font-size: 13px;
    margin: 0;
}

/* ========================================
   Application Content
   ======================================== */
.application-section {
    margin-bottom: 24px;
}

.application-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.application-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.application-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.application-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.application-value {
    font-size: 14px;
    color: var(--gray-800);
    font-weight: 500;
}

.application-value.positive {
    color: var(--color-success);
}

.application-value.negative {
    color: var(--color-danger);
}

/* Meta Single Line Layout */
.meta-single-line {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 16px 16px;
}

.meta-single-line .application-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-single-line .application-value {
    font-size: 14px;
    color: var(--gray-800);
    font-weight: 500;
}

/* ========================================
   Bonität Traffic Light System
   ======================================== */
.bonitaet-section .application-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.bonitaet-section .application-section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.bonitaet-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.bonitaet-badge.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.bonitaet-badge.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.bonitaet-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bonitaet-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

/* Issue 5: Bonitätspunkte - Grauer Rand für OK, Roter Rand für Warnings */
.bonitaet-item.bonitaet-ok {
    background: transparent;
    border: 1px solid var(--gray-200);  /* Grauer dünner Rand */
}

.bonitaet-item.bonitaet-warning {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.5);  /* Roter dünner Rand */
}

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

.bonitaet-ok .bonitaet-icon {
    background: var(--color-success);
    color: white;
}

.bonitaet-warning .bonitaet-icon {
    background: var(--color-danger);
    color: white;
}

.bonitaet-label {
    font-size: 14px;
    color: var(--gray-700);
    flex: 1;
    line-height: 1.4;
}

.bonitaet-details {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--gray-600);
    font-style: italic;
    border-left: 3px solid var(--color-danger);
}

/* Status Select */
.status-select-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: auto;
}

.status-select-wrapper label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
}

.status-select {
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-primary);
    color: var(--gray-800);
    cursor: pointer;
    min-width: 160px;
}

/* ========================================
   Confirm Delete Modal
   ======================================== */
.confirm-text {
    font-size: 15px;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 12px;
}

.confirm-warning {
    font-size: 14px;
    color: var(--color-danger);
    font-weight: 500;
}

/* ========================================
   Toast
   ======================================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    animation: toastSlideUp 0.3s ease;
}

.toast.hidden {
    display: none;
}

.toast svg {
    color: var(--color-success);
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========================================
   Delete Confirmation Modal Overlay
   ======================================== */
.confirmation-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.confirmation-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirmation-modal {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.2s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.confirmation-modal-overlay.active .confirmation-modal {
    transform: scale(1);
}

.confirmation-icon {
    width: 56px;
    height: 56px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.confirmation-icon svg {
    width: 28px;
    height: 28px;
    color: #ef4444;
}

.confirmation-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 12px;
}

.confirmation-text {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 24px;
}

.confirmation-actions {
    display: flex;
    gap: 12px;
}

.confirmation-actions button {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.btn-cancel:hover {
    background: #e5e7eb;
}

.btn-delete {
    background: #ef4444;
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .header-nav {
        display: none;
    }

    .page-main {
        padding: 80px 16px 48px; /* 80px top für fixed header auf Mobile */
    }

    .page-title {
        font-size: 26px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .properties-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-container {
        max-height: 100vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    /* Fullscreen modals stay fullscreen on mobile */
    .modal-container.modal-large {
        border-radius: 0;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-overlay:has(.modal-large) {
        align-items: stretch;
    }

    /* 3-Column Header Mobile */
    .modal-header-3col {
        grid-template-columns: auto 1fr auto;
        padding: 12px 16px;
        gap: 8px;
    }

    /* Keep 44×44px touch targets on mobile */
    .header-action-btn,
    .modal-close,
    .modal-back {
        width: 44px;
        height: 44px;
    }

    .address-street {
        font-size: 14px;
    }

    .address-city {
        font-size: 12px;
    }

    /* Application Detail: Address Name */
    .header-address .address-name {
        font-size: 15px;
    }

    .header-address .address-property {
        font-size: 12px;
    }

    /* Issue 1: Status Stepper Mobile - Pills statt Radio-Buttons, ZENTRIERT */
    .status-stepper {
        display: flex !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 12px 16px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        justify-content: center;  /* ZENTRIERT statt flex-start */
    }

    .status-stepper::-webkit-scrollbar {
        display: none;
    }

    .stepper-pill {
        flex-shrink: 0;
        font-size: 12px;
        padding: 8px 14px;
        min-width: auto;
        background: var(--gray-100);
        color: var(--gray-600);
        border-radius: 20px;
    }

    /* Hide pill indicator circles on mobile */
    .stepper-pill .pill-indicator {
        display: none;
    }

    /* Active status - blue background */
    .stepper-pill.active {
        background: var(--color-primary);
        color: white;
    }

    /* Completed status - green tint */
    .stepper-pill.completed {
        background: rgba(16, 185, 129, 0.15);
        color: var(--color-success);
    }

    .stepper-connector {
        display: none;
    }

    /* Hide reject pill on mobile (Absage = Löschen) */
    .stepper-pill.reject-pill {
        display: none;
    }

    /* Hide dropdown on mobile - use pills instead */
    .hidden-desktop {
        display: none !important;
    }

    /* Mobile Footer Sticky */
    .modal-footer-sticky {
        display: block;
    }

    /* Issue 2: Quick Overview Pills - Equal width on mobile */
    .quick-overview-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .quick-overview-item {
        min-width: 0;  /* Prevents overflow */
        width: 100%;   /* Fill grid cell */
    }

    .quick-overview-card {
        padding: 16px;
    }

    .quick-overview-value {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .generate-link-form {
        flex-direction: column;
        align-items: stretch;
    }

    .application-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 12px;
    }

    /* Issue 3: Text-Overflow - Multiline instead of ellipsis */
    .application-value {
        font-size: 12px;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer button {
        width: 100%;
    }

    .status-select-wrapper {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-right: 0;
        margin-bottom: 12px;
    }

    /* Issue 4: Accordion Gaps - 8px between sections */
    .accordion-section {
        margin-bottom: 8px;
        border-radius: var(--radius-md);
        border: 1px solid var(--gray-100);
    }

    .accordion-section:last-child {
        margin-bottom: 0;
    }

    .accordion-header {
        padding: 14px 16px;
    }

    .accordion-content .application-grid {
        padding: 0 16px 16px;
    }

    /* Mitbewohner-Grid ohne seitliches Padding - bündig mit Überschrift */
    .accordion-content .household-member-section .application-grid {
        padding: 0 0 16px 0;
    }

    .accordion-content .bonitaet-list {
        padding: 0 16px 16px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 16px;
    }

    .page-title {
        font-size: 22px;
    }

    .property-card {
        padding: 16px;
    }

    .link-card-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .link-card-actions button {
        flex: 1;
        min-width: 100px;
    }

    /* Smaller header adjustments */
    .modal-header-3col {
        padding: 10px 12px;
    }

    /* Keep 44×44px touch targets on extra small screens */
    .header-action-btn,
    .modal-close,
    .modal-back {
        width: 44px;
        height: 44px;
    }

    .address-street {
        font-size: 13px;
    }

    .address-city {
        font-size: 11px;
    }
}

/* ========================================
   Hidden Utility
   ======================================== */
.hidden {
    display: none !important;
}
