/* ==========================================
   Sistema de Facturación - Estilos CSS
   ========================================== */

:root {
    --primary-color: #1a5490;
    --primary-light: #3d7fc4;
    --primary-dark: #0f3557;
    --secondary-color: #f39c12;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

.container-fluid {
    padding: 0;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

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

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1.2rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--secondary-color);
}

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

/* Main Content */
.main-content {
    margin-left: 16.6667%;
    padding-top: 20px;
    padding-bottom: 20px;
}

/* Header */
.page-header {
    background: #fff;
    padding: 2rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.page-header h1 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 700;
}

/* Cards */
.card {
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-icon.bg-primary {
    background-color: var(--primary-color);
}

.stat-icon.bg-success {
    background-color: var(--success-color);
}

.stat-icon.bg-warning {
    background-color: var(--warning-color);
}

.stat-icon.bg-info {
    background-color: var(--info-color);
}

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

.card-title {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 1rem 0.75rem;
}

.table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #e9ecef;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

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

.table-light thead th {
    background-color: #f0f0f0;
}

/* Badges */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-pending {
    background-color: #fff3cd;
    color: #856404;
}

.badge-paid {
    background-color: #d4edda;
    color: #155724;
}

.badge-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(26, 84, 144, 0.25);
}

.form-control::placeholder {
    color: #aaa;
}

label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.text-danger {
    color: var(--danger-color);
}

/* Buttons */
.btn {
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(26, 84, 144, 0.3);
}

.btn-secondary {
    background-color: var(--gray-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

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

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    border: 2px solid var(--gray-color);
    color: var(--gray-color);
}

.btn-block {
    width: 100%;
}

/* Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

/* Secciones */
.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        z-index: 50;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }
}

/* Alertas */
.alert {
    border: none;
    border-radius: 4px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* Utilitarios */
.border-bottom {
    border-bottom: 1px solid #e9ecef;
}

.py-3 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.my-4 {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.text-muted {
    color: var(--gray-color);
}

.text-right {
    text-align: right;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

/* Loading */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(26, 84, 144, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.modal-body {
    padding: 1.5rem;
}

/* Pdf Stamp */
.pdf-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    font-size: 120px;
    font-weight: bold;
    color: rgba(220, 53, 69, 0.3);
    z-index: 1;
    white-space: nowrap;
    pointer-events: none;
}
