/* =====================================================================
   THREESIXOH! DARK MODE COMPLETION v1

   Scope:
     Authenticated ThreeSixOh! shell only.

   Intentionally excluded:
     - Login / password reset
     - Public contract signing
     - Public change orders
     - Partner portal
     - Printable proposal output
     - Signature-pad canvas surfaces
   ===================================================================== */


/* =====================================================================
   GENERAL INTERNAL-SHELL FALLBACKS
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled label {
    color:#dbe5ef;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(code,pre) {
    background:#111c2e !important;
    color:#dbe5ef !important;
    border-color:#334155 !important;
}

html[data-theme="dark"] body.tso-shell-enabled hr {
    border-color:#334155 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(.warning-box,.confirm-duplicate) {
    background:#3a3019 !important;
    border-color:#75602a !important;
    color:#fde68a !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(.warning-box,.confirm-duplicate)
:where(strong,p,span,small,label) {
    color:inherit !important;
}


/* =====================================================================
   NAVIGATION / DROPDOWNS
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled .nav-dropdown {
    background:#182235 !important;
    border-color:#475569 !important;
    color:#f1f5f9 !important;
    box-shadow:0 18px 45px rgba(0,0,0,.38) !important;
}

html[data-theme="dark"] body.tso-shell-enabled .nav-dropdown::before {
    background:#182235 !important;
    border-color:#475569 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.nav-dropdown :where(a,strong) {
    color:#f1f5f9 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.nav-dropdown :where(small,.muted) {
    color:#94a3b8 !important;
}

html[data-theme="dark"] body.tso-shell-enabled .nav-logout-button {
    background:#263a52 !important;
    color:#fca5a5 !important;
}

html[data-theme="dark"] body.tso-shell-enabled .nav-logout-button:hover {
    background:#3b2228 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-sidebar-nav .nav-count {
    background:#263a52 !important;
    color:#f1f5f9 !important;
}


/* =====================================================================
   CALENDAR SECTION TABS
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
.tso-calendar-section-tabs {
    background:#182235 !important;
    border-color:#334155 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-calendar-section-tabs a,

html[data-theme="dark"] body.tso-shell-enabled
.calendar-section-tabs a {
    background:#263a52 !important;
    color:#f1f5f9 !important;
    border-color:#475569 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-calendar-section-tabs a:hover,

html[data-theme="dark"] body.tso-shell-enabled
.calendar-section-tabs a:hover {
    background:#304965 !important;
}


/* =====================================================================
   ACTIVE PRODUCTION BOARD
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-column {
    background:#111c2e !important;
    border-color:#334155 !important;
    box-shadow:0 3px 12px rgba(0,0,0,.18) !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-column-head {
    background:#1b293d !important;
    border-color:#334155 !important;
    color:#f1f5f9 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-column-head h2 {
    color:#f1f5f9 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-column-body {
    background:#111c2e !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-stage-count {
    background:#263a52 !important;
    color:#f8fafc !important;
    border-color:#3b526b !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-job-card {
    background:#263a52 !important;
    border-top-color:#3b526b !important;
    border-right-color:#3b526b !important;
    border-bottom-color:#3b526b !important;
    color:#f8fafc !important;

    box-shadow:
        0 2px 6px rgba(0,0,0,.20),
        inset 0 1px 0 rgba(255,255,255,.025) !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-job-card:hover {
    background:#304965 !important;
    border-top-color:#506983 !important;
    border-right-color:#506983 !important;
    border-bottom-color:#506983 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-job-card.is-overdue {
    border-left-color:#f87171 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-job-card
:where(
    strong,h3,
    .tso-production-job-card-head,
    .tso-production-job-card-head strong
) {
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-job-card
:where(
    small,p,
    .tso-production-job-scope span,
    .tso-production-job-card-footer
) {
    color:#a8b6c7 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-job-card a {
    color:#5eead4 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-empty-column {
    background:#152033 !important;
    border-color:#3b526b !important;
    color:#94a3b8 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-production-empty-column :where(p,span) {
    color:#94a3b8 !important;
}


/* Production detail / scheduling metrics */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-production-milestones article,
    .tso-production-module-metrics > div,
    .tso-schedule-card-metrics > div,
    .tso-job-kpis article,
    .tso-schedule-kpis article,
    .tso-field-kpis article,
    .tso-field-job-kpis article
) {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-production-handoff-record,
    .tso-production-scope,
    .tso-production-create-drawer,
    .tso-production-workflow-options article
) {
    background:#182235 !important;
    border-color:#334155 !important;
    color:#f1f5f9 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-production-handoff-record,
    .tso-production-scope,
    .tso-production-note-list,
    .tso-production-history
) p {
    color:#cbd5e1 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-production-task-toggle,
    .tso-task-toggle,
    .tso-sales-task-toggle
) {
    background:#263a52 !important;
    border-color:#475569 !important;
    color:#f1f5f9 !important;
}


/* =====================================================================
   SALES BOARD / OPPORTUNITIES
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
.tso-sales-column {
    background:#111c2e !important;
    border-color:#334155 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-opportunity-card {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-opportunity-card:hover {
    background:#304965 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-opportunity-card
:where(strong,h3) {
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-opportunity-card
:where(span,small,p) {
    color:#a8b6c7 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-sales-empty-column {
    background:#152033 !important;
    border-color:#3b526b !important;
    color:#94a3b8 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-sales-kpi,
    .tso-opportunity-kpis article,
    .tso-followup-kpis article,
    .tso-handoff-kpis article
) {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-next-action-card,
    .tso-accountability-current > div,
    .tso-sales-appointment-chip,
    .tso-appointment-card,
    .tso-appointment-update form,
    .tso-workflow-option,
    .tso-sales-create-drawer
) {
    background:#182235 !important;
    border-color:#334155 !important;
    color:#f1f5f9 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-next-action-card,
    .tso-accountability-current > div
) strong {
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-next-action-card,
    .tso-accountability-current > div,
    .tso-sales-appointment-chip,
    .tso-appointment-card
)
:where(span,small,p) {
    color:#a8b6c7 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-stage-count {
    background:#263a52 !important;
    color:#f8fafc !important;
    border-color:#3b526b !important;
}


/* =====================================================================
   CUSTOMER / PROPERTY / RECORD DETAIL
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-related-row,
    .tso-document-row,
    .tso-next-appointment,
    .tso-customer-summary-card,
    .tso-note,
    .tso-inline-create
) {
    background:#182235 !important;
    border-color:#334155 !important;
    color:#f1f5f9 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-related-row,
    .tso-document-row,
    .tso-next-appointment,
    .tso-customer-summary-card
):hover {
    background:#213149 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-related-row,
    .tso-document-row,
    .tso-next-appointment,
    .tso-customer-summary-card,
    .tso-note
)
:where(span,small,p) {
    color:#a8b6c7 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-customer-list-count {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f1f5f9 !important;
}


/* =====================================================================
   HANDOFF
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-handoff-card,
    .handoff-status-banner,
    .handoff-summary-grid > div,
    .handoff-readonly-grid > div,
    .handoff-queue-card,
    .accepted-handoff-history,
    .inset-panel,
    .review-item
) {
    background:#182235 !important;
    border-color:#334155 !important;
    color:#f1f5f9 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-handoff-summary > div {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.handoff-source-status > div {
    background:#182235 !important;
    border-color:#334155 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.handoff-source-status .source-ok {
    background:#17352a !important;
    border-color:#347451 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.handoff-source-status .source-missing {
    background:#3b2228 !important;
    border-color:#7f3b46 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.correction-card {
    background:#3a3019 !important;
    border-color:#75602a !important;
    color:#fde68a !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.correction-card.open {
    background:#3b2228 !important;
    border-color:#7f3b46 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.correction-card.resolved {
    background:#17352a !important;
    border-color:#347451 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-handoff-summary-card.is-ready {
    background:#17352a !important;
    border-color:#347451 !important;
}


/* =====================================================================
   REPORTING
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .reporting-snapshot-card,
    .reporting-metric-card,
    .reporting-dataset-card,
    .report-builder-step
) {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.reporting-dataset-card:hover {
    background:#304965 !important;
    border-color:#506983 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.reporting-results-table tbody tr:hover td {
    background:#1b293d !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.reporting-definition-note {
    background:#1d3555 !important;
    border-color:#365f8d !important;
    color:#bfdbfe !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(.reporting-tone-warning,.reporting-warning) {
    background:#3a3019 !important;
    border-color:#75602a !important;
    color:#fde68a !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.reporting-tone-danger {
    background:#3b2228 !important;
    border-color:#7f3b46 !important;
    color:#fecaca !important;
}


/* =====================================================================
   CALENDAR 360 ADMIN
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
.tso-calendar360-stats article {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-calendar360-callback code {
    background:#111c2e !important;
    color:#cbd5e1 !important;
}


/* =====================================================================
   RIPPLE
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .ripple-card,
    .ripple-impact,
    .ripple-kpi
) {
    --surface:#263a52;

    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .ripple-kpi span,
    .ripple-customer,
    .ripple-section-label,
    .ripple-mini-severity,
    .ripple-impact > span
) {
    color:#a8b6c7 !important;
}


/* =====================================================================
   ACCOUNTING
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
.accounting-banner {
    background:#3a3019 !important;
    border-color:#75602a !important;
    color:#fde68a !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.accounting-banner p {
    color:#d6c58a !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.readiness-list li {
    background:#182235 !important;
    border-color:#334155 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.readiness-list li.ready {
    background:#17352a !important;
    border-color:#347451 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.readiness-list li.missing {
    background:#3a3019 !important;
    border-color:#75602a !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.accounting-status {
    background:#273449 !important;
    color:#dbe5ef !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.queue-summary span {
    background:#263a52 !important;
    color:#dbe5ef !important;
}


/* =====================================================================
   CLOSEOUT / FINAL PAPERWORK
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .closeout-card,
    .financial-tile,
    .closeout-state-banner > div
) {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .closeout-card,
    .financial-tile,
    .closeout-state-banner
) span {
    color:#a8b6c7 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(.closeout-progress,.closeout-status) {
    background:#273449 !important;
    color:#dbe5ef !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.closeout-card.warning,

html[data-theme="dark"] body.tso-shell-enabled
.closeout-requirement.missing {
    background:#3a3019 !important;
    border-color:#75602a !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.closeout-card.ready,

html[data-theme="dark"] body.tso-shell-enabled
.closeout-requirement.complete {
    background:#17352a !important;
    border-color:#347451 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.financial-tile.variance {
    background:#3b2228 !important;
    border-color:#7f3b46 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.financial-tile.balanced {
    background:#17352a !important;
    border-color:#347451 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.financial-tile.emphasis {
    background:#1d3555 !important;
    border-color:#365f8d !important;
}


/* =====================================================================
   PAYMENT COLLECTIONS
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .payment-summary-card,
    .payment-state-banner > div,
    .payment-financial-grid .financial-tile
) {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .payment-summary-card,
    .payment-state-banner,
    .payment-financial-grid .financial-tile
) span {
    color:#a8b6c7 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .payment-progress,
    .collection-status,
    .aging-badge,
    .transaction-status
) {
    background:#273449 !important;
    color:#dbe5ef !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.payment-summary-card.warning,

html[data-theme="dark"] body.tso-shell-enabled
.payment-requirement.missing {
    background:#3a3019 !important;
    border-color:#75602a !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.payment-summary-card.danger {
    background:#3b2228 !important;
    border-color:#7f3b46 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.payment-summary-card.success,

html[data-theme="dark"] body.tso-shell-enabled
.payment-requirement.complete,

html[data-theme="dark"] body.tso-shell-enabled
.payment-state-banner.Paid-in-Full > div,

html[data-theme="dark"] body.tso-shell-enabled
.paid-in-full-confirmation {
    background:#17352a !important;
    border-color:#347451 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.payment-summary-card.emphasis {
    background:#1d3555 !important;
    border-color:#365f8d !important;
}


/* =====================================================================
   WARRANTY
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .warranty-summary-card,
    .warranty-state-banner > div,
    .warranty-requirement,
    .warranty-registration-card,
    .warranty-info-grid > div,
    .warranty-upload-grid form,
    .warranty-add-registration
) {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .warranty-summary-card,
    .warranty-state-banner,
    .warranty-info-grid,
    .warranty-registration-card
)
:where(span,small,p) {
    color:#a8b6c7 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .warranty-summary-card strong,
    .warranty-state-banner strong,
    .warranty-info-grid strong,
    .warranty-registration-head h3,
    .warranty-add-registration summary
) {
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.warranty-status {
    background:#273449 !important;
    color:#dbe5ef !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.warranty-requirement.complete {
    background:#17352a !important;
    border-color:#347451 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.warranty-requirement.missing {
    background:#3a3019 !important;
    border-color:#75602a !important;
}


/* =====================================================================
   PRODUCTION QUALITY
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .quality-card,
    .quality-item,
    .punch-item,
    .signature-box
) {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.quality-status {
    background:#273449 !important;
    color:#dbe5ef !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(.quality-item.fail,.punch-item.overdue) {
    background:#3b2228 !important;
    border-color:#7f3b46 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.quality-item.pass {
    background:#17352a !important;
    border-color:#347451 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.quality-item.pending {
    background:#3a3019 !important;
    border-color:#75602a !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.quality-requirement.missing {
    background:#3a3019 !important;
    border-color:#75602a !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.quality-requirement.complete {
    background:#17352a !important;
    border-color:#347451 !important;
}

/*
 * .signature-pad deliberately remains white.
 * Black signature ink must remain visible.
 */


/* =====================================================================
   PRODUCTION EXCEPTIONS / CHANGE ORDERS — INTERNAL ONLY
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .exception-card,
    .exception-record,
    .exception-impact > div
) {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.exception-impact span {
    color:#a8b6c7 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.exception-status {
    background:#273449 !important;
    color:#dbe5ef !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.share-link-box {
    background:#1d3555 !important;
    border-color:#365f8d !important;
    color:#bfdbfe !important;
}


/* =====================================================================
   ROLE / PERMISSION ADMIN
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
.role-permission-scroll {
    background:#182235 !important;
    border-color:#334155 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.role-permission-table .permission-name-column,

html[data-theme="dark"] body.tso-shell-enabled
.role-permission-table tbody th {
    background:#1b293d !important;
    color:#f1f5f9 !important;
    border-color:#334155 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.role-permission-actions {
    background:rgba(24,34,53,.97) !important;
    border-color:#334155 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.role-summary-grid article {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}


/* =====================================================================
   REQUIREMENTS NAVIGATOR
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
.requirement-action.secondary {
    background:#263a52 !important;
    border-color:#475569 !important;
    color:#93c5fd !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.requirement-list-toggle {
    background:#182235 !important;
    border-color:#334155 !important;
    color:#f1f5f9 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.requirement-floating-count {
    background:#3b2228 !important;
    color:#fca5a5 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.requirement-inline-help {
    background:#3a3019 !important;
    color:#fde68a !important;
}


/* =====================================================================
   FEEDBACK ATTACHMENTS
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
.feedback-attachment-card {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.feedback-image-upload input[type="file"] {
    background:#111c2e !important;
    color:#dbe5ef !important;
    border-color:#475569 !important;
}


/* =====================================================================
   LEGACY PRODUCTION SCHEDULING CALENDAR
   Embedded template CSS is overridden here with !important.
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
.calendar-scroll {
    background:#182235 !important;
    border-color:#334155 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.sched-month {
    border-color:#475569 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.sched-weekday {
    background:#142f46 !important;
    color:#cbd5e1 !important;
    border-color:#475569 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.sched-day,

html[data-theme="dark"] body.tso-shell-enabled
.week-column {
    background:#182235 !important;
    color:#f1f5f9 !important;
    border-color:#475569 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.sched-day.outside {
    background:#111827 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.sched-day.drag-over {
    background:#1d3555 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.sched-event {
    background:#263a52 !important;
    color:#f8fafc !important;
    border-top-color:#3b526b !important;
    border-right-color:#3b526b !important;
    border-bottom-color:#3b526b !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.sched-event.status-dispatch-ready {
    background:#17352a !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.sched-event.status-needs-review {
    background:#3a3019 !important;
}


/* =====================================================================
   PRODUCTION SCHEDULE DETAIL
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
.readiness-item {
    background:#182235 !important;
    border-color:#334155 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.readiness-item.pass {
    background:#17352a !important;
    border-color:#347451 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.readiness-item.fail {
    background:#3b2228 !important;
    border-color:#7f3b46 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.schedule-state {
    background:#263a52 !important;
    border-color:#3b526b !important;
    color:#f8fafc !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.schedule-state.ready {
    background:#17352a !important;
    border-color:#347451 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.schedule-state.blocked {
    background:#3b2228 !important;
    border-color:#7f3b46 !important;
}


/* =====================================================================
   FIELD / QUALITY INLINE TEMPLATE OVERRIDES
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
.sticky-actions,

html[data-theme="dark"] body.tso-shell-enabled
.inspection-actions,

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-sticky-save,
    .tso-sales-sticky-save,
    .tso-production-sticky-save
) {
    background:rgba(24,34,53,.97) !important;
    border-color:#475569 !important;
    color:#f1f5f9 !important;
    box-shadow:0 8px 24px rgba(0,0,0,.28) !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.inspection-row.fail {
    background:#3b2228 !important;
    border-color:#7f3b46 !important;
}


/* =====================================================================
   TABLE ROW STATES
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-job-directory tr.is-overdue td,
    .tso-field-table tr.is-overdue td,
    .tso-sequence-table tr.is-overdue td
) {
    background:#311f26 !important;
    color:#f8fafc !important;
}


/* =====================================================================
   PROPOSAL / ESTIMATE INTERNAL DETAIL
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .proposal-section,
    .proposal-summary-grid > div,
    .estimate-metrics .stat
) {
    background:#182235 !important;
    border-color:#334155 !important;
    color:#f1f5f9 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.proposal-total-row td {
    background:#263a52 !important;
    color:#f8fafc !important;
}


/* =====================================================================
   STATUS / WARNING SURFACES
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-production-warning,
    .tso-qualification-warning,
    .tso-handoff-warning,
    .tso-urgency-chip
) {
    background:#3a3019 !important;
    border-color:#75602a !important;
    color:#fde68a !important;
}

html[data-theme="dark"] body.tso-shell-enabled
.tso-converted-job-link {
    background:#17352a !important;
    border-color:#347451 !important;
    color:#86efac !important;
}


/* =====================================================================
   DARK-TEXT CORRECTIONS FOUND BY AUDIT
   ===================================================================== */

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-form-grid label,
    .tso-sales-form-grid label,
    .tso-opportunity-form label,
    .tso-stage-update-form label,
    .tso-production-stage-form label,
    .tso-production-form-grid label,
    .tso-field-checkin-form label,
    .tso-calendar-filters label,
    .tso-prod-calendar-filters label
) {
    color:#cbd5e1 !important;
}

html[data-theme="dark"] body.tso-shell-enabled
:where(
    .tso-scope-note p,
    .tso-sales-activity-list p,
    .proposal-section p,
    .tso-followup-card p,
    .tso-field-checkin-list p,
    .tso-production-history p,
    .tso-production-note-list p
) {
    color:#cbd5e1 !important;
}


/* =====================================================================
   END DARK MODE COMPLETION
   ===================================================================== */
