/* ===== ESTILOS COMUNES PARA ADMINISTRACIÓN ===== */

/* ===== LAYOUT PRINCIPAL ===== */
.page-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 2rem;
}

.content-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    backdrop-filter: blur(10px);
    animation: slideIn 0.5s ease-out;
}

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

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

/* ===== BOTONES MODERNOS ===== */
.btn-modern {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-primary-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary-modern {
    background: #e0e0e0;
    color: #666;
}

.btn-secondary-modern:hover {
    background: #d0d0d0;
    transform: translateY(-1px);
}

/* ===== BOTONES DE ICONOS ===== */
.btn-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-edit:hover {
    background: #1976d2;
    color: white;
    transform: scale(1.1);
}

.btn-delete {
    background: #ffebee;
    color: #c62828;
}

.btn-delete:hover {
    background: #c62828;
    color: white;
    transform: scale(1.1);
}

.btn-roles {
    background: #f3e5f5;
    color: #7b1fa2;
}

.btn-roles:hover {
    background: #7b1fa2;
    color: white;
    transform: scale(1.1);
}

.btn-move-up {
    background: #e8f5e8;
    color: #2e7d32;
}

.btn-move-up:hover {
    background: #2e7d32;
    color: white;
    transform: scale(1.1);
}

.btn-move-down {
    background: #fff3e0;
    color: #f57c00;
}

.btn-move-down:hover {
    background: #f57c00;
    color: white;
    transform: scale(1.1);
}

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ===== ALERTAS ===== */
.alert-modern {
    padding: 1rem 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

.alert-danger {
    background: linear-gradient(135deg, #ffe6e6 0%, #ffcccc 100%);
    color: #c62828;
    border-left: 4px solid #f44336;
}

.alert-success {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

/* ===== TABLAS ===== */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    border-radius: 15px;
}

.admin-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.admin-table th {
    padding: 1.2rem;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 1rem 1.2rem;
    background: white;
    border-bottom: 1px solid #f0f0f0;
}

.admin-table tbody tr {
    transition: all 0.3s ease;
}

.admin-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
}

.admin-table tbody tr.table-secondary {
    background: #f8f9fa;
}

.admin-table tbody tr.table-secondary:hover {
    background: #e9ecef;
}

/* ===== BADGES ===== */
.badge-modern {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.125rem;
}

.badge-success {
    background: #e8f5e8;
    color: #2e7d32;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-secondary {
    background: #f5f5f5;
    color: #666;
}

.badge-info {
    background: #e3f2fd;
    color: #1976d2;
}

/* ===== MODALES ===== */
.modal-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content-modern {
    background: white;
    border-radius: 15px;
    width: 100%;
    max-height: calc(100vh - 40px);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.modal-header-modern {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
    height: 60px;
}

.modal-title-modern {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close-modern {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-close-modern:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body-modern {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100vh - 180px);
}

.modal-footer-modern {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-shrink: 0;
    height: 70px;
    align-items: center;
}

/* ===== FORMULARIOS ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.form-control:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
}

.input-group {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
}

.input-group .form-control {
    border-radius: 0;
    border-right: none;
}

.input-group-text {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-left: none;
    padding: 0.6rem;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    width: 50px;
    justify-content: center;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

/* ===== GRID SYSTEM ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 0.5rem;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.5rem;
}

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

/* ===== UTILIDADES ===== */
.text-danger {
    color: #e74c3c !important;
}

.text-muted {
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    line-height: 1.3;
}

.validation-message {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-border {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 4rem;
    color: #e0e0e0;
    margin-bottom: 1rem;
}

/* ===== BÚSQUEDA ===== */
.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

.clear-search {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.3s ease;
}

.clear-search:hover {
    color: #667eea;
}

.search-info {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: #f0f5ff;
    border-left: 4px solid #667eea;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .page-container {
        padding: 1rem;
    }

    .content-card {
        padding: 1rem;
    }

    .header-section {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .page-title {
        font-size: 1.5rem;
        text-align: center;
    }

    .btn-modern {
        width: 100%;
        justify-content: center;
    }

    .search-box {
        width: 100%;
    }

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

    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
    }

    .action-buttons {
        justify-content: center;
        gap: 0.25rem;
    }

    .btn-icon {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .modal-content-modern {
        width: 95%;
        max-height: 90vh;
    }

    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .modal-footer-modern {
        flex-direction: column-reverse;
        gap: 0.75rem;
        height: auto;
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .page-container {
        padding: 0.5rem;
    }

    .content-card {
        border-radius: 10px;
        padding: 0.75rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.6rem 0.4rem;
    }

    .btn-icon {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .badge-modern {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }

    .modal-content-modern {
        width: 98%;
        margin: 1rem;
    }

    .modal-header-modern {
        padding: 0.75rem 1rem;
    }

    .modal-body-modern {
        padding: 1rem;
    }

    .modal-footer-modern {
        padding: 0.75rem 1rem;
    }

    .modal-title-modern {
        font-size: 1.1rem;
    }

    .btn-modern {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}