/* Agenturen (Agencies) Page Styles */

/* Split Layout Container */
.agencies-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.split-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    height: 100%;
    min-height: 600px;
}

/* Left Panel - Agencies List */
.left-panel {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.agencies-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.agency-item {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.agency-item:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.agency-item.active {
    border-color: #2563eb;
    background: #f0f9ff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

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

.agency-header strong {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.agency-id {
    font-size: 10px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
}

.agency-address {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 8px;
}

.agency-address i {
    color: #94a3b8;
    width: 12px;
}

.agency-stats {
    display: flex;
    gap: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #64748b;
}

.stat-item i {
    color: #94a3b8;
    width: 12px;
}

/* Right Panel - Agency Details */
.right-panel {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Empty Selection State */
.empty-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
    text-align: center;
    padding: 40px;
}

.empty-selection i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-selection h3 {
    margin-bottom: 8px;
    color: #374151;
}

/* Agency Details */
.agency-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.details-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

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

.header-info h3 {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.agency-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
}

.info-item i {
    color: #94a3b8;
    width: 16px;
}

/* Sachbearbeiter Section */
.sachbearbeiter-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
}

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

.section-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header h4 i {
    color: #64748b;
}

/* Sachbearbeiter header info */
.sb-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-badge {
    font-size: 12px;
    padding: 4px 8px;
    background: #fbbf24;
    color: #92400e;
    border-radius: 12px;
    font-weight: 500;
}

/* Loading Small */
.loading-small {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #64748b;
    font-size: 14px;
}

/* Empty Sachbearbeiter */
.empty-sachbearbeiter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
}

.empty-sachbearbeiter i {
    font-size: 32px;
    color: #d1d5db;
    margin-bottom: 12px;
}

/* Sachbearbeiter List */
.sachbearbeiter-list {
    flex: 1;
    overflow-y: auto;
}

.sachbearbeiter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
}

.sachbearbeiter-item:hover {
    background: #f0f9ff;
    border-color: #93c5fd;
}

.sachbearbeiter-item:hover .sb-actions {
    opacity: 1;
}

.sb-info {
    flex: 1;
}

.sb-name {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.sb-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sb-email, .sb-telefon {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.sb-email i, .sb-telefon i {
    width: 12px;
    color: #94a3b8;
}

.sb-actions {
    display: flex;
    gap: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sb-actions .btn-danger {
    background: #6b7280;
    color: white;
    border: 1px solid #6b7280;
}

.sb-actions .btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* Readonly sachbearbeiter styling */
.sachbearbeiter-readonly {
    cursor: default;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.sachbearbeiter-readonly:hover {
    background: #f8f9fa;
    border-color: #e9ecef;
}

.sb-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 12px;
}

.sb-status i {
    color: #9ca3af;
}

.readonly-text {
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .split-layout {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .right-panel {
        min-height: 400px;
    }
    
    .sachbearbeiter-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sb-actions {
        margin-top: 8px;
        align-self: flex-end;
    }
}