.quality-alerts{border:1px solid #cf9a31;background:#fff6dc;border-radius:10px;padding:14px 18px;margin-bottom:16px;color:#65491b;font-size:13px}
.quality-alerts summary{cursor:pointer;font-weight:750}
#alert-list{max-height:300px;overflow:auto}
#alert-list p{border-top:1px solid #e8d3a6;padding:10px 0;margin:0}
.quality-item{border-top:1px solid #e8d3a6;padding:12px 0;overflow-wrap:anywhere}
.quality-item button{display:block;margin-top:8px;min-height:40px}
#quality-dialog{border:1px solid #d9d7ca;border-radius:14px;max-width:560px;width:calc(100% - 40px);padding:24px;color:#30362d}
#quality-dialog::backdrop{background:#151d18aa}
#quality-dialog textarea{box-sizing:border-box;width:100%;font:inherit;padding:10px;margin-top:8px}
#quality-dialog form>div{display:flex;gap:12px;justify-content:flex-end}
#quality-feedback{color:#a43023}
#coverage-list p{border-top:1px solid #e4e4dc;padding-top:10px}
.trip-table{min-width:1100px}
.history-actions{display:flex;gap:16px;align-items:center;flex-wrap:wrap;padding:0 24px 18px}
.history-actions label{display:flex;gap:8px;align-items:center;font-size:14px}
.history-actions select,.history-actions button,.history-table button{font:inherit;min-height:42px;border:1px solid #d9dcd0;border-radius:7px;background:#fff;padding:8px 12px;color:#30362d}
.history-actions button{background:#fbb800;border-color:#fbb800;font-weight:700}
.history-actions span{font-size:13px;color:#737a6c}
.history-table{min-width:960px}
.history-table td{font-size:14px}
.history-table small{display:block;font-size:11px;max-width:150px}
.history-selected{background:#fff7d8}
.trip-table td{font-size:14px;vertical-align:top}
.trip-table td:last-child{min-width:220px;max-width:350px}
.trip-table th button{border:0;background:transparent;font:inherit;color:inherit;font-weight:700;min-height:40px}
.trip-table th[aria-sort=ascending],.trip-table th[aria-sort=descending]{background:#fff1bc}
.consumption-table{min-width:1380px;table-layout:auto}
.consumption-table th,.consumption-table td{padding:12px 10px}
.consumption-table th{text-align:center}
.consumption-table td.value{font-size:19px;text-align:center;white-space:nowrap}
.consumption-table td small{font-size:10px;white-space:normal}
.consumption-table .fleet-number{min-width:125px}
.consumption-table .suspect-row td:first-child{box-shadow:inset 4px 0 #c19028}
.tv-toolbar{flex-wrap:wrap}
.tv-toolbar input[type=date]{font:inherit;font-size:.85rem;border:1px solid #d9dcd0;border-radius:5px;padding:5px;background:#fff;color:#30362d;max-width:155px}
.consumption-table th button{border:0;background:transparent;color:inherit;font:inherit;font-weight:750;padding:8px 2px;width:100%;min-height:36px;white-space:normal}
.consumption-table th[aria-sort=ascending],.consumption-table th[aria-sort=descending]{background:#fff1bc;color:#5e490a}
.consumption-table th button:hover{background:#fff6dc;border-radius:5px}
.tv-mode .consumption-table th,.tv-mode .consumption-table td{padding:10px 8px}
.tv-mode .consumption-table .value{font-size:20px}
.tv-mode .consumption-table td{padding-top:8px;padding-bottom:8px}
.tv-mode .tv-card-note{font-size:12px;padding-bottom:10px}
@media(min-width:1060px){
  .tv-mode .consumption-table th{padding:4px 8px}
  .tv-mode .consumption-table th button{min-height:24px;padding:4px 0}
  .tv-mode .consumption-table td{padding-top:7px;padding-bottom:7px}
}
@media(max-width:650px){.consumption-table{min-width:1250px}.quality-alerts{font-size:12px}}
/* Cozinha: leitura automática, sem botões de cálculo ou filtros operacionais. */
body.tv-readonly .tv-toolbar label,body.tv-readonly .tv-tabs,
body.tv-readonly .tv-actions button:not(#tv-logout),body.tv-readonly .table-footer>div,
body.tv-readonly #quality-alerts,body.tv-readonly .data-details,
body.tv-readonly [data-trip-detail],body.tv-readonly .tv-card-note:not(#ranking-note){display:none!important}
body.tv-readonly .tv-toolbar{display:none}
.speeding-panel{border-top:1px solid #e5e5db;padding:12px 20px 16px}
.speeding-panel h3{margin:0 0 5px;font-size:18px;color:#754c0c}
.speeding-panel p{margin:0 0 8px;font-size:12px;color:#6c7266}
.speeding-counts{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:6px}
.speeding-counts>div{display:flex;justify-content:space-between;gap:8px;border:1px solid #e1e2d7;border-radius:6px;padding:5px 9px;font-size:14px;background:#f7f8f1}
.speeding-counts .has-speeding{background:#fff0e7;border-color:#e9c1a5;color:#8f381d}
.speeding-counts strong{font-size:17px;font-variant-numeric:tabular-nums}
@media(max-width:1400px){.speeding-counts{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(max-width:650px){.speeding-counts{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Dedicated two-column, ten-row TV wall; other views remain available outside it. */
#tv-wall{display:none}
body.tv-mode #tv-content> :not(#tv-wall){display:none!important}
body.tv-mode #tv-content{width:100%;max-width:none;height:100dvh;padding:12px;box-sizing:border-box;overflow:hidden}
body.tv-mode #tv-wall{display:flex;flex-direction:column;height:100%;gap:10px}
.wall-header{position:relative;display:flex;align-items:center;gap:20px;height:58px;flex-shrink:0}
.wall-header img{width:145px;object-fit:contain}.wall-header h1{font-size:clamp(18px,1.8vw,32px);margin:0}.wall-header>span{margin-left:auto;font-size:14px}
#wall-exit{opacity:0;min-width:40px}#wall-exit:hover,#wall-exit:focus-visible{opacity:1}
#wall-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;flex:1;min-height:0}
.wall-column{display:grid;grid-template-rows:36px repeat(10,minmax(0,1fr));gap:4px;min-width:0}
.wall-row{display:grid;grid-template-columns:minmax(100px,1.65fr) repeat(3,1fr) .9fr 1fr;align-items:center;gap:5px;padding:0 10px;background:white;border-radius:8px;font-size:clamp(14px,1.35vw,27px);border-left:4px solid #f5b800}
.wall-row strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:clamp(13px,1.15vw,23px)}
.wall-row b{text-align:right;font-variant-numeric:tabular-nums;color:#705500}.wall-row>span{text-align:right;font-variant-numeric:tabular-nums}
.wall-labels{font-size:clamp(10px,.8vw,16px);background:transparent;border:0;font-weight:700}.wall-labels span:first-child{text-align:left}
.wall-empty{visibility:hidden}#wall-note{margin:0;font-size:clamp(10px,.85vw,16px);color:#64685c}
body.tv-readonly .tv-actions #fullscreen{display:inline-block!important}
@media(max-width:700px){.wall-row{padding:0 3px;gap:2px;grid-template-columns:minmax(65px,1.4fr) repeat(5,1fr);font-size:10px}.wall-row strong{font-size:10px}.wall-header img{width:85px}.wall-header>span{font-size:10px}.wall-header{gap:6px}#wall-grid{gap:6px}}

:fullscreen #wall-fullscreen{display:none}
.wall-header button{flex-shrink:0}
#wall-fullscreen{min-width:100px;min-height:44px;padding:8px 12px;cursor:pointer;touch-action:manipulation}
#wall-fullscreen-feedback{position:absolute;left:160px;right:0;bottom:0;margin:0;font-size:12px;color:#705500}
.tv-fullscreen-fallback .wall-header{height:90px;padding-bottom:28px}

/* Daily targets and daily safety strip: keep the full 2 x 10 wall visible. */
.wall-row strong{white-space:normal;line-height:1.15;font-size:clamp(11px,1vw,20px)}
.wall-target{display:block;color:#777b6c;font-size:clamp(10px,.72vw,14px);font-weight:400;margin-top:3px}
#wall-speeding{flex-shrink:0;border-top:2px solid #fbb800;padding:5px 0}
#wall-speeding h2{font-size:clamp(12px,.9vw,18px);margin:0 0 5px}
#wall-speeding-rows{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:6px}
.wall-speed-person{display:flex;align-items:center;gap:5px;padding:4px;background:#fff;border-radius:5px;font-size:clamp(10px,.75vw,15px)}
.wall-speed-person span{flex:1;overflow-wrap:anywhere}.wall-speed-person b{font-size:18px;color:#705500}
#wall-speeding-note{font-size:11px;margin:4px 0 0;color:#656a5d}

.wall-row{grid-template-columns:minmax(100px,2.3fr) repeat(3,.95fr) .8fr .9fr}

#tv-wall .wall-header img,.tv-login>img,.tv-brand>img{background:#20231f;padding:5px;border-radius:4px;box-sizing:border-box}
#wall-speeding-rows>span{grid-column:1/-1;display:block;width:100%;font-size:12px}
#tv-wall .wall-row strong{font-size:clamp(9px,.85vw,18px);line-height:1.05}
#tv-wall .wall-target{font-size:clamp(8px,.65vw,12px);line-height:1.05;margin-top:1px}

/* Shared TV tones. Keep the numeric value readable in both layouts. */
#tv-wall .wall-month { border-radius: 5px; }
#tv-wall .wall-tone-green { background: #e4f3e5; color: #245438; }
#tv-wall .wall-tone-yellow { background: #fff4c7; color: #674b12; }
#tv-wall .wall-tone-amber { background: #ffe8b7; color: #674517; }
#tv-wall .wall-tone-orange { background: #ffdbb0; color: #703d15; }
#tv-wall .wall-tone-deep-orange { background: #ffd0b5; color: #7b371d; }
#tv-wall .wall-tone-red { background: #f7cccc; color: #842b29; }
#tv-wall .wall-tone-neutral { background: #f1f1ed; color: #555950; }
#tv-wall .wall-speed-person b { color: inherit; }

.range-form { align-items: end; border: 0; margin: 0; padding: 0 24px 18px; }
.range-form fieldset { border: 1px solid var(--line); border-radius: 8px; min-width: 0; margin: 0; }
.range-form legend { color: var(--muted); font-size: .8rem; }
.range-options { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.range-options label { font-size: .8rem; display: inline-flex; align-items: center; gap: 4px; }
.range-form button { border: 0; border-radius: 8px; padding: 10px 16px; background: var(--bellmix); font-weight: 700; }
.range-active #tv-content > .tv-toolbar > label,
.range-active .period-note,
.range-active #summary,
.range-active #sources,
.range-active #quality-alerts { display: none; }
