:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Cards */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
    margin-bottom: 1rem;
}

.stat-card {
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.7;
}

.stat-card .card-body {
    padding: 1.5rem;
}

/* Invoice Template */
.invoice-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.invoice-header {
    border-bottom: 2px solid #333;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.invoice-logo {
    max-width: 150px;
}

.invoice-details {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-table th {
    background: #2c3e50;
    color: white;
    padding: 0.75rem;
    text-align: left;
}

.invoice-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.invoice-totals {
    width: 300px;
    margin-left: auto;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
}

/* Badges */
.badge {
    font-size: 0.75em;
}

/* Table responsive */
.table-responsive {
    border-radius: 0.375rem;
}

/* Form controls */
.form-control, .form-select {
    border-radius: 0.375rem;
}

/* Invoice items table */
#itemsTable input, #itemsTable select {
    border: 1px solid #dee2e6;
}

.item-total {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* Status colors */
.status-draft { color: #6c757d; }
.status-sent { color: #fd7e14; }
.status-paid { color: #198754; }
.status-overdue { color: #dc3545; }

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .invoice-container {
        box-shadow: none;
        padding: 0;
    }
    
    body {
        background: white !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .card {
        background: #2d3748;
        border-color: #4a5568;
    }
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .invoice-totals {
        width: 100%;
    }
    
    .stat-card .card-body {
        padding: 1rem;
    }
}

/* Payment buttons */
.payment-btn {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
}

.payment-btn:hover {
    background: linear-gradient(45deg, #764ba2 0%, #667eea 100%);
    color: white;
}