/* ==========================================================
   SISTEMA DE DISEÑO: ESTILO NOTION
   ========================================================== */
:root {
    /* Colores Principales */
    --primary-color: #0062cc; /* Tu azul personalizado */
    --primary-hover: #0056b3;
    
    /* Colores Notion (Minimalistas) */
    --bg-app: #ffffff; /* Blanco puro */
    --bg-card: #ffffff;
    --bg-hover: #f1f3f5; /* Gris muy claro al pasar el mouse */
    --text-main: #37352f; /* Gris casi negro de Notion */
    --text-muted: #787774; /* Gris para textos secundarios */
    --border-color: #e1e4e8; /* Bordes sutiles */
    
    /* Estados */
    --success-color: #0f7b6c; /* Verde estilo Notion */
    --danger-color: #eb5757;
    --warning-color: #d9730d;
    
    /* Sombras y Bordes */
    --radius: 4px; /* Bordes más cuadrados tipo Notion */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3, h4 { color: var(--text-main); font-weight: 600; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
a { color: var(--primary-color); text-decoration: none; transition: 0.2s; }
a:hover { text-decoration: underline; }
hr { border: none; border-top: 1px solid var(--border-color); margin: 20px 0; }

/* ==========================================================
   CABECERAS Y PANELES
   ========================================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Alinea los elementos arriba */
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}

.header-actions { display: flex; gap: 10px; align-items: center; }

.panel-card, .info-header, .edit-box, .tab-content {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    margin-top: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.info-header { background-color: #f7f9fa; border-left: 4px solid var(--primary-color); }

/* ==========================================================
   BOTONES (Estilo Notion)
   ========================================================== */
button, .btn-primary, .btn-secondary, .btn-danger, .btn-success, .btn-back, .btn-download {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 6px 12px; font-size: 0.9rem; font-weight: 500;
    border-radius: var(--radius); border: 1px solid var(--border-color);
    cursor: pointer; transition: all 0.2s; background: white; color: var(--text-main);
}
button:hover { background: var(--bg-hover); }

/* Botones de acción principal */
.btn-primary, button[type="submit"] { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.btn-primary:hover, button[type="submit"]:hover { background: var(--primary-hover); }

/* Botones de peligro/eliminar */
.btn-danger { color: var(--danger-color); border-color: #fad1d1; background: #fff5f5; }
.btn-danger:hover { background: #fee2e2; }

/* ==========================================================
   FORMULARIOS
   ========================================================== */
label { font-weight: 500; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 4px; display: block; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], select, textarea {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border-color);
    border-radius: var(--radius); font-family: inherit; font-size: 0.95rem;
    background-color: white; transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(0, 98, 204, 0.2); }

.field-wrapper { padding: 15px 0; border-bottom: 1px solid var(--border-color); position: relative; }
.field-wrapper:last-child { border-bottom: none; }
.status-pendiente label::before { content: "⏳ "; }
.status-enviado label::before { content: "✅ "; }
.saved-feedback { background: #ebf5ed; color: var(--success-color); padding: 2px 6px; border-radius: 3px; font-size: 0.75em; margin-left: 10px; }

/* ==========================================================
   PESTAÑAS
   ========================================================== */
.tabs-navigation { display: flex; gap: 5px; border-bottom: 1px solid var(--border-color); margin-bottom: 24px; overflow-x: auto; }
.tab-btn { background: transparent; color: var(--text-muted); border: none; padding: 8px 16px; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 2px solid transparent; }
.tab-btn:hover { background: var(--bg-hover); color: var(--text-main); }
.tab-btn.active { color: var(--text-main); border-bottom: 2px solid var(--primary-color); font-weight: 600; }

/* ==========================================================
   TABLAS RESPONSIVAS Y BARRAS DE PROGRESO
   ========================================================== */
.table-responsive { 
    width: 100%; 
    overflow-x: auto; 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius); 
    display: block; /* Fuerza a que el contenedor cree la barra de scroll */
    background: var(--bg-card);
}

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

/* Aplicamos el ancho forzado SOLO a las tablas que están dentro de la pestaña del Excel */
#tab-ecommerce table {
    min-width: 1200px;
}

.admin-layout #tab-ecommerce table {
    min-width: 100%;
}

thead { background-color: #f7f7f5; }
th { 
    padding: 12px 15px; 
    font-weight: 600; 
    font-size: 0.85rem; 
    color: #37352f; /* Oscurecido para que resalte sobre el fondo claro */
    text-align: left; 
    border-bottom: 1px solid var(--border-color); 
    white-space: nowrap; /* EVITA QUE LOS TÍTULOS SE APEÑUZQUEN */
}

td { 
    padding: 10px 15px; 
    border-bottom: 1px solid var(--border-color); 
    font-size: 0.9rem; 
    white-space: nowrap; /* EVITA QUE EL CONTENIDO SE CORTE */
}

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

.ecommerce-input { 
    border: 1px solid transparent; 
    background: transparent; 
    padding: 8px; 
    border-radius: 4px; 
    transition: 0.2s; 
    width: 100%; /* Toma todo el ancho de su celda */
    min-width: 120px; /* Tamaño mínimo para poder leer cómodamente */
}
.ecommerce-input:hover { background: var(--bg-hover); }
.ecommerce-input:focus { background: white; border: 1px solid var(--primary-color); outline: none;}

.progress-container { background-color: var(--bg-hover); border-radius: 999px; overflow: hidden; height: 10px; width: 100%; }
.progress-bar { background-color: var(--success-color); transition: width 0.5s ease; height: 100%; }
.progress-circle { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: bold; box-shadow: inset 0 0 0 1px var(--border-color); }
.progress-circle span { background: white; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }