/*
 * Estilos CRUD Globales para FulgorTechAdmin
 * Basado en la grilla de Roles y Permisos y Consolidación
 */

/* ========================================
   CONTENEDORES / WRAPPERS DE PAGINA
   ======================================== */
.roles-wrapper, .crud-wrapper, .consolidacion-wrapper, .home-wrapper,
body:not(.report-page) .container-fluid > div:first-child {
    background-color: #ffffff !important;
    padding: 16px 20px !important;
    border-radius: 8px !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 2rem !important;
}

/* Margen superior para despegar del top navbar (excepto roles-wrapper) */
.crud-wrapper, .consolidacion-wrapper, .home-wrapper,
body:not(.report-page) .container-fluid > div:first-child:not(.roles-wrapper) {
    margin-top: 24px !important;
}

/* ========================================
   TABLAS / GRILLAS GLOBALES
   ======================================== */
table.table, table.table-custom, table.table-striped, table.table-bordered {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 15px !important;
    border: 1px solid #e2e8f0 !important;
    background-color: #ffffff !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

/* Encabezados de Tablas */
table.table th, table.table-custom th, table.table-striped th, table.table-bordered th {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background-color: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
    color: #475569 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 8px 10px !important;
    text-align: left !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

/* Filas / Celdas de Tablas */
table.table td, table.table-custom td, table.table-striped td, table.table-bordered td {
    padding: 8px 10px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    font-size: 12px !important;
    vertical-align: middle !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background-color: transparent !important;
}

/* Efecto Hover */
table.table tbody tr:hover td, table.table-custom tbody tr:hover td, 
table.table-striped tbody tr:hover td, table.table-bordered tbody tr:hover td {
    background-color: #f8fafc !important;
}

/* Ajustes de responsive wrapper */
.table-responsive {
    position: relative !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-height: 70vh !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

/* ========================================
   BOTONES PREMIUM GLOBALES
   ======================================== */
/* Botón de Creación / Principal */
.btn-create, .btn-primary, input[type="submit"].btn-primary {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 20px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    cursor: pointer !important;
}

.btn-create:hover, .btn-primary:hover, input[type="submit"].btn-primary:hover {
    background-color: #222222 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-1px) !important;
}

.btn-create:active, .btn-primary:active, input[type="submit"].btn-primary:active {
    transform: translateY(0) !important;
}

/* Botón Editar de Acción */
.btn-action-edit, .btn-default, .btn-secondary, a.btn-default {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.btn-action-edit:hover, .btn-default:hover, .btn-secondary:hover, a.btn-default:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
    text-decoration: none !important;
}

/* Botón Eliminar de Acción */
.btn-action-delete, .btn-danger {
    background-color: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fee2e2 !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.btn-action-delete:hover, .btn-danger:hover {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fca5a5 !important;
    text-decoration: none !important;
}

/* ========================================
   BOTONES DE ACCIÓN DE TABLA (CON ICONOS)
   ======================================== */
.btn-action {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
    font-size: 13px !important;
    text-decoration: none !important;
    margin: 0 4px !important;
}

.btn-action:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15) !important;
}

/* Editar (Lápiz) */
.btn-edit-action {
    background-color: #f1f5f9 !important;
    color: #000000 !important;
    border: 1px solid #cbd5e1 !important;
}

.btn-edit-action:hover {
    background-color: #333333 !important;
    color: #ffffff !important;
    border-color: #333333 !important;
}

/* Eliminar (Papelera) */
.btn-delete-action {
    background-color: #fff5f5 !important;
    color: #e03131 !important;
    border: 1px solid #ffc9c9 !important;
}

.btn-delete-action:hover {
    background-color: #e03131 !important;
    color: #ffffff !important;
    border-color: #e03131 !important;
}

/* Ver (Ojo) */
.btn-view-action {
    background-color: #e8f5e9 !important;
    color: #2e7d32 !important;
    border: 1px solid #a5d6a7 !important;
}

.btn-view-action:hover {
    background-color: #2e7d32 !important;
    color: #ffffff !important;
    border-color: #2e7d32 !important;
}

/* ========================================
   MODALES GLOBALES
   ======================================== */
.modal-content {
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden !important;
}

.modal-header {
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background-color: #ffffff !important;
}

.modal-header .modal-title, .modal-header h5, .modal-header h4 {
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
    font-size: 16px !important;
}

.modal-header .close {
    outline: none !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    color: #94a3b8 !important;
    font-size: 24px !important;
    line-height: 1 !important;
    opacity: 0.8 !important;
}

.modal-header .close:hover {
    color: #0f172a !important;
    opacity: 1 !important;
}

.modal-body {
    padding: 24px !important;
    background-color: #ffffff !important;
}

.modal-footer {
    border-top: 1px solid #f1f5f9 !important;
    padding: 16px 24px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background-color: #f8fafc !important;
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}

/* ========================================
   FORMULARIOS Y CAMPOS DE ENTRADA
   ======================================== */
.form-control, select.form-control, textarea.form-control {
    width: 100% !important;
    height: 38px !important;
    padding: 6px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    color: #0f172a !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
}

textarea.form-control {
    height: auto !important;
    min-height: 80px !important;
}

.form-control:focus {
    border-color: #000000 !important;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08) !important;
    outline: none !important;
}

/* ========================================
   BADGES Y ETIQUETAS
   ======================================== */
.badge-modulo, .badge-custom-info {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    border: 1px solid #cbd5e1 !important;
    display: inline-block !important;
}

.badge-permisos-count, .badge-custom-success {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    border: 1px solid #bae6fd !important;
    display: inline-block !important;
}

/* ========================================
   ADICIONES PARA BOTONES DE BOOTSTRAP DE COLOR
   ======================================== */
.btn-success, input[type="button"].btn-success, input[type="submit"].btn-success {
    background-color: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.btn-success:hover, input[type="button"].btn-success:hover, input[type="submit"].btn-success:hover {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
    border-color: #6ee7b7 !important;
    text-decoration: none !important;
}

.btn-info, input[type="button"].btn-info, input[type="submit"].btn-info {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.btn-info:hover, input[type="button"].btn-info:hover, input[type="submit"].btn-info:hover {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    border-color: #93c5fd !important;
    text-decoration: none !important;
}

.btn-warning, input[type="button"].btn-warning, input[type="submit"].btn-warning {
    background-color: #fffbeb !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.btn-warning:hover, input[type="button"].btn-warning:hover, input[type="submit"].btn-warning:hover {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    border-color: #fcd34d !important;
    text-decoration: none !important;
}

/* ========================================
   ESTILOS SEMANTICOS DE BOTONES
   ======================================== */
/* Botón Guardar / Crear (Verde Solid) */
.btn-save-style {
    background-color: #10b981 !important;
    color: #ffffff !important;
    border: 1px solid #059669 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
}
.btn-save-style:hover {
    background-color: #059669 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    transform: translateY(-1px) !important;
}

/* Botón Eliminar (Rojo Solid) */
.btn-delete-style {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border: 1px solid #dc2626 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
}
.btn-delete-style:hover {
    background-color: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    transform: translateY(-1px) !important;
}

/* Botón Neutro / Volver / Siguiente / Cancelar (Blanco y Negro) */
.btn-neutral-style {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
}
.btn-neutral-style:hover {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

/* ========================================
   ESTILOS DE DETALLE (DL A GRILLA PROFESIONAL)
   ======================================== */
dl.dl-horizontal {
    display: grid !important;
    grid-template-columns: 220px 1fr !important;
    gap: 12px 20px !important;
    margin: 20px 0 !important;
    padding: 24px !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

dl.dl-horizontal dt {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #475569 !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    border-bottom: 1px dashed #e2e8f0 !important;
    text-align: left !important;
    width: auto !important;
}

dl.dl-horizontal dd {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    border-bottom: 1px dashed #e2e8f0 !important;
}

@media (max-width: 768px) {
    dl.dl-horizontal {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 16px !important;
    }
    dl.dl-horizontal dt {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }
}

/* ========================================
   FORMULARIOS DENTRO DE CELDAS DE TABLAS
   ======================================== */
table td form {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* ========================================
   CORRECCION DE VISIBILIDAD EN PREMIUM-EDIT-HEADER
   ======================================== */
.premium-edit-header h2,
.premium-edit-header h1,
.premium-edit-header h2 *,
.premium-edit-header h1 *,
.premium-edit-header .page-title,
.premium-edit-header .page-titles,
.premium-edit-header .page-title i,
.premium-edit-header .page-titles i {
    color: white !important;
}

.premium-edit-header p,
.premium-edit-header .page-subtitle,
.premium-edit-header .page-subtitles {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* ========================================
   TITULOS DE PÁGINA PREMIUM
   ======================================== */
.page-title, .page-titles, h2:first-of-type {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: black !important;
    letter-spacing: -0.5px !important;
    margin-top: 15px !important;
    margin-bottom: 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    border-bottom: none !important;
}

.page-title i, .page-titles i, h2:first-of-type i {
    color: white !important;
    font-size: 20px !important;
}

.page-subtitle, .page-subtitles {
    font-size: 13px !important;
    color: white !important;
    margin-top: -4px !important;
    margin-bottom: 24px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
}




