/* MinTrace Custom Theme - CSS Variables and Bootstrap Overrides */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap');

:root {
    /* Primary Colors */
    --color-verde: #139B6A;
    --color-amarillo: #FFC639;
    --color-gris: #605060;
    --color-gris-medio: #9886fc;

    /* Secondary Colors */
    --color-hover: #DF7801;
    --color-hover-2: #02575B;

    /* Dark Colors */
    --color-azul: #001A42;
    --color-gris-bg: #1C1C1C;
    --color-gris-bg-2: #26028;
    --color-blanco: #FFFFFF;

    /* Grey Scale */
    --grey-a: #333333;
    --grey-b: #666666;
    --grey-c: #999999;
    --grey-d: #CCCCCC;
    --grey-e: #EEEEEE;

    /* Typography */
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Roboto', sans-serif;

    /* Bootstrap Color Overrides */
    --bs-primary: #139B6A;
    --bs-warning: #FFC639;
    --bs-dark: #001A42;
    --bs-secondary: #605060;
}

/* Typography Hierarchy */
h1,
.h1 {
    font-family: var(--font-primary);
    font-size: 1.75rem;
    font-weight: 600;
}

h2,
.h2 {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 500;
}

h3,
.h3 {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 500;
}

h4,
.h4 {
    font-family: var(--font-primary);
    font-size: 1.125rem;
    font-weight: 500;
}

h5,
.h5 {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
}

body,
p,
.text-body {
    font-family: var(--font-secondary);
    font-size: 14px;
}

/* Custom Sidebar Styles - Hover Based */
.sidebar {
    background: var(--bs-dark);
    border-right: 1px solid #333;
    min-height: 100vh;
    transition: width 0.3s ease;
    overflow: visible;
    width: 80px;
    /* Default collapsed width */
    position: relative;
    z-index: 1000;
}

/* Hover expansion */
.sidebar:hover,
.sidebar:focus-within,
.sidebar.keyboard-focus {
    width: 250px;
}

table .form-select {
    max-width: 200px;
}

/* Expanded state classes for compatibility */
.sidebar-expanded {
    width: 250px;
}

.sidebar-collapsed {
    width: 80px;
}

.sidebar-brand {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand img {
    max-height: 40px;
    width: auto;
}

.sidebar-nav {
    padding: 0.5rem 0;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.sidebar-nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: var(--color-amarillo);
    text-decoration: none;
    transition: all 0.3s ease;
    min-height: 48px;
    /* Ensure sufficient touch target */
    width: 100%;
}

.sidebar-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-amarillo);
}

.sidebar-nav-link.active {
    background: var(--color-verde);
    color: var(--color-amarillo);
}

.sidebar-nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
}

.sidebar-nav-text {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-amarillo);
    transition: opacity 0.3s ease, transform 0.3s ease, width 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

/* Default collapsed state - hide text */
.sidebar .sidebar-nav-text {
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
    width: 0;
    display: none;
}

/* Show text on hover/focus */
.sidebar:hover .sidebar-nav-text,
.sidebar:focus-within .sidebar-nav-text,
.sidebar.keyboard-focus .sidebar-nav-text {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    width: auto;
    display: inline;
}

/* Logo transitions - Default state shows favicon */
.sidebar .sidebar-logo-full {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
}

.sidebar .sidebar-logo-mini {
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(1);
}

/* Show full logo on hover/focus, hide mini logo */
.sidebar:hover .sidebar-logo-full,
.sidebar:focus-within .sidebar-logo-full,
.sidebar.keyboard-focus .sidebar-logo-full {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.sidebar:hover .sidebar-logo-mini,
.sidebar:focus-within .sidebar-logo-mini,
.sidebar.keyboard-focus .sidebar-logo-mini {
    opacity: 0;
    transform: scale(0.8);
}


/* Icon alignment - Icons are always visible */
.sidebar-nav-icon {
    width: 24px;
    height: 24px;
    transition: margin 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Default collapsed state - icons centered */
.sidebar .sidebar-nav-icon {
    margin: 0 auto;
}

/* Expanded state - icons with margin for text */
.sidebar:hover .sidebar-nav-icon,
.sidebar:focus-within .sidebar-nav-icon,
.sidebar.keyboard-focus .sidebar-nav-icon {
    margin: 0 0.75rem 0 0;
}

/* Center icons when collapsed */
.sidebar .sidebar-nav-link {
    justify-content: center;
    transition: justify-content 0.3s ease;
    padding: 1rem;
}

.sidebar:hover .sidebar-nav-link,
.sidebar:focus-within .sidebar-nav-link,
.sidebar.keyboard-focus .sidebar-nav-link {
    justify-content: flex-start;
    padding: 1rem;
}

/* Ensure icons are always visible and properly sized */
.sidebar .sidebar-nav-icon {
    color: #00FFFF;
    font-size: 1.25rem;
    line-height: 1;
}

.sidebar-nav-link:hover .sidebar-nav-icon,
.sidebar-nav-link.active .sidebar-nav-icon {
    color: #00FFFF;
    filter: brightness(1.2);
}

/* Main Content Layout - Matching Figma Design */
.main-content {
    flex: 1;
    background: #EEEEEE;
    min-height: 100vh;
}

.top-header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e9ecef;
}

.dashboard-title {
    font-family: var(--font-primary);
    color: var(--color-gris);
    font-size: 1.375rem;
    margin: 0;
}

.user-info {
    font-family: var(--font-secondary);
    color: var(--grey-b);
    font-size: 0.8rem;
}

/* Custom Button Styles - Matching Figma Design */
.btn-primary {
    background: #139B6A;
    border-color: #139B6A;
    font-family: var(--font-secondary);
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
}

.btn-primary:hover {
    background: #0f7d57;
    border-color: #0f7d57;
}

.btn-warning {
    background: #FFC639;
    border-color: #FFC639;
    color: #333333;
    font-family: var(--font-secondary);
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
}

.btn-warning:hover {
    background: #DF7801;
    border-color: #DF7801;
    color: white;
}

.btn-outline-primary {
    color: var(--color-verde);
    border-color: var(--color-verde);
}

.btn-outline-primary:hover {
    background: var(--color-verde);
    border-color: var(--color-verde);
}

/* Card Styles - Matching Figma Design */
.dashboard-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: white;
}

.dashboard-card:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.dashboard-card .card-header {
    background: linear-gradient(135deg, #1C1C1C 0%, #333333 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 1.5rem;
    border: none;
}

.dashboard-card .card-body {
    padding: 2rem;
    background: white;
}

/* Search and Notifications */
.search-container {
    position: relative;
    max-width: 400px;
}

.search-input {
    border: 2px solid var(--grey-e);
    border-radius: 25px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    font-family: var(--font-secondary);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-c);
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--grey-b);
    font-size: 1.2rem;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-verde);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar-expanded {
        width: 100%;
        position: absolute;
        z-index: 1000;
    }

    .sidebar-collapsed {
        width: 60px;
    }

    .top-header {
        padding: 1rem;
    }

    .dashboard-title {
        font-size: 1.125rem;
    }
}

/* Accessibility Enhancements */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus indicators */
.sidebar-nav-link:focus,
.btn:focus,
.search-input:focus {
    outline: 2px solid var(--color-amarillo);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--color-verde);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1001;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
}

/* Hide toggle button by default - show only for accessibility */
.sidebar-toggle {
    position: absolute;
    top: -40px;
    left: 6px;
    background: transparent;
    border: 2px solid var(--color-verde);
    color: var(--color-verde);
    padding: 0.25rem;
    border-radius: 4px;
    z-index: 1001;
    transition: top 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

/* Show toggle button on keyboard focus or for screen readers */
.sidebar-toggle:focus,
.sidebar-toggle:focus-visible,
.show-accessibility-controls .sidebar-toggle {
    top: 6px;
    opacity: 1;
    pointer-events: auto;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sidebar-toggle {
        opacity: 1;
        pointer-events: auto;
        position: static;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    .sidebar,
    .sidebar-nav-text,
    .sidebar-logo-full,
    .sidebar-logo-mini,
    .sidebar-nav-icon,
    .sidebar-nav-link {
        transition: none;
    }

    .sidebar:hover,
    .sidebar:focus-within {
        width: 250px;
    }
}

/* Loading states */
.btn.loading {
    position: relative;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Table Styles */
.table-container {
    padding: 0 1.5rem;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #374151;
    padding: 1rem 0.75rem;
}

.table tbody tr {
    border-bottom: 1px solid #f3f4f6;
}

.table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

input,
select {
    height: 40px;
}

.table tbody td {
    padding: 0 10px;
    vertical-align: middle;
}

.table select,
table input:not([type="checkbox"]) {
    border: 0px solid #fff !important;
    border-radius: 0px !important;
    padding: 0;
}

/* Product Icons */
.product-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-aprobado {
    background-color: #dcfce7;
    color: #166534;
}

.status-proceso {
    background-color: #fef3c7;
    color: #92400e;
}

.status-cancelado {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-espera {
    background-color: #fef3c7;
    color: #92400e;
}

/* Type Badges */
.badge-tipo {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-subsistencia {
    background-color: #17a2b8;
    color: white;
}

.badge-origen {
    background-color: var(--color-hover);
    color: white;
}

/* Action Buttons */
.action-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.1rem;
    margin: 0 0.25rem;
    padding: 0.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.action-btn:hover {
    color: #374151;
}

li.page-item {
    min-width: 46px;
    margin-right: 9px;
}

/* Pagination */
.pagination .page-link {
    color: #000;
    border: none;
    min-width: 31px;
    min-height: 31px;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
}

.pagination .page-item.active .page-link {
    background-color: #174284;
    border-color: #174284;
    color: #fff;
}

.pagination .page-link:hover {
    color: #fff;
    background-color: #174284;
}

.form-select {
    min-width: 60px;
    padding: 9px;
    background-color: #E0E0E0;
    border-radius: 8px;
}

/* Gradient Title */
.gradient-title,
.dashboard-title {
    background: linear-gradient(90deg, #525252 0%, #FFC639 50%, #139B6A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}

/* Search Input */
.search-container {
    position: relative;
}

.search-input {
    padding-left: 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    z-index: 10;
}

/* Add Button */
.add-btn {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.add-btn:hover {
    background-color: #d97706;
    border-color: #d97706;
}

/* Variables de diseño */
:root {
    --primary: #139B6A;
    --secondary: #FFC639;
    --dark: #1e293b;
    --light-gray: #f8fafc;
    --border-color: #e2e8f0;
    --text-muted: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Contenedor principal del formulario */
.form-wizard-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Indicador de progreso */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 0 1rem;
}

.progress-step::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step:last-child::before {
    display: none;
}

.progress-step.active::before,
.progress-step.completed::before {
    background: var(--primary);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-gray);
    border: 2px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: relative;
    z-index: 1;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.progress-step.completed .step-number {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.step-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.progress-step.active .step-title {
    color: var(--primary);
    font-weight: 600;
}

/* Tarjetas de formulario */
.form-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.form-card-header {
    background: linear-gradient(135deg, var(--primary) 0%, #0f766e 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-card-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.form-card-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.875rem;
}

.form-card-body {
    padding: 2rem;
}

/* Material dinámico */
.dynamic-material-row {
    background: var(--light-gray);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    position: relative;
}

.dynamic-material-row:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.remove-material-btn {
    /* position: absolute; */
    top: 1rem;
    right: 1rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-material-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Documentos de soporte específicos para subsistencia */
.document-requirement {
    background: rgba(19, 155, 106, 0.05);
    border-left: 4px solid var(--primary);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
}

.document-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.document-upload-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.document-upload-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Área específica para origen geográfico */
.origin-section {
    background: var(--light-gray);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Sección de resumen especializada para subsistencia */
.subsistence-summary {
    background: white;
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 500;
    color: var(--text-muted);
}

.summary-value {
    font-weight: 600;
    color: var(--dark);
}

/* Botones de navegación */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: white;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.btn-wizard {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-wizard-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-wizard-primary:hover {
    background: #0f766e;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-wizard-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-wizard-secondary:hover {
    background: var(--primary);
    color: white;
}

/* Campos específicos para subsistencia */
.subsistence-info {
    background: rgba(255, 198, 57, 0.1);
    border: 1px solid var(--secondary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Impuestos dinámicos */
.tax-item {
    background: var(--light-gray);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    position: relative;
}

.remove-tax-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    font-size: 0.875rem;
}


.btn-primary {
    background-color: #006400;
    color: white;
    border: none;
    border-radius: 4px;
}

.btn-primary:hover {
    background-color: #004d00;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-dialog {
    width: 50%;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
}

.btn-close {
    background-color: transparent;
    border: none;
    font-size: 1.5rem;
    color: #000;
}

/* Estilos para campos de formulario */
input,
select {
    background-color: white !important;
    border: 1px solid #ced4da !important;
    color: #495057 !important;
}

input:focus,
select:focus {
    background-color: #fff !important;
    border-color: #80bdff !important;
    outline: none;
}

/* Accesibilidad - Focus visible */
*:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Skip navigation link */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: var(--radius-md);
    z-index: 1000;
}

.skip-nav:focus {
    top: 10px;
}

/* Loading state */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading .loading-spinner {
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .progress-steps {
        flex-direction: column;
        gap: 1rem;
    }

    .progress-step::before {
        display: none;
    }

    .document-upload-grid {
        grid-template-columns: 1fr;
    }

    .form-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .form-card-body {
        padding: 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-card {
        border: 2px solid var(--dark);
    }

    .btn-wizard-primary {
        border: 2px solid white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {

    .sidebar,
    .form-navigation,
    .btn-wizard {
        display: none;
    }

    .form-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

.chart-container {
    position: relative;
    height: 300px;
}

.metric-card {
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* PDF-specific styles */
@media print {
    .sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .btn {
        display: none !important;
    }

    .no-print {
        display: none !important;
    }
}

/* Invoice-style PDF layout */
.pdf-invoice {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Arial', sans-serif;
    line-height: 1.4;
    color: #333;
}

.pdf-header {
    background: linear-gradient(135deg, #139B6A, #0f7a52);
    color: white;
    padding: 25px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.pdf-company-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.pdf-logo-section h1 {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.pdf-logo-section p {
    font-size: 14px;
    margin: 5px 0 0 0;
    opacity: 0.9;
}

.pdf-report-info {
    text-align: right;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 6px;
}

.pdf-report-info h2 {
    font-size: 20px;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.pdf-client-section {
    background: #f8f9fa;
    padding: 20px;
    border-left: 4px solid #139B6A;
    margin-bottom: 25px;
}

.pdf-client-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.pdf-client-info div {
    background: white;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.pdf-client-info strong {
    color: #139B6A;
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.pdf-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.pdf-kpi-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pdf-kpi-card h3 {
    color: #139B6A;
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 8px 0;
}

.pdf-kpi-card p {
    color: #666;
    font-size: 12px;
    margin: 0;
    text-transform: uppercase;
    font-weight: 600;
}

.pdf-section {
    margin-bottom: 30px;
}

.pdf-section-title {
    background: #139B6A;
    color: white;
    padding: 12px 20px;
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.pdf-table thead {
    background: #f1f3f4;
}

.pdf-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #139B6A;
    font-size: 13px;
    text-transform: uppercase;
}

.pdf-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.pdf-table tr:hover {
    background: #f8f9fa;
}

.pdf-table tr:last-child td {
    border-bottom: none;
}

.pdf-mineral-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.pdf-progress-bar {
    background: #e0e0e0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.pdf-progress-fill {
    height: 100%;
    background: #139B6A;
    transition: width 0.3s ease;
}

.pdf-branch-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.pdf-branch-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pdf-branch-rank {
    position: absolute;
    top: -10px;
    right: 15px;
    background: #139B6A;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.pdf-branch-card h4 {
    color: #333;
    font-size: 16px;
    margin: 0 0 10px 0;
}

.pdf-branch-card .amount {
    color: #139B6A;
    font-size: 20px;
    font-weight: bold;
    margin: 0;
}

.pdf-footer {
    background: #2c3e50;
    color: white;
    padding: 25px;
    text-align: center;
    border-radius: 0 0 8px 8px;
    margin-top: 30px;
}

.pdf-footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.pdf-footer-section h4 {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: #139B6A;
}

.pdf-footer-section p {
    font-size: 12px;
    margin: 0;
    opacity: 0.8;
}

.pdf-signature {
    border-top: 1px solid #445566;
    padding-top: 20px;
    font-size: 11px;
    opacity: 0.7;
}

/* Chart replacement styles */
.pdf-chart-replacement {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px dashed #139B6A;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
}

.pdf-chart-replacement h4 {
    color: #139B6A;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.pdf-chart-data {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.pdf-chart-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #139B6A;
}

.pdf-chart-item strong {
    display: block;
    color: #139B6A;
    font-size: 16px;
}

/* Loading spinner for PDF generation */
.pdf-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
}

.pdf-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Dropdown styles for purchase registration */
.purchase-dropdown {
    position: relative;
    display: inline-block;
}

.purchase-dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 280px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    z-index: 1000;
    border: 1px solid #e0e0e0;
    top: 100%;
    left: 0;
    margin-top: 5px;
}

.purchase-dropdown-content.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.purchase-dropdown-header {
    padding: 15px;
    background: linear-gradient(135deg, #139B6A, #0f7a52);
    color: white;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 14px;
}

.purchase-dropdown-item {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.purchase-dropdown-item:hover {
    background-color: #f8f9fa;
    color: #139B6A;
    transform: translateX(5px);
}

.purchase-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.purchase-dropdown-item i {
    margin-right: 10px;
    width: 16px;
    color: #139B6A;
}

.purchase-dropdown-item .description {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 3px;
    margin-left: 26px;
}

/* Arrow indicator */
.dropdown-arrow {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.dropdown-arrow.rotated {
    transform: rotate(180deg);
}

.invoice-sumary {
    background-color: #f8f8f8;
    padding: 10px;
}

/* ========== ESTILOS PARA BIOMETRÍA ========== */
.scanning-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    border-radius: 50%;
}

.scanner-line {
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, #139B6A, transparent);
    animation: scanning 2s linear infinite;
}

@keyframes scanning {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(200px);
    }
}

.fingerprint-scanner:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.camera-viewport {
    position: relative;
    display: inline-block;
}

.signature-pad-container {
    position: relative;
}

.signature-pad-container canvas {
    touch-action: none;
}

/* ========== ESTILOS PARA CAMPOS DE FORMULARIO ========== */
/* Estilo para los campos de formulario */
.formulario-subsistencia input,
.formulario-subsistencia select {
    background-color: white !important;
    border: 1px solid #ced4da;
    color: #495057 !important;
}

/* Estilo para los campos cuando están en foco */
.formulario-subsistencia input:focus,
.formulario-subsistencia select:focus {
    background-color: #fff !important;
    border-color: #80bdff !important;
    outline: none;
}

/* ========== ESTILOS PARA WIZARD ICONS ========== */
.wizard-step-icon {
    font-size: 3rem;
}

.wizard-step-icon-small {
    font-size: 2rem;
}

.wizard-progress-bar {
    height: 8px;
}

.wizard-modal-body {
    min-height: 500px;
}

/* ========== ESTILOS PARA ELEMENTOS BIOMÉTRICOS ========== */
.fingerprint-scanner {
    width: 200px;
    height: 200px;
    border: 4px solid #139B6A;
    border-radius: 50%;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    cursor: pointer;
}

.fingerprint-icon {
    font-size: 4rem;
    color: #139B6A;
}

.camera-video {
    border-radius: 8px;
    background: #f0f0f0;
}

.photo-canvas {
    border-radius: 8px;
    border: 2px solid #28a745;
}

.signature-canvas {
    border: 2px solid #139B6A;
    border-radius: 8px;
    background: white;
    touch-action: none;
}

/* ========== ESTILOS PARA VALIDATION Y PROCESSING ========== */
.validation-code-input {
    font-size: 2rem;
    letter-spacing: 0.5rem;
}

.processing-spinner {
    width: 3rem;
    height: 3rem;
}

.processing-progress {
    height: 10px;
}

/* ========== ESTILOS PARA FORMULARIOS CON TASA DE CAMBIO ========== */
.tasa-cambio-hidden {
    display: none;
}

input[type="checkbox"]:checked {
    accent-color: #0d6efd !important;
    /* azul Bootstrap */
}

a:focus,
a:active {
    outline: none !important;
    box-shadow: none !important;
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.d-none {
    display: none !important;
}

.text-red-500 {
    color: #ef4444;
    /* rojo Tailwind */
}

.text-sm {
    font-size: 0.875rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.block {
    display: block;
}

.material-select {
    width: auto;
    min-width: 300px;
    max-width: 100% !important;
}

#contenedorMensajesTransaccion {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}