/* ================================================================
   FIXER SERVIS v10 — NO-FLASH + COMPLETE DARK MODE
   Layout untouched. Loaded in <head> before page content paints.
   ================================================================ */
:root{
  --fx10-bg:#eef3f7;
  --fx10-surface:#ffffff;
  --fx10-surface-2:#f7f9fb;
  --fx10-border:#dbe4ea;
  --fx10-text:#1e2c37;
  --fx10-muted:#667b8b;
  --fx10-accent:#557b96;
  --fx10-navy:#17324a;

  --fx10-d-bg:#101820;
  --fx10-d-bg-2:#131e27;
  --fx10-d-surface:#18242e;
  --fx10-d-surface-2:#1d2b36;
  --fx10-d-surface-3:#22323e;
  --fx10-d-border:#324552;
  --fx10-d-text:#e5edf2;
  --fx10-d-muted:#9fb0bc;
  --fx10-d-accent:#789bb3;
}

/* Prevent theme-color interpolation / flashes while navigating */
html,body,.layout,.fixer-shell,.content,main{transition:none!important}
html[data-fixer-theme="light"] body{background:var(--fx10-bg)!important}
html[data-fixer-theme="dark"] body{background:var(--fx10-d-bg)!important;color:var(--fx10-d-text)!important}

/* Keep light mode calm */
html[data-fixer-theme="light"] body .content,
html[data-fixer-theme="light"] body main,
html[data-fixer-theme="light"] body .fixer-shell{background:var(--fx10-bg)!important;color:var(--fx10-text)!important}

/* COMPLETE DARK CANVAS */
html[data-fixer-theme="dark"] body .layout,
html[data-fixer-theme="dark"] body .fixer-shell,
html[data-fixer-theme="dark"] body .content,
html[data-fixer-theme="dark"] body main,
html[data-fixer-theme="dark"] body .et-page,
html[data-fixer-theme="dark"] body .erke-service-page,
html[data-fixer-theme="dark"] body .pro-wrap,
html[data-fixer-theme="dark"] body .services-page,
html[data-fixer-theme="dark"] body .pe-wrap,
html[data-fixer-theme="dark"] body .crm-page,
html[data-fixer-theme="dark"] body .stock-page,
html[data-fixer-theme="dark"] body .finance-page,
html[data-fixer-theme="dark"] body .ap-wrap,
html[data-fixer-theme="dark"] body .company-wrap,
html[data-fixer-theme="dark"] body .calendar-page{
  background:var(--fx10-d-bg)!important;
  color:var(--fx10-d-text)!important;
}

/* Generic surface families used across the old pages */
html[data-fixer-theme="dark"] body :where(
  .card,.stat,.et-card,.et-panel,.et-studio-card,.et-kpi,.et-stat,.et-mini-kpi,.et-insight,.et-service-month,
  .es-card,.es-body,.es-summary-body,.es-savebar,.es-field,.es-v230-box,.es-accessory-wrap,.es-filebox,.es-check,
  .pe-card,.pe-box,.pe-filter,.pe-summary,.pe-partner-card,
  .crm-panel,.crm-card,.crm-kpi,.crm-box,
  .ap-card,.ap-box,.ap-detail-card,
  .bank-card,.bank-box,.stock-box,.stock-card,.sf-card,.cal-card,.eu-card,.services-card,.company-card,
  .wo-panel,.wo-edit,.wo-text,.wo-sub,.wo-photos,.pro-top,
  .modal,.modal-content,.dialog,.dialog-content,.dropdown-menu,.popover,.menu-panel,.filter-box,.summary-card,
  .edl-row,.epl-row,.payment-card,.payment-box,.report-card,.report-box
){
  background:var(--fx10-d-surface)!important;
  color:var(--fx10-d-text)!important;
  border-color:var(--fx10-d-border)!important;
  box-shadow:none!important;
}

/* Second-level panels/headers */
html[data-fixer-theme="dark"] body :where(
  .es-head,.es-summary-head,.wo-panel h3,.section-head,.card-head,.panel-head,.table-head,
  .et-panel-head,.et-studio-head,.crm-head,.pe-head-inner,.ap-head-inner
){
  background:var(--fx10-d-surface-2)!important;
  color:var(--fx10-d-text)!important;
  border-color:var(--fx10-d-border)!important;
}

/* Inline old white backgrounds inside content */
html[data-fixer-theme="dark"] body .content [style*="background:#fff"],
html[data-fixer-theme="dark"] body .content [style*="background: #fff"],
html[data-fixer-theme="dark"] body .content [style*="background:white"],
html[data-fixer-theme="dark"] body .content [style*="background: white"],
html[data-fixer-theme="dark"] body main [style*="background:#fff"],
html[data-fixer-theme="dark"] body main [style*="background: #fff"]{
  background:var(--fx10-d-surface)!important;
  color:var(--fx10-d-text)!important;
  border-color:var(--fx10-d-border)!important;
}

/* Work-order legacy white blocks */
html[data-fixer-theme="dark"] body .wo-head{
  background:linear-gradient(90deg,#1c2a35,#22323e 45%,#1c2a35)!important;
  border-color:var(--fx10-d-border)!important;
}
html[data-fixer-theme="dark"] body .wo-row{border-color:#2b3d49!important}
html[data-fixer-theme="dark"] body .wo-row span{background:#1d2b36!important;color:#aebdc7!important;border-color:#2f414d!important}
html[data-fixer-theme="dark"] body .wo-row b,
html[data-fixer-theme="dark"] body .wo-title,
html[data-fixer-theme="dark"] body .wo-logo strong,
html[data-fixer-theme="dark"] body .wo-no b{color:var(--fx10-d-text)!important}
html[data-fixer-theme="dark"] body .wo-logo,
html[data-fixer-theme="dark"] body .wo-no,
html[data-fixer-theme="dark"] body .wo-wide,
html[data-fixer-theme="dark"] body .wo-grid{border-color:var(--fx10-d-border)!important}

/* Forms */
html[data-fixer-theme="dark"] body input,
html[data-fixer-theme="dark"] body select,
html[data-fixer-theme="dark"] body textarea,
html[data-fixer-theme="dark"] body .form-control{
  background:#111c24!important;
  color:var(--fx10-d-text)!important;
  border-color:#3b4f5d!important;
  box-shadow:none!important;
}
html[data-fixer-theme="dark"] body input:focus,
html[data-fixer-theme="dark"] body select:focus,
html[data-fixer-theme="dark"] body textarea:focus{
  border-color:var(--fx10-d-accent)!important;
  box-shadow:0 0 0 3px rgba(120,155,179,.12)!important;
}
html[data-fixer-theme="dark"] body input::placeholder,
html[data-fixer-theme="dark"] body textarea::placeholder{color:#718592!important}
html[data-fixer-theme="dark"] body label,
html[data-fixer-theme="dark"] body .form-label{color:#b7c5ce!important}
html[data-fixer-theme="dark"] body option{background:#111c24;color:var(--fx10-d-text)}

/* Tables */
html[data-fixer-theme="dark"] body table{background:var(--fx10-d-surface)!important;color:var(--fx10-d-text)!important}
html[data-fixer-theme="dark"] body thead,
html[data-fixer-theme="dark"] body th{background:#202f3a!important;color:#b9c8d1!important;border-color:var(--fx10-d-border)!important}
html[data-fixer-theme="dark"] body tbody,
html[data-fixer-theme="dark"] body td{background:var(--fx10-d-surface)!important;color:#dbe5eb!important;border-color:#2c3d49!important}
html[data-fixer-theme="dark"] body tbody tr:nth-child(even) td{background:#1a2731!important}
html[data-fixer-theme="dark"] body tbody tr:hover td{background:#22323e!important}

/* Text colors that older CSS hard-coded dark */
html[data-fixer-theme="dark"] body :where(h1,h2,h3,h4,h5,h6,strong,b,.title,.card-title,.section-title,.et-section-title){color:var(--fx10-d-text)!important}
html[data-fixer-theme="dark"] body :where(p,small,.muted,.text-muted,.help,.es-help,.subtext,.description){color:var(--fx10-d-muted)!important}
html[data-fixer-theme="dark"] body a:not(.btn):not(.mini-btn){color:#9bbcd2}

/* Alerts stay semantic but dark-compatible */
html[data-fixer-theme="dark"] body .alert.ok{background:#173126!important;border-color:#28513d!important;color:#a9d7bd!important}
html[data-fixer-theme="dark"] body .alert.danger{background:#3a2024!important;border-color:#5b3036!important;color:#e7b2b8!important}
html[data-fixer-theme="dark"] body .alert.warning{background:#372d1d!important;border-color:#5a482c!important;color:#dbc38f!important}
html[data-fixer-theme="dark"] body .alert.info{background:#1a2e3d!important;border-color:#315064!important;color:#aac9dc!important}

/* File inputs and checkboxes often kept white */
html[data-fixer-theme="dark"] body input[type="file"]{background:#16232c!important;color:#cbd7df!important}
html[data-fixer-theme="dark"] body input[type="checkbox"],
html[data-fixer-theme="dark"] body input[type="radio"]{accent-color:var(--fx10-d-accent)!important}

/* Scrollbars */
html[data-fixer-theme="dark"]{scrollbar-color:#465d6c #111a22}
html[data-fixer-theme="dark"] ::-webkit-scrollbar{width:10px;height:10px}
html[data-fixer-theme="dark"] ::-webkit-scrollbar-track{background:#111a22}
html[data-fixer-theme="dark"] ::-webkit-scrollbar-thumb{background:#465d6c;border-radius:999px;border:2px solid #111a22}

/* Software credit */
html[data-fixer-theme="dark"] body .fixer-software-credit{color:#728793!important;border-color:transparent!important;background:transparent!important}
html[data-fixer-theme="dark"] body .fixer-software-credit b{color:#95a9b5!important}

/* Eliminate accidental white mobile navigation / wrappers */
@media(max-width:850px){
  html[data-fixer-theme="dark"] body,
  html[data-fixer-theme="dark"] body .content,
  html[data-fixer-theme="dark"] body main,
  html[data-fixer-theme="dark"] body .et-page,
  html[data-fixer-theme="dark"] body .erke-service-page,
  html[data-fixer-theme="dark"] body .pro-wrap,
  html[data-fixer-theme="dark"] body .services-page,
  html[data-fixer-theme="dark"] body .pe-wrap,
  html[data-fixer-theme="dark"] body .crm-page,
  html[data-fixer-theme="dark"] body .stock-page{
    background:var(--fx10-d-bg)!important;
  }
}
