/* =============================================
   ESTILOS GENERALES
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #333;
}

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

/* =============================================
   LOGIN
   ============================================= */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input, 
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2a5298;
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(30, 60, 114, 0.4);
}

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

.btn-danger {
    background: #dc3545;
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

/* =============================================
   HEADER Y NAV
   ============================================= */
.header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #1e3c72;
    font-size: 24px;
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header .logout-btn {
    padding: 8px 20px;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
}

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

.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.card h3 {
    color: #1e3c72;
    font-size: 16px;
    margin-bottom: 10px;
}

.card .number {
    font-size: 36px;
    font-weight: bold;
    color: #2a5298;
}

/* =============================================
   TABLAS
   ============================================= */
.table-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.table-container h3 {
    color: #1e3c72;
    margin-bottom: 20px;
}

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

table th, 
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background: #f8f9fa;
    color: #1e3c72;
    font-weight: 600;
}

table tr:hover {
    background: #f8f9fa;
}

/* =============================================
   ESTADOS
   ============================================= */
.status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status.ok {
    background: #d4edda;
    color: #155724;
}

.status.low {
    background: #f8d7da;
    color: #721c24;
}

.status.excellent {
    background: #cce5ff;
    color: #004085;
}

/* =============================================
   PUNTOS DE VENTA - SELECCIÓN
   ============================================= */
.puntos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.punto-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 3px solid transparent;
}

.punto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-color: #2a5298;
}

.punto-card h3 {
    color: #1e3c72;
    font-size: 18px;
    margin-bottom: 10px;
}

.punto-card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

/* =============================================
   PRODUCTOS - CHEQUEO
   ============================================= */
.producto-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.producto-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.producto-info h4 {
    color: #1e3c72;
    font-size: 16px;
    margin-bottom: 5px;
}

.producto-info .categoria {
    color: #666;
    font-size: 13px;
}

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

.producto-precio .rango {
    font-size: 14px;
    color: #666;
}

.producto-precio .costo {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.producto-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.producto-form .form-group {
    margin-bottom: 0;
}

.producto-form input,
.producto-form select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.producto-form input:focus,
.producto-form select:focus {
    border-color: #2a5298;
    outline: none;
}

/* =============================================
   CALCULO DE MARGEN
   ============================================= */
.margen-display {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
}

.margen-display .valor {
    font-size: 24px;
    font-weight: bold;
}

.margen-display .valor.ok {
    color: #28a745;
}

.margen-display .valor.low {
    color: #dc3545;
}

.margen-display .valor.excellent {
    color: #007bff;
}

.margen-display .detalle {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* =============================================
   FILTROS
   ============================================= */
.filtros {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filtros select,
.filtros input {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

/* =============================================
   MENSAJES
   ============================================= */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.message.show {
    display: block;
}

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

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

.message.info {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

/* =============================================
   TABS
   ============================================= */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 24px;
    background: white;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.tab.active {
    background: #1e3c72;
    color: white;
}

.tab-content {
    display: none;
}

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

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .producto-form {
        grid-template-columns: 1fr;
    }
    
    .filtros {
        flex-direction: column;
    }
}