:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f8fafc;
    --dark: #1e293b;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* Custom Bootstrap overrides */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.card {
    border-radius: 12px;
    border: 1px solid var(--border);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    padding: 1.25rem 1.5rem;
}

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

/* Navbar */
.navbar {
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary) !important;
    font-size: 1.25rem;
}

.nav-link {
    color: var(--secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}

/* Sidebar */
.sidebar {
    background-color: white;
    border-right: 1px solid var(--border);
    min-height: calc(100vh - 76px);
    padding: 1.5rem 0;
}

.sidebar .nav-link {
    color: var(--secondary);
    padding: 0.75rem 1.5rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

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

.sidebar .nav-link.active {
    color: var(--primary);
    background-color: rgba(79, 70, 229, 0.05);
    border-left-color: var(--primary);
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0.5rem 0;
}

.stat-card .stat-label {
    color: var(--secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card.primary .stat-icon {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.stat-card.success .stat-icon {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-card.warning .stat-icon {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card.info .stat-icon {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

/* Tables */
.table {
    background-color: white;
}

.table thead th {
    border-bottom: 2px solid var(--border);
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: var(--light);
}

/* Badges */
.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    border-radius: 6px;
}

.badge.status-pendiente {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge.status-en_progreso {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge.status-completado {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge.status-cancelado {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge.prioridad-alta {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge.prioridad-media {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge.prioridad-baja {
    background-color: rgba(100, 116, 139, 0.1);
    color: var(--secondary);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Modal */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--secondary);
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--secondary);
    opacity: 0.7;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Utilities */
.text-muted {
    color: var(--secondary) !important;
}

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}
