/* =================================================== */
/* CLIENT DATA ADMINISTRATION PAGE */
/* =================================================== */

/* Refactoring Slider Styles */
.input-with-slider {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.input-with-slider input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--gh-bg-secondary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.input-with-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ios-blue-primary);
    cursor: pointer;
    border: 2px solid var(--gh-bg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.input-with-slider input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ios-blue-primary);
    cursor: pointer;
    border: 2px solid var(--gh-bg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: var(--gh-text-primary);
    font-size: 0.9rem;
}

/* Refactoring Version List */
.refactoring-version-item {
    padding: 16px;
    margin-bottom: 12px;
    background: var(--gh-bg-secondary);
    border: 1px solid var(--lg-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.refactoring-version-item.active {
    border-color: var(--ios-blue-primary);
    background: rgba(40, 167, 69, 0.1);
}

.refactoring-version-item:hover {
    border-color: var(--ios-blue-primary);
    transform: translateY(-1px);
    box-shadow: var(--lg-shadow-hover-combined);
}

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

.version-number {
    font-weight: 600;
    color: var(--gh-text-primary);
    font-size: 1rem;
}

.version-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.version-badge.active {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.version-date {
    font-size: 0.85rem;
    color: var(--gh-text-secondary);
    margin-bottom: 8px;
}

.version-reason {
    font-size: 0.9rem;
    color: var(--gh-text-primary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.no-versions {
    padding: 20px;
    text-align: center;
    color: var(--gh-text-secondary);
    font-size: 0.9rem;
}

/* =================================================== */
/* CLIENT DATA ADMINISTRATION PAGE */
/* =================================================== */

/* Layout: 30% Sidebar / 70% Content */
.client-data-layout {
    display: flex;
    gap: 30px;
    width: 100%;
}

/* Left Sidebar (30%) - Fixed, nicht scrollbar */
.client-data-sidebar {
    width: 30%;
    min-width: 250px;
    max-width: 300px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    overflow-y: visible;
    overflow-x: visible;
    position: sticky;
    top: 100px; /* Fix bei 100px vom Viewport-Top (direkt unter Header) - Sidebar bleibt stehen */
    align-self: flex-start;
    height: fit-content;
    max-height: calc(100vh - 100px); /* Volle Höhe minus Header */
    z-index: 10; /* Höher als Sections (z-index: 1), niedriger als Header (z-index: 100) */
}

/* .client-data-sidebar-header entfernt - wird nicht verwendet */

/* Sections Navigation - Beginnt oben */
.client-data-sections {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Wie Sidebar nav-items */
    margin-top: 0;
    padding-top: 0; /* Direkt oben beginnen */
}

.client-data-section-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px; /* Wie Sidebar nav-item */
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease; /* Wie Sidebar */
    color: var(--gh-text-secondary);
    background: transparent;
    border: none;
    font-size: 14px; /* Wie Sidebar nav-item-label */
    font-weight: 500; /* Normal, nicht fett */
}

.client-data-section-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--gh-text-primary);
}

.client-data-section-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--gh-text-primary);
    font-weight: 600; /* Nur aktiv: fett */
}

.client-data-section-item i {
    width: 8px !important; /* 30% kleiner: 11px * 0.7 = 7.7px (gerundet 8px) */
    height: 8px !important;
    flex-shrink: 0;
    stroke-width: 1.5; /* Dünnerer, präziserer Look für seriöseres Design */
}

.client-data-section-item i svg {
    width: 8px !important;
    height: 8px !important;
}

.client-data-section-item i svg path {
    stroke-width: 1.5; /* Konsistenter, präziserer Stroke */
    stroke-linecap: round; /* Weichere, professionellere Linienenden */
    stroke-linejoin: round;
}

/* Aktive Icons: Etwas dicker für bessere Sichtbarkeit */
.client-data-section-item.active i svg path {
    stroke-width: 2; /* Etwas dicker wenn aktiv */
}

.client-data-section-item.admin-only {
    display: none;
}

.client-data-section-item.admin-only.show {
    display: flex;
}

/* Right Content Area (70%) - Scrollbar */
.client-data-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    /* Kein max-height - Content darf unter Header scrollen */
    min-height: 0;
}

.client-data-sections-container {
    display: flex;
    flex-direction: column;
    gap: 24px; /* Reduziert für kompakteres Design */
    padding-bottom: 50px;
}

/* Section - Liquid Glass Card Design wie Onboarding */
.client-data-section {
    display: block;
    padding: 24px;
    
    /* Liquid Glass Styling */
    background: var(--lg-layer-base);
    border: 1px solid var(--lg-border);
    backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
    -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
    box-shadow: var(--lg-shadow-combined);
    border-radius: var(--lg-border-radius);
    
    /* Scroll Behavior */
    scroll-margin-top: 115px; /* Header-Höhe (100px) + 15px Abstand = 115px */
    
    /* Animation */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 1; /* Niedriger als Header (z-index: 100) */
}

/* Hover-Effekt wie Liquid Cards */
.client-data-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--lg-shadow-combined), 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--lg-layer-hover);
}

/* Content über Pseudo-Elementen */
.client-data-section > * {
    position: relative;
    z-index: 2;
}

/* Mehrschichtige Glass-Layer Overlay */
.client-data-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: var(--lg-layer-overlay);
    border-radius: var(--lg-border-radius) var(--lg-border-radius) 0 0;
    opacity: 0.8;
    z-index: 1;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.client-data-section:hover::after {
    opacity: 1.2;
}

.client-data-section-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--gh-text-primary);
    margin: 0 0 32px 0;
    padding-top: 20px; /* Abstand oben für Scroll-Offset */
    padding-bottom: 16px;
    border-bottom: none; /* Keine Linie unter Überschrift */
    scroll-margin-top: 80px; /* Überschrift muss unter Header sichtbar sein */
}

/* Fields - Grid System */
.client-data-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* 3-Spalten Grid für sehr kurze Felder (< 4 Zeichen) */
.client-data-fields.three-columns {
    grid-template-columns: repeat(3, 1fr);
}

.client-data-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Grid-Klassen für Feld-Breiten */
.client-data-field.full-width {
    grid-column: 1 / -1;
}

.client-data-field.third-width {
    grid-column: span 1;
}

.client-data-field label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gh-text-primary);
}

/* Input with Lock (Liquid Glass) */
.input-with-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.input-with-toggle input,
.input-with-toggle textarea,
.input-with-toggle select {
    flex: 1;
    padding: 10px 50px 10px 12px; /* Padding-right für 28px Schloss + 12px Abstand */
    min-height: 44px; /* Mindesthöhe für 28px Lock-Icon */
    border: 1px solid var(--lg-border);
    border-radius: 8px; /* 8px Rundungsradius */
    background: var(--lg-layer-base);
    color: var(--gh-text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
    -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
    box-shadow: var(--lg-shadow-combined);
}

/* Select-Dropdown: Custom Dropdown-Pfeil (rechts, vor dem Schloss) */
.input-with-toggle select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 42px center; /* Vor dem 28px Schloss + 14px Abstand */
    padding-right: 50px; /* Platz für 28px Schloss */
    cursor: pointer;
}

.input-with-toggle input:focus,
.input-with-toggle textarea:focus,
.input-with-toggle select:focus {
    border-color: var(--ios-blue-primary);
    box-shadow: var(--lg-shadow-combined), 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.input-with-toggle textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Monaco', 'Menlo', monospace;
    padding-right: 12px; /* Textarea hat kein Schloss-Padding, Schloss ist außerhalb */
}

/* Lock-icon für Textarea: Position außerhalb rechts */
.input-with-toggle:has(textarea) .lock-icon {
    position: absolute;
    right: -45px; /* Außerhalb des Textarea */
    top: 12px; /* Oben ausgerichtet */
    transform: none;
}

/* Lock Icon - EXAKT kopiert von .footer-toggle-btn */
.lock-icon {
    /* Positionierung */
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    
    /* EXAKT wie Footer-Toggle */
    padding: 6px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--gh-border);
    color: var(--gh-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin: 0;
    z-index: 10;
}

.lock-icon i {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Zustände: Unlocked (sichtbar für alle) - Grünes, offenes Schloss */
.lock-icon.unlocked {
    opacity: 1.0;
    color: #28a745; /* Grün für aktiv/sichtbar */
    background: rgba(40, 167, 69, 0.15); /* Leicht grüner Hintergrund */
    border-color: rgba(40, 167, 69, 0.3);
}

.lock-icon.unlocked i {
    /* Unlock Icon für "sichtbar für alle" */
}

/* Zustände: Locked (nur Admins) - Graues, geschlossenes Schloss */
.lock-icon.locked {
    opacity: 0.6;
    color: var(--gh-text-secondary); /* Grau für inaktiv */
    background: transparent;
    border-color: var(--gh-border);
}

.lock-icon.locked i {
    /* Lock Icon für "nur Admins" */
}

/* Hover - EXAKT wie Footer-Toggle, aber mit transform fix */
.lock-icon:hover {
    background-color: var(--gh-bg-secondary);
    border-color: var(--ios-blue-primary);
    color: var(--ios-blue-primary);
    transform: translateY(-50%) translateY(-1px);
}

.lock-icon:active {
    transform: translateY(-50%) translateY(0) scale(0.95);
}

/* Grün für unlocked */
.lock-icon.unlocked:hover {
    background: rgba(40, 167, 69, 0.25);
    border-color: #28a745;
    color: #28a745;
}

/* Field Visibility Toggle - DEPRECATED (wird durch lock-icon ersetzt) */
.field-visibility-toggle {
    display: none; /* Alte Implementierung - wird durch lock-icon ersetzt */
}

/* Save Feedback */
.save-feedback {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 10;
}

/* User Items */
.client-data-user-item {
    padding: 16px;
    background: var(--gh-bg-tertiary);
    border: 1px solid var(--gh-border);
    border-radius: 8px;
    margin-bottom: 12px;
}

.client-data-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.client-data-user-role {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 12px;
    color: var(--gh-text-secondary);
    margin-top: 4px;
}

/* Toggle Switch Component (Liquid Glass) */
.toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gh-text-primary);
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    background: var(--lg-layer-base);
    border: 1px solid var(--lg-border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
    -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active {
    background: #28a745;
    border-color: rgba(40, 167, 69, 0.5);
    box-shadow: 0 0 12px rgba(40, 167, 69, 0.3);
}

.toggle-switch.active::after {
    transform: translateX(22px);
}

.toggle-switch:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Admin-only elements */
.admin-only {
    display: none;
}

.admin-only.show {
    display: block;
}

/* Lean & Clean Design - REMOVED: Duplicate definition moved to line 138 */

/* Gap bereits in Grid-System definiert */

/* Responsive */
@media (max-width: 1200px) {
    .client-data-layout {
        flex-direction: column;
    }

    .client-data-sidebar {
        width: 100%;
        position: relative;
        max-height: none;
    }

    .client-data-content {
        width: 100%;
    }
}

@media (max-width: 768px) {
    /* Mobile: 1 Spalte */
    .client-data-fields {
        grid-template-columns: 1fr;
    }
    
    .client-data-fields.three-columns {
        grid-template-columns: 1fr;
    }
}
