/* Reset y estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Navegación */
.main-nav {
    background-color: #34495e;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    flex: 1;
}

.nav-link {
    display: block;
    padding: 1rem;
    color: white;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background-color: #3498db;
}

/* Main content */
main {
    padding: 2rem 0;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    background-color: #ecf0f1;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #bdc3c7;
}

.card-header h2 {
    margin: 0;
    color: #2c3e50;
}

.card-body {
    padding: 1.5rem;
}

.card-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #ecf0f1;
}

/* Botones */
.btn-primary, .btn-secondary, .btn-danger, .btn-logout {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

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

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-logout {
    background-color: #e67e22;
    color: white;
}

.btn-logout:hover {
    background-color: #d35400;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Formularios */
.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

/* Tablas */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

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

/* Estados - ESTILOS CORREGIDOS (SIN DUPLICADOS) */
.estado-pendiente {
    background-color: #f39c12;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    display: inline-block;
}

.estado-aprobado {
    background-color: #27ae60;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    display: inline-block;
}

.estado-rechazado {
    background-color: #e74c3c;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    display: inline-block;
}

.estado-enviado {
    background-color: #3498db;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    display: inline-block;
}

.estado-enproceso {
    background-color: #9b59b6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    display: inline-block;
}

.estado-completado {
    background-color: #2ecc71;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    display: inline-block;
}

.estado-cancelado {
    background-color: #7f8c8d;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    display: inline-block;
}

/* Resumen de presupuesto */
.presupuesto-resumen {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    max-width: 300px;
    margin-left: auto;
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.resumen-item.total {
    font-weight: bold;
    font-size: 1.1rem;
    border-top: 1px solid #bdc3c7;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

/* Login */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.login-form h2 {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
    font-weight: 400;
}

.login-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Dashboard */
.dashboard {
    display: grid;
    gap: 2rem;
}

.welcome-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #3498db;
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Mensajes */
.error {
    background-color: #e74c3c;
    color: white;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.success {
    background-color: #27ae60;
    color: white;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Logo preview */
.logo-preview {
    margin-top: 0.5rem;
}

.logo-preview img {
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    padding: 0.5rem;
}

/* Estilos para impresión */
@media print {
    .no-print, .btn-print, .main-nav, .user-info, .form-actions {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .container {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }
}

/* Botón de impresión */
.btn-print {
    background-color: #17a2b8;
    color: white;
}

.btn-print:hover {
    background-color: #138496;
}

/* Mejoras para tablas en impresión */
.data-table th {
    background-color: #f8f9fa !important;
    color: #000 !important;
}

/* Estilos para firma en presupuesto */
.firma-area {
    margin-top: 50px;
    border-top: 1px solid #000;
    padding-top: 10px;
    text-align: center;
}

/* Formulario de estado */
.status-form {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.current-status {
    margin-top: 0.5rem;
}

/* Para el dropdown en la tabla */
.data-table select {
    font-size: 0.8rem;
    padding: 2px 4px;
    border: 1px solid #bdc3c7;
    border-radius: 3px;
    background-color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .main-nav ul {
        flex-direction: column;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
    }
    
    .presupuesto-resumen {
        max-width: 100%;
        margin-left: 0;
    }
}

/* Estilos adicionales para reportes */
.text-right {
    text-align: right;
}

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

/* Mejoras para impresión de reportes */
@media print {
    .reporte-container {
        max-width: none !important;
        margin: 0 !important;
        padding: 1cm !important;
    }
    
    body {
        font-size: 11pt;
        line-height: 1.3;
        background: white !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .estadisticas-grid,
    .estados-grid {
        break-inside: avoid;
    }
    
    .data-table {
        font-size: 10pt;
    }
    
    .data-table th {
        background-color: #f8f9fa !important;
        color: #000 !important;
    }
}

/* Para formato A4 */
@page {
    size: A4;
    margin: 1.5cm;
}

/* Para formato Carta */
@media print and (orientation: portrait) {
    @page {
        size: letter;
    }
}
/* Estilos para el Footer */
.main-footer {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem 0;
    margin-top: 3rem;
    border-top: 3px solid #3498db;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-section {
    text-align: center;
    flex: 1;
}

.footer-section p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #ecf0f1;
}

.footer-section a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Responsive para el footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-section {
        padding: 0.5rem 0;
    }
    
    .footer-section:not(:last-child) {
        border-bottom: 1px solid #34495e;
    }
}

/* Estilo adicional para el corazón */
.footer-section p:contains("❤️") {
    font-size: 0.95rem;
}
/* Estilos para el logo y nombre de empresa */
.logo-empresa {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-header {
    max-height: 60px;
    max-width: 150px;
    object-fit: contain;
}

.empresa-info-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
    line-height: 1.2;
}

.sistema-titulo {
    margin: 0;
    font-size: 0.9rem;
    color: #bdc3c7;
    font-weight: normal;
}

/* Accesos rápidos */
.quick-actions {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.quick-actions h3 {
    margin: 0 0 1.5rem 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.action-card:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    border-color: #2980b9;
}

.action-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.action-card span {
    font-weight: 500;
    text-align: center;
}

/* Estadísticas adicionales */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #3498db;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card:nth-child(1) {
    border-left-color: #f39c12; /* Naranja para pendientes */
}

.stat-card:nth-child(2) {
    border-left-color: #27ae60; /* Verde para clientes */
}

.stat-card:nth-child(3) {
    border-left-color: #3498db; /* Azul para productos */
}

.stat-card:nth-child(4) {
    border-left-color: #9b59b6; /* Morado para presupuestos del mes */
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    display: block;
}

/* Estilos para el Footer */
.main-footer {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem 0;
    margin-top: 3rem;
    border-top: 3px solid #3498db;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-section {
    text-align: center;
    flex: 1;
}

.footer-section p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #ecf0f1;
}

.footer-section a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logo-empresa {
        justify-content: center;
        text-align: center;
    }
    
    .empresa-info-header h1 {
        font-size: 1.3rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-section {
        padding: 0.5rem 0;
    }
    
    .footer-section:not(:last-child) {
        border-bottom: 1px solid #34495e;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .logo-header {
        max-height: 50px;
        max-width: 120px;
    }
}