/**
 * 🚀 FINANCECORE COMPONENTS SYSTEM
 * Einheitliches UI-Komponenten-System für alle 36 PHP-Dateien
 * Erstellt: 2025-07-27
 * Zweck: 100% Konsistenz zwischen allen Seiten
 */

/* ========================================
   ACCESSIBILITY FOUNDATION
======================================== */

/* Screen Reader Only Content */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus Management */
*:focus {
    outline: 2px solid #2563eb !important;
    outline-offset: 2px !important;
}

.focus-visible {
    outline: 2px solid #2563eb !important;
    outline-offset: 2px !important;
}

/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #2563eb;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
}

.skip-link:focus {
    top: 6px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid !important;
    }
    
    .summary-card {
        border: 2px solid #000000 !important;
    }
    
    .nav-item {
        border: 1px solid !important;
    }
    
    .form-input,
    .form-select {
        border: 2px solid #000000 !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   FILTER-SYSTEME - VOLLSTÄNDIG VEREINHEITLICHT
======================================== */

/* Basis Filter-Container - FÜR ALLE SEITEN GLEICH */
.filter-section,
.transfer-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

/* Filter-Header - EINHEITLICH */
.section-header,
.filter-header {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Section-Subtitle */
.section-subtitle {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

/* Filter-Grid-Layouts - STANDARDISIERT */
.filter-row,
.filter-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.filter-grid-three {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.filter-grid-four {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* Filter-Gruppe - KONSISTENT */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* Filter-Buttons */
.filter-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* ========================================
   FORM UX ENHANCEMENT SYSTEM - PHASE 3
======================================== */

/* Enhanced Form Inputs */
.form-input,
.form-select {
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    background: #ffffff;
    width: 100%;
}

.form-input:focus,
.form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Validation States */
.form-input.valid,
.form-select.valid {
    border-color: #10b981;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2310b981'%3e%3cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.form-input.invalid,
.form-select.invalid,
.form-input.field-error,
.form-select.field-error {
    border-color: #ef4444;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ef4444'%3e%3cpath fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Required Field Indicator */
.required-asterisk {
    color: #ef4444 !important;
    font-weight: 600;
}

/* Field Error Messages */
.field-error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.field-error-message::before {
    content: "⚠";
    font-size: 14px;
}

/* Standard Label System - No Floating Effect */
.label-wrapper,
.floating-label-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.label-wrapper label,
.floating-label-wrapper label {
    display: block;
    position: static;
    left: auto;
    top: auto;
    transform: none;
    background: transparent;
    padding: 0;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    pointer-events: auto;
    z-index: auto;
}

.label-wrapper input:focus + label,
.floating-label-wrapper input:focus + label {
    color: #2563eb;
}

.label-wrapper input.field-error + label,
.floating-label-wrapper input.field-error + label {
    color: #ef4444;
}

/* Enhanced File Input */
.file-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-input-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 12px 20px;
    border: 2px dashed #d1d5db;
    background: #f9fafb;
    color: #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-btn:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

.file-input-feedback {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
}

/* Enhanced Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

/* Form Progress Indicator */
.form-progress {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 24px;
}

.form-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #10b981);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Form Steps */
.form-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 20px;
}

.form-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    position: relative;
}

.form-step::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

.form-step:last-child::after {
    display: none;
}

.form-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.form-step.active .form-step-number {
    background: #2563eb;
    color: white;
}

.form-step.completed .form-step-number {
    background: #10b981;
    color: white;
}

.form-step.completed .form-step-number::after {
    content: '✓';
}

.form-step-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.form-step.active .form-step-label {
    color: #2563eb;
}

/* Enhanced Buttons for Forms */
.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-group .btn {
    flex: 1;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Form Help Text */
.form-help {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}

.form-help.success {
    color: #10b981;
}

.form-help.error {
    color: #ef4444;
}

/* ========================================
   AVATAR-SYSTEME - VOLLSTÄNDIG EINHEITLICH
======================================== */

/* Avatar-Varianten - Konsistente User-Avatare */
.user-avatar,
.avatar-black {
    background: #000000 !important;
    color: #ffffff !important;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
}

/* ========================================
   CARD-SYSTEME - VOLLSTÄNDIG STANDARDISIERT
======================================== */

/* Basis-Card-Styling - FÜR ALLE CARDS GLEICH */
.metric-card,
.summary-card,
.category-card,
.balance-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.metric-card:hover,
.summary-card:hover,
.category-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Metric Card - FÜR STATISTIKEN */
.metric-card {
    text-align: center;
}

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

.metric-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
}

.metric-icon.income {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.metric-icon.expense {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.metric-title {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
}

.metric-amount {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    font-family: 'SF Mono', monospace;
}

.metric-change {
    font-size: 12px;
    font-weight: 500;
}

.metric-change.positive {
    color: #16a34a;
}

.metric-change.negative {
    color: #dc2626;
}

/* Summary Card - FÜR ZUSAMMENFASSUNGEN */
.summary-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.summary-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.summary-content {
    flex: 1;
    min-width: 0;
}

.summary-label {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    font-family: 'SF Mono', monospace;
}

/* Balance Card - LESBAR MIT HELLEM HINTERGRUND */
.balance-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #000000;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.balance-content {
    position: relative;
    z-index: 2;
}

.balance-label {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    font-family: 'SF Mono', monospace;
}

.card-number {
    font-size: 14px;
    font-family: 'SF Mono', monospace;
    opacity: 0.7;
    margin-bottom: 4px;
}

.card-date {
    font-size: 12px;
    opacity: 0.6;
}

.card-brand {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    font-weight: 700;
    opacity: 0.3;
}

/* Category Card - KATEGORIEN */
.category-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.category-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.category-details {
    flex: 1;
    min-width: 0;
}

.category-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.category-amount {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    font-family: 'SF Mono', monospace;
}

.category-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.category-percentage {
    font-weight: 600;
    color: #111827;
}

.category-count {
    color: #6b7280;
}

.category-progress {
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #111827, #16a34a);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ========================================
   GRID-LAYOUTS - VOLLSTÄNDIG VEREINHEITLICHT
======================================== */

/* 3-Spalten-Grid für Haupt-Cards */
.cards-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

/* 4-Spalten-Grid für Summary Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* 3-Spalten-Grid für Statistiken */
.stats-grid-three {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

/* Kategorien-Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* Charts-Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

/* Formular-Grids */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.form-grid-three {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.form-grid-mixed {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

/* ========================================
   BUTTON-SYSTEME - VOLLSTÄNDIG STANDARDISIERT
======================================== */

/* Basis-Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

/* Button-Größen */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
}

.btn-full {
    width: 100%;
}

/* Button-Varianten - EINHEITLICHE DEFINITION */
.btn-primary {
    background: #2563eb !important;
    color: #ffffff !important;
    border: 2px solid #2563eb !important;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 16px;
    min-height: 44px;
}

.btn-primary:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: 2px solid #9ca3af !important;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 10px 16px;
    min-height: 44px;
}

.btn-secondary:hover {
    background: #e5e7eb !important;
    border-color: #6b7280 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-success {
    background: #10b981 !important;
    color: #ffffff !important;
    border: 2px solid #10b981 !important;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 16px;
    min-height: 44px;
}

.btn-success:hover {
    background: #059669 !important;
    border-color: #059669 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: #ef4444 !important;
    color: #ffffff !important;
    border: 2px solid #ef4444 !important;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 16px;
    min-height: 44px;
}

.btn-danger:hover {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}



/* Button-Gruppen */
.button-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.button-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Action-Buttons */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ========================================
   TABELLEN-SYSTEME - VOLLSTÄNDIG VEREINHEITLICHT
======================================== */

/* Tabellen-Container */
.table-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-bottom: 24px;
}

.table-responsive {
    overflow-x: auto;
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.table-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.table-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Basis-Tabelle */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: #f9fafb;
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

/* Table cell variants */
.table-cell {
    padding: 12px;
    vertical-align: top;
}

.table-cell-date {
    padding: 12px;
    vertical-align: top;
}

.table-cell-date .date-main {
    font-weight: 500;
    color: #333;
}

.table-cell-date .date-time {
    font-size: 12px;
    color: #666;
}

.table-cell-flow {
    padding: 12px;
    vertical-align: top;
}

.transfer-flow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.transfer-from {
    background: #fef2f2;
    color: #dc2626;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.transfer-to {
    background: #ecfdf5;
    color: #059669;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.transfer-arrow {
    color: #666;
}

.transfer-owners {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

.transfer-amount {
    font-weight: 600;
    color: #2196F3;
}

.transfer-description em {
    color: #999;
}

.transfer-source {
    font-size: 12px;
    color: #666;
}

.transfer-source em {
    color: #999;
}

.table tbody tr:hover {
    background: #f9fafb;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Tabellen-Ausrichtung */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Transaktions-spezifische Zellen */
.transaction-main {
    font-weight: 600;
    color: #111827;
}

.transaction-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.transaction-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Betrags-Formatierung */
.amount-positive {
    color: #16a34a;
    font-weight: 600;
}

.amount-negative {
    color: #dc2626;
    font-weight: 600;
}

.balance-amount {
    font-family: 'SF Mono', monospace;
    font-weight: 600;
}

/* ========================================
   STATUS-BADGES - VOLLSTÄNDIG STANDARDISIERT
======================================== */

/* Basis-Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
}

/* Badge-Varianten */
.status-active {
    background: #dcfce7;
    color: #16a34a;
}

.status-inactive {
    background: #fef3c7;
    color: #d97706;
}

.status-paid {
    background: #dcfce7;
    color: #16a34a;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-overdue {
    background: #fee2e2;
    color: #dc2626;
}

.success {
    background: #dcfce7;
    color: #16a34a;
}

.warning {
    background: #fef3c7;
    color: #d97706;
}

.error {
    background: #fee2e2;
    color: #dc2626;
}

.info {
    background: #dbeafe;
    color: #2563eb;
}

/* ========================================
   ALERT-SYSTEME - VOLLSTÄNDIG STANDARDISIERT
======================================== */

/* Basis-Alert */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* Alert-Varianten */
.alert-success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert-error,
.alert-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fed7aa;
}

.alert-info {
    background: #dbeafe;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* ========================================
   FORMULAR-ELEMENTE - VOLLSTÄNDIG STANDARDISIERT
======================================== */

/* Labels */
.label-text {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

/* Input-Elemente */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    background: #ffffff;
    transition: all 0.2s ease;
    min-height: 44px;
    font-weight: 500;
}

/* Spezielle Styling für Betrags-Eingabe */
input[name="amount"], 
#amount,
input[type="number"][name="amount"],
.amount-input,
input.amount-field {
    font-size: 20px !important;
    font-weight: 600 !important;
    padding: 16px 20px !important;
    min-height: 56px !important;
    text-align: right;
    background: #f0f9ff !important;
    border: 3px solid #3b82f6 !important;
    border-radius: 12px !important;
    min-width: 120px !important;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Upload-Bereiche */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #2563eb;
    background: #f0f9ff;
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.upload-main-text {
    font-weight: 500;
    color: #374151;
    margin: 0 0 4px 0;
}

.upload-help-text {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.upload-filename {
    margin-top: 8px;
    font-weight: 500;
    color: #16a34a;
}

/* ========================================
   LAYOUT-SPEZIFISCHE KLASSEN
======================================== */

/* Special-Layout für add-transaction.php */
.transaction-layout-grid {
    display: grid;
    grid-template-columns: 35% 65%;
    gap: 24px;
    align-items: start;
}

/* Transfer-Layout für transfer-money.php */
.transfer-layout-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: start;
}

.transfer-section-title {
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.transfer-arrow-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding-top: 40px;
}

.transfer-arrow-icon {
    font-size: 48px;
    color: #4CAF50;
}

/* Account Cards für Transfer */
.account-card {
    padding: 15px;
    margin-bottom: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.account-card.selected {
    border-color: #4CAF50;
    background-color: #e8f5e9;
}

.account-card .account-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.account-card .account-owner {
    color: #666;
}

.account-card .account-balance {
    font-weight: 600;
}

.account-card .account-balance.positive {
    color: #4CAF50;
}

.account-card .account-balance.negative {
    color: #f44336;
}

/* Amount Colors - FÜR KONTEN-ÜBERSICHT UND TRANSAKTIONEN */
.amount-positive,
.amount.positive {
    color: #059669 !important;
    font-weight: 600;
}

.amount-negative,
.amount.negative {
    color: #dc2626 !important;
    font-weight: 600;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-column {
    max-height: 80vh;
    overflow-y: auto;
}

/* Payment-Layout für pending-payments.php */
.payment-layout-grid {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 24px;
    align-items: start;
}

/* Currency-Select - Fixed sizing issue and USI truncation bug */
.currency-select,
.currency-selector select,
#currency-select {
    min-width: 95px;  /* Increased from 80px to prevent USD→USI truncation */
    max-width: 120px; /* Increased from 100px for better display */
    width: auto;      /* Changed from fixed 80px to auto-width */
    flex-shrink: 0;
    padding: 8px 12px; /* Ensure proper padding for currency codes */
}

/* Amount input should be visible and large enough */
.form-input[type="number"] {
    min-width: 120px;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 16px;
}

/* Fix flexbox layout for amount + currency */
.flex.gap-2 .form-input.flex-1 {
    flex: 2;
    min-width: 150px;
}

.flex.gap-2 .currency-select {
    flex: 0 0 95px; /* Increased from 80px to match min-width and prevent truncation */
}

.amount-currency-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Conversion-Info */
.conversion-info {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    display: none;
}

.balance-info {
    margin-top: 8px;
    display: none;
}

.info-text {
    color: #666;
}

/* Section Title */
.section-title {
    margin: 0;
    color: #495057;
    font-size: 20px;
}

/* Radio Labels für Forms */
.radio-label {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    border: 2px solid #d1d5db;
    font-size: 13px;
    font-weight: 500;
    display: block;
}

.radio-label.expense {
    background: #fee2e2;
    border-color: #dc2626;
}

.radio-label.income {
    background: #dcfce7;
    border-color: #16a34a;
}

/* Amount Input Styling */
.amount-input {
    font-size: 16px !important;
    font-weight: 600 !important;
    background: #f9fafb !important;
}

/* Radio Labels für Payment Status */
.radio-label.paid {
    background: #dcfce7;
    border-color: #16a34a;
}

.radio-label.pending {
    background: #fef3c7;
    border-color: #f59e0b;
}

.radio-label.partially {
    background: #fee2e2;
    border-color: #dc2626;
}

/* Receipt Info */
.receipt-info {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

.receipt-filename {
    color: #333;
}

.receipt-actions {
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.delete-text {
    color: #dc3545;
}

/* Due Date Field */
.due-date-field {
    margin-top: 15px;
    display: none;
}

.due-date-field.visible {
    display: block;
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.file-icon {
    font-size: 1.5em;
}

.file-name {
    font-weight: 500;
    font-size: 14px;
}

.file-size {
    color: #666;
}

/* ========================================
   UTILITY-KLASSEN
======================================== */

/* Spacing */
.mb-25 { margin-bottom: 25px; }
.mb-20 { margin-bottom: 20px; }
.mb-15 { margin-bottom: 15px; }
.mb-10 { margin-bottom: 10px; }
.mb-5 { margin-bottom: 5px; }
.mt-4 { margin-top: 16px; }
.mt-2 { margin-top: 8px; }

.p-30 { padding: 30px; }
.p-20 { padding: 20px; }
.p-15 { padding: 15px; }
.p-10 { padding: 10px; }

/* Display */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

.block { display: block; }
.hidden { display: none; }
.inline-block { display: inline-block; }

.text-center { text-align: center; }

/* Text */
.text-primary { color: #111827; }
.text-secondary { color: #6b7280; }
.text-muted { color: #9ca3af; }
.text-success { color: #16a34a; }
.text-error { color: #dc2626; }
.text-warning { color: #d97706; }

.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 18px; }

/* Misc */
.cursor-pointer { cursor: pointer; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }

/* ========================================
   ANALYSE & COMPARISON GRIDS - FÜR 10/10 UX
======================================== */

/* Zwei-Spalten Vergleichsansicht */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 30px;
}

/* Statistik-Grid für Karten */
.stats-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.stats-grid-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stats-grid-five {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

/* Analyse-Karten */
.analysis-card {
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.analysis-card-detailed {
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

/* Statistik-Karten */
.stat-card-center {
    padding: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.stat-value.positive {
    color: #4CAF50;
}

.stat-value.negative {
    color: #f44336;
}

.stat-value.primary {
    color: #2196F3;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

/* Konto-Balance Zeilen */
.account-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

/* Investment-Overview Grids */
.investment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.investment-info {
    padding: 10px;
    border-radius: 6px;
}

.investment-income {
    background: #e8f5e9;
}

.investment-expense {
    background: #fef2f2;
}

/* Owner Information Styles */
.owner-name-main {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

.owner-accounts-list {
    font-size: 12px;
    color: #666;
}

.net-contribution {
    font-weight: 600;
    font-size: 18px;
}

.net-contribution.positive {
    color: #4CAF50;
}

.net-contribution.negative {
    color: #f44336;
}

.investment-amount {
    font-weight: 600;
    margin-bottom: 2px;
}

.investment-amount.positive {
    color: #4CAF50;
}

.investment-amount.negative {
    color: #f44336;
}

.investment-count {
    font-size: 12px;
    color: #666;
}

/* Navigation-Center */
.navigation-center {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Empty State */
.empty-state-text {
    text-align: center;
    color: #666;
    padding: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state-title {
    margin: 0 0 10px 0;
}

.empty-state-description {
    margin: 0 0 20px 0;
}

/* Full Width Section */
.full-width-section {
    width: 100%;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-link {
    padding: 8px 12px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    border: 1px solid #ddd;
}

.pagination-link.active {
    background: #4CAF50;
    color: white;
    border: 1px solid #4CAF50;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

/* TABLET RESPONSIVE (1024px and below) */
@media (max-width: 1024px) {
    /* Enhanced Sidebar Behavior */
    .sidebar {
        z-index: 1100;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .main-content {
        transition: filter 0.3s ease;
    }
    
    .sidebar.expanded ~ .main-content {
        filter: blur(2px);
        pointer-events: none;
    }
    
    /* Grid Layout Improvements */
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .transaction-layout-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .payment-layout-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filter-grid-four {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    /* Header Responsiveness */
    .header-actions {
        gap: 8px;
    }
    
    .search-bar {
        max-width: 200px;
    }
}

/* MOBILE RESPONSIVE (768px and below) */
@media (max-width: 768px) {
    /* Mobile Overlay for Sidebar */
    .sidebar.expanded::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
    
    /* Grid Simplification */
    .summary-grid,
    .categories-grid,
    .stats-grid-three {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-grid-two,
    .form-grid-three,
    .filter-grid-two,
    .filter-grid-three {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .filter-grid-four {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Card Optimizations */
    .metric-card,
    .summary-card,
    .category-card {
        padding: 16px;
    }
    
    .transfer-section,
    .filter-section {
        padding: 16px;
    }
    
    /* Table Improvements */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }
    
    .table th,
    .table td {
        min-width: 100px;
        white-space: nowrap;
    }
    
    /* Header Adjustments */
    .header-greeting h1 {
        font-size: 1.25rem;
    }
    
    .search-bar {
        display: none; /* Hide search on small screens */
    }
    
    .notification-bell {
        display: none; /* Hide notifications on mobile */
    }
}

/* ULTRA MOBILE (480px and below) */
@media (max-width: 480px) {
    /* Content Adjustments */
    .content-wrapper {
        padding: 16px;
    }
    
    /* Button Improvements */
    .btn {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }
    
    .btn-lg {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .button-group {
        flex-direction: column;
        gap: 8px;
    }
    
    /* Section Improvements */
    .filter-section {
        padding: 16px;
    }
    
    /* Header Adjustments */
    .header-greeting {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }
    
    /* Form Stack */
    .form-grid,
    .form-grid-two,
    .form-grid-three {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
}

/* TOUCH-FRIENDLY IMPROVEMENTS */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-item,
    .sidebar-toggle {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .form-input,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Ensure amount inputs remain large on mobile */
    input[name="amount"], 
    #amount,
    input[type="number"][name="amount"],
    .amount-input,
    input.amount-field {
        font-size: 18px !important;
        min-height: 52px !important;
        padding: 14px 18px !important;
        min-width: 120px !important;
    }
}

/* LANDSCAPE ORIENTATION */
@media (max-width: 768px) and (orientation: landscape) {
    .content-wrapper {
        padding: 12px 16px;
    }
    
    .header-modern {
        padding: 12px 0;
    }
}

/* ========================================
   NEGATIVE AMOUNT STYLING - RED ONLY
======================================== */

/* Only NEGATIVE amounts should be displayed in RED */
.negative-amount,
.text-error,
.amount-negative,
[data-negative="true"] {
    color: #dc2626 !important; /* Red color only for negative amounts */
    font-weight: 600 !important;
}

/* Positive amounts should remain black/normal */
.positive-amount,
.text-success,
.amount-positive,
[data-negative="false"] {
    color: #1f2937 !important; /* Dark gray for positive amounts */
    font-weight: 600 !important;
}