:root {
    --primary: #1e3a5f;
    --primary-dark: #152943;
    --accent: #d4a574;
    --accent-hover: #c49563;
    --bg-light: #fafbfc;
    --sidebar-width: 280px;
}

* {
    font-family: 'Manrope', sans-serif;
}

.font-display {
    font-family: 'Crimson Pro', serif;
}

body {
    background: var(--bg-light);
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.nav-item {
    position: relative;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: var(--accent);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--accent);
    border-radius: 2px 0 0 2px;
}

/* Header Styles */
.header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.btn-logout {
    padding: 0.5rem;
    border-radius: 8px;
    background: #fee2e2;
    color: #dc2626;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #dc2626;
    color: white;
}

/* Form Styles */
.form-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    animation: fadeInUp 0.5s ease-out;
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-input:disabled {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

/* Search Results */
.search-container {
    position: relative;
}

.search-results {
    position: absolute;
    top: 85px;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: #f1f5f9;
    border-left-color: var(--accent);
    transform: translateX(2px);
}

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

.match-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.match-exact {
    background: #dcfce7;
    color: #166534;
}

.match-partial {
    background: #fef3c7;
    color: #92400e;
}

.field-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #64748b;
    display: block;
    margin-bottom: 0.125rem;
}

/* Account Cards */
.account-card {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

.account-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.1);
}

.account-card.selected {
    border-color: var(--accent);
    background: rgba(212, 165, 116, 0.05);
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-custom:checked {
    background: var(--primary);
    border-color: var(--primary);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 95, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fed7aa;
    color: #92400e;
}

/* Section Header */
.section-header {
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

/* Info Box */
.info-box {
    background: rgba(30, 58, 95, 0.05);
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: 8px;
    padding: 1rem;
}

/* Notes */
.note-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.note-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.1);
}

.note-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.note-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-top: 1px solid #e5e7eb;
}

.note-item.expanded .note-content {
    max-height: 500px;
}

.note-item.expanded .note-chevron {
    transform: rotate(180deg);
}

.note-chevron {
    transition: transform 0.3s ease;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-settled { background: #dbeafe; color: #1e40af; }
.status-in-progress { background: #fef3c7; color: #92400e; }

/* File Upload */
.drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafbfc;
    position: relative;
}

.drop-zone:hover {
    border-color: var(--accent);
    background: #fff;
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: #eff6ff;
    border-width: 3px;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.drop-zone-button {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drop-zone-button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.file-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.file-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.file-details {
    flex: 1;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1f2937;
}

.file-size {
    font-size: 0.75rem;
    color: #6b7280;
}

.file-remove {
    padding: 0.25rem 0.5rem;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: #dc2626;
    color: white;
}

/* PowerBI Container */
.powerbi-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

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

/* Flash Messages */
.flash-message {
    padding: 1rem 1.5rem;
    margin: 1rem 2rem;
    border-radius: 8px;
    animation: slideDown 0.3s ease-out;
}

.flash-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.flash-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

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

/* Login Page Styles */
.login-body {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    min-height: 100vh;
}

.login-card {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.6s ease-out;
}

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

.logo-area {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.logo-area::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

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

.microsoft-btn {
    background: white;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.microsoft-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(30, 58, 95, 0.05), transparent);
    transition: left 0.5s ease;
}

.microsoft-btn:hover::before {
    left: 100%;
}

.microsoft-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(30, 58, 95, 0.15);
}

.decorative-line {
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 1.5rem 0;
}
