:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --background-color: #f5f6fa;
    --text-color: #2c3e50;
    --border-color: #dcdde1;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    font-size: 24px;
    font-weight: 600;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

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

.events-list {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.event-form-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
    transition: all 0.3s ease;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.equipment-list {
    margin: 20px 0;
}

.equipment-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.equipment-item:last-child {
    border-bottom: none;
}

.equipment-item input[type="number"] {
    width: 100%;
}

.total-section {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.total-row:last-child {
    border-bottom: none;
}

.total-row.total-final {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #dee2e6;
    font-weight: bold;
    font-size: 1.2rem;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.event-card {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-card h3 {
    margin: 0;
    color: var(--primary-color);
}

.event-card .event-actions {
    display: flex;
    gap: 10px;
}

.event-card .btn-action {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-size: 16px;
}

.event-card .btn-action:hover {
    color: var(--secondary-color);
}

.btn-group .btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-right: 4px;
    transition: all 0.3s ease;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

.btn-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.card-body {
    padding: 1.5rem;
}

.border-top {
    border-color: #f0f0f0 !important;
}

.badge {
    padding: 0.5em 0.8em;
    font-weight: 500;
}

.navbar-logo {
    height: 50px;
    width: auto;
}

.equipment-list .form-control {
    min-width: 80px;
    max-width: 120px;
}

.table > :not(caption) > * > * {
    padding: 0.5rem;
}

.table input[type="number"] {
    padding: 0.25rem 0.5rem;
}

.form-control-sm {
    height: 31px;
}

/* Mejoras de accesibilidad */
.form-control:focus,
.btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: none;
}

/* Animaciones suaves */
.card {
    transition: transform 0.2s ease;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-responsive {
        border: 0;
    }
    
    .table th {
        display: none;
    }
    
    .table td {
        display: block;
        padding: 0.5rem;
        text-align: right;
        border-bottom: 1px solid #dee2e6;
    }
    
    .table td:before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
    }
    
    .table td:last-child {
        border-bottom: 0;
    }
    
    .equipment-list .form-control {
        max-width: 100%;
    }
}

.navbar {
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.logo-container {
    width: 140px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 5px;
}

.navbar-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.logo-container:hover .navbar-logo {
    transform: scale(1.02);
}

.navbar h1 {
    color: #2c3e50;
    margin: 0;
    padding-right: 1rem;
}

.navbar-brand {
    color: #2c3e50 !important;
}

.navbar-brand img {
    transition: transform 0.2s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-brand img {
    height: 32px !important;
}

.navbar-brand span {
    font-size: 1.1rem !important;
}

@media (max-width: 768px) {
    .logo-container {
        width: 100px;
        height: 32px;
    }

    .navbar h1 {
        font-size: 1.1rem !important;
    }

    .table-responsive {
        border: 0;
    }
    
    .table th {
        display: none;
    }
    
    .table td {
        display: block;
        padding: 0.5rem;
        text-align: right;
        border-bottom: 1px solid #dee2e6;
    }
    
    .table td:before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
    }
    
    .table td:last-child {
        border-bottom: 0;
    }
    
    .equipment-list .form-control {
        max-width: 100%;
    }
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 15px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.stat-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-card-title {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-card-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #3498db;
    margin: 8px 0;
}

.stat-card-info {
    width: 100%;
    margin: 10px 0;
}

.stat-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #666;
    margin: 4px 0;
    font-size: 0.8rem;
}

.stat-meta i {
    color: #3498db;
}

.stat-card-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.action-button {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-button i {
    font-size: 1.1rem;
}

.view-btn {
    background-color: #3498db;
}

.view-btn:hover {
    background-color: #2980b9;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.4);
}

.download-btn {
    background-color: #27ae60;
}

.download-btn:hover {
    background-color: #219a52;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.4);
}

.pdf-btn {
    background-color: #e74c3c;
}

.pdf-btn:hover {
    background-color: #c0392b;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
}

.delete-btn {
    background-color: #c0392b;
}

.delete-btn:hover {
    background-color: #a93226;
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.4);
}

.total-events-card {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.total-events-card .stat-card-title,
.total-events-card .stat-card-value,
.total-events-card .stat-meta {
    color: white;
}

.total-events-card .stat-card-value {
    font-size: 2.5rem;
    margin: 15px 0;
}

@media (max-width: 1200px) {
    .events-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .events-grid {
        grid-template-columns: 1fr;
    }
}

.total-amount-card {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.total-amount-card .stat-card-title,
.total-amount-card .stat-card-value,
.total-amount-card .stat-meta,
.total-amount-card .stat-meta i {
    color: white;
}

.total-amount-card .stat-card-value {
    font-size: 2.5rem;
    margin: 15px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.total-amount-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(39, 174, 96, 0.2);
}

/* Ajustar el orden de las tarjetas en pantallas grandes */
@media (min-width: 768px) {
    .total-amount-card,
    .total-events-card {
        grid-column: span 2;
    }
}

.edit-btn {
    background-color: #f39c12;
}

.edit-btn:hover {
    background-color: #d68910;
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.4);
}

/* Estilos para el modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 50px auto;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--danger-color);
}

.modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 10px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.modal.show {
    display: block;
}

.edit-form {
    padding: 10px;
}

.edit-form .form-group {
    margin-bottom: 15px;
}

.edit-form label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 500;
}

.edit-form input[type="text"],
.edit-form input[type="date"],
.edit-form input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.edit-form input[type="checkbox"] {
    margin-right: 8px;
}

.equipment-section {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.equipment-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.1rem;
}

.equipment-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.equipment-item:last-child {
    border-bottom: none;
}

.equipment-name {
    font-weight: 500;
}

.equipment-price {
    color: #666;
}

.equipment-quantity {
    width: 80px !important;
}

.edit-total {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-align: right;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Mejoras en el modal */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.modal-body {
    padding: 20px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.modal-footer {
    background-color: #f8f9fa;
    padding: 15px 20px;
    position: sticky;
    bottom: 0;
}

.modal .table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border-collapse: collapse;
}

.modal .table th,
.modal .table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

.modal .table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
}

.modal .table tbody tr:hover {
    background-color: rgba(0,0,0,.075);
}

.modal .form-control {
    width: 80px;
    text-align: center;
}

/* ===========================
   DASHBOARD DE ANÁLISIS
   =========================== */

.analytics-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
}

.analytics-container .card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
    margin-bottom: 20px;
}

.analytics-container .card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

/* Tonos de azul para las tarjetas */
.bg-blue-1 {
    background-color: #4a6fa5 !important;
}

.bg-blue-2 {
    background-color: #5a8fd6 !important;
}

.bg-blue-3 {
    background-color: #6ba3e0 !important;
}

.bg-blue-4 {
    background-color: #7db9ea !important;
}

/* Tarjetas de resumen */
.analytics-container .card.bg-blue-1,
.analytics-container .card.bg-blue-2,
.analytics-container .card.bg-blue-3,
.analytics-container .card.bg-blue-4 {
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.analytics-container .card.bg-blue-1:hover,
.analytics-container .card.bg-blue-2:hover,
.analytics-container .card.bg-blue-3:hover,
.analytics-container .card.bg-blue-4:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.analytics-container .card.bg-blue-1 .card-body,
.analytics-container .card.bg-blue-2 .card-body,
.analytics-container .card.bg-blue-3 .card-body,
.analytics-container .card.bg-blue-4 .card-body {
    padding: 0.75rem;
}

.analytics-container .card h2 {
    font-size: 1.25rem;
    font-weight: bold;
}

.analytics-container .card h6 {
    font-size: 0.5525rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

/* Gráficas */
.analytics-container canvas {
    max-height: 250px;
}

/* Tabla de análisis */
#equipmentRevenueTable td {
    vertical-align: middle;
}

#equipmentRevenueTable strong {
    color: #2c3e50;
}

/* Filtros */
.analytics-container .card-body .form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #495057;
}

.analytics-container .form-control,
.analytics-container .form-select {
    border-radius: 5px;
    border: 1px solid #ced4da;
}

.analytics-container .form-control:focus,
.analytics-container .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Responsive */
@media (max-width: 768px) {
    .analytics-container .col-md-3 {
        margin-bottom: 15px;
    }
    
    .analytics-container h2 {
        font-size: 1.5rem;
    }
}
