/* V2 TFS Ecosystem — full-app UX / dark-mode hardening */
:root{--tfs2-dark-bg:#0f151b;--tfs2-dark-card:#17212b;--tfs2-dark-card2:#1e2a35;--tfs2-dark-border:#3a4a59;--tfs2-dark-text:#eef4f8;--tfs2-dark-muted:#b5c2cd}
.tfs2-start{border:2px solid var(--tfs-accent,#ef7d22);border-radius:16px;padding:14px;background:linear-gradient(135deg,rgba(239,125,34,.10),rgba(239,125,34,.03));margin-bottom:12px}.tfs2-start h2{margin:0 0 4px;font-size:1.15rem}.tfs2-start-current{display:flex;gap:10px;align-items:center;justify-content:space-between;border:1px solid var(--border);border-radius:12px;padding:11px;background:var(--card,#fff)}.tfs2-start-current .meta{min-width:0}.tfs2-start-current strong,.tfs2-start-current small{display:block}.tfs2-start-current small{color:var(--muted);margin-top:2px}.tfs2-open-work{display:flex;gap:7px;overflow:auto;padding-top:8px}.tfs2-open-work button{white-space:nowrap}
.tfs2-metric-button{cursor:pointer;text-align:left;width:100%;font:inherit;color:inherit}.tfs2-metric-button:active{transform:translateY(1px)}
.tfs2-status-list{display:grid;gap:8px}.tfs2-status-row{width:100%;text-align:left;border:1px solid var(--border);border-radius:11px;background:var(--card,#fff);padding:11px;color:inherit}.tfs2-status-row .top{display:flex;justify-content:space-between;gap:10px}.tfs2-status-row small{color:var(--muted);display:block;margin-top:3px}
.tfs2-ratebar{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;border:1px solid #cbd5df;border-radius:8px;padding:7px 9px;margin:7px 0 9px;background:#f8fafc;color:#17212b;font-size:.76rem}.tfs2-ratebar div{text-align:center}.tfs2-ratebar strong{display:block;font-size:.68rem;text-transform:uppercase;color:#64748b}.tfs2-rate-toggle{margin:8px 0;padding:10px;border:1px solid var(--border);border-radius:10px;background:var(--card,#fff)}.tfs2-rate-toggle label{display:flex;align-items:center;gap:8px;font-weight:700}.tfs2-rate-toggle small{display:block;color:var(--muted);margin-top:4px}
.tfs2-media-row{display:flex;gap:8px;flex-wrap:wrap;margin:9px 0}.tfs2-file-btn{position:relative;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;gap:5px;cursor:pointer}.tfs2-file-btn input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}.tfs2-media-preview{font-size:.75rem;color:var(--muted);padding:7px 9px;border:1px dashed var(--border);border-radius:8px;display:none}.tfs2-media-preview.on{display:block}.tfs2-photo-actions{display:flex;gap:8px;flex-wrap:wrap}.tfs2-truck-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.tfs2-truck-btn{position:relative;overflow:hidden;min-height:46px}.tfs2-truck-btn input{position:absolute;inset:0;opacity:0;width:100%;height:100%}.tfs2-truck-btn.done{border-color:#21915a!important;box-shadow:inset 0 0 0 1px #21915a}.tfs2-photo video,.tfs2-photo img{width:100%;height:140px;object-fit:cover;border-radius:6px;background:#000}
.tfs2-review-card{border:1px solid var(--border);border-radius:12px;padding:12px;background:var(--card,#fff);margin:10px 0}.tfs2-review-card h3{margin:0 0 7px}.tfs2-review-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:7px}.tfs2-review-grid>div{padding:7px;border-radius:8px;background:rgba(128,128,128,.08)}
/* Remove the accidental microphone/control collision in invoice line-item cells. */
#lines-body td:nth-child(2){min-width:190px}#lines-body td:nth-child(2) .btn{margin-left:5px;vertical-align:middle}#lines-body .l-job{position:relative!important;z-index:2!important;background-clip:padding-box!important}#lines-body td:nth-child(3){position:relative!important;overflow:visible!important}#lines-body td:nth-child(3) button,#lines-body td:nth-child(3) .btn{display:none!important}
/* GLOBAL DARK MODE: one rule set, not screen-by-screen patches. */
html.tfs-dark,html[data-theme="dark"],body.tfs-dark,body.dark-mode{color-scheme:dark}
html.tfs-dark body,html[data-theme="dark"] body,body.tfs-dark,body.dark-mode{background:var(--tfs2-dark-bg)!important;color:var(--tfs2-dark-text)!important}
html.tfs-dark :is(.page,.container,.app),html[data-theme="dark"] :is(.page,.container,.app),body.tfs-dark :is(.page,.container,.app),body.dark-mode :is(.page,.container,.app){background:var(--tfs2-dark-bg)!important;color:var(--tfs2-dark-text)!important}
html.tfs-dark :is(.card,.tfs16-card,.tfs16-row,.tfs17-tile,.tfs17-metric,.tfs17-report-card,.tfs17-sheet,.tfs18-review,.tfs18-sub,.tfs18-profile,.tfs-v6-card,.tfs7-tile,.tfs8-card,.stat-card,.metric-card,.dashboard-card,.settings-group,.global-search-card,#find-anything-card,#tfs17-find-card,.tfs2-start-current,.tfs2-status-row,.tfs2-rate-toggle,.tfs2-review-card),html[data-theme="dark"] :is(.card,.tfs16-card,.tfs16-row,.tfs17-tile,.tfs17-metric,.tfs17-report-card,.tfs17-sheet,.tfs18-review,.tfs18-sub,.tfs18-profile,.tfs-v6-card,.tfs7-tile,.tfs8-card,.stat-card,.metric-card,.dashboard-card,.settings-group,.global-search-card,#find-anything-card,#tfs17-find-card,.tfs2-start-current,.tfs2-status-row,.tfs2-rate-toggle,.tfs2-review-card),body.tfs-dark :is(.card,.tfs16-card,.tfs16-row,.tfs17-tile,.tfs17-metric,.tfs17-report-card,.tfs17-sheet,.tfs18-review,.tfs18-sub,.tfs18-profile,.tfs-v6-card,.tfs7-tile,.tfs8-card,.stat-card,.metric-card,.dashboard-card,.settings-group,.global-search-card,#find-anything-card,#tfs17-find-card,.tfs2-start-current,.tfs2-status-row,.tfs2-rate-toggle,.tfs2-review-card),body.dark-mode :is(.card,.tfs16-card,.tfs16-row,.tfs17-tile,.tfs17-metric,.tfs17-report-card,.tfs17-sheet,.tfs18-review,.tfs18-sub,.tfs18-profile,.tfs-v6-card,.tfs7-tile,.tfs8-card,.stat-card,.metric-card,.dashboard-card,.settings-group,.global-search-card,#find-anything-card,#tfs17-find-card,.tfs2-start-current,.tfs2-status-row,.tfs2-rate-toggle,.tfs2-review-card){background:var(--tfs2-dark-card)!important;color:var(--tfs2-dark-text)!important;border-color:var(--tfs2-dark-border)!important}
html.tfs-dark :is(h1,h2,h3,h4,.section-title,.bill-company,.label,strong),html[data-theme="dark"] :is(h1,h2,h3,h4,.section-title,.bill-company,.label,strong),body.tfs-dark :is(h1,h2,h3,h4,.section-title,.bill-company,.label,strong),body.dark-mode :is(h1,h2,h3,h4,.section-title,.bill-company,.label,strong){color:var(--tfs2-dark-text)!important}
html.tfs-dark :is(.muted,.settings-help,.field-help,.tfs16-note,.tfs17-hint,.tfs8-helper,small),html[data-theme="dark"] :is(.muted,.settings-help,.field-help,.tfs16-note,.tfs17-hint,.tfs8-helper,small),body.tfs-dark :is(.muted,.settings-help,.field-help,.tfs16-note,.tfs17-hint,.tfs8-helper,small),body.dark-mode :is(.muted,.settings-help,.field-help,.tfs16-note,.tfs17-hint,.tfs8-helper,small){color:var(--tfs2-dark-muted)!important}
html.tfs-dark :is(input,select,textarea,button.btn-outline),html[data-theme="dark"] :is(input,select,textarea,button.btn-outline),body.tfs-dark :is(input,select,textarea,button.btn-outline),body.dark-mode :is(input,select,textarea,button.btn-outline){background:var(--tfs2-dark-card2)!important;color:var(--tfs2-dark-text)!important;border-color:#506273!important}
html.tfs-dark :is(input.yellow,select.yellow,textarea.yellow,.yellow),html[data-theme="dark"] :is(input.yellow,select.yellow,textarea.yellow,.yellow),body.tfs-dark :is(input.yellow,select.yellow,textarea.yellow,.yellow),body.dark-mode :is(input.yellow,select.yellow,textarea.yellow,.yellow){background:#303024!important;color:#fff!important}
html.tfs-dark :is(table,tbody,tr,td),html[data-theme="dark"] :is(table,tbody,tr,td),body.tfs-dark :is(table,tbody,tr,td),body.dark-mode :is(table,tbody,tr,td){background:var(--tfs2-dark-card)!important;color:var(--tfs2-dark-text)!important;border-color:var(--tfs2-dark-border)!important}
html.tfs-dark :is(thead,th),html[data-theme="dark"] :is(thead,th),body.tfs-dark :is(thead,th),body.dark-mode :is(thead,th){background:var(--tfs2-dark-card2)!important;color:#fff!important;border-color:var(--tfs2-dark-border)!important}
html.tfs-dark .tfs17-tile.primary,html[data-theme="dark"] .tfs17-tile.primary,body.tfs-dark .tfs17-tile.primary,body.dark-mode .tfs17-tile.primary{background:#322419!important;border-color:#805431!important}.tfs17-tile strong,.tfs17-tile small{display:block}.tfs17-tile strong{margin-bottom:3px}
html.tfs-dark :is(.header,.bottom-nav),html[data-theme="dark"] :is(.header,.bottom-nav),body.tfs-dark :is(.header,.bottom-nav),body.dark-mode :is(.header,.bottom-nav){background:#141d25!important;border-color:var(--tfs2-dark-border)!important}
html.tfs-dark .tfs16-pagehead,html[data-theme="dark"] .tfs16-pagehead,body.tfs-dark .tfs16-pagehead,body.dark-mode .tfs16-pagehead{background:var(--tfs2-dark-bg)!important}
/* Customer documents remain white by design even while app is dark. */
:is(html.tfs-dark,html[data-theme="dark"],body.tfs-dark,body.dark-mode) :is(.tfs9-customer-copy,.tfs9-paper,.invoice-print,.f18-sheet,.tfs17-famco,.f18-bundle){background:#fff!important;color:#111!important;color-scheme:light}
@media(max-width:700px){.tfs2-start-current{align-items:stretch;flex-direction:column}.tfs2-start-current .btn{width:100%}.tfs2-review-grid{grid-template-columns:1fr}.tfs2-ratebar{grid-template-columns:1fr 1fr 1fr;font-size:.7rem}#lines-body td:nth-child(2){min-width:210px}.tfs17-tile{min-height:112px}.tfs17-capturetext strong{margin-bottom:3px}}
