/* ===== ESTILOS GENERALES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== CONTENEDORES PRINCIPALES ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    flex: 1;
}

/* ===== ENCABEZADOS ===== */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.header h1 i {
    margin-right: 10px;
    color: #f1c40f;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.user-name i {
    margin-right: 5px;
}

/* ===== BOTONES ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52,152,219,0.3);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46,204,113,0.3);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231,76,60,0.3);
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243,156,18,0.3);
}

.btn-info {
    background: #00bcd4;
    color: white;
}

.btn-info:hover {
    background: #00acc1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,188,212,0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== TARJETAS ===== */
.card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card-header {
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 20px;
    color: #2c3e50;
    font-weight: 600;
}

.card-header h2 i {
    margin-right: 10px;
    color: #3498db;
}

.card-body {
    padding: 10px 0;
}

.card-footer {
    border-top: 2px solid #f0f2f5;
    padding-top: 15px;
    margin-top: 15px;
}

/* ===== FORMULARIOS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.form-group label i {
    margin-right: 5px;
    color: #3498db;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

.form-control.error {
    border-color: #e74c3c;
}

.form-control.success {
    border-color: #27ae60;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 45px;
}

/* ===== TABLAS ===== */
.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

table thead {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

table thead th {
    padding: 15px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background 0.3s ease;
}

table tbody tr:hover {
    background: #f8f9fa;
}

table tbody td {
    padding: 15px;
    color: #2c3e50;
}

table tbody tr:last-child {
    border-bottom: none;
}

/* ===== ALERTAS Y MENSAJES ===== */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-success {
    background: #d4edda;
    border-left: 5px solid #27ae60;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-left: 5px solid #e74c3c;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-left: 5px solid #f39c12;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-left: 5px solid #3498db;
    color: #0c5460;
}

.alert i {
    font-size: 20px;
}

.alert .close {
    margin-left: auto;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.alert .close:hover {
    opacity: 1;
}

/* ===== MENÚ INFERIOR (MÓVIL) ===== */
.bottom-menu {
    background: white;
    padding: 10px;
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #e0e0e0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
}

.bottom-menu a {
    text-decoration: none;
    color: #7f8c8d;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.bottom-menu a i {
    font-size: 20px;
}

.bottom-menu a:hover {
    background: #f0f2f5;
    color: #3498db;
}

.bottom-menu a.active {
    color: #3498db;
    font-weight: 600;
}

.bottom-menu a.active i {
    color: #3498db;
}

/* ===== MODALES ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 25px;
    border-radius: 15px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f2f5;
}

.modal-header h3 {
    font-size: 20px;
    color: #2c3e50;
    margin: 0;
}

.modal-header h3 i {
    margin-right: 10px;
    color: #3498db;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 2px solid #f0f2f5;
    padding-top: 20px;
}

/* ===== LOADING SPINNER ===== */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #27ae60;
}

.badge-danger {
    background: #f8d7da;
    color: #e74c3c;
}

.badge-warning {
    background: #fff3cd;
    color: #f39c12;
}

.badge-info {
    background: #d1ecf1;
    color: #3498db;
}

/* ===== GRID SYSTEM ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.col {
    flex: 1;
    padding: 10px;
}

.col-1 { flex: 0 0 8.33%; padding: 10px; }
.col-2 { flex: 0 0 16.66%; padding: 10px; }
.col-3 { flex: 0 0 25%; padding: 10px; }
.col-4 { flex: 0 0 33.33%; padding: 10px; }
.col-5 { flex: 0 0 41.66%; padding: 10px; }
.col-6 { flex: 0 0 50%; padding: 10px; }
.col-7 { flex: 0 0 58.33%; padding: 10px; }
.col-8 { flex: 0 0 66.66%; padding: 10px; }
.col-9 { flex: 0 0 75%; padding: 10px; }
.col-10 { flex: 0 0 83.33%; padding: 10px; }
.col-11 { flex: 0 0 91.66%; padding: 10px; }
.col-12 { flex: 0 0 100%; padding: 10px; }

/* ===== UTILIDADES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 25px; }

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 25px; }

.ml-1 { margin-left: 5px; }
.ml-2 { margin-left: 10px; }
.ml-3 { margin-left: 15px; }
.ml-4 { margin-left: 20px; }
.ml-5 { margin-left: 25px; }

.mr-1 { margin-right: 5px; }
.mr-2 { margin-right: 10px; }
.mr-3 { margin-right: 15px; }
.mr-4 { margin-right: 20px; }
.mr-5 { margin-right: 25px; }

.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }
.p-5 { padding: 25px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        flex: 0 0 100%;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .modal-content {
        margin: 20px;
        padding: 15px;
    }
    
    table thead {
        display: none;
    }
    
    table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        padding: 10px;
    }
    
    table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
        border-bottom: 1px solid #ecf0f1;
    }
    
    table tbody td:last-child {
        border-bottom: none;
    }
    
    table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #7f8c8d;
        margin-right: 10px;
    }
}

/* ===== IMPRESIÓN ===== */
@media print {
    .header, .bottom-menu, .btn, .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        padding: 20px;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    table {
        border: 1px solid #ddd;
    }
}