/* 
   sap_modern.css 
   Design System: The Executive Horizon (iPhone Optimized)
   Goal: 11 points of entry (5 masters + 6 tools) on a single screen.
*/

:root {
    --sap-horizon-bg: #f2f5f8;
    --sap-horizon-surface: #ffffff;
    --sap-horizon-text: #1a1c1c;
    --sap-horizon-text-sec: #5c6670;
    --sap-horizon-primary: #0070f2; /* SAP Vibrant Blue */
    --sap-horizon-radius: 12px;
    --sap-horizon-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    
    /* Semantic Colors */
    --color-empresa: #0070f2;
    --color-hogar: #2d9441;
    --color-clientes: #6158da;
    --color-proveedores: #6a7d89;
    --color-colaboradores: #f07b14;
}

/* Main Grid for iPhone (Executive Dashboard) - Optimized for flexible width */
.horizon-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    padding: 10px;
    width: 100%;
    margin: 0 auto;
}

/* Master Tile (Larger, more informative with Glassmorphism) */
.horizon-tile-master {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--sap-horizon-radius);
    padding: 12px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04), 0 2px 8px 0 rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 90px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.horizon-tile-master:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.08);
    border-color: rgba(255, 255, 255, 0.6);
}

.horizon-tile-master:active {
    transform: translateY(1px) scale(0.97);
    background: rgba(255, 255, 255, 0.3);
}

.tile-master-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.tile-master-icon {
    font-size: 1.2rem;
}

.tile-master-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--sap-horizon-text);
}

.tile-master-data {
    font-size: 0.75rem;
    color: var(--sap-horizon-text-sec);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Tool Tile (Compact, action-oriented with Glassmorphism) */
.horizon-tile-tool {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--sap-horizon-radius);
    padding: 8px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04), 0 2px 8px 0 rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 75px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.horizon-tile-tool:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.08);
    border-color: rgba(255, 255, 255, 0.6);
}

.horizon-tile-tool:active {
    transform: translateY(1px) scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

.tile-tool-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.tile-tool-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sap-horizon-text);
    text-transform: uppercase;
}

/* Tools Section Grid (Small icons) */
.actions-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 5px;
}

/* Section Label - Ultra Compact Spacing */
.section-label {
    grid-column: 1 / -1;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--sap-horizon-text-sec);
    letter-spacing: 0.08em;
    font-weight: 700;
    margin: 16px 0 4px 4px; /* Ultra-compactación: 16px arriba, 4px abajo */
}

/* First label reduction */
.horizon-dashboard .section-label:first-child {
    margin-top: 10px;
}

/* Status Pulse for Active Sectors (Radio Online Style) */
.status-pulse-red {
    width: 8px;
    height: 8px;
    background-color: #ff3b30; /* Red vibrante estilo Apple/Radio */
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4);
    animation: status-pulse-red 2s infinite;
}

@keyframes status-pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 59, 48, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

/* Adjustments for tight space */
@media (max-width: 380px) {
    .horizon-dashboard {
        gap: 8px;
        padding: 8px;
    }
    .horizon-tile-master {
        padding: 10px;
        min-height: 80px;
    }
}

/* Active style with glowing outline/shadow in theme-matching colors */
.horizon-tile-master.active {
    transform: translateY(-2px);
}
.horizon-tile-master.active[data-type="EMPRESA"] {
    border-color: rgba(0, 112, 242, 0.6) !important;
    box-shadow: 0 0 15px rgba(0, 112, 242, 0.4), 0 8px 32px 0 rgba(0, 112, 242, 0.15) !important;
}
.horizon-tile-master.active[data-type="HOGAR"] {
    border-color: rgba(45, 148, 65, 0.6) !important;
    box-shadow: 0 0 15px rgba(45, 148, 65, 0.4), 0 8px 32px 0 rgba(45, 148, 65, 0.15) !important;
}

/* Quick view button interactions */
.quick-view-btn {
    position: relative;
    overflow: hidden;
}
.quick-view-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.3s, opacity 0.5s;
}
.quick-view-btn:active::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    transition: 0s;
}

