/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media screen and (min-width: 1024px) {

    #left_panels_container {
        padding-top: 65px !important;
        height: 100vh !important;
        gap: 2px !important;
        width: 45vw !important;
        max-width: 45vw !important;
        left: 0 !important;

    }

    #right_panels {
        padding-top: 65px !important;
        height: 100vh !important;
        gap: 2px !important;
        width: 45vw !important;
        max-width: 45vw !important;
        left: auto !important;
        right: 0 !important;

    }

    .left-panel {
        padding-top: 0.5vh !important;
        padding-bottom: 0.5vh !important;
        padding-left: 2vw !important;
        /* Shift content to the right as requested */
        padding-right: 20vw !important;
        width: 100% !important;
        flex-grow: 1 !important;
        display: flex !important;
        flex-direction: row !important;
        border-top-right-radius: 250px 100% !important;
        border-bottom-right-radius: 250px 100% !important;
        border-right: 2.5px solid rgba(112, 218, 210, 0.45) !important;
    }

    .panel-right {
        display: grid !important;
        grid-template-columns: 90px 90px !important;
        /* Ultra-tight fixed width for maximum density */
        gap: 4px !important;
        flex: 1 !important;
        max-width: none !important;
        justify-content: start !important;
        align-items: center !important;
    }

    .points-column {
        min-width: 0 !important;
        width: 100% !important;
        gap: 0.2vh !important;
        padding: 0 0.2vw !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .left-panel .tech-item-number {
        font-size: 1.4rem !important;
    }

    .left-panel .tech-item-desc {
        font-size: 0.85rem !important;
        opacity: 0.85 !important;
    }

    /* RIGHT PANELS SYMMETRY */
    .clients-panel,
    .cns-panel,
    .om-panel {
        padding-top: 0.5vh !important;
        padding-bottom: 0.5vh !important;
        padding-left: 5vw !important;
        /* Balanced for responsive width */
        padding-right: 1.2vw !important;
        width: 100% !important;
        border-top-left-radius: 250px 100% !important;
        border-bottom-left-radius: 250px 100% !important;
        border-top-right-radius: 12px !important;
        border-bottom-right-radius: 12px !important;
        border-left: 2.5px solid rgba(112, 218, 210, 0.45) !important;
        border-right: none !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }

    #right_panels .cns-number,
    #right_panels .om-number {
        font-size: clamp(1.1rem, 1.5vw, 1.8rem) !important;
    }

    .right-panel .cns-subtitle,
    .right-panel .om-subtitle,
    .right-panel .cns-progress-info,
    .right-panel .om-progress-info {
        font-size: clamp(0.8rem, 1vw, 1.1rem) !important;
    }
}

/* Base Responsive rules for medium screens */
@media screen and (min-width: 1025px) and (max-width: 1380px) {
    /* Kept for compatibility if needed */
}

/* Standardize gaps and sizes for all modes - Overrides removed for consistency */

#panel2 {
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.8);
}

.clients-panel {
    min-height: 20vh;
    padding-top: 1vh !important;
    padding-bottom: 1vh !important;
}

.client-card {
    padding: 10px;
}

.clients-panel h2,
.hse-panel h2 {
    font-size: clamp(0.875rem, 1.2vw + 0.5rem, 1rem);
}

.left {
    left: -10px;
}

.right {
    right: -10px;
}

.hse-panel {
    padding: 14px;
    height: 170px;
}



.hse-image img {
    height: 150px;
}

.hse-days {
    font-size: clamp(1.4rem, 2.2vw, 1.8rem);
}

.hse-panel p {
    font-size: clamp(0.75rem, 1vw + 0.5rem, 0.875rem);
}

#panel-presencia.overview-panel {
    top: 130px;
    right: 120px;
    left: auto;
    width: clamp(340px, 35vw, 430px);
    min-width: 320px;
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
}

#panel-presencia .overview-header {
    padding: 15px 18px;
    font-size: clamp(0.875rem, calc(1.2vw + 0.5rem), 1rem);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

#panel-presencia .overview-body {
    padding: 10px 10px 0;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.overview-filters {
    margin-bottom: 18px;
}

.filter-cell span {
    font-size: clamp(0.875rem, 1.2vw + 0.5rem, 1rem);
    margin-bottom: 5px;
}

.filter-grid {
    gap: 16px 28px;
}

.select-container select {
    border-radius: 7px;
    font-size: clamp(0.75rem, 1.2vw + 0.5rem, .5rem);
    padding: 7px 24px 7px 11px;
}

.select-container::after {
    font-size: clamp(0.8125rem, 1vw + 0.5rem, 0.9375rem);
}


.futurist-btn {
    padding: 9px 36px;
    border-radius: 9px;
    font-size: clamp(0.9375rem, 1.2vw + 0.5rem, .5rem);
}

.overview-chart-block {
    margin-bottom: 15px;
    min-height: 550px;
    /* More space for donut chart */
}

.donut-value {
    font-size: clamp(1.6rem, 3vh, 2.4rem);
}

.donut-label {
    font-size: clamp(0.9rem, 1.2vw, 1.2rem);
}



@media screen and (max-width: 1380px) {
    html {
        font-size: 12px;
    }

    .cns-panel .cns-number {
        font-size: 18px;
    }

    .cns-panel .cns-subtitle {
        font-size: 12px;
    }

    .left-panel .tech-item-number {
        font-size: 1.1rem !important;
    }

    .left-panel .tech-item-desc {
        font-size: 0.75rem !important;
    }


    .om-panel .om-number {
        font-size: 18px;
    }

    .om-panel .om-subtitle {
        font-size: 12px;
    }

    .cns-panel .cns-phase,
    .om-panel .om-phase {
        font-size: 14px;
    }

    .cns-panel .cns-image,
    .om-panel .om-image {
        position: relative;
        right: auto;
    }

    .cns-panel .cns-image img,
    .om-panel .om-image img {
        max-width: 120px;
    }

    .cns-panel .cns-progress-info,
    .om-panel .om-progress-info {
        font-size: 12px;
    }

    .cns-panel .cns-progress-bar,
    .om-panel .om-progress-bar {
        margin-top: 6px;
    }

    #logo img {
        display: none;
    }

    #techdock {
        max-width: 100%;
    }

    #techdock-bar {
        justify-content: space-between;
    }

    #techdock-bar .logo {
        display: block;
        position: relative;
    }

    .techdock-bar-menus .techdock-item {
        font-size: clamp(0.5rem, 1vw, 0.65rem);
    }

    #right_panels,
    #left_panels_container {
        padding-top: 40px !important;
        height: 100vh !important;
        gap: 2px !important;
    }

    #panel2 {
        border-radius: 12px;
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    }

    #panel2 .highlight-number {
        font-size: 20px;
    }

    #panel2 .panel-stats {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    #panel2 .panel-stats p {
        font-size: 14px;
    }

    .clients-panel {
        padding: 6px 12px;
        min-height: 140px;
    }


    .client-card {
        padding: 8px;
        width: 10vh;
        height: 10vh;
    }

    .clients-panel h2,
    .hse-panel h2 {
        font-size: 16px;
    }

    .left {
        left: 5px;
    }

    .right {
        right: 5px;
    }

    .client-card img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .hse-panel {
        padding: 6px 12px;
        height: 130px;
    }



    .hse-image img {
        height: 150px;
    }

    .hse-days {
        font-size: 20px;
    }

    .hse-panel p {
        font-size: 14px
    }

    #panel-presencia.overview-panel {
        top: 28%;
        right: 120px;
        left: auto;
        width: 340px;
        min-width: 320px;
        font-size: 14px;
    }

    #panel-presencia .overview-header {
        padding: 8px;
        font-size: 14px;
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }

    #panel-presencia .overview-body {
        padding: 8px;
        max-height: 75vh;
        overflow: hidden;
    }

    .overview-filters {
        margin-bottom: 4px;
    }


    .filter-cell span {
        font-size: 14px;
        margin-bottom: 0px;
    }

    .filter-grid {
        gap: 8px 8px;
    }

    .select-container select {
        border-radius: 4px;
        font-size: 10px;
        padding: 6px 25px 6px 6px;
    }

    .select-container::after {
        font-size: 12px;
    }


    .futurist-btn {
        padding: 6px 36px;
        border-radius: 9px;
        font-size: 14px;
        width: 100%;
    }

    .overview-chart-block {
        margin-bottom: 10px;
        min-height: 100%;
    }

    .donut-value {
        font-size: clamp(2.5rem, 4vw + 1rem, 3.6rem);
    }

    .donut-label {
        font-size: clamp(1rem, 1.5vw + 0.5rem, 1.3rem);
    }


}

@media screen and (max-width: 1200px) {


    .techdock-bar-menus {
        display: none;
    }

    #techdock-bar .menu-togler {
        display: block
    }
}

/* Tablets y pantallas medianas (≤1024px) */
@media screen and (max-width: 1024px) {
    .logo-header {
        width: 180px;
    }


    #info-panel {
        width: 220px;
        padding: 12px;
    }

    .panel-tecnologia {
        width: 900px;
        max-width: 92vw;
    }

    #panel-hse {
        width: 350px;
    }

    #panel-presencia .overview-body {
        max-height: 70dvh;
        overflow-y: auto;
    }
}

/* Tablets pequeñas y móviles grandes (≤768px) */
@media screen and (max-width: 768px) {
    #dashboard-container {
        width: 95vw;
        height: 95vh;
    }

    .logo-header {
        width: 150px;
        top: 10px;
        right: 10px;
    }

    #left_panels_container {
        display: none;
    }

    /* Botones principales más pequeños */
    .round-cyber-btn,
    #tech-header {
        width: 56px;
        height: 56px;
    }

    .round-cyber-btn {
        left: 16px;
    }

    #panel-tecnologias {
        bottom: 16px;
        left: 16px;
    }

    .panel-stats p {
        margin: 8px 0;
    }

    /* Info panel responsive */
    #info-panel {
        width: 160px;
        padding: 10px;
        max-width: 90vw;
    }

    /* Paneles de tecnología */
    .panel-tecnologia {
        width: 95vw;
        top: 60px;
        resize: none;
    }

    .panel-content {
        padding: 12px;
    }

    /* Menú de tecnologías */
    #menu-tecnologias {
        min-width: 160px;
    }

    #panel-hse {
        width: 300px;
        max-width: calc(100vw - 32px);
        bottom: 16px;
        right: 16px;
    }

    .hse-panel {
        width: 180px;
        top: 12vh;
        right: 3vh;
    }

    .techdock-bar-menus {
        right: 10px;
        width: 200px;
    }
}

/* Móviles (≤480px) */
@media screen and (max-width: 480px) {
    .logo-header {
        width: 120px;
    }

    /* Botones aún más pequeños en móviles */
    .round-cyber-btn,
    #tech-header {
        width: 48px;
        height: 48px;
    }

    .round-cyber-btn svg {
        width: 28px;
        height: 28px;
    }

    .panel-stats p {
        gap: 6px;
    }

    #info-panel {
        width: 180px;
        padding: 8px;
    }

    .panel-tecnologia {
        top: 40px;
    }

    .panel-header {
        padding: 10px 12px;
    }

    .panel-content {
        padding: 10px;
    }

    .tech-item {
        padding: 6px 10px;
    }

    #menu-tecnologias {
        min-width: 140px;
    }

    #panel-hse {
        width: calc(100vw - 32px);
    }


}

/* Landscape mode para móviles */
@media screen and (max-width: 768px) and (orientation: landscape) {
    #dashboard-container {
        width: 98vw;
        height: 98vh;
    }

    .logo-header {
        width: 100px;
    }

    .round-cyber-btn {
        top: auto;
        bottom: 16px;
    }

    .panel-tecnologia {
        max-height: 85vh;
    }
}

@media (max-width: 690px) {
    #panel-presencia.overview-panel {
        min-width: 95vw;
        width: 99vw;
        padding: 0;
    }

    .overview-header {
        font-size: clamp(1rem, 1.2vw + 0.5rem, 1.125rem);
    }

    .overview-filters {
        margin-bottom: 10px;
    }

    .filter-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, auto);
        gap: 10px;
        max-width: 96vw;
    }

    .filter-cell {
        align-items: stretch;
    }

    .donut-value {
        font-size: clamp(1.5rem, 3vw + 0.5rem, 2.5rem);
    }

    .overview-chart-block {
        min-height: 120px;
    }
}

/* Opcional: media queries para ajustar aún más */
@media (max-width: 600px) {
    .globe-icon-btn {
        left: 10px;
        width: clamp(26px, 13vw, 52px);
        height: clamp(26px, 13vw, 52px);
    }

    .globe-icon-btn svg {
        width: clamp(26px, 13vw, 50px);
        height: clamp(26px, 13vw, 50px);
    }
}

/* Modo muy pequeño (≤360px) */
@media screen and (max-width: 360px) {
    .logo-header {
        width: 100px;
    }

    .round-cyber-btn,
    #tech-header {
        width: 44px;
        height: 44px;
    }

    #info-panel {

        width: 200px;

    }

}