/* UTE Customer Portal additions on top of the website's own stylesheet (assets/site.css, copied
   unchanged from the website's dist/assets/site.css; re-copy it when the website's styles change).
   Pass/fail use blue and dark orange with a symbol, never red/green alone. */

/* The website opens its mobile menu with site.js; the portal has no script, so keep the nav visible. */
@media (max-width: 850px) {
    nav { display: flex; flex-direction: row; flex-wrap: wrap; gap: 14px 20px; order: 4; width: 100%; margin: 0; padding-top: 8px; }
    nav > a { padding: 0; }
}

nav form { display: inline; margin: 0; }
.nav-button { background: none; border: 0; padding: 0; color: inherit; font-size: .875rem; font-weight: 500; }
.nav-button:hover { color: #ba2318; }
.nav-user { color: #666f74; font-size: .8rem; }
nav a[aria-current="page"] { color: #ba2318; }

.portal-body { padding-block: 40px 80px; }
.form-layout form > .button, .form-layout form > button { margin-top: 28px; }
.form-narrow { max-width: 560px; }

/* Validation messages: tinted box and border, not red text alone. */
.validation-summary-errors { background: #fdf3f2; border-left: 3px solid #ac241b; padding: 14px 18px; margin-bottom: 20px; color: #202427; font-size: .9rem; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }

/* Search bar */
.filter-bar { display: grid; grid-template-columns: 2fr 1fr 1fr auto auto; gap: 18px; align-items: end; margin-bottom: 12px; }
.filter-bar.short { grid-template-columns: minmax(0, 420px) auto; }
@media (max-width: 850px) { .filter-bar, .filter-bar.short { grid-template-columns: 1fr; } }

/* Data tables (the website's table styles are for two-column spec tables) */
table.data { font-size: .9rem; margin-bottom: 8px; }
table.data th { width: auto; font-weight: 600; background: #f0f3f4; white-space: nowrap; }
table.data th, table.data td { padding: 10px 12px; }
table.data tr:nth-child(odd) { background: none; }
table.data tbody tr:nth-child(even) { background: #f7f8f9; }
table.data tr.selected td { background: #e6f0f8; }
table.data a { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
table.data.compact { width: auto; min-width: 50%; }
table.pins td:not(:first-child) { text-align: right; font-family: Consolas, monospace; }
td.actions { white-space: nowrap; }
td.actions form { display: inline; margin: 0 4px 4px 0; }
.nowrap { white-space: nowrap; }

.button.compact { min-height: 34px; padding: 6px 11px; font-size: .78rem; }

.pass { color: #1373bb; font-weight: 700; }
.fail { color: #a64b00; font-weight: 700; }

/* Cable record */
.record-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 24px; }
.record-panel { border: 1px solid #dfe3e6; padding: 26px; }
.record-panel h2 { font-size: 1.4rem; margin-bottom: 14px; }
.section-block { margin-top: 55px; }
.section-block > h2 { font-size: 1.65rem; }
dl.facts { margin: 0; }
dl.facts .f { display: grid; grid-template-columns: 11rem 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #e0e5e8; font-size: .92rem; }
dl.facts .f:last-child { border-bottom: 0; }
dl.facts dt { color: #5b6166; }
dl.facts dd { margin: 0; white-space: pre-wrap; }
@media (max-width: 600px) { .record-grid { grid-template-columns: 1fr; } dl.facts .f { grid-template-columns: 1fr; gap: 2px; } }

/* Authenticator setup */
.qr img { margin: 10px 0 18px; border: 1px solid #dfe3e6; }
code.key { font-family: Consolas, monospace; font-size: 1.05rem; letter-spacing: .05em; color: #202427; }
.link-text { font-family: Consolas, monospace; font-size: .85rem; }
.side-panel + .side-panel { margin-top: 24px; }

.button + .muted, .button + p.muted { margin-top: 14px; }

/* Test report */
.overall-box { display: inline-block; border: 3px solid #202427; padding: 8px 18px; font-size: 1.5rem; font-weight: 700; margin: 0 0 28px; }
.overall-box.pass { border-color: #1373bb; color: #1373bb; }
.overall-box.fail { border-color: #a64b00; color: #a64b00; }
table.data td.num { text-align: right; font-family: Consolas, monospace; }
table.data tr.problem td { background: #fbeee2; font-weight: 700; }

/* Dashboard */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; margin-bottom: 10px; }
.stat { border: 1px solid #dfe3e6; border-top: 3px solid #ba2c21; padding: 18px 20px; }
.stat .value { font-size: 2.2rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; color: #202427; }
.stat .label { font-size: .85rem; color: #5b6166; margin-top: 6px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 850px) { .chart-grid { grid-template-columns: 1fr; } }
table.bars { font-size: .9rem; }
table.bars th, table.bars td { padding: 7px 10px; border-bottom: 1px solid #e0e5e8; }
table.bars th { width: 38%; font-weight: 500; background: none; white-space: normal; }
table.bars tr:nth-child(odd) { background: none; }
table.bars td.n { width: 70px; text-align: right; font-weight: 600; white-space: nowrap; }
svg.bar { display: block; width: 100%; height: 14px; }
svg.bar rect { fill: #3f5866; }
svg.bar rect.late { fill: #a64b00; }
svg.bar rect.ok { fill: #1373bb; }
svg.columns { display: block; width: 100%; height: auto; }
svg.columns rect.ok { fill: #1373bb; }
svg.columns rect.late { fill: #a64b00; }
svg.columns text { font-size: 11px; fill: #5b6166; font-family: "Segoe UI", Arial, sans-serif; }
.legend { display: flex; gap: 20px; font-size: .85rem; color: #5b6166; margin-top: 8px; }
.legend .swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }
.legend .swatch.ok { background: #1373bb; }
.legend .swatch.late { background: #a64b00; }

/* Printing: letterhead and footer, no site chrome. */
.print-only { display: none; }
@media print {
    @page { size: letter; margin: 0.5in 0.45in 0.6in; }
    body { font-size: 10pt; }
    header, footer, .no-print, .skip, nav, .header-actions { display: none !important; }
    .print-only { display: block; }
    .print-letterhead { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 2px solid #ba2c21; padding-bottom: 8px; margin-bottom: 12px; font-size: 8.5pt; text-align: right; }
    .print-letterhead img { width: 80px; height: auto; }
    .print-footer { position: fixed; bottom: 0; left: 0; right: 0; font-size: 7.5pt; color: #444; text-align: center; border-top: 1px solid #999; padding-top: 3px; }
    .wrap { width: 100%; }
    .page-intro { padding: 0 0 10px; border-bottom: 1px solid #999; }
    .page-intro h1 { font-size: 20pt; margin-bottom: 4px; }
    .lead { font-size: 10pt; }
    .eyebrow { margin-bottom: 4px; }
    .portal-body { padding: 12px 0 0; }
    .record-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .record-panel { padding: 8px 10px; break-inside: avoid; }
    .record-panel h2, .section-block > h2 { font-size: 12pt; margin-bottom: 4px; }
    .section-block { margin-top: 14px; }
    dl.facts .f { grid-template-columns: 9.5rem 1fr; padding: 3px 0; font-size: 9pt; }
    table.data { font-size: 8pt; }
    table.data th, table.data td { padding: 3px 5px; }
    table.data tr { break-inside: avoid; }
    .table-wrap { overflow: visible; }
    .overall-box { font-size: 14pt; padding: 4px 12px; margin-bottom: 10px; }
    .notice { padding: 6px 10px; }
    a { text-decoration: none !important; }
}
.filter-bar.dates { grid-template-columns: minmax(0, 220px) minmax(0, 220px) auto auto; justify-content: start; }
@media (max-width: 850px) { .filter-bar.dates { grid-template-columns: 1fr; } }
svg.columns { max-width: 900px; }
.chart-grid h2 { font-size: 1.45rem; margin-bottom: 12px; }
table.bars td, table.bars th { vertical-align: middle; }
.stat-grid { margin-top: 24px; }
.admin-check {
    margin-top: 22px;
}

.form-actions {
    margin-top: 28px;
}