@font-face {
    font-family: "MontBold";
    src: url("../fonts/Mont-Bold.ttf") format("truetype");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "MontRegular";
    src: url("../fonts/Mont-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "MontThinItalic";
    src: url("../fonts/Mont-ThinItalic.ttf") format("truetype");
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Digital7";
    src: url("../fonts/digital-7.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --navy: #104b73;
    --cyan: #05a9d7;
    --cyan-dark: #038fc0;
    --panel: #d9d9dc;
    --label: #a9adb0;
    --white: #ffffff;
    --digit: #0d4a73;
    --gap: clamp(5px, 0.72vh, 8px);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #071d2f;
    font-family: "MontThinItalic", Arial, Helvetica, sans-serif;
}

body {
    color: var(--white);
}

.tv-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    place-items: center;
    align-content: center;
    gap: clamp(8px, 1.1vh, 14px);
    padding: clamp(8px, 1vh, 14px);
    background: #071d2f;
}

.board {
    width: min(calc(100vw - clamp(16px, 2vw, 28px)), calc((100dvh - clamp(26px, 3.4vh, 44px)) * 16 / 9));
    height: min(calc(100dvh - clamp(26px, 3.4vh, 44px)), calc((100vw - clamp(16px, 2vw, 28px)) * 9 / 16));
    aspect-ratio: 16 / 9;
    background: var(--navy);
    padding: clamp(22px, 4.1vh, 46px) clamp(26px, 3vw, 48px) clamp(18px, 2.4vh, 26px);
    display: grid;
    grid-template-rows: 14.2% 1fr;
    gap: clamp(8px, 1.1vh, 12px);
    overflow: hidden;
}

.board-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: clamp(18px, 2.4vw, 40px);
    min-height: 0;
}

.board-title {
    min-width: 0;
}

.board-title h1 {
    margin: 0;
    font-size: clamp(34px, 5.15vh, 58px);
    line-height: 0.96;
    letter-spacing: 0.015em;
    font-family: "MontBold", Arial, Helvetica, sans-serif;
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
    white-space: nowrap;
}

.board-title p {
    margin: clamp(4px, 0.7vh, 8px) 0 0;
    font-size: clamp(28px, 4.15vh, 48px);
    line-height: 1;
    font-family: "MontRegular", Arial, Helvetica, sans-serif;
    font-weight: 400;
    white-space: nowrap;
}

.brand {
    min-width: 22%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding-top: clamp(1px, 0.35vh, 4px);
}

.brand img {
    max-width: min(22vw, 350px);
    max-height: min(9.2vh, 92px);
    object-fit: contain;
}

.brand-fallback {
    display: none;
    text-align: right;
    line-height: 0.9;
}

.brand-fallback strong {
    display: block;
    font-size: clamp(28px, 4.1vh, 50px);
    font-family: "MontBold", Arial, Helvetica, sans-serif;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand-fallback span {
    display: block;
    font-size: clamp(14px, 2.05vh, 24px);
    font-family: "MontRegular", Arial, Helvetica, sans-serif;
    font-weight: 400;
    opacity: 0.96;
}

.stats-grid {
    display: grid;
    grid-template-columns: 30.5% 19.8% 21.3% 26.4%;
    grid-template-rows: 12.8% 15.8% 12.2% 15.8% 12.4% 15.8% 15.2%;
    gap: var(--gap);
    min-height: 0;
}

.grid-spacer,
.blank-left {
    background: transparent;
}

.metric-head,
.total-head {
    background: var(--cyan);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding: 0.18em 0.5em;
    overflow: hidden;
}

.metric-head strong,
.total-head {
    font-size: clamp(16px, 1.95vh, 24px);
    line-height: 0.95;
    font-family: "MontBold", Arial, Helvetica, sans-serif;
    font-weight: 800;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.metric-head span {
    margin-top: 0.1em;
    font-size: clamp(16px, 2.15vh, 25px);
    line-height: 0.96;
    font-family: "MontRegular", Arial, Helvetica, sans-serif;
    font-weight: 400;
}

.label-cell {
    background: var(--label);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(8px, 1.05vh, 14px) clamp(10px, 1vw, 18px);
    overflow: hidden;
}

.label-cell strong {
    font-size: clamp(18px, 2.15vh, 26px);
    line-height: 1.04;
    font-family: "MontBold", Arial, Helvetica, sans-serif;
    font-weight: 800;
    white-space: nowrap;
}

.label-cell span {
    margin-top: 0.22em;
    font-size: clamp(16px, 1.95vh, 24px);
    line-height: 1.05;
    font-family: "MontRegular", Arial, Helvetica, sans-serif;
    font-weight: 400;
}

.value-cell {
    background: var(--panel);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.total-head {
    grid-column: 2 / 5;
    letter-spacing: 0.02em;
    font-size: clamp(19px, 2.45vh, 28px);
    font-family: "MontBold", Arial, Helvetica, sans-serif;
    font-weight: 800;
}

.value-total {
    grid-column: 2 / 5;
}

.metric-head-manhours {
    grid-column: 2 / 4;
}

.metric-head-pob {
    grid-column: 4 / 5;
}

.value-current {
    grid-column: 2 / 4;
}

.value-cumulative {
    grid-column: 2 / 4;
}

.screen-footer {
    width: min(calc(100vw - clamp(16px, 2vw, 28px)), calc((100dvh - clamp(26px, 3.4vh, 44px)) * 16 / 9));
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: clamp(10px, 1.3vw, 18px);
    min-height: 16px;
    padding-inline: clamp(8px, 0.4vw, 12px);
    font-size: clamp(11px, 1.35vh, 14px);
    color: var(--white);
    opacity: 0.78;
    pointer-events: none;
}

.status-dot {
    position: relative;
    padding-left: 14px;
}

.status-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #f3c969;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.status-dot.is-online::before {
    background: #48e58c;
}

.status-dot.is-error::before {
    background: #ff625d;
}

/* Dígitos del tablero usando assets/fonts/digital-7.ttf */
.seven {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--digit);
    font-family: "Digital7", "Courier New", monospace;
    font-weight: 400;
    font-style: normal;
    line-height: 0.68;
    letter-spacing: 0.012em;
    padding: 0 0.04em;
    white-space: nowrap;
    overflow: hidden;
    font-variant-numeric: tabular-nums;
    transform: translateY(0.06em);
    text-shadow: 0 0 0.5px rgba(13, 74, 115, 0.18);
}

.seven-main {
    font-size: clamp(46px, 8.1vh, 90px);
}

.seven-total {
    font-size: clamp(54px, 9.6vh, 106px);
}

.seven-wide {
    font-size: clamp(48px, 8.5vh, 96px);
}

.seven-cumulative {
    font-size: clamp(44px, 7.7vh, 86px);
    letter-spacing: 0.008em;
}

@media (max-aspect-ratio: 16 / 9) {
    .board {
        padding-inline: clamp(18px, 2.4vw, 36px);
    }

    .board-title h1 {
        font-size: clamp(28px, 4.65vw, 52px);
    }

    .board-title p {
        font-size: clamp(22px, 3.55vw, 42px);
    }
}

@media (max-width: 900px) {
    .label-cell strong,
    .label-cell span,
    .metric-head span {
        white-space: normal;
    }

    .metric-head strong {
        white-space: nowrap;
    }

    .screen-footer {
        display: none;
    }
}

.back-hotspot {
    position: fixed;
    left: 10px;
    top: 10px;
    z-index: 20;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.45);
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-size: 18px;
    opacity: .18;
    transition: opacity .2s ease, background .2s ease;
}
.back-hotspot:hover { opacity: 1; background: rgba(255,255,255,.18); color: #fff; }
