/* =====================================================
   SISTEMA DE DISEÑO PROAUTEK ADMIN
   =====================================================
   
   Este archivo contiene todos los estilos estandarizados
   para mantener consistencia visual en todo el proyecto.
   
   Estructura:
   1. Variables CSS (colores, espaciados, fuentes)
   2. Elementos base (tipografía, contenedores)
   3. Componentes comunes (cards, botones, tablas)
   4. Layouts específicos
   5. Utilidades y helpers
   ===================================================== */

/* =====================================================
   1. VARIABLES CSS - DESIGN TOKENS
   ===================================================== */

:root {
    /* === COLORES PRINCIPALES === */
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-light: #6ea8fe;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    /* === COLORES DE FONDO === */
    --bg-body: #f8f9fa;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-dark: #212529;
    --bg-muted: #e9ecef;
    
    /* === COLORES DE TEXTO === */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --text-white: #ffffff;
    
    /* === ESPACIADOS === */
    --spacing-xs: 0.25rem;  /* 4px */
    --spacing-sm: 0.5rem;   /* 8px */
    --spacing-md: 1rem;     /* 16px */
    --spacing-lg: 1.5rem;   /* 24px */
    --spacing-xl: 2rem;     /* 32px */
    --spacing-xxl: 3rem;    /* 48px */
    
    /* === TIPOGRAFÍA === */
    --font-family-base: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    --font-size-xs: 0.75rem;   /* 12px */
    --font-size-sm: 0.875rem;  /* 14px */
    --font-size-base: 1rem;    /* 16px */
    --font-size-lg: 1.125rem;  /* 18px */
    --font-size-xl: 1.25rem;   /* 20px */
    --font-size-xxl: 1.5rem;   /* 24px */
    
    /* === SOMBRAS === */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    /* === BORDES === */
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-color: #dee2e6;
    --border-color-light: #f0f0f0;
    
    /* === TRANSICIONES === */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* =====================================================
   2. ELEMENTOS BASE - RESET Y CONFIGURACIÓN GLOBAL
   ===================================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-body);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
}

/* =====================================================
   3. TIPOGRAFÍA ESTANDARIZADA
   ===================================================== */

/* === TÍTULOS PRINCIPALES === */
.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: var(--spacing-sm);
}

/* === SUBTÍTULOS DE SECCIÓN === */
.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

/* === SUBTÍTULOS AZULES (para formularios) === */
.subtitle-blue {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* === ENCABEZADOS DE PÁGINA === */
.page-header {
    background: var(--bg-white);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.page-header p {
    color: var(--text-secondary);
    margin: var(--spacing-sm) 0 0 0;
    font-size: var(--font-size-sm);
}

/* =====================================================
   4. COMPONENTES - TARJETAS
   ===================================================== */

/* === TARJETAS ESTÁNDAR === */
.card-standard {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    margin-bottom: var(--spacing-lg);
}

.card-standard:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-standard .card-header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) var(--spacing-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.card-standard .card-body {
    padding: var(--spacing-lg);
}

/* === TARJETAS DE ESTADÍSTICAS === */
.stats-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-xl);
    text-align: center;
    transition: var(--transition-normal);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stats-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.stats-card .stats-icon {
    font-size: 3rem;
    opacity: 0.2;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.stats-card .stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

.stats-card .stats-label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* === VARIANTES DE COLORES PARA STATS CARDS === */
.stats-card-primary .stats-icon,
.stats-card-primary .stats-number {
    color: var(--primary-color);
}

.stats-card-success .stats-icon,
.stats-card-success .stats-number {
    color: var(--success-color);
}

.stats-card-warning .stats-icon,
.stats-card-warning .stats-number {
    color: var(--warning-color);
}

.stats-card-danger .stats-icon,
.stats-card-danger .stats-number {
    color: var(--danger-color);
}

.stats-card-info .stats-icon,
.stats-card-info .stats-number {
    color: var(--info-color);
}

.stats-card-secondary .stats-icon,
.stats-card-secondary .stats-number {
    color: var(--secondary-color);
}

/* =====================================================
   5. COMPONENTES - FORMULARIOS
   ===================================================== */

/* === CONTENEDORES DE BÚSQUEDA === */
.search-container {
    background: var(--bg-white);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* === FORMULARIOS FLOTANTES === */
.form-floating > .form-control,
.form-floating > .form-select {
    border: none;
    border-bottom: 2px solid var(--border-color);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    height: calc(3.5rem + 2px);
    min-height: 3.5rem;
    transition: var(--transition-fast);
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: none;
    background: transparent;
}

.form-floating > label {
    padding: 1rem 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* === CAMPOS OBLIGATORIOS === */
.required-field::before {
    content: '*';
    color: var(--danger-color);
    margin-right: var(--spacing-xs);
    font-size: 1.1em;
    font-weight: bold;
}

/* === SECCIONES DE FORMULARIO === */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color-light);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h4 {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

/* === TIPOS DE INPUT EN FORMULARIOS === */
.form-input-file {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--background-color);
    background-image: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input-file:focus {
    color: var(--text-primary);
    background-color: var(--background-color);
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
}

.form-textarea {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--background-color);
    background-image: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    resize: vertical;
    min-height: 100px;
}

.form-textarea:focus {
    color: var(--text-primary);
    background-color: var(--background-color);
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
}

.form-help {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* =====================================================
   6. COMPONENTES - BOTONES
   ===================================================== */

/* === BOTONES ESTANDARIZADOS (PEQUEÑOS Y DISCRETOS) === */
.btn {
    font-weight: 400;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
    padding: 0.4rem 0.8rem;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.4;
}

.btn:hover {
    opacity: 0.85;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn i {
    font-size: 0.8rem;
}

/* === TAMAÑOS DE BOTONES === */
.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
}

.btn-xs i {
    font-size: 0.7rem;
}

/* === COLORES PLANOS Y FORMALES === */
.btn-primary {
    background: #5a6c7d;
    color: #ffffff;
    border-color: #5a6c7d;
}

.btn-primary:hover {
    background: #4a5a69;
    color: #ffffff;
    border-color: #4a5a69;
}

.btn-success {
    background: #6b8e7a;
    color: #ffffff;
    border-color: #6b8e7a;
}

.btn-success:hover {
    background: #5a7a67;
    color: #ffffff;
    border-color: #5a7a67;
}

.btn-warning {
    background: #a08956;
    color: #ffffff;
    border-color: #a08956;
}

.btn-warning:hover {
    background: #8f7849;
    color: #ffffff;
    border-color: #8f7849;
}

.btn-danger {
    background: #8b5a5a;
    color: #ffffff;
    border-color: #8b5a5a;
}

.btn-danger:hover {
    background: #7a4d4d;
    color: #ffffff;
    border-color: #7a4d4d;
}

.btn-secondary {
    background: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    color: #ffffff;
    border-color: #5a6268;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
    font-weight: 400;
    transition: all 0.15s ease;
}

.btn-outline:hover {
    background-color: #6c757d;
    color: #ffffff;
    opacity: 1;
}

.btn-outline-secondary {
    background-color: transparent;
    border: 1px solid #8e9aaf;
    color: #6c757d;
    font-weight: 400;
    transition: all 0.15s ease;
}

.btn-outline-secondary:hover {
    background-color: #8e9aaf;
    color: #ffffff;
    opacity: 1;
}

.btn-light {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #6c757d;
    font-weight: 400;
    transition: all 0.15s ease;
}

.btn-light:hover {
    background-color: #e8e8e8;
    border-color: #d0d0d0;
    color: #5a6268;
    opacity: 1;
}

/* === GRUPOS DE BOTONES (MEJORADOS) === */
.action-buttons {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    align-items: center;
}

.action-buttons.center {
    justify-content: center;
}

.action-buttons.start {
    justify-content: flex-start;
}

/* === BOTONES EN LÍNEA === */
.btn-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    margin: 0 0.2rem;
}

/* === BOTONES DE TABLA === */
.table-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
}

.table-actions .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    min-width: 24px;
    height: 24px;
}

.table-actions .btn i {
    font-size: 0.65rem;
}

/* =====================================================
   7. COMPONENTES - TABLAS
   ===================================================== */

/* === CONTENEDORES DE TABLA === */
.table-container {
    background: var(--bg-white);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

.table-responsive {
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    width: 100%;
    overflow-x: auto;
    margin-bottom: var(--spacing-lg);
}

/* === ESTILOS DE TABLA === */
.table-standard {
    width: 100%;
    margin-bottom: 0;
    table-layout: fixed;
}

.table-standard th {
    background-color: var(--dark-color);
    color: var(--text-white);
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    padding: var(--spacing-md);
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-standard td {
    padding: var(--spacing-md);
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
}

.table-standard td:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.table-standard td:nth-child(2) {
    padding: 0.75rem;
}

.table-standard td:nth-child(3),
.table-standard td:nth-child(4) {
    text-align: center;
}

.table-standard tbody tr:hover {
    background-color: var(--bg-light);
}

/* =====================================================
   8. COMPONENTES - ALERTAS Y NOTIFICACIONES
   ===================================================== */

/* === ALERTAS MEJORADAS === */
.alert {
    border: none;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.alert-success {
    background: #d1e7dd;
    color: #0a3622;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: #f8d7da;
    color: #58151c;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    color: #664d03;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #055160;
    border-left: 4px solid var(--info-color);
}

/* =====================================================
   9. COMPONENTES - BADGES Y ETIQUETAS
   ===================================================== */

.badge {
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background-color: var(--success-color);
    color: var(--text-white);
}

.badge-inactive {
    background-color: var(--secondary-color);
    color: var(--text-white);
}

.badge-primary {
    background-color: var(--primary-color);
    color: var(--text-white);
}

/* === BADGES ADICIONALES === */
.badge-secondary {
    background-color: var(--secondary-color);
    color: var(--text-white);
}

.badge-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.badge-info {
    background-color: var(--info-color);
    color: var(--text-white);
}

/* =====================================================
   10. LAYOUTS - ESTRUCTURA PRINCIPAL
   ===================================================== */

/* === CONTENEDOR PRINCIPAL === */
.main-content {
    margin-left: 60px;
    margin-top: 20px; /* Espaciado superior para evitar superposición */
    width: calc(100vw - 60px);
    max-width: calc(100vw - 60px);
    padding: var(--spacing-xl);
    transition: margin-left var(--transition-normal), width var(--transition-normal);
    min-height: calc(100vh - 20px); /* Ajustamos para compensar el margin-top */
    overflow-x: auto;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0 !important;
        margin-top: 15px !important; /* Espaciado superior reducido para móviles */
        width: 100vw !important;
        max-width: 100vw !important;
        padding: var(--spacing-md);
        min-height: calc(100vh - 15px); /* Ajustamos para compensar el margin-top */
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .stats-card {
        margin-bottom: var(--spacing-md);
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
        width: 100%;
    }
}

/* =====================================================
   11. UTILIDADES
   ===================================================== */

/* === ESPACIADOS === */
.mt-custom { margin-top: var(--spacing-xl); }
.mb-custom { margin-bottom: var(--spacing-xl); }
.p-custom { padding: var(--spacing-lg); }

/* === TEXTO === */
.text-primary-custom { color: var(--primary-color); }
.text-muted-custom { color: var(--text-muted); }

/* === BORDES === */
.border-primary-left {
    border-left: 4px solid var(--primary-color);
}

/* === ANIMACIONES === */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* === ESTADOS DE CARGA === */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   12. MODO OSCURO (FUTURO)
   ===================================================== */

/* Preparación para futuro modo oscuro */
@media (prefers-color-scheme: dark) {
    /* Variables oscuras se pueden definir aquí en el futuro */
}

/* =====================================================
   13. IMPRESIÓN
   ===================================================== */

@media print {
    .sidebar,
    .btn,
    .search-container {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        margin-top: 0 !important; /* Sin margen superior en impresión */
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* =====================================================
   CLASES ADICIONALES PARA TABLAS Y FORMULARIOS
   ===================================================== */

/* === CONTENEDOR DE TABLA === */
.table-container {
    background: var(--bg-white);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

/* === BOTONES DE ACCIÓN (PEQUEÑOS Y DISCRETOS) === */
.action-buttons {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    align-items: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.5rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    font-size: 0.75rem;
    text-decoration: none;
    transition: opacity 0.15s ease;
    cursor: pointer;
    min-width: 28px;
    height: 28px;
}

.btn-action:hover {
    opacity: 0.8;
}

.btn-action-info {
    background: #7a8a9a;
    color: #ffffff;
}

.btn-action-info:hover {
    background: #6c7b89;
    color: #ffffff;
}

.btn-action-warning {
    background: #a08956;
    color: #ffffff;
}

.btn-action-warning:hover {
    background: #8f7849;
    color: #ffffff;
}

.btn-action-danger {
    background: #8b5a5a;
    color: #ffffff;
}

.btn-action-danger:hover {
    background: #7a4d4d;
    color: #ffffff;
}

/* === BADGES ACTUALIZADOS === */
.badge-success {
    background-color: var(--success-color);
    color: var(--text-white);
}

.badge-danger {
    background-color: var(--danger-color);
    color: var(--text-white);
}

/* === TOOLBAR DE ACCIONES === */
.toolbar-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md) 0;
}

.toolbar-actions .text-info {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* === FORMULARIOS DE BÚSQUEDA (MEJORADOS) === */
.search-form {
    width: 100%;
    margin: 0;
}

.search-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: var(--spacing-md);
    align-items: end;
}

.search-field {
    display: flex;
    flex-direction: column;
}

.search-actions {
    display: flex;
    gap: 0.3rem;
    align-items: end;
    flex-wrap: wrap;
}

.search-actions .btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

/* === ESTILOS ESPECÍFICOS PARA INVENTARIO === */
.search-actions-inventory {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-actions-inventory .btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.875rem;
    height: auto;
    min-height: 42px;
    border-radius: var(--border-radius-sm);
}

.search-actions-inventory .btn-search {
    background: #4a90e2;
    border: 1px solid #4a90e2;
    color: white;
    font-weight: 500;
}

.search-actions-inventory .btn-search:hover {
    background: #357abd;
    border-color: #357abd;
    opacity: 0.9;
}

.search-actions-inventory .btn-clear {
    background: #8e9aaf;
    border: 1px solid #8e9aaf;
    color: white;
    font-weight: 500;
}

.search-actions-inventory .btn-clear:hover {
    background: #7a8699;
    border-color: #7a8699;
    opacity: 0.9;
}

/* =====================================================
   CLASES PARA DASHBOARD Y PANELES
   ===================================================== */

/* === GRID DE ESTADÍSTICAS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xxl);
}

/* === GRID DE DASHBOARD === */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xxl);
}

.dashboard-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-xl);
    text-align: center;
    transition: var(--transition-normal);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.dashboard-card-disabled {
    background: var(--bg-light);
    opacity: 0.7;
}

.dashboard-card-disabled:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

.dashboard-card-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto var(--spacing-lg);
}

.dashboard-card-icon-primary {
    background: var(--primary-color);
}

.dashboard-card-icon-success {
    background: var(--success-color);
}

.dashboard-card-icon-warning {
    background: var(--warning-color);
}

.dashboard-card-icon-danger {
    background: var(--danger-color);
}

.dashboard-card-icon-info {
    background: var(--info-color);
}

.dashboard-card-icon-secondary {
    background: var(--secondary-color);
}

.dashboard-card h5 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    font-weight: 600;
}

.dashboard-card p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    flex-grow: 1;
}

.btn-disabled {
    background: var(--bg-muted);
    color: var(--text-muted);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    text-transform: uppercase;
    font-size: var(--font-size-sm);
    letter-spacing: 0.5px;
    cursor: not-allowed;
}

/* === RESPONSIVE PARA DASHBOARD === */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .stats-card,
    .dashboard-card {
        padding: var(--spacing-lg);
    }
    
    .stats-card .stats-number {
        font-size: 2rem;
    }
    
    .stats-card .stats-icon {
        font-size: 2.5rem;
    }
    
    .dashboard-card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* =====================================================
   CLASES PARA FORMULARIOS ESTANDARIZADOS
   ===================================================== */

/* === CONTENEDORES DE FORMULARIO === */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    background: var(--bg-white);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.form-row.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-lg {
    grid-column: span 2;
}

/* === INPUTS Y SELECTS === */
.form-input,
.form-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    transition: var(--transition-fast);
    background: var(--bg-white);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

/* === ASTERISCO OBLIGATORIO === */
.required-asterisk {
    color: var(--danger-color);
    margin-right: var(--spacing-xs);
    font-size: 1.1em;
    font-weight: bold;
}

/* === SUBIDA DE ARCHIVOS (MEJORADO) === */
.file-upload-container {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-xl);
    text-align: center;
    transition: var(--transition-fast);
    background: #fafbfc;
}

.file-upload-container:hover {
    border-color: var(--primary-color);
    background: var(--bg-light);
}

.file-upload-container .form-label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.file-upload-container .btn {
    margin-top: 1rem;
}

/* === INFO DISPLAY COMPONENTS === */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-item {
    min-height: 60px;
}

.info-item label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.info-value {
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    background: var(--background-light);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-value a {
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-value a:hover {
    text-decoration: underline;
}

/* Content grid layout */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-top: 2rem;
}

.content-main {
    min-width: 0; /* Prevents overflow issues */
}

.content-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

/* Sidebar cards */
.sidebar-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-card h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

/* Action buttons vertical */
.action-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-buttons-vertical .btn {
    width: 100%;
    justify-content: center;
}

/* Info list for small items */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item-small {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item-small .label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.info-item-small .value {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .content-sidebar {
        position: static;
        order: -1;
    }
    
    .action-buttons-vertical {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .action-buttons-vertical .btn {
        flex: 1;
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sidebar-card {
        padding: 1rem;
    }
    
    .action-buttons-vertical {
        flex-direction: column;
    }
}

/* === ENHANCED ACTION BUTTONS === */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
}

.action-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* Better icon alignment in buttons */
.btn i {
    font-size: 1em;
    line-height: 1;
}

/* === PERCENTAGE DISPLAY === */
.percentage-display {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-primary);
    font-size: 1rem;
    pointer-events: none;
    font-weight: 500;
}

/* Better relative positioning for input containers */
.form-group {
    position: relative;
}

.form-group.has-percentage .form-input,
.form-group.has-percentage .form-select {
    padding-right: 4rem;
}

/* === UTILITY CLASSES === */
.uppercase {
    text-transform: uppercase;
}

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

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

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

.text-nowrap {
    white-space: nowrap;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Position utilities */
.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
}

.position-sticky {
    position: sticky;
}

/* Display utilities */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.d-grid {
    display: grid !important;
}

/* Flex utilities */
.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.align-items-center {
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-column {
    flex-direction: column;
}

/* Spacing utilities */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.ml-1, .ms-1 { margin-left: 0.25rem; }
.ml-2, .ms-2 { margin-left: 0.5rem; }
.ml-3, .ms-3 { margin-left: 1rem; }

.mr-1, .me-1 { margin-right: 0.25rem; }
.mr-2, .me-2 { margin-right: 0.5rem; }
.mr-3, .me-3 { margin-right: 1rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }

/* Width utilities */
.w-100 { width: 100%; }
.w-75 { width: 75%; }
.w-50 { width: 50%; }
.w-25 { width: 25%; }

/* Height utilities */
.h-100 { height: 100%; }

/* Border utilities */
.border { border: 1px solid var(--border-color); }
.border-0 { border: 0; }
.rounded { border-radius: var(--border-radius); }
.rounded-circle { border-radius: 50%; }

/* Background utilities */
.bg-light { background-color: var(--background-light); }
.bg-white { background-color: #fff; }

/* Shadow utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* === IMAGE PREVIEW === */
.img-preview {
    max-width: 100px;
    max-height: 60px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color-light);
}

.img-preview-large {
    max-width: 200px;
    max-height: 150px;
    border-radius: var(--border-radius);
    object-fit: cover;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color-light);
}

/* === PREVIEW IMAGES FOR PROMOTIONS === */
.preview-img {
    max-width: 120px;
    max-height: 75px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color-light);
    display: block;
    margin: 0 auto;
}

/* === EMPTY STATE ICONS === */
.empty-state-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* === CODE DISPLAY === */
.code-display {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.code-display-info {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: var(--border-radius);
    padding: 1rem;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* === PDF IFRAME === */
.pdf-viewer {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: 100%;
    height: 600px;
}

/* === REQUIRED FIELD LABELS === */
.form-label.required::before {
    content: "*";
    color: var(--danger-color);
    margin-right: 0.25rem;
    font-size: 1.1em;
    font-weight: bold;
}

/* File Upload Button Styles (Discreto) */
.btn-file-upload {
    background: #6c757d;
    border: 1px solid #6c757d;
    color: white;
    font-weight: 400;
    transition: opacity 0.15s ease;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.btn-file-upload:hover {
    background: #5a6268;
    border-color: #5a6268;
    color: white;
    opacity: 0.9;
}

.btn-file-upload i {
    font-size: 0.75rem;
    margin-right: 0.3rem;
}

/* Search Button Styles (Discreto) */
.btn-search {
    background: #7a8a9a;
    border: 1px solid #7a8a9a;
    color: white;
    font-weight: 400;
    transition: opacity 0.15s ease;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.btn-search:hover {
    background: #6c7b89;
    border-color: #6c7b89;
    color: white;
    opacity: 0.9;
}

.btn-search i {
    font-size: 0.75rem;
    margin-right: 0.3rem;
}

/* Clear/Limpiar Button Styles (Discreto) */
.btn-clear {
    background: #8e9aaf;
    border: 1px solid #8e9aaf;
    color: white;
    font-weight: 400;
    transition: opacity 0.15s ease;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.btn-clear:hover {
    background: #7a8699;
    border-color: #7a8699;
    color: white;
    opacity: 0.9;
}

.btn-clear i {
    font-size: 0.75rem;
    margin-right: 0.3rem;
}

/* Download/Export Button Styles */
.btn-download {
    background: #28a745;
    border: 1px solid #28a745;
    color: white;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-download:hover {
    background: #218838;
    border-color: #218838;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.btn-download::before {
    content: '💾';
    margin-right: 4px;
    font-size: 0.8em;
}

/* Print Button Styles */
.btn-print {
    background: #ffc107;
    border: 1px solid #ffc107;
    color: #212529;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-print:hover {
    background: #e0a800;
    border-color: #e0a800;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.btn-print::before {
    content: '🖨️';
    margin-right: 4px;
    font-size: 0.8em;
}

/* Icon-only Button Styles */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2em;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    transform: scale(1.1);
}

/* Button Group Styles */
.btn-group {
    display: inline-flex;
    gap: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-group .btn {
    border-radius: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-group .btn:first-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    border-right: none;
}

.btn-group .btn:only-child {
    border-radius: var(--border-radius);
    border-right: none;
}

/* Custom File Input Styling */
.file-input-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: var(--font-size-base);
}

.file-input-wrapper:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.file-input-wrapper::before {
    content: '📁';
    margin-right: 6px;
    font-size: 0.9em;
}

/* File Input Selected State */
.file-input-wrapper.has-file {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.file-input-wrapper.has-file::before {
    content: '✅';
}

/* File Input Feedback */
.file-feedback {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
    transition: all 0.2s ease;
}

/* Button Loading State */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

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

/* Button Size Variations */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.125rem;
    line-height: 1.5;
}

.btn-xl {
    padding: 1rem 2rem;
    font-size: 1.25rem;
    line-height: 1.6;
}

/* Responsive Button Adjustments */
@media (max-width: 768px) {
    .search-actions .btn,
    .action-buttons .btn {
        width: auto;
        margin-bottom: 4px;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .btn-group .btn:first-child {
        border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    }
    
    .btn-group .btn:last-child {
        border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
        border-bottom: none;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }
    
    .file-input-wrapper {
        width: auto;
        text-align: center;
        margin-bottom: 4px;
    }
}

/* =====================================================
   ESTILOS ESPECÍFICOS PARA BARRA LATERAL
   ===================================================== */

/* === BOTONES DE LA BARRA LATERAL (DISCRETOS) === */
.sidebar .btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 2px 0;
}

.sidebar .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    opacity: 1;
}

.sidebar .btn i {
    font-size: 0.75rem;
    margin-right: 0.3rem;
}

/* === SIDEBAR RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
}

/* =====================================================
   AJUSTES FINALES PARA CONSISTENCIA
   ===================================================== */

/* === BOTONES EN FORMULARIOS === */
.form-container .btn {
    margin: 0.2rem 0;
}

.form-section .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

/* === FILE INPUT WRAPPER (MEJORADO) === */
.file-input-wrapper {
    position: relative;
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
    text-align: center;
    min-width: 200px;
    font-weight: 500;
}

.file-input-wrapper:hover {
    background: #e9ecef;
    border-color: #5a6c7d;
    color: #5a6c7d;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    left: 0;
    top: 0;
}

.file-input-wrapper.has-file {
    background: #d1e7dd;
    border-color: #6b8e7a;
    color: #0a3622;
}

.file-input-wrapper::before {
    content: "📁 ";
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* === ESPACIADO MEJORADO === */
.mt-3 {
    margin-top: 0.75rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

/* === ALINEACIÓN DE ICONOS === */
.btn i + span,
.btn span + i {
    margin-left: 0.25rem;
}

.btn i:first-child {
    margin-right: 0.35rem;
}

.btn i:last-child {
    margin-left: 0.35rem;
}

/* === BOTONES DE ACCIONES IMPORTANTES (MANTIENEN AZUL) === */
.btn-save,
.btn-create,
.btn-update,
.btn-submit {
    background: #4a6b8a;
    color: #ffffff;
    border-color: #4a6b8a;
    font-weight: 500;
}

.btn-save:hover,
.btn-create:hover,
.btn-update:hover,
.btn-submit:hover {
    background: #3d5a75;
    color: #ffffff;
    border-color: #3d5a75;
}

/* === OVERRIDE PARA BOTONES PRIMARIOS DE FORMULARIOS === */
form .btn-primary,
.form-container .btn-primary,
button[type="submit"].btn-primary {
    background: #4a6b8a;
    color: #ffffff;
    border-color: #4a6b8a;
    font-weight: 500;
}

form .btn-primary:hover,
.form-container .btn-primary:hover,
button[type="submit"].btn-primary:hover {
    background: #3d5a75;
    color: #ffffff;
    border-color: #3d5a75;
}

/* === BOTONES CON ICONOS ESPECÍFICOS === */
.btn[data-action="save"],
.btn[data-action="create"],
.btn[data-action="update"],
.btn:has(.bi-save),
.btn:has(.bi-plus-circle),
.btn:has(.bi-arrow-repeat) {
    background: #4a6b8a;
    color: #ffffff;
    border-color: #4a6b8a;
}

.btn[data-action="save"]:hover,
.btn[data-action="create"]:hover,
.btn[data-action="update"]:hover,
.btn:has(.bi-save):hover,
.btn:has(.bi-plus-circle):hover,
.btn:has(.bi-arrow-repeat):hover {
    background: #3d5a75;
    color: #ffffff;
    border-color: #3d5a75;
}

/* === ESTILOS ESPECÍFICOS PARA DAR ALTA VEHÍCULO === */
.search-actions-vehicle {
    display: flex;
    gap: 0.4rem;
    align-items: end;
    flex-wrap: wrap;
}

.search-actions-vehicle .btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.875rem;
    height: auto;
    min-height: 42px;
    border-radius: var(--border-radius-sm);
}

.search-actions-vehicle .btn-consultar {
    background: #4a90e2;
    border: 1px solid #4a90e2;
    color: white;
    font-weight: 500;
}

.search-actions-vehicle .btn-consultar:hover {
    background: #357abd;
    border-color: #357abd;
    opacity: 0.9;
}

/* === BOTÓN GUARDAR VEHÍCULO (COLOR AZUL) === */
.btn-save-vehicle {
    background: #4a90e2 !important;
    border-color: #4a90e2 !important;
    color: white !important;
    font-weight: 500;
}

.btn-save-vehicle:hover {
    background: #357abd !important;
    border-color: #357abd !important;
    color: white !important;
    opacity: 0.9;
}

/* === TABLA DE PROMOCIONES (ALINEACIÓN MEJORADA) === */
.table-standard td {
    text-align: center;
    vertical-align: middle;
}

.table-standard td:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.table-standard td:nth-child(2) {
    padding: 0.75rem;
}

.table-standard td:nth-child(3),
.table-standard td:nth-child(4) {
    text-align: center;
}

/* === EMPTY STATE STYLING === */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.empty-state .empty-state-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state .text-secondary {
    font-size: 0.9rem;
    font-style: italic;
}

/* =====================================================
   SPECIFIC CIF FILE INPUT (NO CONFLICTS WITH JS)
   ===================================================== */

.cif-file-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden;
    background: #f8f9fa;
    color: #495057;
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--font-size-base);
    text-align: center;
    min-width: 200px;
}

.cif-file-wrapper:hover {
    border-color: #0d6efd;
    background: #e7f1ff;
    color: #0d6efd;
}

.cif-file-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.cif-file-wrapper::before {
    content: '�';
    margin-right: 8px;
    font-size: 1.1em;
}

.cif-file-wrapper.has-file {
    background: #d1edff;
    border-color: #0d6efd;
    color: #0d6efd;
}

.cif-file-wrapper.has-file::before {
    content: '✓';
    color: #28a745;
}

/* =====================================================
   CAMPOS DE DINERO Y GRUPOS DE ENTRADA
   ===================================================== */

/* Estilos para grupos de entrada (input-group) */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-input,
.input-group > .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    margin-bottom: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    text-align: center;
    white-space: nowrap;
    background-color: var(--bg-muted);
    border: 1px solid #ced4da;
    border-top-left-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
    border-right: 0;
}

/* Estilos específicos para campos de dinero */
.money-input {
    text-align: right;
    padding-right: 0.75rem;
    font-weight: 500;
}

.money-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    border-left: none;
}

/* Placeholder para campos de dinero */
.money-input::placeholder {
    text-align: right;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Estados de error para grupos de entrada */
.input-group .field-error {
    border-color: var(--danger-color);
}

.input-group .field-error:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    border-left: none;
}

/* Estilos para grupos de precios */
.price-group {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.price-group-title {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsivo para grupos de entrada */
@media (max-width: 576px) {
    .input-group-text {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .money-input {
        padding-right: 0.5rem;
    }
}
