/* =========================================
   1. ESTRUCTURA GENERAL (DASHBOARD)
   ========================================= */
.ayr-analytics-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 100%;
    box-sizing: border-box;
    padding-right: 20px;
    margin-top: 20px;
    zoom: 0.95; /* ZOOM OUT LIGERO PARA VER TODO MEJOR */
}

/* Encabezados y Títulos */
.ayr-analytics-wrap h1 {
    font-weight: 700;
    color: #1d1d1f;
    font-size: 24px;
}

/* =========================================
   2. BARRA DE HERRAMIENTAS Y FILTROS
   ========================================= */
.ayr-filters-bar {
    background: #fff;
    padding: 15px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.ayr-filters-bar select, 
.ayr-select {
    min-width: 150px;
    height: 36px;
    line-height: 1;
    border: 1px solid #8c8f94;
    color: #2c3338;
    border-radius: 4px;
}

.ayr-input {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    color: #2c3338;
}

/* =========================================
   3. TARJETAS KPI (INDICADORES DE COLORES)
   ========================================= */
.ayr-grid-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ayr-card-kpi {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    border-left: 4px solid #ccc; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: transform 0.2s;
}
.ayr-card-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.ayr-card-kpi .kpi-label {
    color: #646970;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 5px;
}

.ayr-card-kpi .kpi-num {
    font-size: 28px;
    font-weight: 800;
    color: #1d2327;
    line-height: 1.2;
}

.ayr-card-kpi small { color: #a7aaad; font-size: 11px; }

/* Variantes de Color KPI */
.ayr-card-kpi.green-border { border-left-color: #27ae60; }
.ayr-card-kpi.red-border { border-left-color: #c0392b; }
.ayr-card-kpi.blue-border { border-left-color: #2271b1; }
.ayr-card-kpi.orange-border { border-left-color: #f39c12; }

.kpi-num.green { color: #27ae60; }
.kpi-num.red { color: #c0392b; }
.kpi-num.blue { color: #2271b1; }
.kpi-num.orange { color: #f39c12; }

/* =========================================
   4. GRÁFICOS Y CONTENEDORES
   ========================================= */
.ayr-grid-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ayr-chart-container {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    min-height: 350px; 
    box-sizing: border-box;
    position: relative;
}

.ayr-chart-container.full {
    grid-column: 1 / -1;
}

.ayr-chart-container h3 {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #1d2327;
    border-bottom: 1px solid #f0f0f1;
    padding-bottom: 10px;
    font-weight: 600;
}

/* =========================================
   5. TABLAS DE DATOS (DATA EXPLORER - SCROLL)
   ========================================= */
.ayr-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

.ayr-table-scroll {
    max-height: 600px; /* Altura máxima antes de hacer scroll */
    overflow-y: auto;  /* Activa la barra de desplazamiento vertical */
    overflow-x: hidden;
    position: relative;
    border-top: 1px solid #eee;
}

.table-view-list {
    border-collapse: collapse;
    width: 100%;
    border-spacing: 0;
}

/* Cabecera Fija (Sticky Header) */
.table-view-list thead th {
    position: sticky;
    top: 0;
    background: #f6f7f7;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0,0,0,0.1);
    
    border-bottom: 2px solid #c3c4c7;
    padding: 12px;
    text-transform: uppercase;
    font-size: 11px;
    color: #50575e;
    font-weight: 700;
}

.table-view-list tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f1;
    font-size: 13px;
}

.table-view-list tbody tr:hover {
    background: #f0f6fc; /* Hover azul claro tipo Mac */
}

/* Badges / Etiquetas en Tabla */
.ayr-badge {
    background: #e5e5e5;
    color: #333;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    display: inline-block;
}

/* =========================================
   6. HERRAMIENTAS Y PANELES
   ========================================= */
.ayr-tools-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.ayr-card-tool {
    background: #fff;
    padding: 30px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Listas de Embudo */
.ayr-funnel-list { list-style: none; margin: 0; padding: 0; }
.ayr-funnel-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f1;
    font-size: 13px;
}
.ayr-funnel-list li strong { font-weight: 700; color: #1d2327; }
.ayr-funnel-list li.conversion {
    background: #f0f6fc;
    padding: 12px;
    margin-top: 10px;
    border-radius: 4px;
    color: #2271b1;
    border: 1px solid #cce5ff;
}

/* Botones Especiales */
.button-hero { padding: 8px 20px !important; font-size: 14px !important; height: auto !important; }
.button-link-delete { color: #d63638 !important; text-decoration: none; border: 1px solid #d63638 !important; }
.button-link-delete:hover { background: #d63638 !important; color: #fff !important; }