/* style.css */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    background: #0a0f2e;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Auth Pages Styling */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #0a0f2e;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: linear-gradient(180deg, transparent, rgba(120, 40, 200, 0.15));
    pointer-events: none;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(120, 40, 200, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.auth-card {
    background: rgba(15, 22, 55, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.05);
    border-radius: 20px;
    overflow: hidden;
    max-width: 450px;
    width: 100%;
}

.auth-header {
    background: linear-gradient(135deg, #0d1b4b 0%, #1a1060 100%);
    color: white;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: relative;
}

.auth-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #f97316, #ec4899, #7c3aed);
}

.auth-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.auth-body {
    padding: 2rem;
    background: rgba(15, 22, 55, 0.95);
}

.form-floating {
    margin-bottom: 1rem;
}

/* ── Auth-Seiten: form-floating im dunklen Kontext ───────────────────────
   Bootstrap form-floating braucht:
   - Feste Höhe (58px)
   - padding-top: 1.625rem  (Platz für das hochgerutschte Label)
   - padding-bottom: 0.625rem
   - Placeholder MUSS gesetzt sein (damit :placeholder-shown funktioniert)
   Das Label floated nach oben bei Fokus ODER wenn Feld gefüllt ist.
   Ohne korrekte Höhe/Padding stehen Label + Placeholder übereinander.
   ──────────────────────────────────────────────────────────────────── */
.auth-body .form-floating,
.auth-wrapper .form-floating {
    margin-bottom: 1rem;
    position: relative;
}

.auth-body .form-floating > .form-control,
.auth-wrapper .form-floating > .form-control {
    height: 58px !important;
    padding: 1.625rem 0.85rem 0.625rem !important;
    border: 1.5px solid rgba(255,255,255,0.15) !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,0.07) !important;
    color: #fff !important;
    font-size: 0.95rem !important;
    line-height: 1.25 !important;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s !important;
    /* Placeholder unsichtbar — Label übernimmt die Beschriftung */
    --bs-placeholder-opacity: 0;
}

/* Placeholder komplett ausblenden — verhindert Doppel-Beschriftung */
.auth-body .form-floating > .form-control::placeholder,
.auth-wrapper .form-floating > .form-control::placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

/* Label: standard = vertikal zentriert (wie Placeholder) */
.auth-body .form-floating > label,
.auth-wrapper .form-floating > label {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 58px !important;
    padding: 1rem 0.85rem !important;
    color: rgba(255,255,255,0.45) !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
    pointer-events: none !important;
    border: 1px solid transparent !important;
    transform-origin: 0 0 !important;
    transition: opacity .1s ease-in-out, transform .1s ease-in-out !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: calc(100% - 1rem) !important;
}

/* Label floated nach oben: bei Fokus ODER wenn Feld nicht leer */
.auth-body .form-floating > .form-control:focus ~ label,
.auth-body .form-floating > .form-control:not(:placeholder-shown) ~ label,
.auth-wrapper .form-floating > .form-control:focus ~ label,
.auth-wrapper .form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.75) translateY(-0.65rem) !important;
    color: rgba(255,255,255,0.65) !important;
    opacity: 1 !important;
}

/* Fokus-Styling */
.auth-body .form-floating > .form-control:focus,
.auth-wrapper .form-floating > .form-control:focus {
    border-color: #f97316 !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18) !important;
    background: rgba(255,255,255,0.10) !important;
    color: #fff !important;
    outline: none !important;
}

/* Autofill-Fix: Chrome setzt weißen Hintergrund */
.auth-body .form-floating > .form-control:-webkit-autofill,
.auth-body .form-floating > .form-control:-webkit-autofill:focus,
.auth-wrapper .form-floating > .form-control:-webkit-autofill,
.auth-wrapper .form-floating > .form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #141c3a inset !important;
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff !important;
}

/* Dashboard-Formulare (außerhalb auth): unverändertes Bootstrap-Verhalten */
.form-floating > .form-control {
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.form-floating > .form-control:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 0.2rem rgba(249, 115, 22, 0.2);
}

.btn-auth {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
    color: #fff;
    font-size: 0.9rem;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.4);
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    color: #fff;
}

/* Dashboard Styling */
.dashboard-wrapper {
    background: #f8f9fa;
    min-height: 100vh;
}

.navbar-custom {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
}

.config-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: none;
    overflow: hidden;
    margin-bottom: 2rem;
}

.card-header-custom {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    padding: 1.5rem;
}

.card-header-custom h2 {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.3rem;
}

/* Custom Tabs */
.nav-tabs-custom {
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
    padding: 0 1rem;
}

.nav-tabs-custom .nav-link {
    border: none;
    border-radius: 10px 10px 0 0;
    color: var(--secondary-color);
    font-weight: 500;
    padding: 1rem 1.5rem;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.nav-tabs-custom .nav-link:hover {
    background: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
}

.nav-tabs-custom .nav-link.active {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: white;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.35);
}

.tab-content-custom {
    padding: 2rem;
    background: white;
}

/* Form Styling */
.form-floating-custom {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-control-custom {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-control-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    background: white;
}

.form-label-custom {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Character Counter */
.char-counter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 0.75rem;
    color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Help Text */
.help-text {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-left: 4px solid var(--info-color);
    border-radius: 0 8px 8px 0;
}

/* Dynamic Fields */
.dynamic-field {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    align-items: end;
}

.dynamic-field .form-floating-custom {
    flex: 1;
    margin-bottom: 0;
}

/* Ansprechpartner Cards */
.ansprechpartner-card {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    position: relative;
}

.ansprechpartner-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #f97316, #ec4899);
    border-radius: 15px 15px 0 0;
}

.ansprechpartner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* Topic Groups */
.topic-card {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    background: white;
}

.topic-header {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.topic-body {
    padding: 1.5rem;
}

.form-check-custom {
    margin-bottom: 0.75rem;
}

.form-check-custom .form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.1em;
    border: 2px solid #dee2e6;
    border-radius: 4px;
}

.form-check-custom .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-custom .form-check-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-left: 0.5rem;
}

/* Buttons */
.btn-custom {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.btn-primary-custom {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border: none;
    color: white;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.35);
}

.btn-secondary-custom {
    background: linear-gradient(135deg, var(--secondary-color), #5a6268);
    border: none;
    color: white;
}

.btn-danger-custom {
    background: linear-gradient(135deg, var(--danger-color), #b02a37);
    border: none;
    color: white;
}

.btn-outline-custom {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

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

/* Save Button */
.save-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 2rem;
    text-align: center;
    border-top: 2px solid #dee2e6;
}

.btn-save {
    background: linear-gradient(135deg, var(--success-color), #146c43);
    border: none;
    color: white;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.3);
}

.btn-save:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(25, 135, 84, 0.4);
}

/* Alerts */
.alert-custom {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success-custom {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1), rgba(25, 135, 84, 0.05));
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger-custom {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-card {
        margin: 1rem;
        border-radius: 15px;
    }

    .auth-header,
    .auth-body {
        padding: 1.5rem;
    }

    .main-content {
        padding: 1rem 0;
    }

    .tab-content-custom {
        padding: 1rem;
    }

    .dynamic-field {
        flex-direction: column;
    }

    .ansprechpartner-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Zusätzliche CSS-Regeln für bessere mobile Darstellung */
@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .auth-card {
        margin: 0.5rem;
        border-radius: 10px;
    }

    .auth-header,
    .auth-body {
        padding: 1rem;
    }

    .nav-tabs-custom .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .tab-content-custom {
        padding: 1rem;
    }

    .ansprechpartner-card {
        padding: 1rem;
    }

    .btn-save {
        padding: 0.75rem 2rem;
        font-size: 1rem;
    }

    .topic-header {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .topic-body {
        padding: 1rem;
    }

    .form-check-custom .form-check-label {
        font-size: 0.875rem;
    }

    .char-counter {
        font-size: 0.7rem;
    }

    .help-text {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

/* Toast Notifications */
.toast-notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading button state */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Form validation styles */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Smooth transitions */
.form-control-custom,
.btn-custom {
    transition: all 0.3s ease;
}

/* Focus improvements */
.form-control-custom:focus,
.form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Better checkbox styling */
.form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

/* Improved button hover effects */
.btn-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(25, 135, 84, 0.4);
}

/* Better spacing for form elements */
.form-floating-custom + .form-floating-custom {
    margin-top: 1.5rem;
}

.row .form-floating-custom {
    margin-bottom: 1rem;
}

/* Improved card shadows */
.config-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.config-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Workflow-Management Styles */
.workflow-management {
    padding: 1rem 0;
}

.workflow-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.workflow-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.workflow-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid #f8f9fa;
}

.workflow-title h4 {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
}

.workflow-description {
    margin: 0.5rem 0 0 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

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

.workflow-steps {
    padding: 1rem 1.5rem 1.5rem;
}

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

.workflow-step {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.step-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    font-weight: 500;
    color: var(--dark-color);
}

/* Workflow Editor Modal */
.workflow-step-editor {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.step-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.step-editor-header h5 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.remove-step {
    padding: 0.25rem 0.5rem;
}

/* Responsive Workflow Cards */
@media (max-width: 768px) {
    .workflow-header {
        flex-direction: column;
        gap: 1rem;
    }

    .workflow-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .workflow-step {
        flex-direction: column;
        text-align: center;
    }

    .step-icon {
        margin: 0 0 0.5rem 0;
    }
}

/* Workflow-spezifische Button-Styles */
.btn-workflow {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-workflow:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Workflow-Status Badges */
.workflow-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workflow-status.active {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.workflow-status.default {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

/* Workflow-Typ Icons */
.workflow-type-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.workflow-type-icon.authenticate {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.workflow-type-icon.collect_data {
    background: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
}

.workflow-type-icon.connect {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.workflow-type-icon.callback {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.workflow-type-icon.email {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

.workflow-type-icon.reference {
    background: rgba(13, 202, 240, 0.2);
    color: #0dcaf0;
}

/* Verbesserter Speichern-Button */
.btn-xl {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 12px;
    min-width: 280px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
}

.btn-xl:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.save-button {
    position: relative;
    overflow: hidden;
}

.save-button.saving {
    pointer-events: none;
}

.save-button.saving::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Footer Styling */
.footer-custom {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 3px solid #3498db;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-custom p {
    font-size: 0.9rem;
    color: #bdc3c7;
    font-weight: 400;
}

.footer-custom i {
    color: #3498db;
}

/* Anpassung des Main Content für Footer */
.main-content {
    min-height: calc(100vh - 140px);
    padding-bottom: 20px;
}

/* Config Footer Anpassungen */
.config-footer {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 2px solid #dee2e6;
    padding: 30px 20px;
    margin-top: 30px;
    border-radius: 0 0 15px 15px;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .btn-xl {
        min-width: 100%;
        padding: 12px 30px;
        font-size: 1.1rem;
    }

    .footer-custom {
        padding: 15px 0;
    }

    .footer-custom p {
        font-size: 0.8rem;
    }
}

/* Loading Animation für Button */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Anruf-Management Styles */
.calls-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.calls-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #dee2e6;
    padding: 1.5rem;
}

.calls-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.period-title {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.3rem;
}

.calls-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.stat-item i {
    color: var(--primary-color);
}

.calls-list {
    padding: 1.5rem;
}

.call-card {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
}

.call-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-bottom: 1px solid #e9ecef;
}

.call-info {
    flex: 1;
}

.caller-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.call-details {
    display: flex;
    gap: 1.5rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.call-conversation {
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.conversation-log {
    max-height: 400px;
    overflow-y: auto;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 10px;
    position: relative;
}

.message.assistant {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.05));
    border-left: 4px solid var(--primary-color);
    margin-right: 2rem;
}

.message.caller {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(108, 117, 125, 0.05));
    border-left: 4px solid var(--secondary-color);
    margin-left: 2rem;
}

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

.message-header strong {
    color: var(--dark-color);
    font-size: 0.9rem;
}

.timestamp {
    color: var(--secondary-color);
    font-size: 0.8rem;
    font-weight: 400;
}

.message-text {
    color: var(--dark-color);
    line-height: 1.5;
}

.call-notes {
    padding: 1.5rem;
    background: white;
}

.note-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.no-calls {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.no-calls i {
    color: var(--primary-color);
    opacity: 0.5;
}

/* Responsive Design für Anrufe */
@media (max-width: 768px) {
    .calls-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .calls-stats {
        justify-content: center;
    }

    .call-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .call-details {
        justify-content: center;
    }

    .message.assistant {
        margin-right: 0;
    }

    .message.caller {
        margin-left: 0;
    }
}

/* Navigation aktive Links */
.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-weight: 600;
}

textarea[name="note"] {
    resize: none; /* Verhindert manuelles Resize */
    overflow: hidden; /* Verhindert Scrollbars */
    min-height: 40px; /* Mindesthöhe */
    transition: height 0.2s ease; /* Sanfte Animation */
}

/* Tagesansicht spezifische Styles */
.calls-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: darkslategray;
    font-weight: 500;
}

.calls-stats .stat-item i {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Verbesserte Button-Gruppe für drei Buttons */
.period-selector .btn-group {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.period-selector .btn-group .btn-custom {
    border-radius: 0;
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    min-width: 80px;
}

.period-selector .btn-group .btn-custom:first-child {
    border-left: 2px solid var(--primary-color);
    border-radius: 10px 0 0 10px;
}

.period-selector .btn-group .btn-custom:last-child {
    border-right: 2px solid var(--primary-color);
    border-radius: 0 10px 10px 0;
}

.period-selector .btn-group .btn-primary-custom {
    border-color: var(--primary-color);
    z-index: 1;
}

/* Responsive Anpassungen für drei Buttons */
@media (max-width: 576px) {
    .period-selector .btn-group .btn-custom {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        min-width: 60px;
    }

    .calls-navigation {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .nav-controls {
        order: 2;
    }

    .period-title {
        order: 1;
        text-align: center;
        font-size: 1.1rem;
    }
}

/* Bessere Darstellung der Anrufkarten in der Tagesansicht */
.day-view .call-card {
    border-left: 4px solid var(--primary-color);
}

.day-view .call-card:nth-child(even) {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

/* Zeitanzeige in der Tagesansicht hervorheben */
.day-view .call-time {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Call Cards Styling */
.calls-content {
    padding: 1rem 0;
}

.calls-header {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.calls-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.period-title {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
}

.calls-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.stat-item i {
    color: var(--primary-color);
}

.calls-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.call-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.call-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.call-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.call-info {
    flex: 1;
}

.caller-number {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.call-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.call-meta span {
    display: flex;
    align-items: center;
}

.call-cost {
    color: var(--success-color) !important;
    font-weight: 600;
}

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

.call-notes-section {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.notes-container {
    position: relative;
}

.auto-resize-textarea {
    min-height: 40px;
    resize: none;
    overflow: hidden;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.auto-resize-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.call-conversation {
    padding: 1.5rem;
    background: #fafafa;
}

.conversation-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.conversation-header h5 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.conversation-log {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
    padding: 1rem;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
}

.message.assistant {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.05));
    border-left: 4px solid var(--primary-color);
}

.message.caller {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(108, 117, 125, 0.05));
    border-left: 4px solid var(--secondary-color);
}

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

.message-text {
    line-height: 1.5;
}

.forward-info {
    margin-top: 1rem;
}

.no-calls {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.no-calls i {
    color: var(--light-color);
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calls-navigation {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .calls-stats {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .call-header {
        flex-direction: column;
        gap: 1rem;
    }

    .call-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .caller-number {
        font-size: 1rem;
    }

    .nav-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .calls-header {
        padding: 1rem;
    }

    .call-card {
        margin: 0 -0.5rem;
        border-radius: 10px;
    }

    .call-header,
    .call-notes-section,
    .call-conversation {
        padding: 1rem;
    }

    .period-selector .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .period-selector .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
}

/* Badge Styling */
.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Form Styling in Notes */
.notes-form .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Smooth Transitions */
.call-conversation {
    transition: all 0.3s ease;
}

/* Custom Scrollbar für Conversation Log */
.conversation-log::-webkit-scrollbar {
    width: 6px;
}

.conversation-log::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.conversation-log::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* Guthaben-Widget Styling */
.balance-widget {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--success-color);
    margin-bottom: 1rem;
}

.balance-widget.balance-low {
    border-left-color: var(--danger-color);
    background: linear-gradient(135deg, #fff5f5, #fed7d7);
}

.balance-widget.balance-medium {
    border-left-color: var(--warning-color);
    background: linear-gradient(135deg, #fffbf0, #fef5e7);
}

.balance-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.balance-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--dark-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.balance-widget.balance-low .balance-amount {
    color: var(--danger-color);
}

.balance-widget.balance-medium .balance-amount {
    color: var(--warning-color);
}

.balance-warning {
    color: var(--danger-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.balance-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Modal Styling für Guthaben aufladen */
.amount-btn {
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

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

/* Transaktions-Tabelle */
.current-balance-display {
    background: rgba(13, 110, 253, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: 2px solid rgba(13, 110, 253, 0.2);
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Responsive Design für Guthaben-Widget */
@media (max-width: 768px) {
    .balance-content {
        flex-direction: column;
        text-align: center;
    }

    .balance-actions {
        justify-content: center;
        width: 100%;
    }

    .balance-actions .btn {
        flex: 1;
        min-width: 140px;
    }
}

/* Anruf-Kosten in der Anrufliste */
.call-cost {
    font-weight: 600;
    color: var(--danger-color);
}

.call-cost-info {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

/* Transaktionen Styling */
.transactions-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.current-balance-display {
    text-align: right;
}

.transaction-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.transaction-item:hover {
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 0 -1rem;
    padding: 1rem;
}

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

/* Pagination Styling */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 2px solid #e9ecef;
    color: var(--primary-color);
}

.page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white !important;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.nav-link:hover, .nav-link.active {
    color: white !important;
    font-weight: bold;
}

/* Datenerfassung Überschrift zentrieren */
.config-card h2 {
    text-align: center;
}

/* Spezifische Zentrierung für die Datenerfassung-Sektion */
.card-header-custom h2 {
    text-align: center;
}

/* Dynamic Fields - Button auf gleicher Höhe wie Input */
.dynamic-field {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    align-items: flex-end; /* Ändere von end zu flex-end für bessere Kompatibilität */
}

.dynamic-field .form-floating-custom {
    flex: 1;
    margin-bottom: 0;
}

.dynamic-field .btn {
    height: 58px; /* Gleiche Höhe wie die Input-Felder */
    min-width: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Spezifische Anpassung für Datenerfassung-Felder */
.data-collection-section {
    margin-bottom: 3rem;
}

.data-collection-section h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    font-weight: 600;
}

/* Ansprechpartner Sektion Styling */
.contacts-section {
    margin-top: 3rem;
}

.contacts-section .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.contacts-section .section-header h3 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Ansprechpartner hinzufügen Button zentrieren mit mehr Abstand */
.add-contact-section {
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

#add-ansprechpartner {
    margin-top: 2rem;
}

/* Bessere Ausrichtung für mobile Geräte */
@media (max-width: 768px) {
    .dynamic-field {
        flex-direction: column;
        align-items: stretch;
    }

    .dynamic-field .btn {
        height: 45px;
        margin-top: 10px;
    }

    .add-contact-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
}

/* Zusätzliche Verbesserungen für die Form-Struktur */
.form-section {
    margin-bottom: 2.5rem;
}

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

/* Bessere Ausrichtung der Lösch-Buttons */
.btn-danger-custom.btn-sm {
    height: 58px;
    width: 58px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

/* Spezielle Klasse für Datenerfassung Container */
.data-capture-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.data-capture-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark-color);
    font-weight: 600;
}

/* Zwei-Spalten Layout für Interessenten/Kunden */
.data-capture-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

@media (max-width: 992px) {
    .data-capture-row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.data-capture-column {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.data-capture-column h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Password strength indicator */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    display: block;
    margin-top: 5px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Auth links styling */
.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-link {
    color: #f97316;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #fb923c;
    text-decoration: underline;
}

.auth-divider {
    margin: 0 10px;
    color: rgba(255,255,255,0.25);
}

/* Zusätzliche Styles für Stripe Integration */

.payment-form {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.amount-btn {
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    font-weight: 600;
}

.amount-btn:hover {
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.1);
}

.amount-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

#payment-element {
    margin-bottom: 1rem;
}

.stripe-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.payment-success-icon {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.payment-error-icon {
    font-size: 4rem;
    color: var(--danger-color);
    margin-bottom: 1rem;
}

/* Balance Widget Styles */
.balance-widget {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

.balance-widget.balance-low {
    border-color: var(--danger-color);
    background: linear-gradient(135deg, #fff5f5, #ffe6e6);
}

.balance-widget.balance-medium {
    border-color: var(--warning-color);
    background: linear-gradient(135deg, #fffbf0, #fff3cd);
}

.balance-widget.balance-good {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #f0fff4, #d1e7dd);
}

.balance-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.balance-warning {
    color: var(--danger-color);
    font-weight: 600;
    margin-top: 0.5rem;
}

.balance-actions {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

@media (max-width: 768px) {
    .balance-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .balance-actions {
        flex-direction: row;
        width: 100%;
    }

    .balance-actions .btn {
        flex: 1;
    }
}

/* Responsive Design für Agenten - Fortsetzung */
@media (max-width: 768px) {
    .agent-header {
        flex-direction: column;
        gap: 1rem;
    }

    .agent-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .agent-card {
        margin-left: 0 !important;
    }

    .agent-card.agent-child {
        border-left: none;
        border-top: 4px solid #6c757d;
        position: relative;
    }

    .agent-card.agent-child::before {
        content: "↳ Unteragent";
        position: absolute;
        top: -1px;
        left: 10px;
        background: #6c757d;
        color: white;
        padding: 2px 8px;
        font-size: 0.7rem;
        border-radius: 0 0 4px 4px;
    }

    .agent-details .row {
        flex-direction: column;
    }
}

/* Agenten-Hierarchie Visualisierung */
.agent-tree-line {
    position: absolute;
    left: -15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.agent-tree-connector {
    position: absolute;
    left: -15px;
    top: 50%;
    width: 15px;
    height: 2px;
    background: #dee2e6;
}

/* Status Badges */
.agent-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.agent-status .badge {
    font-size: 0.75rem;
}

/* Prompt Textarea Styling */
.prompt-textarea {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.4;
}

.prompt-textarea:focus {
    background: white;
    border-color: var(--primary-color);
}

/* Agenten-Karten Animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agent-card {
    animation: slideInUp 0.3s ease-out;
}

/* Loading States */
.agent-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.agent-loading i {
    margin-right: 0.5rem;
    animation: spin 1s linear infinite;
}

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

/* Empty State */
.agent-empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.agent-empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Agenten-Management - Verbesserte Styles */
.agent-management {
    padding: 0;
}

.agent-card {
    background: white;
    border: 1px solid #e3e6f0;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.agent-card:hover {
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.25);
    transform: translateY(-3px);
}

.agent-card.agent-parent {
    border-left: 0px solid #4e73df;
}

.agent-card.agent-child {
    border-left: 0px solid #36b9cc;
    background: linear-gradient(135deg, #f8f9fc 0%, #ffffff 100%);
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: 0;
    border-radius: 15px 15px 0 0;
}

.agent-card.agent-child .agent-header {
    background: linear-gradient(135deg, #36b9cc 0%, #4e73df 100%);
}

.agent-title {
    display: flex;
    align-items: flex-start;
    flex: 1;
    gap: 0.75rem;
}

.agent-title i {
    font-size: 1.5rem;
    margin-top: 0.25rem;
    opacity: 0.9;
}

.agent-title-content h4 {
    margin: 0 0 0.5rem 0;
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
}

.agent-status {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.agent-status .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 50px;
    font-weight: 500;
}

.agent-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.agent-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.agent-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: translateY(-1px);
}

.agent-description {
    padding: 1rem 1.5rem;
    background: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    margin: 0;
    font-style: italic;
    color: #5a5c69;
    position: relative;
}

.agent-details {
    padding: 1.5rem;
}

.agent-details .row > div {
    margin-bottom: 1.5rem;
}

.agent-details strong {
    color: #4e73df;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.agent-details p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #5a5c69;
    background: #f8f9fc;
    padding: 1rem;
    border-radius: 8px;
    border-left: 0px solid #e3e6f0;
}

.agent-details pre {
    background: #2d3748 !important;
    color: #e2e8f0;
    border: none;
    border-radius: 10px;
    padding: 1.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.agent-details small {
    background: #e3e6f0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.8rem;
}

/* Empty State Verbesserung */
.agent-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.agent-empty-state i {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.agent-empty-state h4 {
    color: #5a5c69;
    font-weight: 600;
    margin-bottom: 1rem;
}

.agent-empty-state p {
    color: #858796;
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Modal Verbesserungen */
#agentModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    border: none;
}

#agentModal .modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

#agentModal .modal-header .btn-close:hover {
    opacity: 1;
}

#agentModal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 0.5rem 3rem rgba(58, 59, 69, 0.3);
}

#agentModal .modal-body {
    padding: 2rem;
}

#agentModal .form-label {
    font-weight: 600;
    color: #4e73df;
    margin-bottom: 0.5rem;
}

#agentModal .form-control,
#agentModal .form-select {
    border: 2px solid #e3e6f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

#agentModal .form-control:focus,
#agentModal .form-select:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

#agentModal .form-text {
    color: #858796;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

#agent-prompt {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #2d3748;
    color: #e2e8f0;
    border: 2px solid #4a5568;
    min-height: 200px;
}

#agent-prompt:focus {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4e73df;
}

.form-check-input:checked {
    background-color: #4e73df;
    border-color: #4e73df;
}

/* Button Styles */
.btn-primary-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(78, 115, 223, 0.3);
}

/* Responsive Verbesserungen */
@media (max-width: 768px) {
    .agent-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .agent-actions {
        justify-content: center;
        width: 100%;
    }

    .agent-card {
        margin-left: 0 !important;
    }

    .agent-card.agent-child {
        position: relative;
    }

    .agent-card.agent-child::after {
        content: "Unteragent";
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(54, 185, 204, 0.9);
        color: white;
        padding: 0.25rem 0.75rem;
        border-radius: 15px;
        font-size: 0.75rem;
        font-weight: 600;
    }

    .agent-description {
        padding: 1rem;
        text-align: center;
    }

    .agent-details {
        padding: 1rem;
    }

    .agent-empty-state {
        padding: 2rem 1rem;
    }

    .agent-empty-state i {
        font-size: 3rem;
    }
}

/* Loading Animation */
.agent-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.agent-loading i {
    color: #4e73df;
    margin-right: 1rem;
    animation: spin 1s linear infinite;
}

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

/* Smooth Animations */
.agent-card {
    animation: slideInUp 0.4s ease-out;
}

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

/* Hover Effects für bessere UX */
.agent-card .collapse {
    transition: all 0.3s ease;
}

.agent-details strong i {
    color: #4e73df;
    font-size: 1rem;
}

/* Badge Styles */
.badge.bg-success {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #858796 0%, #5a5c69 100%) !important;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #36b9cc 0%, #258391 100%) !important;
}

/* API Parameter Styling */
.api-parameter-row {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.api-parameter-row:hover {
    background-color: #e9ecef;
}

.api-parameter-row .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
}

.api-parameter-row .form-control {
    font-size: 0.875rem;
}

.remove-api-parameter {
    margin-top: 1.5rem;
}

/* Card Header für API-Sektion */
.card-header h6 {
    color: #495057;
    font-weight: 600;
}

/* Modal Erweiterungen */
.modal-xl .modal-dialog {
    max-width: 1200px;
}

/* Form Text Styling */
.form-text {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Button Styling für API Parameter */
#add-api-parameter {
    font-size: 0.875rem;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .api-parameter-row .row > div {
        margin-bottom: 1rem;
    }

    .remove-api-parameter {
        margin-top: 0.5rem;
    }
}


.toggle-children {
    transition: all 0.3s ease;
    border: none !important;
    background: transparent !important;
    padding: 2px 6px !important;
}

.toggle-children:hover {
    background: #f8f9fa !important;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-children.expanded .toggle-icon {
    transform: rotate(90deg);
}

.agent-children {
    transition: all 0.3s ease;
    overflow: hidden;
}

.agent-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    transition: all 0.2s ease;
}

.agent-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.agent-title {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.agent-title h4 {
    margin: 0;
    font-size: 1.1rem;
}

.agent-status {
    margin-top: 5px;
}

.agent-status .badge {
    margin-right: 5px;
    font-size: 0.75rem;
}

.agent-description {
    padding: 10px 15px 10px 15px;
    color: #6c757d;
    font-style: italic;
}

.agent-details {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.agent-actions {
    display: flex;
    gap: 5px;
}

.agent-child {
    border-left: 0px solid #007bff;
    margin-left: 20px !important;
}

.agent-parent {
    border-left: 0px solid #28a745;
}

.agent-card:not(:has(.agent-children)) .toggle-children {
    display: none !important;
}

.toggle-children {
    transition: all 0.3s ease;
    border: none !important;
    background: transparent !important;
    padding: 2px 6px !important;
}

.toggle-children:hover {
    background: #f8f9fa !important;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-children.expanded .toggle-icon {
    transform: rotate(90deg);
}

.agent-children {
    transition: all 0.3s ease;
    overflow: hidden;
    margin-top: 10px;
}

.agent-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
    background: white;
    transition: all 0.2s ease;
    position: relative;
    /* Entferne die störenden Linien */
}

.agent-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.agent-title {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.agent-title h4 {
    margin: 0;
    font-size: 1.1rem;
}

.agent-status {
    margin-top: 5px;
}

.agent-status .badge {
    margin-right: 5px;
    font-size: 0.75rem;
}

.agent-description {
    padding: 10px 15px 10px 15px;
    color: #6c757d;
    font-style: italic;
}

.agent-details {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.agent-actions {
    display: flex;
    gap: 5px;
}

.agent-child {
    border-left: 0px solid #007bff;
    margin-left: 30px !important;
    margin-top: 10px;
}

.agent-parent {
    border-left: 0px solid #28a745;
}

/* Entferne die störenden Tree-Line Elemente */
.agent-tree-line,
.agent-tree-connector {
    display: none;
}

/* Container für die gesamte Agent-Hierarchie */
.agents-container {
    padding: 20px;
}

/* Verbesserte Animation für das Aufklappen */
.agent-children.expanding {
    display: block !important;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out;
}

.agent-children.expanded {
    max-height: 2000px; /* Großer Wert für beliebige Höhe */
    opacity: 1;
}

.agent-children.collapsing {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in, opacity 0.3s ease-in;
}

.agent-details pre {
    background: #2d3748 !important;
    color: #e2e8f0;
    padding: 15px !important;
    border-radius: 8px !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    border: 1px solid #dee2e6 !important;

    /* Wichtig für Textumbruch */
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;

    /* Responsive Schriftgröße */
    font-family: 'Courier New', Consolas, monospace !important;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .agent-details pre {
        font-size: 0.75rem !important;
        padding: 10px !important;
        max-height: 250px !important;
    }
}

@media (max-width: 576px) {
    .agent-details pre {
        font-size: 0.7rem !important;
        padding: 8px !important;
        max-height: 200px !important;
    }
}

/* Zusätzliche Verbesserungen für die Agent-Details */
.agent-details {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    word-wrap: break-word;
}

.agent-details .row {
    margin: 0;
}

.agent-details .col-md-6 {
    padding: 0 10px;
    margin-bottom: 15px;
}

.agent-details p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Live Call Styles - Ergänzung zu style.css */
.live-call-box {
    border-left: 4px solid var(--primary-color);
}

.live-call-box.active {
    border-left-color: #28a745;
}

.conversation-log::-webkit-scrollbar {
    width: 6px;
}

.conversation-log::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.conversation-log::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

@media (max-width: 768px) {
    .call-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .message.assistant {
        margin-right: 0;
    }

    .message.caller {
        margin-left: 0;
    }

    .conversation-log {
        padding: 1rem;
    }
}

/* Vorlagen-Modal Styling */
#templates-list .list-group-item {
    transition: all 0.2s ease;
}

#templates-list .list-group-item:not(.list-group-item-secondary):hover {
    background-color: #f8f9fa;
    border-color: #0d6efd;
}

#templates-list .list-group-item-secondary {
    opacity: 0.7;
}

#templates-list .form-check-input:disabled {
    cursor: not-allowed;
}

#templates-list label {
    cursor: pointer;
    user-select: none;
}

#templates-list .badge {
    font-size: 0.75rem;
}

.btn-success-custom {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
}

.btn-success-custom:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* ── Sidebar-Layout ───────────────────────────────────────────────── */
:root {
    --sidebar-w: 240px;
    --topbar-h: 56px;
    --sidebar-bg: #0a0f2e;
    --sidebar-accent: #c4b5fd;
    --sidebar-text: #c8d0e0;
    --sidebar-hover: rgba(79,70,229,.12);
    --sidebar-active-bg: rgba(79,70,229,.2);
}

body.db-body { margin: 0; background: #f0f2f7; font-family: "Source Sans Pro", Arial, sans-serif; }

/* ── Topbar ───────────────────────────────────────────────────────── */
.db-topbar {
    position: fixed; top: 0; left: var(--sidebar-w); right: 0;
    height: var(--topbar-h); background: #fff;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #f97316, #ec4899, #7c3aed) 1;
    display: flex; align-items: center; padding: 0 1.5rem;
    z-index: 1000; gap: 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.db-topbar .topbar-title {
    font-weight: 700; font-size: 1rem; color: #1a202c;
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Sub-Account Banner in Topbar */
.sub-badge {
    background: #fff3cd; color: #856404; border: 1px solid #ffc107;
    border-radius: 20px; padding: .2rem .8rem; font-size: .8rem; font-weight: 600;
    display: flex; align-items: center; gap: .4rem;
}
/* Guthaben-Chip */
.balance-chip {
    display: flex; align-items: center; gap: .5rem;
    background: #f8f9fa; border: 1px solid #dee2e6;
    border-radius: 20px; padding: .3rem 1rem;
    font-size: .85rem; font-weight: 600; color: #1a202c;
    text-decoration: none; transition: background .15s;
}
.balance-chip:hover { background: #e9ecef; color: #1a202c; }
.balance-chip.bal-danger { background: #fff5f5; border-color: #fc8181; color: #c53030; }
.balance-chip.bal-warn   { background: #fffaf0; border-color: #f6ad55; color: #c05621; }
.balance-chip.bal-ok     { background: #f0fff4; border-color: #68d391; color: #276749; }

/* Account-Switcher Dropdown */
.account-switcher .dropdown-toggle {
    background: none; border: 1px solid #dee2e6; border-radius: 20px;
    padding: .3rem 1rem; font-size: .85rem; display: flex; align-items: center; gap: .5rem;
    color: #1a202c; font-weight: 600; cursor: pointer;
    max-width: 240px; overflow: hidden;
}
.account-switcher .dropdown-toggle .acct-label {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-switcher .dropdown-toggle:hover { background: #f8f9fa; }
.account-switcher .dropdown-menu { min-width: 200px; }
.account-switcher .dropdown-item.active-acc {
    background: #e8f4fd; font-weight: 700;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.db-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
    background: linear-gradient(180deg, #0a0f2e 0%, #0d1540 60%, #10194d 100%);
    display: flex; flex-direction: column;
    z-index: 1045; overflow-y: auto;
    border-right: 1px solid rgba(124,58,237,0.2);
}
.sidebar-logo {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(124,58,237,.2);
}

.sidebar-section-label {
    padding: 1.2rem 1.25rem .4rem;
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: rgba(255,255,255,.3);
}
.sidebar-nav { list-style: none; margin: 0; padding: 0 .5rem; }
.sidebar-nav li a {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem .75rem; border-radius: 8px; margin-bottom: 2px;
    color: #ffffff; text-decoration: none;
    font-weight: 500; transition: background .15s, color .15s;
}
.sidebar-nav li a:hover  { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav li a.active {
    background: linear-gradient(90deg, #391894 0%, #7c2dc0 55%, #60185d 100%);
    color: #fff;
}
.sidebar-nav li a .nav-icon { width: 18px; text-align: center; opacity: .7; font-size: .85rem; }
.sidebar-nav li a.active .nav-icon { opacity: 1; color: #fff; }

.sidebar-footer {
    margin-top: auto; padding: 1rem .5rem;
    border-top: 1px solid rgba(124,58,237,.15);
}
.sidebar-footer a {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem .75rem; border-radius: 8px;
    color: var(--sidebar-text); text-decoration: none; font-size: .875rem;
    transition: background .15s;
}
.sidebar-footer a:hover { background: var(--sidebar-hover); color: #fff; }

/* ── Main content ─────────────────────────────────────────────────── */
.db-main {
    margin-left: var(--sidebar-w);
    padding-top: var(--topbar-h);
    min-height: 100vh;
}
.db-content { padding: 1.75rem 1.75rem 3rem; }

/* ── Guthaben-Widget (Konfigurationsseite) ────────────────────────── */
.balance-widget-bar {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 1rem 1.5rem; margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.balance-widget-bar .bw-amount {
    font-size: 1.75rem; font-weight: 800; line-height: 1;
}
.balance-widget-bar .bw-amount.bal-danger { color: #e53e3e; }
.balance-widget-bar .bw-amount.bal-warn   { color: #dd6b20; }
.balance-widget-bar .bw-amount.bal-ok     { color: #276749; }
.balance-widget-bar .bw-label { font-size: .8rem; color: #718096; text-transform: uppercase; letter-spacing: .05em; }
.balance-widget-bar .bw-actions { margin-left: auto; display: flex; gap: .75rem; }

/* ── Burger-Button Icon-Transition ───────────────────────────────── */
#sidebarToggleBtn i {
    transition: transform 0.2s ease, opacity 0.15s ease;
    display: inline-block;
}

/* ── Sidebar-Overlay (mobile) ─────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1040;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ── Responsive ───────────────────────────────────────────────────── */
/* Laptop/Tablet: Sidebar ab 1399px ausgeblendet (maximaler Platz für Content) */
@media (max-width: 1399px) {
    :root { --sidebar-w: 0px; }
    .db-sidebar { transform: translateX(-240px); transition: transform .25s; width: 240px; z-index: 1045; }
    .db-sidebar.open { transform: translateX(0); }
    .db-topbar { left: 0; }
    .db-main { margin-left: 0; }
    /* Account-Label ausblenden – nur Icon sichtbar */
    .account-switcher .dropdown-toggle .acct-label { display: none; }
    .account-switcher .dropdown-toggle { max-width: unset; padding: .3rem .75rem; }
}

/* ── Kleine Displays (Smartphone): Topbar kompakter ──────────────── */
@media (max-width: 640px) {
    .db-topbar { padding: 0 0.75rem; gap: 0.5rem; }
    /* Abo-Chip + Telefonnummer-Chip ausblenden – brauchen den Platz */
    .db-topbar .balance-chip:not(.bal-danger):not(.bal-warn) { display: none; }
    /* Titel kürzen */
    .db-topbar .topbar-title { font-size: 0.9rem; }
    .db-content { padding: 1rem 0.75rem 3rem; }
    /* Stats-Karten: 2 Spalten statt 4 */
    .stats-row { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Nav-Tabs: Text nicht umbrechen, Tab-Zeile scrollbar halten */
.nav-tabs-custom .nav-link { white-space: nowrap; }

/* ============================================================
Dashboard UI Overrides
============================================================ */

/* ----------------------------------------------------------
   1. HERO-BOX – kompakter, weniger verschwendeter Platz
   ---------------------------------------------------------- */
.home-hero {
    padding: 1.25rem 1.75rem !important;
    min-height: unset !important;
    border-radius: 16px !important;
    margin-bottom: 1.25rem !important;
}

.hero-number {
    font-size: 1.6rem !important;
    margin-bottom: 0.25rem !important;
}

.hero-balance {
    font-size: 0.9rem !important;
    padding: 0.4rem 0.9rem !important;
}

/* ----------------------------------------------------------
   2. STAT-KARTEN – einheitliche Höhe & konsistente Farben
   ---------------------------------------------------------- */
.stats-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem !important;
    margin-bottom: 1.25rem !important;
}

.stat-card-home {
    border-radius: 14px !important;
    padding: 1.25rem 1rem !important;
    background: #ffffff !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07) !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
    min-height: 140px !important;
}

.stat-card-home:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.11) !important;
}

/* Einheitliche Icon-Farben (Abstufungen einer Primärfarbe) */
.sic-today    { background: #4f8ef7 !important; }
.sic-yesterday{ background: #6a9ef8 !important; }
.sic-week     { background: #85aef9 !important; }
.sic-month    { background: #a0befa !important; }

.stat-icon-circle {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 0.6rem !important;
    color: #fff !important;
    font-size: 1rem !important;
}

.stat-num {
    font-size: 1.8rem !important;
    font-weight: 800 !important;
    color: #1a1a2e !important;
    line-height: 1.1 !important;
}

.stat-lbl {
    font-size: 0.78rem !important;
    color: #6c757d !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    margin-bottom: 0.4rem !important;
}

.stat-sub {
    display: flex !important;
    gap: 0.75rem !important;
    font-size: 0.78rem !important;
    color: #9aa3af !important;
}

/* ----------------------------------------------------------
   3. INSIGHT CARDS – gleiche Höhe, besserer Abstand
   ---------------------------------------------------------- */
.insight-card {
    border-radius: 14px !important;
    border: 1px solid rgba(0,0,0,0.07) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
    padding: 1.25rem !important;
    height: 100% !important;
    background: #ffffff !important;
    transition: box-shadow 0.2s !important;
}

.insight-card:hover {
    box-shadow: 0 6px 22px rgba(0,0,0,0.10) !important;
}

.insight-card h3 {
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
    color: #6c757d !important;
    margin-bottom: 1rem !important;
    font-weight: 600 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    padding-bottom: 0.6rem !important;
}

/* ----------------------------------------------------------
   4. KI-PERFORMANCE – Benchmark-Balken unter Ø Dauer
   ---------------------------------------------------------- */
.perf-big-num {
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    color: #f97316 !important;
}

.perf-label {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #343a40 !important;
}

.perf-sublabel {
    font-size: 0.72rem !important;
    color: #9aa3af !important;
}

/* Visueller Benchmark-Balken unter Ø Dauer */
.perf-item:last-child::after {
    content: "⌀ Ziel: unter 02:00" !important;
    display: block !important;
    font-size: 0.68rem !important;
    color: #28a745 !important;
    margin-top: 0.3rem !important;
    background: rgba(40,167,69,0.08) !important;
    border-radius: 20px !important;
    padding: 2px 8px !important;
    text-align: center !important;
}

/* ----------------------------------------------------------
   5. WOCHEN-VERGLEICH – neutralerer Trend-Pfeil
   ---------------------------------------------------------- */
.trend-arrow.trend-down {
    background: rgba(255, 193, 7, 0.12) !important;
    color: #e6a817 !important;
    border-radius: 8px !important;
    padding: 0.4rem 0.75rem !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
}

/* Kontexthinweis "Heute noch keine Anrufe" weniger alarmierend */
.peak-hour-info {
    background: rgba(249,115,22,0.07) !important;
    border: 1px dashed rgba(249,115,22,0.3) !important;
    border-radius: 8px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8rem !important;
    color: #f97316 !important;
    margin-top: 0.75rem !important;
}

/* ----------------------------------------------------------
   6. TOP-CALLER LISTE – klickbare Zeilen
   ---------------------------------------------------------- */
.top-caller-row {
    display: flex !important;
    align-items: center !important;
    padding: 0.5rem 0.6rem !important;
    border-radius: 8px !important;
    transition: background 0.15s !important;
    cursor: pointer !important;
    gap: 0.6rem !important;
}

.top-caller-row:hover {
    background: rgba(249,115,22,0.08) !important;
}

.top-caller-rank {
    width: 22px !important;
    height: 22px !important;
    background: #f97316 !important;
    color: #fff !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
}

.top-caller-num {
    flex: 1 !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: #343a40 !important;
}

.top-caller-count {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    color: #f97316 !important;
    background: rgba(249,115,22,0.1) !important;
    border-radius: 20px !important;
    padding: 2px 8px !important;
}

/* ----------------------------------------------------------
   7. LETZTE ANRUFE – bessere Zeilentrennung
   ---------------------------------------------------------- */
.rc-item {
    border-radius: 10px !important;
    padding: 0.65rem 0.75rem !important;
    margin-bottom: 0.4rem !important;
    transition: background 0.15s, transform 0.15s !important;
    border: 1px solid transparent !important;
}

.rc-item:hover {
    background: rgba(249,115,22,0.06) !important;
    border-color: rgba(249,115,22,0.2) !important;
    transform: translateX(3px) !important;
}

.rc-num {
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    color: #1a1a2e !important;
}

.rc-meta {
    font-size: 0.75rem !important;
    color: #9aa3af !important;
}

/* ----------------------------------------------------------
   8. CHART WRAPPER – Skeleton-Loading Placeholder
   ---------------------------------------------------------- */
.chart-wrap {
    border-radius: 14px !important;
    border: 1px solid rgba(0,0,0,0.07) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
    background: #ffffff !important;
    padding: 1.25rem !important;
}

.chart-wrap h3 {
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
    color: #6c757d !important;
    margin-bottom: 1rem !important;
    font-weight: 600 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    padding-bottom: 0.6rem !important;
}

/* Skeleton-Animation für leere Charts */
canvas:empty,
.chart-container:empty::after {
    content: "" !important;
    display: block !important;
    height: 240px !important;
    border-radius: 8px !important;
    background: linear-gradient(
            90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%
    ) !important;
    background-size: 200% 100% !important;
    animation: skeleton-shimmer 1.5s infinite !important;
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ----------------------------------------------------------
   9. SIDEBAR – besserer Hover-Kontrast
   ---------------------------------------------------------- */
.sidebar-nav li a {
    border-radius: 8px !important;
    transition: background 0.2s, padding-left 0.2s !important;
    margin-bottom: 2px !important;
}

.sidebar-nav li a:not(.active):hover {
    background: rgba(79,70,229,0.12) !important;
    padding-left: 1.1rem !important;
}

.sidebar-nav li a.active {
    background: linear-gradient(90deg, #391894 0%, #7c2dc0 55%, #60185d 100%) !important;
    border-left: none !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,.3) !important;
}

/* ----------------------------------------------------------
   10. TOPBAR – mehr Abstand zwischen Chips
   ---------------------------------------------------------- */
.db-topbar {
    gap: 1rem !important;
}

.balance-chip {
    border-radius: 20px !important;
    padding: 0.35rem 0.9rem !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
}

.account-switcher {
    margin-left: 0.5rem !important;
}

/* ----------------------------------------------------------
   11. RESPONSIVE – Mobile Anpassungen
   ---------------------------------------------------------- */
@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .home-hero {
        padding: 1rem !important;
    }

    .hero-number {
        font-size: 1.3rem !important;
    }

    .insight-card {
        margin-bottom: 1rem !important;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
    }

    .stat-num {
        font-size: 1.4rem !important;
    }

    .stat-card-home {
        min-height: 120px !important;
        padding: 1rem 0.75rem !important;
    }
}
/* ── Fähigkeiten – Clean Design (überschreibt ältere agent-card Stile) ───── */
.skill-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: box-shadow .15s ease;
}
.skill-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,.09);
}
.skill-item-parent {
    border-left: 4px solid #f97316;
}
.skill-item-child {
    border-left: 3px solid #ec4899;
}
.skill-item-header {
    background: #fff;
}
.skill-item-details {
    background: #f8f9fa;
}
.skill-children {
    padding: 0.5rem 0 0.25rem 1.5rem;
    border-top: 1px solid #f0f2f5;
    background: #f8f9fc;
}
.toggle-icon {
    transition: transform .2s ease;
    display: inline-block;
}
.toggle-children.expanded .toggle-icon {
    transform: rotate(90deg);
}

/* ── VersOffice Theme: Login-Seite Feinabstimmung ─────────────────── */
.auth-body hr {
    border-color: rgba(255,255,255,0.12);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

/* Navbar/Header Primary auf Orange umstellen */
.navbar-custom {
    background: linear-gradient(135deg, #0a0f2e 0%, #0d1540 100%) !important;
    border-bottom: 2px solid rgba(249,115,22,0.4);
}

/* Dashboard Hero-Banner */
.home-hero {
    background: linear-gradient(135deg, #0a0f2e 0%, #0d1b4b 100%) !important;
    border: 1px solid rgba(249,115,22,0.15) !important;
}

.home-hero .hero-number,
.home-hero .hero-label {
    color: #fff !important;
}

/* Config-Tabs hover in Orange */
.nav-tabs-custom .nav-link:hover {
    background: rgba(249,115,22,0.10) !important;
    color: #f97316 !important;
}

/* Outline-Button auf Orange */
.btn-outline-custom {
    border: 2px solid #f97316 !important;
    color: #f97316 !important;
    background: transparent !important;
}
.btn-outline-custom:hover {
    background: #f97316 !important;
    color: #fff !important;
}
/* ══════════════════════════════════════════════════════════════════════
   VERSOFFICE AUTH – Buttons & Zusatzstyles (alle Auth-Seiten)
   ══════════════════════════════════════════════════════════════════════ */

/* Haupt-Submit (Login: btn-auth) */
.auth-wrapper .btn-auth {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    border: none !important; border-radius: 10px !important;
    padding: 13px 30px !important; font-weight: 700 !important;
    text-transform: uppercase !important; letter-spacing: 1px !important;
    color: #fff !important; font-size: 0.9rem !important;
    width: 100% !important; margin-top: 0.75rem !important;
    box-shadow: 0 4px 15px rgba(249,115,22,0.3) !important;
    transition: all 0.25s ease !important;
}
.auth-wrapper .btn-auth:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(249,115,22,0.45) !important;
    color: #fff !important;
}

/* Register-Button (btn-primary-custom) */
.auth-wrapper .btn-primary-custom {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    border: none !important; color: #fff !important;
    border-radius: 10px !important; font-weight: 700 !important;
    text-transform: uppercase !important; letter-spacing: 1px !important;
    font-size: 0.9rem !important; padding: 13px 30px !important;
    box-shadow: 0 4px 15px rgba(249,115,22,0.3) !important;
    transition: all 0.25s ease !important;
}
.auth-wrapper .btn-primary-custom:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(249,115,22,0.45) !important;
    color: #fff !important;
}

/* "Anmelden"-Link unter Registrieren (btn-outline-primary-custom) */
.auth-wrapper .btn-outline-primary-custom {
    background: transparent !important;
    border: 2px solid rgba(249,115,22,0.5) !important;
    color: #f97316 !important; border-radius: 10px !important;
    font-weight: 600 !important; text-transform: uppercase !important;
    letter-spacing: 0.8px !important; font-size: 0.875rem !important;
    padding: 10px 30px !important; display: inline-block !important;
    text-decoration: none !important; margin-top: 0.5rem !important;
    transition: all 0.25s ease !important;
}
.auth-wrapper .btn-outline-primary-custom:hover {
    background: rgba(249,115,22,0.12) !important;
    border-color: #f97316 !important;
    color: #f97316 !important; transform: translateY(-1px) !important;
}

/* Forgot-Password Reset-Button (btn-primary) */
.auth-wrapper .btn-primary {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    border: none !important; color: #fff !important;
    font-weight: 700 !important; text-transform: uppercase !important;
    letter-spacing: 1px !important; border-radius: 10px !important;
    padding: 13px 30px !important;
    box-shadow: 0 4px 15px rgba(249,115,22,0.3) !important;
    transition: all 0.25s !important;
}
.auth-wrapper .btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(249,115,22,0.45) !important;
    color: #fff !important;
}

/* Checkbox & Datenschutz-Links */
.auth-body .form-check-label { color: rgba(255,255,255,0.55) !important; font-size: 0.82rem !important; }
.auth-body .form-check-label a { color: #f97316 !important; text-decoration: none !important; }
.auth-body .form-check-label a:hover { color: #fb923c !important; text-decoration: underline !important; }
.auth-body .form-check-input { background-color: rgba(255,255,255,0.08) !important; border-color: rgba(255,255,255,0.25) !important; }
.auth-body .form-check-input:checked { background-color: #f97316 !important; border-color: #f97316 !important; }

/* "Bereits ein Konto?" Text */
.auth-body .text-center p { color: rgba(255,255,255,0.45) !important; }

/* Alerts auf dunklem Grund */
.auth-body .alert-danger-custom {
    background: rgba(220,53,69,0.15) !important; border-left: 4px solid #dc3545 !important;
    color: #f87171 !important; border-radius: 8px !important;
    border-top: none !important; border-right: none !important; border-bottom: none !important;
}
.auth-body .alert-success-custom {
    background: rgba(25,135,84,0.15) !important; border-left: 4px solid #198754 !important;
    color: #6ee7b7 !important; border-radius: 8px !important;
}

/* ══════════════════════════════════════════════════════════════════════
   GLOBAL UI MODERNIZATION – Dashboard content area
   Applied to .db-content scope to avoid touching auth / sidebar styles.
   ══════════════════════════════════════════════════════════════════════ */

/* ─── config-card: lighter shadow, crisper border ─────────────────── */
.db-content .config-card {
    box-shadow: 0 1px 6px rgba(0,0,0,.06) !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
}

/* ─── btn-primary inside dashboard: slate blue instead of default BS ─ */
.db-content .btn-primary {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}
.db-content .btn-primary:hover, .db-content .btn-primary:focus {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}

/* ─── btn-outline-primary: softer ─────────────────────────────────── */
.db-content .btn-outline-primary {
    color: #2563eb !important;
    border-color: #2563eb !important;
}
.db-content .btn-outline-primary:hover {
    background-color: #eff6ff !important;
    border-color: #2563eb !important;
    color: #1d4ed8 !important;
}

/* ─── Standard Bootstrap cards: consistent with design system ──────── */
.db-content .card {
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.05) !important;
    border-radius: 10px !important;
}
.db-content .card .card-body { padding: .85rem !important; }

/* ─── Alerts: softer, less aggressive ─────────────────────────────── */
.db-content .alert {
    border-radius: 10px !important;
    border: none !important;
    font-size: .875rem;
}
.db-content .alert-info    { background: #eff6ff !important; color: #1e40af !important; border-left: 3px solid #3b82f6 !important; }
.db-content .alert-success { background: #f0fdf4 !important; color: #166534 !important; border-left: 3px solid #22c55e !important; }
.db-content .alert-warning { background: #fffbeb !important; color: #854d0e !important; border-left: 3px solid #f59e0b !important; }
.db-content .alert-danger  { background: #fef2f2 !important; color: #991b1b !important; border-left: 3px solid #f87171 !important; }

/* ─── Dropdown menus: cleaner ──────────────────────────────────────── */
.db-content .dropdown-menu {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.09) !important;
    font-size: .85rem !important;
    padding: .35rem .35rem !important;
}
.db-content .dropdown-item {
    border-radius: 6px !important;
    padding: .45rem .75rem !important;
    color: #334155 !important;
}
.db-content .dropdown-item:hover, .db-content .dropdown-item:focus {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}
.db-content .dropdown-divider { border-color: #e2e8f0 !important; margin: .25rem 0 !important; }

/* ─── Modal: crisper corners, lighter backdrop ─────────────────────── */
.db-content ~ .modal .modal-content,
.modal .modal-content {
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.15) !important;
}
.modal .modal-header {
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 1rem 1.25rem !important;
}
.modal .modal-footer {
    border-top: 1px solid #e2e8f0 !important;
    padding: .75rem 1.25rem !important;
}
.modal .modal-title { font-size: 1rem !important; font-weight: 700 !important; color: #1e293b !important; }

/* ─── Table (global for dashboard content) ─────────────────────────── */
.db-content .table thead th {
    font-size: .72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .05em !important;
    color: #94a3b8 !important;
    border-bottom-color: #e2e8f0 !important;
}
.db-content .table-light { background: #f8fafc !important; }
.db-content .table > :not(:first-child) { border-top: 1px solid #e2e8f0 !important; }

/* ─── Form controls: cleaner borders ──────────────────────────────── */
.db-content .form-control, .db-content .form-select {
    border-color: #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: .875rem !important;
    color: #334155 !important;
}
.db-content .form-control:focus, .db-content .form-select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important;
}

/* ─── Input group: consistent look ────────────────────────────────── */
.db-content .input-group-text {
    border-color: #e2e8f0 !important;
    background: #f8fafc !important;
    color: #64748b !important;
    font-size: .875rem !important;
}

/* ─── Badges (default Bootstrap): pill-shaped ──────────────────────── */
.db-content .badge { border-radius: 20px !important; font-weight: 600 !important; }

/* ─── Readonly-Modus für Nur-Lesen-Team-Member ──────────────────────── */
.config-readonly-mode input,
.config-readonly-mode select,
.config-readonly-mode textarea,
.config-readonly-mode .form-control,
.config-readonly-mode .form-select,
.config-readonly-mode .form-check-input {
    pointer-events: none !important;
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    opacity: .75 !important;
    cursor: not-allowed !important;
}
.config-readonly-mode button[type="submit"],
.config-readonly-mode .btn-save,
.config-readonly-mode input[type="submit"] {
    pointer-events: none !important;
    opacity: .35 !important;
    cursor: not-allowed !important;
}
.config-readonly-mode .nav-link[data-bs-toggle] { pointer-events: auto !important; opacity: 1 !important; }

/* ── Passwort-Sichtbarkeit Toggle (alle Formulare im Dashboard) ──── */
.pw-toggle-wrap { position: relative; }
.pw-toggle-btn {
    position: absolute; right: .65rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; padding: .25rem .3rem;
    color: #94a3b8; font-size: .85rem; cursor: pointer; z-index: 5;
    transition: color .15s; line-height: 1;
}
.pw-toggle-btn:hover { color: #475569; }
.pw-toggle-btn:focus { outline: none; }
.pw-toggle-wrap .form-control { padding-right: 2.4rem; }