/* ==========================================================================
   SGCI THEME V2 - COMPONENTES Y BOTONES DE ACCIONES
   Estilos específicos para todos los botones de todos los plugins siguiendo
   el patrón de diseño de sgci-proveedores-gastos
   ========================================================================== */

/* ==========================================================================
   BOTONES BASE - ESTILO SGCI ESTÁNDAR
   ========================================================================== */

/* Remover bordes y border-radius para coherencia con sgci-proveedores-gastos */
.button {
    border: none !important;
    border-radius: 0 !important;
    transition: all 0.2s ease !important;
}

/* Forzar que los botones se mantengan horizontales siempre */
.button-group {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    display: flex;
    gap: 6px;
    justify-content: flex-end !important;
    align-items: center !important;
}

.button-group .button {
    margin-bottom: 0 !important;
    margin: 0;
}

/* Alineación específica para columnas de acciones */
.text-right {
    text-align: right !important;
}

.text-right .button-group {
    justify-content: flex-end !important;
    margin-left: auto !important;
}

/* Asegurar que las celdas de acciones tengan el ancho correcto */
td.text-right {
    text-align: right !important;
    white-space: nowrap;
    width: 120px;
    min-width: 120px;
    vertical-align: middle;
}

/* Responsive: mantener botones horizontales incluso en móvil */
@media screen and (max-width: 768px) {
    .button-group {
        flex-direction: row !important;
    }
}

/* ==========================================================================
   BOTONES DE VER/VISUALIZAR - TODOS LOS PLUGINS
   ========================================================================== */

.ver-proveedor,
.ver-cliente,
.ver-gasto-proveedor,
.ver-factura,
.ver-item {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

.ver-proveedor:hover,
.ver-proveedor:focus,
.ver-cliente:hover,
.ver-cliente:focus,
.ver-gasto-proveedor:hover,
.ver-gasto-proveedor:focus,
.ver-factura:hover,
.ver-factura:focus,
.ver-item:hover,
.ver-item:focus {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
    color: white !important;
}

/* ==========================================================================
   BOTONES DE EDITAR - TODOS LOS PLUGINS
   ========================================================================== */

.editar-proveedor,
.editar-cliente,
.editar-gasto-proveedor,
.editar-factura,
.editar-item,
.editar-obra,
.editar-centro,
.editar-departamento,
.editar-cuenta-contable,
.editar-senalizacion {
    background-color: #007cba !important;
    border-color: #007cba !important;
    color: white !important;
}

.editar-proveedor:hover,
.editar-proveedor:focus,
.editar-cliente:hover,
.editar-cliente:focus,
.editar-gasto-proveedor:hover,
.editar-gasto-proveedor:focus,
.editar-factura:hover,
.editar-factura:focus,
.editar-item:hover,
.editar-item:focus,
.editar-obra:hover,
.editar-obra:focus,
.editar-centro:hover,
.editar-centro:focus,
.editar-departamento:hover,
.editar-departamento:focus,
.editar-cuenta-contable:hover,
.editar-cuenta-contable:focus,
.editar-senalizacion:hover,
.editar-senalizacion:focus {
    background-color: #005177 !important;
    border-color: #004085 !important;
    color: white !important;
}

/* ==========================================================================
   BOTONES DE VALIDAR/CONFIRMAR - VERDE
   ========================================================================== */

.validar-gasto-proveedor,
.validar-factura,
.validar-item,
.confirmar-item {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

.validar-gasto-proveedor:hover,
.validar-gasto-proveedor:focus,
.validar-factura:hover,
.validar-factura:focus,
.validar-item:hover,
.validar-item:focus,
.confirmar-item:hover,
.confirmar-item:focus {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    color: white !important;
}

/* ==========================================================================
   BOTONES DE ELIMINAR/BORRAR - TODOS LOS PLUGINS
   ========================================================================== */

.eliminar-proveedor,
.eliminar-cliente,
.eliminar-gasto-proveedor,
.eliminar-factura,
.eliminar-item,
.eliminar-obra,
.eliminar-centro,
.borrar-senalizacion,
.borrar-departamento,
.borrar-cuenta-contable,
.borrar-obra {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.eliminar-proveedor:hover,
.eliminar-proveedor:focus,
.eliminar-cliente:hover,
.eliminar-cliente:focus,
.eliminar-gasto-proveedor:hover,
.eliminar-gasto-proveedor:focus,
.eliminar-factura:hover,
.eliminar-factura:focus,
.eliminar-item:hover,
.eliminar-item:focus,
.eliminar-obra:hover,
.eliminar-obra:focus,
.eliminar-centro:hover,
.eliminar-centro:focus,
.borrar-senalizacion:hover,
.borrar-senalizacion:focus,
.borrar-departamento:hover,
.borrar-departamento:focus,
.borrar-cuenta-contable:hover,
.borrar-cuenta-contable:focus,
.borrar-obra:hover,
.borrar-obra:focus {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
    color: white !important;
}

/* ==========================================================================
   ESTADOS FOCUS PARA ACCESIBILIDAD
   ========================================================================== */

/* Ver */
.ver-proveedor:focus,
.ver-cliente:focus,
.ver-gasto-proveedor:focus,
.ver-factura:focus,
.ver-item:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.3) !important;
}

/* Editar */
.editar-proveedor:focus,
.editar-cliente:focus,
.editar-gasto-proveedor:focus,
.editar-factura:focus,
.editar-item:focus,
.editar-obra:focus,
.editar-centro:focus,
.editar-departamento:focus,
.editar-cuenta-contable:focus,
.editar-senalizacion:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.3) !important;
}

/* Validar */
.validar-gasto-proveedor:focus,
.validar-factura:focus,
.validar-item:focus,
.confirmar-item:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3) !important;
}

/* Eliminar */
.eliminar-proveedor:focus,
.eliminar-cliente:focus,
.eliminar-gasto-proveedor:focus,
.eliminar-factura:focus,
.eliminar-item:focus,
.eliminar-obra:focus,
.eliminar-centro:focus,
.borrar-senalizacion:focus,
.borrar-departamento:focus,
.borrar-cuenta-contable:focus,
.borrar-obra:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3) !important;
}

/* ==========================================================================
   ESTADOS ACTIVE PARA FEEDBACK VISUAL
   ========================================================================== */

.ver-proveedor:active,
.ver-cliente:active,
.ver-gasto-proveedor:active,
.ver-factura:active,
.ver-item:active,
.editar-proveedor:active,
.editar-cliente:active,
.editar-gasto-proveedor:active,
.editar-factura:active,
.editar-item:active,
.editar-obra:active,
.editar-centro:active,
.editar-departamento:active,
.editar-cuenta-contable:active,
.editar-senalizacion:active,
.validar-gasto-proveedor:active,
.validar-factura:active,
.validar-item:active,
.confirmar-item:active,
.eliminar-proveedor:active,
.eliminar-cliente:active,
.eliminar-gasto-proveedor:active,
.eliminar-factura:active,
.eliminar-item:active,
.eliminar-obra:active,
.eliminar-centro:active,
.borrar-senalizacion:active,
.borrar-departamento:active,
.borrar-cuenta-contable:active,
.borrar-obra:active {
    transform: translateY(0) !important;
    transition: transform 0.1s ease !important;
}

/* ==========================================================================
   BOTONES TINY CON EFECTOS PROFESIONALES
   ========================================================================== */

.button.tiny {
    transition: all 0.2s ease !important;
    padding: 0 !important;
    font-size: 12px;
    width: 36px !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    min-width: 36px !important;
    max-width: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    box-sizing: border-box !important;
}

.button.tiny:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

/* ==========================================================================
   BOTONES EN MODALES - CONSISTENCIA
   ========================================================================== */

.reveal .cell.medium-12 .button {
    min-width: 120px;
    margin-right: 10px;
    padding: 0.75rem 1.25rem;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
    height: auto;
    line-height: 1;
    transition: all 0.2s ease;
}

.reveal .cell.medium-12 .button:last-child {
    margin-right: 0;
}

/* Botones específicos del modal */
.reveal .button.alert,
.reveal .button.alert.eliminar-form {
    background: linear-gradient(135deg, #dc3545 0%, #c53030 100%) !important;
    color: white !important;
}

.reveal .button.alert:hover,
.reveal .button.alert.eliminar-form:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(197, 48, 48, 0.4) !important;
}

.reveal .button.secondary,
.reveal .button.secondary.cancelar-form {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    color: white !important;
}

.reveal .button.secondary:hover,
.reveal .button.secondary.cancelar-form:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4) !important;
}

.reveal .button.primary {
    background: linear-gradient(135deg, #007cba 0%, #005177 100%);
    color: white;
}

.reveal .button.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.4);
}

/* ==========================================================================
   MODALES PROFESIONALES
   ========================================================================== */

.reveal {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid #dee2e6;
}

/* ==========================================================================
   BOTONES FOUNDATION FRAMEWORK
   ========================================================================== */

.button.primary {
    background: linear-gradient(135deg, #007cba 0%, #005177 100%);
    color: white;
}

.button.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.4);
}

.button.success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.button.success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    color: white !important;
}

.button.secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.button.secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.button.alert {
    background: linear-gradient(135deg, #dc3545 0%, #c53030 100%);
    color: white;
}

.button.alert:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* ==========================================================================
   ALERTS Y NOTIFICACIONES
   ========================================================================== */

.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    position: relative;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* ==========================================================================
   LOADING Y SPINNERS - ELIMINADOS
   ========================================================================== */

/* Loading spinner eliminado - era molesto visualmente */

/* ==========================================================================
   TABLAS PROFESIONALES
   ========================================================================== */

/* Headers de tabla consistentes */
table thead th {
    background-color: #495057 !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    letter-spacing: 0.25px !important;
    padding: 12px 8px !important;
    border: 1px solid #6c757d !important;
}

/* Celdas de tabla */
table tbody td {
    padding: 12px 8px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #dee2e6 !important;
    font-size: 16px !important;
}

/* Filas alternas */
table tbody tr:nth-child(even) {
    background-color: #f8f9fa !important;
}

/* Hover en filas */
table tbody tr:hover {
    background-color: #e9ecef !important;
}

/* Header específico de acciones */
th.text-right {
    text-align: right !important;
    width: 120px !important;
    min-width: 120px !important;
}

/* Elementos dentro de tablas */
table td select,
table td .custom-status-select {
    font-size: 13px !important;
    padding: 6px 8px !important;
    border: 1px solid #ced4da !important;
    border-radius: 3px !important;
    background-color: white !important;
}

/* Dropdowns de estado */
.custom-status-select {
    position: relative !important;
    display: inline-block !important;
    min-width: 100px !important;
}

/* Asegurar consistencia en todos los elementos de tabla */
table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

/* Contenedor de tabla */
.table-container {
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

/* ==========================================================================
   FORMULARIOS Y CAMPOS
   ========================================================================== */

/* Campos de entrada mejorados */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    font-size: 16px !important;
    padding: 8px 12px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    line-height: 1.4 !important;
}

/* Botones de formulario y acciones */
.button:not(.tiny) {
    font-size: 16px !important;
    padding: 10px 16px !important;
    line-height: 1.4 !important;
}

/* Labels mejorados */
label {
    font-size: 16px !important;
    font-weight: 500 !important;
    margin-bottom: 6px !important;
    display: block;
}

/* --------------------------------------------------------------------------
   INPUT BLOQUEADO REUTILIZABLE (para cualquier plugin)
   Usar class="sgci-locked-input" junto a readonly para activar el estilo
   -------------------------------------------------------------------------- */
input.sgci-locked-input[readonly] {
    cursor: not-allowed;
    background-color: var(--sgci-gray-100);
    color: var(--sgci-gray-500);
    border-color: var(--sgci-gray-300);
    box-shadow: none;
    caret-color: transparent;
}

input.sgci-locked-input[readonly]::placeholder {
    color: var(--sgci-gray-400);
}

input.sgci-locked-input[readonly]:focus,
input.sgci-locked-input[readonly]:hover {
    outline: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

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

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; } 