/**
 * Kundenportal Styles
 * Design analog zum Intranet & UVA Portal (Bootstrap 5 + Custom Variables)
 */

/* ==================== CSS Variables (Intranet Colors) ==================== */
:root {
    /* CI Colors */
    --ci-main: #1d1d35;
    --ci-primary: #1d66b3;
    --ci-secondary: #9593a1;

    /* Neutral Colors */
    --text-color: #9593a1;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --border-color: #e9e9e9;
    --bg-light: #f8f9fa;
    --card-bg: #ffffff;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

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

body {
html {
    height: 100%;
}
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    min-height: 100vh;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ==================== Header ==================== */
.portal-header {
    background: var(--ci-main);
    color: white;
    padding: var(--spacing-lg) 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}


/* Enhanced dropdown styles */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    /* Remove custom animation to prevent conflict with Bootstrap */
}

/* Bootstrap handles the dropdown animation, so we don't need custom keyframes */

.dropdown-item {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    border-left-color: var(--ci-primary);
    transform: translateX(3px);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Badge in dropdown */
.dropdown-item .badge {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Notification badge animation */
.dropdown-item .badge.bg-danger {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    max-height: 40px;
}

.header-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-left: var(--spacing-md);
}

/* Header with user menu */
.portal-header .dropdown-toggle {
    text-decoration: none;
    color: white;
    font-weight: 500;
}

.portal-header .dropdown-toggle:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ==================== Main Content ==================== */
.portal-main {
    flex: 1;
    padding-top: 120px;
    padding-bottom: 70px;
}

/* ==================== Authentication Pages ==================== */
.auth-wrapper {
    min-height: 100vh;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
    background: linear-gradient(135deg, var(--ci-main) 0%, var(--ci-primary) 100%);
}

.auth-card {
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: var(--spacing-xl);
    max-width: 450px;
    width: 100%;
}

.auth-card h4 {
    font-weight: 600;
    color: var(--text-dark);
}

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

.auth-card .input-group-text {
    background-color: var(--bg-light);
    border-right: none;
    color: var(--ci-primary);
}

.auth-card .form-control {
    border-left: none;
}

.auth-card .form-control:focus {
    border-color: var(--ci-primary);
    box-shadow: 0 0 0 0.2rem rgba(29, 102, 179, 0.25);
}

/* ==================== Card Components ==================== */
.custom-card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.custom-card:hover {
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.3s ease;
}

.custom-card .card-body {
    padding: var(--spacing-xl);
}

/* Card Header & Body Custom */
.card-header-custom {
    background: linear-gradient(135deg, var(--ci-main) 0%, var(--ci-primary) 100%);
    color: white;
    padding: var(--spacing-xl);
    text-align: center;
    border-bottom: none;
}

.card-header-custom i {
    color: rgba(255, 255, 255, 0.9);
}

.card-header-custom h2 {
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.card-header-custom p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}

.card-body-custom {
    padding: var(--spacing-xl);
}

/* ==================== Info Boxes ==================== */
.info-box {
    background: var(--bg-light);
    border-left: 4px solid var(--ci-primary);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 0.5rem;
    margin-bottom: var(--spacing-md);
}

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ci-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
}

.amount-value {
    font-size: 18px;
    font-weight: 600;
}

/* ==================== Company Selection ==================== */
.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.company-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: var(--spacing-xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.company-card:hover {
    border-color: var(--ci-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(29, 102, 179, 0.2);
}

.company-icon {
    color: var(--ci-primary);
    margin-bottom: var(--spacing-md);
}

.company-card h5 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

/* ==================== Dashboard ==================== */
.welcome-section h3 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-dark);
}

/* ==================== Icons ==================== */
.success-icon,
.error-icon,
.info-icon {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== Buttons ==================== */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    /* Touch optimization */
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* Touch-optimized button sizes */
.btn-sm {
    min-height: 40px;
    min-width: 40px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    min-height: 52px;
    min-width: 52px;
    padding: 0.875rem 1.5rem;
    font-size: 1.125rem;
}

/* Touch feedback for buttons */
.btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Enhanced touch targets for dropdowns */
.dropdown-toggle {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Touch-optimized links */
.btn-link {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0.5rem 1rem;
}

/* Touch-optimized form controls */
.form-control, .form-select {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
    touch-action: manipulation;
}

.form-check {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

.form-check-input {
    min-width: 24px;
    min-height: 24px;
    margin-right: 0.75rem;
}

/* Touch-optimized pagination */
.pagination .page-link {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

/* Touch-optimized alerts */
.alert {
    position: relative;
    padding-right: 3rem; /* Space for close button */
}

.alert .btn-close {
    min-height: 44px;
    min-width: 44px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0.5rem;
}

.btn-primary {
    background-color: var(--ci-primary);
    border-color: var(--ci-primary);
}

.btn-primary:hover {
    background-color: #1554a3;
    border-color: #1554a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 102, 179, 0.3);
}

.btn-primary:disabled {
    background-color: var(--ci-secondary);
    border-color: var(--ci-secondary);
    transform: none;
}

.btn-outline-primary {
    color: var(--ci-primary);
    border-color: var(--ci-primary);
}

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

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 18px;
}

/* ==================== Alerts & Toasts ==================== */
.alert {
    border-radius: 0.5rem;
    border: none;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    min-width: 300px;
}

/* ==================== Footer ==================== */
.portal-footer {
    background: var(--ci-main);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--spacing-md) 0;
    font-size: 14px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.portal-footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: inherit;
}

.portal-footer .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ==================== Loading States ==================== */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Skeleton animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background-color: #e9ecef;
    background-image: linear-gradient(
        90deg,
        #e9ecef 0px,
        #f8f9fa 40px,
        #e9ecef 80px
    );
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 0.25rem;
}

/* Skeleton components */
.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.large {
    height: 1.5rem;
}

.skeleton-text.small {
    height: 0.75rem;
    width: 60%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-button {
    height: 44px;
    width: 120px;
    border-radius: 0.5rem;
}

.skeleton-card {
    height: 200px;
    margin-bottom: 1rem;
}

.skeleton-table-row {
    height: 60px;
    margin-bottom: 0.5rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid #f3f3f3;
    border-top: 0.25rem solid var(--ci-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading states for buttons */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

/* Skeleton for mobile cards */
.skeleton-mobile-card {
    height: 180px;
    margin-bottom: 1rem;
    border-left: 4px solid #e9ecef;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .portal-header {
        padding: var(--spacing-md) 0;
    }

    .header-subtitle {
        font-size: 12px;
    }

    .auth-wrapper {
        padding: var(--spacing-md);
    }

    .auth-card {
        padding: var(--spacing-lg);
    }

    .portal-main {
        padding-top: 100px;
        padding-bottom: 70px;
    }

    .portal-footer {
        font-size: 0.85rem;
        padding: var(--spacing-sm) 0;
    }

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

    .welcome-section h3 {
        font-size: 24px;
    }
    
    /* Company name truncation for mobile */
    .company-name-truncate-mobile {
        display: inline-block;
        max-width: 188px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }
    
    /* Adjust header button spacing on mobile */
    .portal-header .dropdown-toggle {
        padding-right: 0.5rem;
    }
    
    /* Mobile account card styles */
    .mobile-account-card {
        border-left: 4px solid var(--ci-primary);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .mobile-account-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .mobile-saldo-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .mobile-action-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ==================== Utility Classes ==================== */
.text-ci-primary {
    color: var(--ci-primary) !important;
}

.bg-ci-primary {
    background-color: var(--ci-primary) !important;
}

.border-ci-primary {
    border-color: var(--ci-primary) !important;
}

/* Unified Navigation (Mobile + Desktop) */
.mobile-navigation {
    position: fixed;
    top: 0;
    left: -100%;
    width: 320px;
    height: 100vh;
    background: var(--ci-main);
    z-index: 1050;
    transition: left 0.3s ease;
    overflow-y: auto;
    display: none; /* Standardmäßig versteckt */
}

.mobile-navigation.active {
    left: 0;
}

/* Desktop Navigation Styles */
@media (min-width: 992px) {
    .mobile-navigation {
        width: 350px; /* Breiter für Desktop */
        display: block; /* Immer verfügbar */
    }
    
    /* Desktop Hamburger Button */
    .desktop-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem;
        color: white;
        text-decoration: none;
        transition: all 0.2s ease;
    }
    
    .desktop-menu-toggle:hover {
        color: rgba(255, 255, 255, 0.8);
        transform: translateY(-1px);
    }
    
    .desktop-menu-toggle:focus {
        outline: 2px solid rgba(255, 255, 255, 0.5);
        outline-offset: 2px;
    }
    
    /* Hide old desktop navigation */
    .desktop-nav {
        display: none !important;
    }
}

/* Mobile Navigation Styles */
@media (max-width: 991.98px) {
    .mobile-navigation {
        display: block; /* Auf mobilen Geräten verfügbar */
    }
    
    .desktop-menu-toggle {
        display: none; /* Nur auf Desktop zeigen */
    }
}

.mobile-nav-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-nav-content {
    padding: var(--spacing-md) 0;
}

.mobile-nav-section {
    margin-bottom: var(--spacing-lg);
}

.mobile-nav-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.mobile-nav-item {
    margin: 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    color: white;
    text-decoration: none;
    border: none;
    background: none;
    text-align: left;
    transition: background-color 0.2s ease;
    min-height: 48px;
}

.mobile-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.mobile-nav-link.active {
    background-color: var(--ci-primary);
    color: white;
}

.mobile-nav-link.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Mobile navigation overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none; /* Verhindert Klicks wenn inaktiv */
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Erlaubt Klicks wenn aktiv */
}

/* Mobile menu toggle button */
#mobileMenuToggle {
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem;
}

#mobileMenuClose {
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem;
}

/* ==================== Accordion Components ==================== */
.custom-accordion {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.accordion-item {
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

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

.accordion-header {
    margin: 0;
    background: var(--bg-light);
}

.accordion-button {
    background: transparent;
    color: var(--text-dark);
    font-weight: 500;
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    transition: all 0.2s ease;
    position: relative;
}

.accordion-button:not(.collapsed) {
    background: var(--ci-primary);
    color: white;
}

.accordion-button:focus {
    box-shadow: none;
    border: none;
    outline: none;
}

.accordion-button::after {
    content: '\f107'; /* fa-chevron-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    transition: transform 0.2s ease;
    margin-left: auto;
}

.accordion-button:not(.collapsed)::after {
    content: '\f106'; /* fa-chevron-up */
    transform: rotate(180deg);
}

.accordion-button:not(.collapsed):hover {
    background: #1554a3;
}

.accordion-button:hover {
    background: rgba(29, 102, 179, 0.1);
}

.accordion-collapse {
    transition: all 0.3s ease;
}

.accordion-body {
    padding: var(--spacing-lg);
}

/* Mobile Accordion */
@media (max-width: 768px) {
    .custom-accordion {
        margin-bottom: var(--spacing-md);
    }
    
    .accordion-button {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    .accordion-body {
        padding: var(--spacing-md);
    }
    
    /* Info accordion for mobile */
    .info-accordion .accordion-button {
        background: var(--bg-light);
        border-left: 4px solid var(--ci-primary);
    }
    
    .info-accordion .accordion-button:not(.collapsed) {
        background: var(--ci-primary);
        color: white;
        border-left-color: var(--ci-primary);
    }
}

/* Compact accordion for dense information */
.accordion-compact .accordion-button {
    padding: var(--spacing-sm) var(--spacing-md);
    min-height: 40px;
    font-size: 0.875rem;
}

.accordion-compact .accordion-body {
    padding: var(--spacing-md);
    font-size: 0.875rem;
}

/* Accordion with icons */
.accordion-with-icons .accordion-button {
    padding-left: 3rem;
    position: relative;
}

.accordion-with-icons .accordion-button i {
    position: absolute;
    left: var(--spacing-lg);
    top: 50%;
    transform: translateY(-50%);
    color: var(--ci-primary);
}

.accordion-with-icons .accordion-button:not(.collapsed) i {
    color: white;
}

/* Accordion for cards */
.card-accordion {
    border: none;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    margin-bottom: var(--spacing-md);
}

.card-accordion .accordion-item {
    border: none;
    border-radius: 0.75rem;
    margin-bottom: var(--spacing-sm);
}

.card-accordion .accordion-button {
    border-radius: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.card-accordion .accordion-button:not(.collapsed) {
    background: var(--ci-primary);
    color: white;
    border-color: var(--ci-primary);
}

/* ==================== Form Validation ==================== */
/* Realtime validation styles */
.form-control {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

/* Validation feedback styles */
.valid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #198754;
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.form-control.is-valid ~ .valid-feedback,
.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Realtime validation indicators */
.validation-indicator {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.validation-indicator.valid {
    color: #198754;
    opacity: 1;
}

.validation-indicator.invalid {
    color: #dc3545;
    opacity: 1;
}

/* Input group with validation */
.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .form-control.is-valid ~ .input-group-text {
    border-color: #198754;
    color: #198754;
}

.input-group .form-control.is-invalid ~ .input-group-text {
    border-color: #dc3545;
    color: #dc3545;
}

/* Form field wrapper */
.form-field {
    position: relative;
    margin-bottom: 1.5rem;
}

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

.form-field .required-indicator {
    color: #dc3545;
    margin-left: 0.25rem;
}

/* Validation messages with animations */
.validation-message {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    animation: slideInDown 0.3s ease;
}

.validation-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.validation-message.success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.validation-message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile form validation */
@media (max-width: 768px) {
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }
    
    .validation-message {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .form-field {
        margin-bottom: 1.25rem;
    }
    
    .validation-indicator {
        right: 0.5rem;
        font-size: 0.9rem;
    }
}

/* ==================== Enhanced Mobile Typography ==================== */
@media (max-width: 768px) {
    /* Improved readability */
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    h1 {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 0.875rem;
    }
    
    h3 {
        font-size: 1.25rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    h4 {
        font-size: 1.125rem;
        line-height: 1.3;
        margin-bottom: 0.625rem;
    }
    
    h5 {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    h6 {
        font-size: 0.875rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    /* Better spacing for mobile */
    .custom-card {
        margin-bottom: 1.25rem;
        padding: 1rem;
    }
    
    .custom-card .card-body {
        padding: 1rem;
    }
    
    /* Improved touch targets */
    .btn {
        min-height: 48px;
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        min-height: 44px;
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Better form spacing */
    .form-control {
        font-size: 16px;
        min-height: 48px;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .form-field {
        margin-bottom: 1.25rem;
    }
    
    .form-field label {
        font-size: 1rem;
        margin-bottom: 0.625rem;
        font-weight: 600;
    }
    
    /* Table improvements */
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem;
        vertical-align: middle;
    }
    
    /* Alert improvements */
    .alert {
        font-size: 0.9rem;
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    /* Breadcrumb improvements */
    .breadcrumb {
        font-size: 0.875rem;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
}

/* ==================== Touch Gestures ==================== */
/* Swipe indicators */
.swipe-hint {
    position: relative;
    overflow: hidden;
}

.swipe-hint::after {
    content: '';
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2rem;
    height: 0.25rem;
    background: linear-gradient(90deg, transparent, rgba(29, 102, 179, 0.3), transparent);
    border-radius: 0.125rem;
    animation: swipeHint 2s ease-in-out infinite;
}

@keyframes swipeHint {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(-50%) scaleX(0.8);
    }
    50% {
        opacity: 0.8;
        transform: translateX(-50%) scaleX(1.2);
    }
}

/* Touch-friendly swipe areas */
.swipe-area {
    position: relative;
    min-height: 100px;
    touch-action: pan-x;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.swipe-area:active {
    cursor: grabbing;
}

/* Swipe navigation for mobile */
.swipe-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(29, 29, 53, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.swipe-navigation.active {
    transform: translateY(0);
}

.swipe-nav-item {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.swipe-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.swipe-nav-item.active {
    background-color: var(--ci-primary);
}

/* Pull-to-refresh indicator */
.pull-to-refresh {
    position: relative;
    padding-top: 2rem;
    margin-top: -2rem;
    transition: margin-top 0.3s ease;
}

.pull-to-refresh.pulling {
    margin-top: 0;
}

.pull-to-refresh-spinner {
    display: none;
    text-align: center;
    padding: 1rem;
}

.pull-to-refresh.pulling .pull-to-refresh-spinner {
    display: block;
}

/* Touch feedback */
.touch-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(29, 102, 179, 0.1);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.touch-feedback.active {
    opacity: 1;
}

/* Improved mobile interactions */
@media (max-width: 768px) {
    .swipe-navigation {
        display: flex;
    }
    
    .mobile-card {
        transform: translateZ(0); /* Hardware acceleration */
        backface-visibility: hidden;
    }
    
    /* Better scrolling */
    .mobile-scroll-container {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}


/* ==================== Breadcrumb Navigation ==================== */
.breadcrumb-navigation {
    background: var(--bg-light);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
    position: relative;
}

/* Bootstrap-Standard-Separator deaktivieren (kollidiert mit eigenem ::after) */
.breadcrumb-list .breadcrumb-item + .breadcrumb-item::before {
    content: none;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb-item.active::before {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--ci-primary);
    border-radius: 1px;
}

.breadcrumb-link {
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.breadcrumb-link:hover {
    background-color: var(--ci-primary);
    color: white;
    border-color: var(--ci-primary);
}

.breadcrumb-text {
    color: var(--text-muted);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

/* Breadcrumb responsive adjustments */
@media (max-width: 768px) {
    .breadcrumb-navigation {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .breadcrumb-item {
        margin-right: 0.25rem;
    }
    
    .breadcrumb-item:not(:last-child)::after {
        margin-left: 0.25rem;
        font-size: 0.875rem;
    }
    
    .breadcrumb-link,
    .breadcrumb-text {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .breadcrumb-link i,
    .breadcrumb-text i {
        font-size: 0.875rem;
    }
}

/* ==================== Brand Colors (CI) ==================== */

/* ÖGK - Österreichische Gesundheitskasse (Grün) */
.brand-oegk { --brand-color: #00843D; --brand-light: #2AAE66; --brand-bg: #e8f5ee; }
.brand-oegk .btn-brand { background: #00843D; color: #fff; border: none; border-radius: 0.375rem; padding: 0.25rem 0.75rem; font-size: 0.875rem; transition: background 0.2s; display: inline-flex; align-items: center; justify-content: center; }
.brand-oegk .btn-brand:hover { background: #006B31; color: #fff; }
.brand-oegk .btn-outline-brand { color: #00843D; border: 1px solid #00843D; background: transparent; border-radius: 0.375rem; padding: 0.25rem 0.75rem; font-size: 0.875rem; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; }
.brand-oegk .btn-outline-brand:hover { background: #00843D; color: #fff; }

/* BMF / Finanzamt Österreich (Rot) */
.brand-bmf { --brand-color: #E6320F; --brand-light: #F05A3C; --brand-bg: #fce8e4; }
.brand-bmf .btn-brand { background: #E6320F; color: #fff; border: none; border-radius: 0.375rem; padding: 0.25rem 0.75rem; font-size: 0.875rem; transition: background 0.2s; display: inline-flex; align-items: center; justify-content: center; }
.brand-bmf .btn-brand:hover { background: #C42A0D; color: #fff; }
.brand-bmf .btn-outline-brand { color: #E6320F; border: 1px solid #E6320F; background: transparent; border-radius: 0.375rem; padding: 0.25rem 0.75rem; font-size: 0.875rem; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; }
.brand-bmf .btn-outline-brand:hover { background: #E6320F; color: #fff; }
