* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Estilos para Login */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-header i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
}

.login-header h1 {
    color: #333;
    margin: 0;
    font-size: 1.8rem;
}

.login-header p {
    color: #666;
    margin: 5px 0 0 0;
    font-size: 1rem;
}

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

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

.error-message {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message i {
    color: #721c24;
}

/* Información de usuario en sidebar */
.user-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.user-info span {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

#user-name {
    font-weight: 600;
    color: white;
    margin-bottom: 3px;
}

#user-level {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

/* Badges para niveles de usuario */
.nivel-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.nivel-superadmin {
    background-color: #dc3545;
    color: white;
}

.nivel-administrador {
    background-color: #28a745;
    color: white;
}

.nivel-cotizador {
    background-color: #007bff;
    color: white;
}

.nivel-vendedor {
    background-color: #6f42c1;
    color: white;
}

.nivel-supervisor {
    background-color: #fd7e14;
    color: white;
}

/* Badges de estatus */
.estatus-badge.activo {
    background-color: #28a745;
    color: white;
}

.estatus-badge.inactivo {
    background-color: #dc3545;
    color: white;
}

/* Estilos para pestañas */
.tabs-container {
    margin-top: 20px;
}

.tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background-color: #f8f9fa;
    color: #6c757d;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

.tab-btn.active {
    background-color: #667eea;
    color: white;
    border-bottom: 2px solid #667eea;
    margin-bottom: -2px;
}

.tab-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Estilos para Estadísticas */
.stats-dashboard {
    padding: 20px 0;
}

.stats-section {
    margin-bottom: 40px;
}

.stats-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
}

.stat-content h4 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    color: #333;
    font-size: 1.8rem;
    font-weight: 700;
}

.stats-subsection {
    margin-bottom: 30px;
}

.stats-subsection h5 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.ranking-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.chart-container h5 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

canvas {
    max-width: 100%;
    height: 200px;
}

/* Rankings */
.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-position {
    font-weight: 700;
    color: #667eea;
    font-size: 1.2rem;
    width: 30px;
}

.ranking-name {
    flex: 1;
    margin: 0 15px;
}

.ranking-value {
    font-weight: 600;
    color: #333;
}

/* Productos y Clientes */
.products-stats, .clients-stats {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-item, .client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.product-item:last-child, .client-item:last-child {
    border-bottom: none;
}

.product-name, .client-name {
    font-weight: 500;
    color: #333;
}

.product-count, .client-value {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Calendario de actividad */
#calendar-activity {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    padding: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
}

.calendar-day.high-activity {
    background: #28a745;
    color: white;
}

.calendar-day.medium-activity {
    background: #ffc107;
    color: #333;
}

.calendar-day.low-activity {
    background: #e9ecef;
    color: #666;
}

.calendar-day.no-activity {
    background: #f8f9fa;
    color: #ccc;
}

/* Estilos para totales */
.totales-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.totales-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    align-items: end;
}

.total-item {
    display: flex;
    flex-direction: column;
}

.total-item label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.total-item input {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    background: white;
    color: #333;
}

.total-item input[readonly] {
    background: #f8f9fa;
    cursor: not-allowed;
}

.total-item:last-child input {
    border-color: #28a745;
    background: #f0fff4;
    font-size: 1.2rem;
    color: #155724;
}

/* Estilos para botones de exportación */
.export-buttons {
    display: flex;
    gap: 5px;
}

.export-buttons .btn {
    padding: 5px 8px;
    font-size: 0.8rem;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Estilos para Datos de la Empresa */
#datos-empresa {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.empresa-info-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    margin-top: 20px;
}

.empresa-logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-container {
    text-align: center;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    background: #f8f9fa;
}

.empresa-logo-img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.empresa-details-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.empresa-info-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.empresa-info-card h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.2rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-item label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    color: #333;
    font-size: 1rem;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #667eea;
}

/* Estilos para el modal de empresa */
#datos-empresa-modal .modal-content {
    max-width: 800px;
    width: 90%;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 15px;
    margin-bottom: 8px;
    align-items: end;
}

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

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

.form-row.four-columns {
    grid-template-columns: 2fr 1.5fr 1fr 1fr;
}

/* Grid para productos con botón a la izquierda - CORREGIDO */
.producto-item .form-row {
    grid-template-columns: 3fr 1fr 1.2fr 1.2fr;
    gap: 15px;
    align-items: end;
}

/* Grid específico para cotización con 5 campos incluyendo eliminar */
#cotizacion-productos-container .producto-item .form-row {
    grid-template-columns: 2.5fr 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

/* Estilos para subida de archivos */
.file-upload-container {
    position: relative;
    border: 2px dashed #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8f9fa;
}

.file-upload-container:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

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

.file-upload-label {
    pointer-events: none;
}

.file-upload-label i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
    display: block;
}

.file-upload-label span {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 5px;
}

.file-upload-label small {
    display: block;
    color: #666;
    font-size: 0.8rem;
}

.archivos-lista {
    margin-top: 15px;
    text-align: left;
}

.archivo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    margin-bottom: 5px;
}

.archivo-item:last-child {
    margin-bottom: 0;
}

.archivo-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.archivo-icon {
    color: #667eea;
}

.archivo-nombre {
    font-size: 0.9rem;
    color: #333;
}

.archivo-tamaño {
    font-size: 0.8rem;
    color: #666;
}

.archivo-eliminar {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.archivo-eliminar:hover {
    background-color: #f8d7da;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 5px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Estilos para tarjetas de estatus */
.estadisticas-estatus {
    margin-bottom: 35px;
}

.estadisticas-estatus h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.estatus-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.estatus-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.estatus-card.nueva-solicitud {
    border-left: 4px solid #28a745;
}

.estatus-card.en-revision {
    border-left: 4px solid #ffc107;
}

.estatus-card.info-pendiente {
    border-left: 4px solid #fd7e14;
}

.estatus-card.cotizada {
    border-left: 4px solid #007bff;
}

.estatus-card.nueva-solicitud .stat-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.estatus-card.en-revision .stat-icon {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.estatus-card.info-pendiente .stat-icon {
    background: linear-gradient(135deg, #fd7e14, #dc3545);
}

.estatus-card.cotizada .stat-icon {
    background: linear-gradient(135deg, #007bff, #6610f2);
}

/* Badges de estatus */
.estatus-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.estatus-nueva-solicitud {
    background: #d4edda;
    color: #155724;
}

.estatus-en-revisión {
    background: #fff3cd;
    color: #856404;
}

.estatus-info-pendiente {
    background: #f8d7da;
    color: #721c24;
}

.estatus-cotizada {
    background: #d1ecf1;
    color: #0c5460;
}

/* Nuevos estilos para estatus adicionales */
.estatus-aprobada {
    background: #d4edda;
    color: #155724;
}

.estatus-en-proceso {
    background: #fff3cd;
    color: #856404;
}

.estatus-entregada {
    background: #cce5ff;
    color: #004085;
}

.estatus-pagada {
    background: #e2e3e5;
    color: #383d41;
}

.estatus-cancelada {
    background: #f8d7da;
    color: #721c24;
}

/* Estilos para selector de modo */
.modo-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e5e9;
}

.modo-tabs {
    display: flex;
    gap: 10px;
}

.modo-tab {
    padding: 10px 20px;
    border: 2px solid #e1e5e9;
    background: white;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modo-tab:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.modo-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.folio-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* Estilos para sección de datos del cliente */
.datos-cliente-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e1e5e9;
}

.datos-cliente-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

/* Estilos para modo de cotización */
.producto-item .form-group.precio-group {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.modo-cotizacion .producto-item .form-group.precio-group {
    opacity: 1;
}

.modo-cotizacion .producto-precio {
    background: white;
    border-color: #28a745;
    font-weight: 600;
}

/* Estilos para sección de datos del cliente */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

.form-actions .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Indicadores de modo */
.modo-solicitud .precio-group input::placeholder {
    color: #999;
    font-style: italic;
}

.modo-cotizacion .precio-group input::placeholder {
    color: #333;
    font-style: normal;
}

.modo-cotizacion .precio-group label::after {
    content: " *";
    color: #dc3545;
}

/* Estilos para sección de información adicional */
.datos-adicionales-section {
    background: #f0f8ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #b3d9ff;
}

.datos-adicionales-section h3 {
    margin: 0 0 15px 0;
    color: #0066cc;
    font-size: 1.2rem;
    border-bottom: 2px solid #0066cc;
    padding-bottom: 8px;
}

.datos-adicionales-section select,
.datos-adicionales-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.datos-adicionales-section select:focus,
.datos-adicionales-section textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.datos-adicionales-section textarea {
    resize: vertical;
    min-height: 80px;
}

/* Estilos para campos de precio sin flechas */
.cotizacion-precio {
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

.cotizacion-precio::-webkit-outer-spin-button,
.cotizacion-precio::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cotizacion-precio[type=number]::-webkit-outer-spin-button,
.cotizacion-precio[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cotizacion-precio[type=number] {
    -moz-appearance: textfield;
}
.producto-row .form-group:last-child {
    display: flex;
    align-items: flex-end;
    padding-bottom: 10px;
}

.producto-row .form-group:last-child label {
    visibility: hidden;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.75rem;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

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

/* Botón eliminar ultra compacto */
.producto-item .btn-danger.btn-sm {
    padding: 4px 6px;
    height: 28px;
    min-width: 28px;
    font-size: 0.65rem;
}

.producto-item .btn-danger.btn-sm i {
    font-size: 0.6rem;
}

.required {
    color: #dc3545;
}

/* Responsive para empresa */
@media (max-width: 768px) {
    .empresa-info-container {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Botón de menú hamburguesa para móvil */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #333;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    margin-right: 10px;
}

/* Responsive - Menú móvil */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .sidebar.mobile-active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .top-header {
        padding-left: 15px;
    }
}

/* Sidebar Styles */
.sidebar {
    width: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: rgba(255,255,255,0.1);
    padding-left: 25px;
}

.sidebar-menu i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 180px;
    padding: 0;
    max-width: none;
    width: calc(100% - 180px);
}

.top-header {
    background: white;
    padding: 20px 60px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-header h1 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
}

#current-datetime {
    color: #666;
    font-size: 0.9rem;
}

/* Content Sections */
.content-section {
    display: none;
    padding: 50px 60px;
    animation: fadeIn 0.3s ease-in;
    max-width: none;
    width: 100%;
}

.content-section.active {
    display: block;
}

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

/* Dashboard Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
}

.large-modal .modal-content {
    max-width: 1750px;
    width: 99%;
}

/* Espaciado para productos */
.producto-row {
    margin-bottom: 2px;
    margin-left: 0;
}

.producto-item {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 2px;
    margin-left: 0;
}

.productos-section {
    margin-top: 10px;
}

.productos-section h4 {
    margin-bottom: 8px;
    color: #333;
    font-size: 1.1rem;
}

.producto-row:last-child .producto-item {
    margin-bottom: 0;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 1.5rem;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
}

.recent-activities {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.recent-activities h2 {
    margin-bottom: 20px;
    color: #333;
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-text {
    flex: 1;
}

.activity-time {
    color: #666;
    font-size: 0.8rem;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    color: #333;
    font-size: 1.5rem;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

tr:hover {
    background-color: #f8f9fa;
}

tr:last-child td {
    border-bottom: none;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

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

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideIn 0.3s ease;
}

.large-modal .modal-content {
    max-width: none;
    width: 98vw;
    margin: 1vh auto;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.modal h2 {
    margin-bottom: 20px;
    color: #333;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Cotizaciones Section */
.cotizaciones-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-superior {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 20px;
}

.panel-inferior {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 20px;
    border: 2px solid #667eea;
}

.panel-info {
    color: #666;
    font-size: 0.9rem;
}

.cotizacion-info {
    color: #667eea;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Secciones del formulario de cotización */
.datos-cliente-section,
.productos-section,
.condiciones-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.datos-cliente-section h3,
.productos-section h3 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* Productos de cotización */
.cotizacion-producto-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1.2fr 1fr auto;
    gap: 15px;
    align-items: end;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.cotizacion-producto-row input {
    padding: 10px;
}

/* Totales */
.totales-section {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #28a745;
}

.totales-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.total-item {
    display: flex;
    flex-direction: column;
}

.total-item label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.total-input {
    font-size: 1.1rem;
    font-weight: 600;
    background: #f8f9fa;
    border: 2px solid #28a745;
}

.total-input:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Textarea */
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Estatus Badges */
.estatus-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.estatus-nueva-solicitud {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.estatus-en-revisión {
    background-color: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.estatus-info-pendiente {
    background-color: #fce4ec;
    color: #c2185b;
    border: 1px solid #f8bbd9;
}

.estatus-cotizada {
    background-color: #e8f5e8;
    color: #388e3c;
    border: 1px solid #a5d6a7;
}

/* Estadísticas por Estatus en Dashboard */
.estadisticas-estatus {
    margin-bottom: 30px;
}

.estadisticas-estatus h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.estatus-card {
    border-left: 5px solid;
}

.estatus-card.nueva-solicitud {
    border-left-color: #1976d2;
}

.estatus-card.nueva-solicitud .stat-icon {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
}

.estatus-card.en-revision {
    border-left-color: #f57c00;
}

.estatus-card.en-revision .stat-icon {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc02 100%);
    color: #f57c00;
}

.estatus-card.info-pendiente {
    border-left-color: #c2185b;
}

.estatus-card.info-pendiente .stat-icon {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    color: #c2185b;
}

.estatus-card.cotizada {
    border-left-color: #388e3c;
}

.estatus-card.cotizada .stat-icon {
    background: linear-gradient(135deg, #e8f5e8 0%, #a5d6a7 100%);
    color: #388e3c;
}

/* Estilos para solicitudes cotizadas */
.fila-cotizada {
    background-color: #f0f8f0 !important;
    opacity: 0.8;
}

.fila-cotizada td {
    color: #666 !important;
}

/* Botones mejorados para cotización */
.btn-warning {
    background-color: #f57c00;
    color: white;
    border: none;
}

.btn-warning:hover {
    background-color: #e65100;
    transform: translateY(-2px);
}

.btn-sm {
    font-size: 0.75rem;
    padding: 4px 8px;
    margin: 1px;
}

/* Badges mejorados */
.estatus-badge i {
    margin-right: 4px;
}

/* Estilos para bitácora */
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
    border: none;
}

.btn-info:hover {
    background-color: #138496;
    transform: translateY(-2px);
}

.bitacora-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

#bitacora-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

#bitacora-table th {
    background-color: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    white-space: nowrap;
}

#bitacora-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

#bitacora-table td:nth-child(2) {
    max-width: 200px;
    word-wrap: break-word;
}

#bitacora-table td:nth-child(3) {
    max-width: 300px;
    word-wrap: break-word;
    line-height: 1.4;
}

#bitacora-table tr:hover {
    background-color: #f8f9fa;
}

/* Modal más grande para bitácora */
#bitacora-modal .modal-content {
    width: 95vw;
    max-width: 1200px;
}

/* Responsive para cotizaciones */
@media (max-width: 768px) {
    .cotizacion-producto-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .totales-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Product Rows */
.producto-row {
    display: grid;
    grid-template-columns: 4fr 1fr 1.5fr auto;
    gap: 25px;
    align-items: end;
    margin-bottom: 25px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
}

#productos-container {
    margin-bottom: 20px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .producto-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .large-modal .modal-content {
        width: 98%;
        margin: 2% auto;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}

@media (max-width: 576px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-header {
        padding: 15px 20px;
    }
    
    .content-section {
        padding: 20px;
    }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error Messages */
.message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ccc;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}
