/* Estilos principales del sistema - WeldTech Solutions Branding */

:root {
    /* Colores principales WELDTECH */
    --weldtech-dark-steel: #0F1216;
    --weldtech-orange: #FF7A00;
    --weldtech-blue: #2AA1FF;
    --weldtech-steel-gray: #6B7280;
    --weldtech-light-steel: #E5E7EB;
    --weldtech-white: #FFFFFF;
    
    /* Colores de estado WELDTECH */
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    
    /* Aplicaciones de colores */
    --primary-color: var(--weldtech-orange);
    --secondary-color: var(--weldtech-blue);
    --bg-color: var(--weldtech-dark-steel);
    --card-bg: #1A1F26;
    --card-bg-hover: #222831;
    --text-color: var(--weldtech-white);
    --text-light: #B0B8C4;
    --border-color: rgba(255, 255, 255, 0.2);
    --input-bg: #252B33;
    --input-bg-focus: #2D3439;
    
    /* Sombras WELDTECH */
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-glow-orange: 0 0 40px rgba(255, 122, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    background: linear-gradient(180deg, #0F1216 0%, #1a1f26 100%);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Previene scroll horizontal no deseado */
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

/* Navbar */
.navbar {
    background-color: rgba(15, 18, 22, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    color: var(--weldtech-white);
}

.nav-logo i {
    color: var(--weldtech-orange);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
}

.nav-link:hover {
    color: var(--weldtech-orange);
    background-color: rgba(255, 122, 0, 0.1);
}

/* Estilos para información de usuario y logout */
.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.nav-user-info {
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-user-info i {
    color: var(--weldtech-orange);
}

.nav-logout-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
    font-weight: 600;
}

.nav-logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.25);
    border-color: var(--danger-color);
    color: var(--danger-color);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Menú hamburguesa para móviles */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.nav-toggle:hover {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.subtitle {
    color: var(--text-light);
    margin-top: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-info {
    background-color: #0ea5e9;
    color: white;
}

.btn-info:hover {
    background-color: #0284c7;
}

.btn-info:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card.warning {
    border-left: 4px solid var(--warning-color);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
}

.stat-content p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Quick Actions */
.quick-actions {
    margin-top: 3rem;
}

.quick-actions h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.action-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.action-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.action-card p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.input, .select {
    padding: 0.625rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    flex: 1;
    min-width: 200px;
    background-color: var(--input-bg);
    color: var(--weldtech-white);
    font-weight: 500;
}

.input::placeholder, .select::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input:focus, .select:focus {
    outline: none;
    border-color: var(--weldtech-orange);
    background-color: var(--input-bg-focus);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.3), 0 0 20px rgba(255, 122, 0, 0.4);
}

.input:hover, .select:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background-color: #2A3038;
}

/* Tables */
.table-container {
    background: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
    position: relative;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(135deg, #1F252D 0%, #252B33 100%);
    border-bottom: 2px solid rgba(255, 122, 0, 0.3);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--weldtech-white);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.data-table .loading {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--weldtech-white);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.textarea {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    background-color: var(--input-bg);
    color: var(--weldtech-white);
    font-weight: 500;
    transition: all 0.2s;
}

.textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.textarea:focus {
    outline: none;
    border-color: var(--weldtech-orange);
    background-color: var(--input-bg-focus);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.3), 0 0 20px rgba(255, 122, 0, 0.4);
}

.textarea:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background-color: #2A3038;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
}

.modal-content {
    background: linear-gradient(135deg, #1A1F26 0%, #222831 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin: 5% auto;
    padding: 0;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(255, 122, 0, 0.2);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--weldtech-white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.close {
    color: rgba(255, 255, 255, 0.7);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
}

.close:hover {
    color: var(--weldtech-white);
    text-shadow: 0 0 10px rgba(255, 122, 0, 0.5);
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
    background: linear-gradient(135deg, #1A1F26 0%, #222831 100%);
}

/* Mejorar contraste de labels en modales */
.modal-body label,
.modal-content label,
.modal-body .form-group label,
.modal-content .form-group label {
    color: var(--weldtech-white) !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

/* Mejorar contraste de texto en modales */
.modal-body,
.modal-content {
    color: var(--weldtech-white) !important;
}

.modal-body p,
.modal-content p,
.modal-body span,
.modal-content span {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-card, .resultado-card, .info-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.search-card h3, .resultado-card h3, .info-card h3 {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resultado-section {
    margin-top: 2rem;
}

.resultado-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.info-section li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.pagination button:hover {
    background: var(--bg-color);
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Footer */
.footer {
    background-color: var(--card-bg);
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    color: var(--text-light);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.info-grid > div {
    padding: 0.5rem 0;
}

/* Precio Info */
.precio-info h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.precio-valores {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.precio-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.precio-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

.precio-valor {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.precio-metadata {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.precio-metadata p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.precio-metadata a {
    color: var(--primary-color);
    text-decoration: none;
}

.precio-metadata a:hover {
    text-decoration: underline;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--weldtech-white);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);
    border: 2px solid rgba(239, 68, 68, 0.5);
    border-radius: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--danger-color);
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5));
}

.error-message h3 {
    color: var(--weldtech-white) !important;
}

.error-message p {
    color: rgba(255, 255, 255, 0.9) !important;
}

.error-message .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
    margin-top: 0.5rem;
}

/* Historial */
.precio-actual, .historial-cambios {
    margin-bottom: 2rem;
}

.precio-actual h3, .historial-cambios h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Responsive - Mobile First Approach */
@media (max-width: 768px) {
    /* Navbar móvil */
    .nav-container {
        padding: 0 1rem;
        position: relative;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--card-bg);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        margin-top: 1rem;
    }
    
    .nav-menu.active {
        max-height: 500px;
        transition: max-height 0.3s ease-in;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        padding: 1rem 1.5rem;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-logo span {
        font-size: 1rem;
    }
    
    /* Contenedor principal */
    .container {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 1rem 0;
    }
    
    /* Page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Stats grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
    
    /* Actions grid */
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-card {
        padding: 1.5rem;
    }
    
    /* Filters bar */
    .filters-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .input, .select {
        width: 100%;
        min-width: unset;
    }
    
    /* Tablas - Scroll horizontal en móviles */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .data-table {
        min-width: 800px;
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Modales */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Formularios */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Tabs */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    
    .tab-button {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Footer */
    .footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }
    
    .footer-content {
        padding: 0 1rem;
        font-size: 0.875rem;
    }
    
    /* Botones */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 44px; /* Tamaño táctil mínimo */
    }
    
    /* Paginación */
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination button {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Estilos para historial de precios */
.variacion-positiva {
    color: var(--success-color);
    font-weight: 600;
}

.variacion-negativa {
    color: var(--danger-color);
    font-weight: 600;
}

.benchmarking-row {
    background-color: rgba(245, 158, 11, 0.2);
    border-left: 3px solid var(--warning-color);
    color: var(--weldtech-white);
}

.benchmarking-row:hover {
    background-color: rgba(245, 158, 11, 0.3);
}

.benchmarking-row td {
    color: var(--weldtech-white) !important;
}

/* Mejoras adicionales para móviles */
@media (max-width: 480px) {
    /* Pantallas muy pequeñas */
    .nav-logo {
        font-size: 1rem;
    }
    
    .nav-logo i {
        font-size: 1.25rem;
    }
    
    .page-header h1 {
        font-size: 1.25rem;
    }
    
    .stat-icon {
        font-size: 1.75rem;
    }
    
    .stat-content h3 {
        font-size: 1.25rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 2% auto;
    }
    
    .modal-header h2 {
        font-size: 1.125rem;
    }
    
    .btn {
        font-size: 0.8125rem;
        padding: 0.625rem 0.875rem;
    }
    
    .data-table {
        font-size: 0.8125rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.375rem;
    }
}

/* Mejoras de accesibilidad táctil */
@media (hover: none) and (pointer: coarse) {
    /* Dispositivos táctiles */
    .btn,
    .nav-link,
    .tab-button,
    .close {
        min-height: 44px;
        min-width: 44px;
    }
    
    .input,
    .select,
    .textarea {
        font-size: 16px; /* Previene zoom en iOS */
    }
    
    .data-table tbody tr {
        min-height: 44px;
    }
}

/* ============================================
   ESTILOS PARA EDICIÓN DE PRESUPUESTOS
   ============================================ */

/* Modal extra large */
.modal-extra-large {
    max-width: 95%;
    width: 95%;
    max-height: 95vh;
}

.modal-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Presupuesto Info Card */
.presupuesto-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.presupuesto-info-card .info-grid {
    color: white;
}

.presupuesto-info-card .info-grid strong {
    color: rgba(255, 255, 255, 0.9);
}

.presupuesto-info-card .badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Presupuesto Toolbar */
.presupuesto-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toolbar-left h3 {
    margin: 0;
    font-size: 1.25rem;
}

.toolbar-right {
    display: flex;
    gap: 0.5rem;
}

/* Presupuesto Table Container */
.presupuesto-table-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.presupuesto-table {
    margin: 0;
}

.presupuesto-table thead {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.presupuesto-table tbody tr {
    transition: background-color 0.2s;
}

.presupuesto-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.presupuesto-table tbody tr.item-editado {
    background-color: rgba(245, 158, 11, 0.2);
    border-left: 3px solid var(--warning-color);
}

.presupuesto-table tbody tr.item-editado:hover {
    background-color: rgba(245, 158, 11, 0.3);
}

.presupuesto-table tbody tr td {
    color: rgba(255, 255, 255, 0.9) !important;
}

.presupuesto-table tbody tr.item-editado td {
    color: var(--weldtech-white) !important;
}

/* Inputs Calculados (readonly) */
.input-calculated {
    background-color: rgba(255, 122, 0, 0.15) !important;
    color: var(--weldtech-orange) !important;
    font-weight: 600 !important;
    cursor: not-allowed !important;
    border-color: var(--weldtech-orange) !important;
    text-shadow: 0 0 10px rgba(255, 122, 0, 0.3);
}

.input-calculated:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.3) !important;
}

/* Inputs Inline */
.input-inline {
    width: 100%;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--weldtech-white);
    font-weight: 500;
    transition: all 0.2s;
}

.input-inline::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.input-inline:focus {
    outline: none;
    border-color: var(--weldtech-orange);
    background-color: var(--input-bg-focus);
    box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.3), 0 0 10px rgba(255, 122, 0, 0.4);
}

.input-inline:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background-color: #2A3038;
}

.input-inline.input-number {
    text-align: right;
}

.textarea-inline {
    width: 100%;
    min-height: 80px;
    max-height: 300px;
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--weldtech-white);
    font-weight: 500;
    resize: vertical;
    font-family: inherit;
    transition: all 0.2s;
    overflow-y: auto;
    line-height: 1.6;
    word-wrap: break-word;
}

.textarea-inline::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.textarea-inline:focus {
    outline: none;
    border-color: var(--weldtech-orange);
    background-color: var(--input-bg-focus);
    box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.3), 0 0 10px rgba(255, 122, 0, 0.4);
}

.textarea-inline:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background-color: #2A3038;
}

/* Total Cell */
.total-cell {
    text-align: right;
    font-weight: 600;
    color: var(--primary-color);
}

/* Botones pequeños */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Panel de Subtotales */
.subtotales-panel {
    background: linear-gradient(135deg, #1F252D 0%, #252B33 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    margin-top: 0.75rem;
    max-height: 350px;
    overflow-y: auto;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out, margin 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 1;
}

.subtotales-panel.collapsed {
    max-height: 0;
    padding: 0 1rem;
    margin-top: 0;
    overflow: hidden;
    opacity: 0;
}

.subtotales-panel h4 {
    margin-bottom: 1rem;
    color: var(--weldtech-white);
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subtotales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0;
}

.subtotal-card {
    background: linear-gradient(135deg, #1F252D 0%, #252B33 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.subtotal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 122, 0, 0.3);
    border-color: rgba(255, 122, 0, 0.4);
}

.subtotal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.subtotal-header strong {
    font-size: 1rem;
    color: var(--weldtech-white);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.subtotal-values {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subtotal-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subtotal-value .label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.subtotal-value .value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--weldtech-orange);
    text-shadow: 0 0 10px rgba(255, 122, 0, 0.5);
}

/* Totales Generales */
.totales-generales {
    display: flex;
    justify-content: space-around;
    padding-top: 1.5rem;
    border-top: 3px solid var(--primary-color);
    gap: 1rem;
    flex-wrap: wrap;
}

.total-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    min-width: 180px;
    box-shadow: var(--shadow-lg);
}

.total-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-align: center;
}

.total-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    text-align: center;
}

/* Badge Info */
.badge-info {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Botón Success */
.btn-success {
    background-color: var(--success-color);
    color: white;
    border: none;
}

.btn-success:hover {
    background-color: #059669;
}

/* Botón Warning */
.btn-warning {
    background-color: var(--warning-color);
    color: white;
    border: none;
}

.btn-warning:hover {
    background-color: #d97706;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-extra-large {
        width: 98%;
        max-width: 98%;
        margin: 2% auto;
    }
    
    .presupuesto-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        flex-direction: column;
        width: 100%;
    }
    
    .subtotales-grid {
        grid-template-columns: 1fr;
    }
    
    .totales-generales {
        flex-direction: column;
    }
    
    .total-item {
        width: 100%;
        min-width: unset;
    }
    
    .presupuesto-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .presupuesto-table {
        min-width: 1000px;
        font-size: 0.875rem;
    }
    
    .presupuesto-table th,
    .presupuesto-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .parametros-grid {
        grid-template-columns: 1fr;
    }
    
    .parametro-card {
        padding: 1rem;
    }
    
    .search-card,
    .resultado-card,
    .info-card {
        padding: 1.5rem;
    }
    
    .resultado-actions {
        flex-direction: column;
    }
    
    .resultado-actions .btn {
        width: 100%;
    }
}

/* ============================================
   ESTILOS PARA EDICIÓN DE PRESUPUESTO POR SECCIONES
   ============================================ */

/* Container principal */
.container-presupuesto {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Header del Presupuesto */
.presupuesto-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    backdrop-filter: blur(10px);
    color: white;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

.presupuesto-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.presupuesto-title-section h1 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 2rem;
}

.presupuesto-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.meta-item i {
    opacity: 0.95;
    color: rgba(255, 255, 255, 1);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Selector de estado del presupuesto */
.select-estado {
    padding: 0.4rem 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    background-color: var(--input-bg);
    color: var(--weldtech-white);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 140px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 2;
    margin-left: 0.25rem;
}

.select-estado:hover {
    border-color: var(--weldtech-orange);
    background-color: var(--input-bg-focus);
    box-shadow: 0 0 15px rgba(255, 122, 0, 0.4);
}

.select-estado:focus {
    outline: none;
    border-color: var(--weldtech-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.4), 0 0 20px rgba(255, 122, 0, 0.5);
    background-color: var(--input-bg-focus);
    z-index: 100;
}

/* Estilos para el dropdown del select cuando está abierto */
.select-estado option {
    background-color: #252B33;
    color: var(--weldtech-white);
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.select-estado option:hover,
.select-estado option:focus,
.select-estado option:checked {
    background-color: rgba(255, 122, 0, 0.3);
    color: var(--weldtech-white);
    font-weight: 600;
}

/* Estilos generales para todos los selects y sus opciones */
select {
    background-color: var(--input-bg) !important;
    color: var(--weldtech-white) !important;
}

select option {
    background-color: #252B33 !important;
    color: var(--weldtech-white) !important;
    padding: 0.75rem 1rem !important;
    font-weight: 500 !important;
}

select option:hover,
select option:focus,
select option:checked {
    background-color: rgba(255, 122, 0, 0.4) !important;
    color: var(--weldtech-white) !important;
    font-weight: 600 !important;
}

/* Mejorar contraste del select cuando está abierto (dropdown) */
select:focus {
    background-color: var(--input-bg-focus) !important;
}

/* Estilos específicos para selects en modales */
.modal-body select,
.modal-content select {
    background-color: var(--input-bg) !important;
    color: var(--weldtech-white) !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
}

.modal-body select option,
.modal-content select option {
    background-color: #252B33 !important;
    color: var(--weldtech-white) !important;
}

.modal-body select option:hover,
.modal-body select option:focus,
.modal-body select option:checked,
.modal-content select option:hover,
.modal-content select option:focus,
.modal-content select option:checked {
    background-color: rgba(255, 122, 0, 0.4) !important;
    color: var(--weldtech-white) !important;
}

.select-estado.badge-success {
    background-color: rgba(16, 185, 129, 0.2);
    border-color: var(--success-color);
    color: #6ee7b7;
}

.select-estado.badge-success:hover {
    background-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.select-estado.badge-secondary {
    background-color: rgba(42, 161, 255, 0.2);
    border-color: var(--weldtech-blue);
    color: #7dd3fc;
}

.select-estado.badge-secondary:hover {
    background-color: rgba(42, 161, 255, 0.3);
    box-shadow: 0 0 15px rgba(42, 161, 255, 0.5);
}

.select-estado.badge-warning {
    background-color: rgba(245, 158, 11, 0.2);
    border-color: var(--warning-color);
    color: #fcd34d;
}

.select-estado.badge-warning:hover {
    background-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

.select-estado.badge-danger {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: var(--danger-color);
    color: #fca5a5;
}

.select-estado.badge-danger:hover {
    background-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.presupuesto-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Secciones Container */
.secciones-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 2rem 2rem;
    min-height: calc(100vh - 400px);
    padding-bottom: 1rem;
}

/* Sección Card */
.seccion-card {
    background: linear-gradient(135deg, #1F252D 0%, #252B33 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s;
}

.seccion-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 122, 0, 0.3);
    border-color: rgba(255, 122, 0, 0.4);
    transform: translateY(-2px);
}

.seccion-header {
    background: linear-gradient(135deg, #2A3038 0%, #323A44 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid rgba(255, 122, 0, 0.3);
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    user-select: none;
}

.seccion-header:hover {
    background: linear-gradient(135deg, #323A44 0%, #3A424A 100%);
    border-color: rgba(255, 122, 0, 0.5);
    border-bottom-color: rgba(255, 122, 0, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 122, 0, 0.1);
}

.seccion-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.seccion-icon {
    font-size: 0.875rem;
    color: var(--weldtech-orange);
    transition: transform 0.3s;
    filter: drop-shadow(0 0 5px rgba(255, 122, 0, 0.5));
}

.seccion-title {
    margin: 0;
    font-size: 1.25rem;
    color: var(--weldtech-white);
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.seccion-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.seccion-subtotal {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.subtotal-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.subtotal-value-cop,
.subtotal-value-usd {
    font-weight: 700;
    color: var(--weldtech-orange);
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(255, 122, 0, 0.5);
}

/* Sección Content */
.seccion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.seccion-content.expanded {
    max-height: 5000px;
    transition: max-height 0.5s ease-in;
}

.seccion-content.collapsed {
    max-height: 0;
}

.seccion-items {
    padding: 1rem 1.5rem;
}

/* Item Row */
.item-row {
    display: grid;
    grid-template-columns: 50px 2fr 100px 80px 130px 130px 130px 130px 1.5fr 120px;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    align-items: start;
    transition: all 0.2s;
    background-color: transparent;
}

.item-row:last-child {
    border-bottom: none;
}

.item-row:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-left: 3px solid rgba(255, 122, 0, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.item-row.item-editado {
    background-color: rgba(245, 158, 11, 0.2);
    border-left: 3px solid var(--warning-color);
}

.item-row.item-editado:hover {
    background-color: rgba(245, 158, 11, 0.3);
    border-left-color: var(--warning-color);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.item-number {
    font-weight: 700;
    color: var(--weldtech-white);
    text-align: center;
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.item-descripcion {
    min-width: 0;
    display: flex;
    align-items: flex-start;
}

.item-descripcion span {
    display: block;
    word-wrap: break-word;
    color: var(--weldtech-white);
    font-weight: 500;
    line-height: 1.6;
    white-space: pre-wrap;
}

.item-cantidad,
.item-unidad {
    text-align: center;
    color: var(--weldtech-white);
    font-weight: 500;
}

.item-precio-cop,
.item-precio-usd {
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.item-total-cop,
.item-total-usd {
    text-align: right;
    font-weight: 700;
    color: var(--weldtech-orange);
    text-shadow: 0 0 10px rgba(255, 122, 0, 0.5);
    font-size: 1rem;
}

.item-notas {
    min-width: 0;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
}

.item-notas .notas-text {
    display: block;
    word-wrap: break-word;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    font-weight: 400;
    white-space: pre-wrap;
}

.textarea-small {
    min-height: 70px;
    max-height: 250px;
    font-size: 0.8125rem;
    line-height: 1.6;
    overflow-y: auto;
}

.item-acciones {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

/* Input with Action Inline */
.input-with-action-inline {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.input-with-action-inline .input-inline {
    flex: 1;
}

.input-with-action {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-with-action .input {
    flex: 1;
}

.input-sm {
    padding: 0.5rem;
    font-size: 0.875rem;
}

/* Botón IA */
.btn-ia {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-ia:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-ia i {
    margin-right: 0.25rem;
}

/* Totales Panel Fixed */
.totales-panel-fixed {
    position: sticky;
    bottom: 0;
    background: var(--card-bg);
    border-top: 3px solid var(--primary-color);
    padding: 0.5rem 1.5rem 0.75rem 1.5rem;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    margin-top: 1rem;
}

.totales-panel-header {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.totales-buttons-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.btn-toggle-subtotales {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-toggle-subtotales:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-toggle-subtotales i {
    transition: transform 0.3s;
}

.btn-toggle-subtotales.collapsed i {
    transform: rotate(180deg);
}

.btn-toggle-totales-generales {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.btn-toggle-totales-generales:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-toggle-totales-generales i {
    transition: transform 0.3s;
    font-size: 0.75rem;
}

.btn-toggle-totales-generales.collapsed i {
    transform: rotate(180deg);
}

.totales-generales-wrapper {
    margin-top: 0.5rem;
}

.totales-generales-fixed {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    padding-top: 0.75rem;
    flex-wrap: wrap;
}

.totales-generales-fixed.collapsed {
    display: none;
}

.total-item-fixed {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
}

.total-item-fixed:hover {
    transform: translateY(-2px);
}

.total-item-fixed .total-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.total-item-fixed .total-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* Totales Indirectos */
.totales-indirectos-wrapper {
    margin-top: 0.5rem;
}

.totales-indirectos-header {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.btn-toggle-totales {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.btn-toggle-totales:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-toggle-totales i {
    transition: transform 0.3s;
    font-size: 0.75rem;
}

.totales-indirectos-fixed {
    display: flex;
    justify-content: space-around;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    flex-wrap: wrap;
}

.totales-indirectos-fixed.collapsed {
    display: none;
}

.total-item-fixed.indirecto {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    min-width: 140px;
    padding: 0.6rem 0.85rem;
}

.total-item-fixed.indirecto .total-label {
    font-size: 0.75rem;
}

.total-item-fixed.indirecto .total-value {
    font-size: 1.25rem;
}

.total-item-fixed.destacado {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    min-width: 160px;
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.total-item-fixed.destacado:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.total-item-fixed.destacado .total-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.total-item-fixed.destacado .total-value {
    font-size: 1.75rem;
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Responsive para totales indirectos */
@media (max-width: 1200px) {
    .totales-indirectos-fixed {
        gap: 0.75rem;
    }
    
    .total-item-fixed.indirecto {
        min-width: 140px;
        padding: 0.65rem 0.85rem;
    }
    
    .total-item-fixed.indirecto .total-value {
        font-size: 1.2rem;
    }
    
    .total-item-fixed.destacado {
        min-width: 160px;
        padding: 0.85rem 1rem;
    }
    
    .total-item-fixed.destacado .total-value {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .totales-indirectos-fixed {
        flex-direction: column;
        align-items: stretch;
    }
    
    .total-item-fixed.indirecto,
    .total-item-fixed.destacado {
        min-width: 100%;
        width: 100%;
    }
}

/* Botones de generación de documentos */
.btn-group-documentos {
    display: flex;
    gap: 0.5rem;
    margin-right: 0.5rem;
}

.btn-group-documentos .btn {
    min-width: 80px;
}

@media (max-width: 768px) {
    .btn-group-documentos {
        flex-direction: column;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group-documentos .btn {
        width: 100%;
    }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--weldtech-white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.empty-state h3,
.empty-state p {
    color: var(--weldtech-white) !important;
}

.empty-state-small {
    text-align: center;
    padding: 1rem;
    color: var(--text-light);
    font-style: italic;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--danger-color);
    background: #fee2e2;
    border-radius: 8px;
    margin: 2rem;
}

.loading-full {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

/* Botón Outline */
.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Responsive para edición de presupuesto */
@media (max-width: 1400px) {
    .item-row {
        grid-template-columns: 40px 1.5fr 80px 70px 110px 110px 110px 110px 1.2fr 100px;
        gap: 0.75rem;
        padding: 0.75rem;
    }
}

@media (max-width: 1200px) {
    .item-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .item-row > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        flex-wrap: wrap;
    }
    
    .item-row > div::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-light);
        margin-right: 1rem;
        flex: 0 0 120px;
    }
    
    .item-number::before { content: '#'; }
    .item-descripcion::before { content: 'Descripción:'; }
    .item-cantidad::before { content: 'Cantidad:'; }
    .item-unidad::before { content: 'Unidad:'; }
    .item-precio-cop::before { content: 'Precio COP:'; }
    .item-precio-usd::before { content: 'Precio USD:'; }
    .item-total-cop::before { content: 'Total COP:'; }
    .item-total-usd::before { content: 'Total USD:'; }
    .item-notas::before { content: 'Notas:'; }
    
    .item-descripcion {
        flex: 1 1 100%;
        margin-top: 0.5rem;
    }
    
    .item-descripcion::before {
        flex: 0 0 100%;
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 768px) {
    .presupuesto-header {
        padding: 1.5rem 1rem;
    }
    
    .presupuesto-header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .presupuesto-title-section h1 {
        font-size: 1.5rem;
    }
    
    .presupuesto-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .meta-item {
        font-size: 0.875rem;
    }
    
    .presupuesto-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .presupuesto-actions .btn {
        width: 100%;
        min-width: unset;
        justify-content: center;
    }
    
    .secciones-container {
        padding: 0 1rem 1rem 1rem;
    }
    
    .seccion-header {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .seccion-title {
        font-size: 1rem;
    }
    
    .seccion-subtotal {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.25rem;
        font-size: 0.875rem;
    }
    
    .seccion-items {
        padding: 0.75rem 1rem;
    }
    
    .item-row {
        padding: 0.75rem 0;
        gap: 0.5rem;
    }
    
    .item-acciones {
        flex-direction: column;
        gap: 0.25rem;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .item-acciones .btn {
        width: 100%;
        min-height: 44px;
    }
    
    .totales-generales-fixed {
        flex-direction: column;
        gap: 1rem;
    }
    
    .total-item-fixed {
        width: 100%;
        min-width: unset;
    }
    
    .totales-panel-fixed {
        padding: 0.5rem 1rem 0.75rem 1rem;
    }
    
    .subtotales-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .btn-toggle-subtotales {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
    
    .total-item-fixed {
        min-width: unset;
        width: 100%;
        padding: 0.75rem 1rem;
    }
    
    .totales-generales-fixed {
        gap: 0.75rem;
        padding-top: 0.75rem;
    }
    
    .presupuesto-toolbar {
        padding: 1rem;
    }
    
    .toolbar-left h3 {
        font-size: 1rem;
    }
    
    .toolbar-right {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .toolbar-right .input {
        width: 100%;
    }
}

/* ============================================
   ESTILOS PARA PARÁMETROS DEL PROYECTO
   ============================================ */

.parametros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.parametro-card {
    background: linear-gradient(135deg, #1F252D 0%, #252B33 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.parametro-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 122, 0, 0.4), 0 0 30px rgba(255, 122, 0, 0.2);
    transform: translateY(-2px);
    border-color: rgba(255, 122, 0, 0.5);
    background: linear-gradient(135deg, #252B33 0%, #2A3038 100%);
}

.parametro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.parametro-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--weldtech-white);
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.parametro-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.parametro-info {
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.15) 0%, rgba(255, 122, 0, 0.1) 100%);
    border-radius: 6px;
    border-left: 3px solid var(--weldtech-orange);
    border: 2px solid rgba(255, 122, 0, 0.3);
    border-left-width: 4px;
}

.parametro-info p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--weldtech-white);
    line-height: 1.6;
    font-weight: 500;
}

.parametro-info strong {
    color: var(--weldtech-white);
    font-weight: 700;
}

.text-suggested {
    color: var(--weldtech-orange) !important;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 122, 0, 0.5);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Input inline para proyecto */
.input-proyecto-inline {
    background-color: var(--input-bg);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    color: var(--weldtech-white);
    font-weight: 500;
    transition: all 0.2s;
}

.input-proyecto-inline:focus {
    outline: none;
    border-color: var(--weldtech-orange);
    background-color: var(--input-bg-focus);
    box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.3);
}

.input-proyecto-inline:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

#proyectoNombre:hover {
    color: var(--weldtech-orange);
    text-decoration: underline;
}

