/* Paletas Gurabo 1.0 - Main Styles */

:root {
    --bs-primary: #0d6efd;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-danger: #dc3545;
    --bs-warning: #ffc107;
    --bs-info: #0dcaf0;
    --sidebar-width: 250px;
}

/* Layout */
body {
    padding-top: 56px;
    font-size: 14px;
}

.main-content {
    min-height: calc(100vh - 56px);
    padding-bottom: 100px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    overflow-y: auto;
}

.sidebar .nav-link {
    color: #333;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0 0.5rem 0.25rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    color: var(--bs-primary);
    background-color: rgba(13, 110, 253, 0.1);
}

.sidebar .nav-link.active {
    color: white;
    background-color: var(--bs-primary);
}

.sidebar .nav-link i {
    width: 16px;
}

/* Cards */
.kpi-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.kpi-label {
    font-size: 0.875rem;
    color: #090909;
    font-weight: 500;
}

/* Tables */
.table-responsive {
    border-radius: 0.375rem;
    overflow: hidden;
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Buttons */
.btn {
    font-weight: 500;
    transition: all 0.2s ease;
}

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

/* Status badges */
.status-abierta { background-color: #ffc107; color: #000; }
.status-proceso { background-color: #0dcaf0; color: #000; }
.status-enproceso { background-color: #0dcaf0; color: #000; }
.status-cerrada { background-color: #198754; }
.status-pendiente { background-color: #dc3545; }
.status-pagada { background-color: #198754; }
.status-parcial { background-color: #fd7e14; }

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
}

/* Dark mode support */
[data-bs-theme="dark"] .sidebar {
    background-color: #212529 !important;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, .1);
}

[data-bs-theme="dark"] .sidebar .nav-link {
    color: #adb5bd;
}

[data-bs-theme="dark"] .sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .kpi-card {
    background-color: #343a40;
    border-color: #495057;
}

[data-bs-theme="dark"] .table th {
    background-color: #495057;
    color: #fff;
}

/* Responsive */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -280px;
        width: 280px;
        height: calc(100vh - 56px);
        transition: left 0.3s ease;
        z-index: 1050;
        background-color: #f8f9fa;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        transform: translateX(0);
    }
    
    .sidebar.show {
        left: 0;
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }
    
    .main-content {
        padding-left: 15px;
        padding-right: 15px;
        margin-left: 0;
    }
    
    .kpi-value {
        font-size: 2rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
}

@media (min-width: 768px) {
    .main-content {
        margin-left: var(--sidebar-width);
    }
    
    .sidebar {
        width: var(--sidebar-width);
    }
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}

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

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

/* Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.shadow-hover {
    transition: box-shadow 0.2s ease;
}

.shadow-hover:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}