/* V7.7.12 — Light theme hard guard. Loaded LAST. */
html[data-theme="light"],html[data-theme="light"] body{color-scheme:light!important;background:#f3f5f7!important;color:#171a20!important}
html[data-theme="light"] body.v5-body{background:#f3f5f7!important;color:#171a20!important}
html[data-theme="light"] body.v5-body .app-shell,
html[data-theme="light"] body.v5-body .v5-shell,
html[data-theme="light"] body.v5-body .v5-main,
html[data-theme="light"] body.v5-body .unified-page{background:#f3f5f7!important;color:#171a20!important}

/* Sidebar must fully follow selected theme */
html[data-theme="light"] body.v5-body .v5-sidebar,
html[data-theme="light"] body.v5-body .sidebar{background:#f7f9fb!important;background-image:none!important;color:#171a20!important;border-color:#dce2e8!important;box-shadow:none!important}
html[data-theme="light"] body.v5-body .v5-sidebar .brand{background:transparent!important;background-image:none!important;border:0!important;box-shadow:none!important}
html[data-theme="light"] body.v5-body .v5-nav-group,
html[data-theme="light"] body.v5-body .v5-user-mini,
html[data-theme="light"] body.v5-body .v5-theme-wrap{background:#fff!important;background-image:none!important;color:#171a20!important;border-color:#dde3e9!important;box-shadow:none!important}
html[data-theme="light"] body.v5-body .v5-nav a{background:transparent!important;background-image:none!important;color:#303944!important;border-color:transparent!important}
html[data-theme="light"] body.v5-body .v5-nav a b{color:#303944!important}
html[data-theme="light"] body.v5-body .v5-nav-icon{background:#f1f4f7!important;background-image:none!important;color:#303944!important;border-color:#dbe1e7!important}
html[data-theme="light"] body.v5-body .v5-nav a:hover{background:#f2f6f8!important;color:#171a20!important;border-color:#dfe5ea!important}
html[data-theme="light"] body.v5-body .v5-nav a.active{background:#eaf8f1!important;background-image:none!important;color:#153e2b!important;border-color:#c8ead9!important;box-shadow:inset 3px 0 0 #22b878!important}
html[data-theme="light"] body.v5-body .v5-nav a.active b,
html[data-theme="light"] body.v5-body .v5-nav a.active .v5-nav-arrow{color:#153e2b!important}
html[data-theme="light"] body.v5-body .v5-nav a.active .v5-nav-icon{background:#def4e9!important;color:#147148!important;border-color:#bfe3d0!important}
html[data-theme="light"] body.v5-body .v5-nav-label,
html[data-theme="light"] body.v5-body .v5-user-copy small{color:#7a8490!important}
html[data-theme="light"] body.v5-body .v5-user-copy span{color:#171a20!important}
html[data-theme="light"] body.v5-body .v5-theme-toggle,
html[data-theme="light"] body.v5-body .v5-user-mini>a{background:#f3f6f8!important;color:#27313b!important;border-color:#d9e0e6!important}

/* Generic structural surfaces across every module */
html[data-theme="light"] body.v5-body :where(
.panel,.unified-panel,.card,.pro-card,.quick-card,.activity-card,.status-summary,
.ops-board,.ops-live-panel,.ops-card,.ops-summary-card,.ops-contact-row,.ops-flow,.ops-flow-track,
.metric-card,.v7-kpi,.v7-block,.v7-list>a,.v7-finance-strip a,
.workspace-grid>section,.workspace-grid>aside>*,.workspace-side>*,
.service-directory-pro,.service-row,.service-card,.service-panel,.service-tab-panel,.service-form-card,.service-detail-shell,.service-workspace,
.field-card,.field-status-card,.field-status-line,.field-flow,.field-flow-step,.field-week-calendar,.calendar-day,.calendar-job,
.customer-directory,.customer-card,.customer-hero,.customer-live-card,.profile-card,
.company-directory-card,.company-mobile-card,.company-hero,
.device-card,.device-hero,.device-history,.device-history-card,
.account-party-card,.account-summary,.account-kpi,.account-hero,.payment-card,.payment-row,.promise-card,
.maintenance-card,.maintenance-item,.maintenance-visit-page,
.reminder-card,.reminder-item,.reminder-row,.communication-item,
.collection-item,.collection-customer,.collection-job-list>a,
.timeline-item,.timeline-card,.timeline-log,.activity-item,.v60-user-card,
.filters,.service-pro-filter,.customer-searchbar,.device-pro-filter,.history-filter,.warranty-filter,.corp-search,.field-filter,.collection-filter,.unified-searchbar,
.modal,.modal-card,.comm-dialog,.mobile-create-sheet>section,.detail-card,.detail-header,.detail-body,.detail-footer,
.v5-intake-card,.selected-customer,.v5-quick-customer,.v5-new-device,.device-mode-bar,.v5-intake-footer,.smart-results,.v5-smart-results,.history-placeholder,
.service-item-row,.service-item-add,.service-item-list,.service-item-head,.field-item-list article,.field-payment-breakdown,
.scale-table-row,.scale-table-head,.scale-table,.report-card,.report-panel,.report-box,.report-kpi,
.management-card,.management-grid>*,.settings-card,.settings-panel
){background:#fff!important;background-image:none!important;color:#171a20!important;border-color:#dfe4ea!important;box-shadow:0 5px 18px rgba(15,23,42,.035)!important}

/* Forms — no dark input can survive light mode */
html[data-theme="light"] body.v5-body :where(input,select,textarea){background:#fff!important;background-image:none!important;color:#171a20!important;border-color:#d6dde4!important;box-shadow:none!important}
html[data-theme="light"] body.v5-body :where(input,select,textarea):focus{background:#fff!important;color:#171a20!important;border-color:#62b58d!important;box-shadow:0 0 0 3px rgba(34,184,120,.10)!important}
html[data-theme="light"] body.v5-body :where(input,textarea)::placeholder{color:#8a949f!important;opacity:1!important}
html[data-theme="light"] body.v5-body option{background:#fff!important;color:#171a20!important}

/* Default text contrast inside content. Specific semantic controls are restored below. */
html[data-theme="light"] body.v5-body .v5-main :where(h1,h2,h3,h4,h5,h6,label,legend,dt,dd,td,th,p,li,b,strong){color:#171a20!important}
html[data-theme="light"] body.v5-body .v5-main :where(small,.muted,.sub,.hint,.help,.meta,.eyebrow-muted){color:#68737f!important}

/* Neutral action controls */
html[data-theme="light"] body.v5-body :where(.btn-light,.open-btn,.quick-action,.mini-action,.v5-link-btn,.v5-text-action,.service-item-presets button,.record-count){background:#f5f7f9!important;background-image:none!important;color:#202830!important;border-color:#dce2e8!important}
html[data-theme="light"] body.v5-body :where(.btn-dark,.btn-filter){background:#20252b!important;color:#fff!important;border-color:#20252b!important}
html[data-theme="light"] body.v5-body :where(.btn-dark,.btn-filter) *{color:#fff!important}
html[data-theme="light"] body.v5-body :where(.btn-primary,.v5-primary,.primary-quick,.item-save,.mobile-new-service){background:linear-gradient(135deg,#27d78a,#1dbf76)!important;color:#07140d!important;border-color:#1fc47a!important}
html[data-theme="light"] body.v5-body :where(.btn-danger,.item-delete){background:#fff1f2!important;color:#b4232d!important;border-color:#f0c7cc!important}

/* Semantic chips keep their meaning */
html[data-theme="light"] body.v5-body .badge.new{background:#eef1f4!important;color:#59636f!important}
html[data-theme="light"] body.v5-body :where(.badge.diagnosis,.badge.repair){background:#eef4ff!important;color:#255ab3!important}
html[data-theme="light"] body.v5-body .badge.approval{background:#fff5df!important;color:#985a07!important}
html[data-theme="light"] body.v5-body .badge.waiting{background:#fff1e8!important;color:#a54a12!important}
html[data-theme="light"] body.v5-body .badge.ready{background:#eaf8f0!important;color:#147649!important}
html[data-theme="light"] body.v5-body .badge.delivered{background:#edf7f4!important;color:#326f61!important}
html[data-theme="light"] body.v5-body .badge.cancelled{background:#f7eeee!important;color:#8d5055!important}
html[data-theme="light"] body.v5-body :where(.phone-chip){background:#eaf9f1!important;color:#14744b!important;border-color:#ccefdc!important}
html[data-theme="light"] body.v5-body :where(.device-chip){background:#eef4ff!important;color:#255ab3!important;border-color:#d4e1fb!important}
html[data-theme="light"] body.v5-body :where(.serial-chip){background:#f4efff!important;color:#6841a5!important;border-color:#e3d8fa!important}

/* Tables/list headers */
html[data-theme="light"] body.v5-body :where(.service-row-head,.scale-table-head,thead,tr,th){border-color:#e4e8ed!important}
html[data-theme="light"] body.v5-body :where(.service-row-head,.scale-table-head,thead th){background:#f7f9fb!important;color:#65707c!important}
html[data-theme="light"] body.v5-body :where(.service-row,.scale-table-row,.activity-item,.status-line,.timeline-item){border-color:#e8ecf0!important}

/* Mobile chrome and docks */
html[data-theme="light"] body.v5-body .mobile-headbar{background:rgba(255,255,255,.98)!important;background-image:none!important;color:#171a20!important;border-color:#dde3e9!important;box-shadow:0 2px 12px rgba(15,23,42,.05)!important}
html[data-theme="light"] body.v5-body .mobile-headbar :where(a,button){background:#f4f7f9!important;color:#222b34!important;border-color:#dce2e8!important}
html[data-theme="light"] body.v5-body .mobile-bottom-nav{background:rgba(255,255,255,.99)!important;background-image:none!important;color:#66717d!important;border-color:#dce2e8!important;box-shadow:0 -8px 24px rgba(15,23,42,.06)!important}
html[data-theme="light"] body.v5-body .mobile-bottom-nav :where(a,button){color:#66717d!important;background:transparent!important}
html[data-theme="light"] body.v5-body .mobile-bottom-nav .mobile-new-service{background:linear-gradient(135deg,#27d78a,#1dbf76)!important;color:#07140d!important}
html[data-theme="light"] body.v5-body :where(.service-mobile-dock,.field-mobile-sticky-actions){background:rgba(255,255,255,.98)!important;background-image:none!important;border-color:#dce2e8!important;box-shadow:0 -8px 24px rgba(15,23,42,.07)!important}
html[data-theme="light"] body.v5-body :where(.service-mobile-dock,.field-mobile-sticky-actions) :where(a,button){background:#f4f7f9!important;color:#26303a!important;border-color:#dce2e8!important}

/* JS guard classes — catches anything missed or dynamically inserted */
html[data-theme="light"] .zbts-light-neutral-surface{background:#fff!important;background-image:none!important;color:#171a20!important;border-color:#dfe4ea!important;box-shadow:none!important}
html[data-theme="light"] .zbts-light-neutral-surface-soft{background:#f7f9fb!important;background-image:none!important;color:#171a20!important;border-color:#e0e5ea!important}
html[data-theme="light"] .zbts-light-dark-text{color:#171a20!important}
html[data-theme="light"] .zbts-light-muted-text{color:#68737f!important}

/* Login also follows theme fully */
html[data-theme="light"] body.login-pro{background:#f3f5f7!important;background-image:none!important;color:#171a20!important}
html[data-theme="light"] body.login-pro .login-card{background:#fff!important;color:#171a20!important;border-color:#dfe4ea!important;box-shadow:0 24px 60px rgba(15,23,42,.12)!important}
html[data-theme="light"] body.login-pro :where(h1,label){color:#171a20!important}
html[data-theme="light"] body.login-pro input{background:#fff!important;color:#171a20!important;border-color:#d6dde4!important}
html[data-theme="light"] body.login-pro .theme-toggle{background:#fff!important;color:#202830!important;border-color:#dce2e8!important}

@media print{.theme-toggle,.v5-theme-toggle{display:none!important}}
/* V7.8 operational additions */
html[data-theme="light"] body.v5-body :where(.ready-share-card,.today-collection-panel,.service-due-card,.management-work-card,.report-finance-card,.report-customer-row){background:#fff!important;color:#171a20!important;border-color:#dce2e8!important;background-image:none!important}
html[data-theme="light"] body.v5-body :where(.ready-share-card span,.ready-share-card small,.today-collection-panel small,.service-due-card small,.management-work-card small,.report-finance-card small,.report-customer-row small){color:#68737f!important}
html[data-theme="light"] body.v5-body .ready-share-wa{background:#20b96f!important;color:#07150d!important;border-color:#20b96f!important}
html[data-theme="light"] body.v5-body .ready-share-open{background:#f5f7f9!important;color:#202830!important;border-color:#dce2e8!important}


/* V7.9 operations/table light-theme completion */
html[data-theme="light"] body.v5-body :where(.ops-board-row,.scale-table-row,.service-due-row,.collection-customer){background:#fff!important;color:#171a20!important;border-color:#dfe5ea!important;background-image:none!important}
html[data-theme="light"] body.v5-body :where(.ops-board-row,.scale-table-row,.service-due-row,.collection-customer) :where(b,strong,h3,p,span){color:inherit}
html[data-theme="light"] body.v5-body .collection-customer-total strong{color:#b93643!important}
