/**
 * FIN - Belegzuordnung & Buchhaltung
 * Stylesheet im Contentmonster-Design
 * fin.intern.datenschutzfabrik.de
 */

:root {
    --primary: #e91e63;
    --primary-secondary: #f06292;
    --primary-hover: #d81b60;
    --primary-light: #fce4ec;
    --primary-border: #f8bbd9;
    --bg-main: #faf9fc;
    --shadow: rgba(233, 30, 99, 0.1);
    --shadow-hover: rgba(233, 30, 99, 0.15);
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196f3;
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    min-height: 100vh;
    color: #333;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid var(--primary-border);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 0;
    box-shadow: 2px 0 20px var(--shadow);
    z-index: 1000;
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid var(--primary-border);
    background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
    color: #fff;
}

.sidebar-brand h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.3rem;
}

.sidebar-brand small {
    opacity: 0.85;
    font-size: 0.75rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    color: #555;
    padding: 0.75rem 1.5rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-nav .nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 24px;
}

.sidebar-section {
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-top: 1rem;
}

.sidebar-user {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--primary-border);
    background: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

.sidebar-user-info {
    flex: 1;
}

.sidebar-user-info strong {
    display: block;
    font-size: 0.85rem;
}

.sidebar-user-info small {
    color: #999;
    font-size: 0.75rem;
}

/* Company Selector */
.company-selector {
    background: var(--primary-light);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 1rem 1.5rem;
    border: 1px solid var(--primary-border);
}

.company-selector select {
    border: none;
    background: transparent;
    font-weight: 600;
    color: var(--primary);
    width: 100%;
    cursor: pointer;
}

.company-selector select:focus {
    outline: none;
    box-shadow: none;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(233, 30, 99, 0.1);
}

.page-header h1 {
    font-weight: 700;
    color: #e91e63;
    margin-bottom: 0.25rem;
    font-size: 1.75rem;
}

.page-header p {
    color: #777;
    margin: 0;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    border: 1px solid var(--primary-border);
    border-radius: 1rem;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.2s;
    background: #fff;
}

.card:hover {
    box-shadow: 0 8px 30px var(--shadow-hover);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--primary-border);
    padding: 1rem 1.25rem;
    border-radius: 1rem 1rem 0 0 !important;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    border-top: 1px solid var(--primary-border);
    padding: 1rem 1.25rem;
    border-radius: 0 0 1rem 1rem !important;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
    background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
    border: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #d81b60 0%, #ec407a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    border-radius: 0.5rem;
}

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

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

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

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

/* ============================================
   STAT CARDS
   ============================================ */

.stat-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--primary-border);
    box-shadow: 0 4px 20px var(--shadow);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.stat-card-label {
    color: #777;
    font-size: 0.85rem;
}

/* ============================================
   TABLE
   ============================================ */

.table-container {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid var(--primary-border);
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
}

.table {
    margin: 0;
}

.table thead th {
    background: var(--primary-light);
    border-bottom: 2px solid var(--primary-border);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f5f5f5;
}

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

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

/* ============================================
   BADGES
   ============================================ */

.badge-status {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-pending {
    background: #fff3e0;
    color: #e65100;
}

.badge-done {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-unclear {
    background: #fce4ec;
    color: #c2185b;
}

.badge-unassigned {
    background: #f5f5f5;
    color: #757575;
}

/* ============================================
   AMOUNTS
   ============================================ */

.amount-positive {
    color: #2e7d32;
    font-weight: 600;
}

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

/* ============================================
   FILTER BAR
   ============================================ */

.filter-bar {
    background: #fff;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--primary-border);
    box-shadow: 0 4px 20px var(--shadow);
}

/* ============================================
   FORMS
   ============================================ */

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.15);
}

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

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
}

.login-box {
    background: #fff;
    border-radius: 1.5rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h2 {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-logo p {
    color: #999;
    font-size: 0.9rem;
}

/* ============================================
   TRANSACTION TYPE ICONS
   ============================================ */

.tx-type {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tx-type i {
    color: var(--primary);
}

/* ============================================
   COMMENTS
   ============================================ */

.comment-box {
    background: #f9f9f9;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    border-left: 3px solid var(--primary);
}

.comment-box strong {
    color: var(--primary);
}

/* ============================================
   DROPZONE (Import)
   ============================================ */

.dropzone {
    border: 2px dashed var(--primary-border);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    background: var(--primary-light);
    transition: all 0.3s;
    cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: #fff;
}

.dropzone i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* ============================================
   MODALS
   ============================================ */

.modal-content {
    border-radius: 1rem;
    border: none;
}

.modal-header {
    background: var(--primary-light);
    border-radius: 1rem 1rem 0 0;
    border-bottom: 1px solid var(--primary-border);
}

.modal-title {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   PROGRESS
   ============================================ */

.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    border-radius: 0.75rem;
    border: none;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination .page-link {
    color: var(--primary);
    border-color: var(--primary-border);
}

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

.pagination .page-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

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

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

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

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

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

/* Transaction row with unclear status */
tr.status-unclear {
    background: #fff8e1 !important;
}

tr.status-unclear:hover {
    background: #fff3cd !important;
}

/* Card with highlight border */
.card-highlight {
    border-left: 4px solid var(--primary);
}

.card-highlight-danger {
    border-left: 4px solid var(--danger);
}

.card-highlight-success {
    border-left: 4px solid var(--success);
}

.card-highlight-warning {
    border-left: 4px solid var(--warning);
}
