/* Custom styles for Invoice & Payment Tracker - Modern Sidebar Design */

:root {
    --primary-color: #4C6FFF;
    --primary-light: #6C8AFF;
    --success-color: #22C55E;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #06B6D4;
    --purple-color: #A855F7;
    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border-color: #E2E8F0;
    --sidebar-bg: #1E293B;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Force light mode colors regardless of system preferences */
* {
    color-scheme: light !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color) !important;
    color: var(--text-primary) !important;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    transition: width 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand .brand-icon {
    font-size: 1.8rem;
    color: var(--primary-light);
    min-width: 32px;
}

.sidebar.collapsed .brand-text {
    display: none;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    margin: 0.25rem 0.75rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav .nav-link i {
    font-size: 1.3rem;
    min-width: 24px;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white !important;
    box-shadow: 0 4px 8px rgba(76, 111, 255, 0.3);
}

.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    overflow: hidden;
}

.profile-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
}

.sidebar.collapsed .user-info {
    display: none;
}

.btn-logout {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    background-color: var(--bg-color) !important;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

/* Cards - Force light background */
.card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    color: var(--text-primary) !important;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary) !important;
}

.card-body {
    padding: 1.5rem;
}

/* Metric Cards */
.metric-card {
    background: white !important;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.metric-icon.bg-primary {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%) !important;
    color: white !important;
}

.metric-icon.bg-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%) !important;
    color: white !important;
}

.metric-icon.bg-success {
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%) !important;
    color: white !important;
}

.metric-icon.bg-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%) !important;
    color: white !important;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary) !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.stat-change {
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive {
    color: var(--success-color) !important;
}

.stat-change.neutral {
    color: var(--info-color) !important;
}

/* Buttons - Force light theme */
.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    color: white !important;
    box-shadow: 0 4px 8px rgba(76, 111, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(76, 111, 255, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #16A34A 100%) !important;
    color: white !important;
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #DC2626 100%) !important;
    color: white !important;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #F97316 100%) !important;
    color: white !important;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
    background: #E2E8F0 !important;
    color: var(--text-primary) !important;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
    background: white !important;
}

.btn-outline-primary:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

/* Tables - Force light theme */
.table {
    background: white !important;
    color: var(--text-primary) !important;
}

.table thead th {
    background: var(--bg-color) !important;
    color: var(--text-primary) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(76, 111, 255, 0.05) !important;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--text-primary) !important;
}

/* Badges */
.badge {
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success-color), #16A34A) !important;
    color: white !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--warning-color), #F97316) !important;
    color: white !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--danger-color), #DC2626) !important;
    color: white !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, var(--info-color), #0891B2) !important;
    color: white !important;
}

.badge.bg-secondary {
    background: #94A3B8 !important;
    color: white !important;
}

/* Forms - Force light theme */
.form-label {
    font-weight: 600;
    color: var(--text-primary) !important;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border: 2px solid var(--border-color) !important;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white !important;
    color: var(--text-primary) !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(76, 111, 255, 0.1) !important;
    background: white !important;
    color: var(--text-primary) !important;
}

/* Alerts */
.alert {
    border: none !important;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1) !important;
    color: #15803D !important;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #991B1B !important;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #92400E !important;
}

.alert-info {
    background: rgba(6, 182, 212, 0.1) !important;
    color: #155E75 !important;
}

/* Progress Bars */
.progress {
    height: 12px;
    border-radius: 10px;
    background: var(--border-color) !important;
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Dropdown Menus */
.dropdown-menu {
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    background: white !important;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
    color: var(--text-primary) !important;
}

.dropdown-item:hover {
    background: rgba(76, 111, 255, 0.1) !important;
    color: var(--primary-color) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .sidebar .brand-text,
    .sidebar .nav-text,
    .sidebar .user-info {
        display: none;
    }
    
    .sidebar .sidebar-nav .nav-link {
        justify-content: center;
        padding: 0.75rem;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed-width);
    }
    
    .metric-value {
        font-size: 1.75rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* Scrollbar Styling */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Print Styles */
@media print {
    .sidebar,
    .btn,
    .alert {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}
