/* SecuTest private app theme layer.
 *
 * Dark remains the default SecuTest appearance. The light palette overrides
 * the few legacy hard-coded dark surfaces without changing app structure.
 */

html{
  color-scheme:dark;
}

html[data-theme="light"]{
  color-scheme:light;

  --app-bg:#f4f7fa;
  --app-surface:#ffffff;
  --app-surface-2:#f1f5f8;
  --app-surface-3:#e7eef3;
  --app-line:#d4dfe7;
  --app-line-strong:#b8c9d5;
  --app-text:#102431;
  --app-muted:#617685;
  --app-cyan:#087e9d;
  --app-violet:#6555c7;
  --app-success:#147a53;
  --app-warning:#876300;
  --app-danger:#b4232c;
}

.app-theme-toggle{
  min-width:104px;
  gap:8px;
}

.app-theme-toggle::before{
  content:"";
  width:10px;
  height:10px;
  flex:0 0 10px;
  border-radius:999px;
  background:#eef4f8;
  box-shadow:inset -3px -2px 0 #91a8b8;
}

html[data-theme="light"] .app-theme-toggle::before{
  background:#f0b429;
  box-shadow:0 0 0 3px rgba(240,180,41,.14);
}

/* Header and primary shell */
html[data-theme="light"] body{
  background:var(--app-bg);
  color:var(--app-text);
}

html[data-theme="light"] .topbar{
  background:rgba(255,255,255,.96);
  border-bottom-color:var(--app-line);
}

html[data-theme="light"] .topbar .brand{
  color:var(--app-text);
}

html[data-theme="light"] .topbar .button-ghost{
  background:#ffffff;
  border-color:var(--app-line);
  color:var(--app-text);
}

html[data-theme="light"] .topbar .button-ghost:hover:not(:disabled){
  background:#f1f5f8;
  border-color:var(--app-line-strong);
}

html[data-theme="light"] .app-sidebar{
  background:#eef3f6;
}

/* Dashboard and scanner */
html[data-theme="light"] .app-metric-card{
  background:linear-gradient(160deg,#ffffff,#f1f5f8);
}

html[data-theme="light"] .app-scan-tabs,
html[data-theme="light"] .app-notice,
html[data-theme="light"] .app-labeled-value,
html[data-theme="light"] .app-opportunity-card,
html[data-theme="light"] .app-signal-card,
html[data-theme="light"] .app-bulk-jobs-panel,
html[data-theme="light"] .app-bulk-detail-panel,
html[data-theme="light"] .app-history-row,
html[data-theme="light"] .app-account-current .app-labeled-value,
html[data-theme="light"] .app-account-billing-toggle{
  background:#f4f7fa;
}

html[data-theme="light"] .app-field input,
html[data-theme="light"] .app-field textarea,
html[data-theme="light"] .app-field select,
html[data-theme="light"] .app-filter-field input,
html[data-theme="light"] .app-filter-field select,
html[data-theme="light"] .app-bulk-job,
html[data-theme="light"] .app-bulk-item{
  background:#ffffff;
  border-color:var(--app-line-strong);
  color:var(--app-text);
}

html[data-theme="light"] .app-field input::placeholder,
html[data-theme="light"] .app-field textarea::placeholder,
html[data-theme="light"] .app-filter-field input::placeholder{
  color:#8799a6;
}

html[data-theme="light"] .app-notice-info{
  border-color:#8fcbd9;
  color:#176b7f;
}

html[data-theme="light"] .app-notice-success{
  border-color:#9bd5bd;
}

html[data-theme="light"] .app-notice-error{
  border-color:#e4a7ab;
}

html[data-theme="light"] .app-scan-result{
  background:linear-gradient(160deg,#ffffff,#f4f7fa);
}

html[data-theme="light"] .app-result-count{
  background:rgba(8,126,157,.07);
  border-color:rgba(8,126,157,.24);
}

html[data-theme="light"] .app-sales-angle strong{
  color:#2c414f;
}

/* Status pills keep the SecuTest accent semantics with light-mode contrast. */
html[data-theme="light"] .app-stage{
  background:#e8eff4;
  color:#4b6272;
}

html[data-theme="light"] .app-stage-qualified,
html[data-theme="light"] .app-stage-replied,
html[data-theme="light"] .app-stage-meeting,
html[data-theme="light"] .app-stage-proposal{
  background:rgba(101,85,199,.10);
  color:#5443b3;
}

html[data-theme="light"] .app-priority-high,
html[data-theme="light"] .app-job-failed,
html[data-theme="light"] .app-job-quota_exhausted{
  background:rgba(180,35,44,.08);
}

html[data-theme="light"] .app-priority-medium,
html[data-theme="light"] .app-job-partial{
  background:rgba(135,99,0,.09);
}

html[data-theme="light"] .app-priority-low,
html[data-theme="light"] .app-job-queued,
html[data-theme="light"] .app-job-running,
html[data-theme="light"] .app-job-retry_wait{
  background:rgba(8,126,157,.08);
}

html[data-theme="light"] .app-stage-won,
html[data-theme="light"] .app-job-completed{
  background:rgba(20,122,83,.09);
}

/* Interactive lists and tables */
html[data-theme="light"] .app-bulk-job:hover,
html[data-theme="light"] .app-bulk-job.active,
html[data-theme="light"] .app-prospect-row:hover{
  background:#edf3f7;
}

html[data-theme="light"] .app-table th{
  background:#eef3f6;
}

html[data-theme="light"] .app-table td{
  color:#324956;
}

html[data-theme="light"] .app-database-row:hover td{
  background:#f1f5f8;
}

/* Prospect drawer */
html[data-theme="light"] .app-drawer-overlay{
  background:rgba(16,36,49,.34);
}

html[data-theme="light"] .app-prospect-drawer{
  background:#f7fafc;
  box-shadow:-24px 0 70px rgba(16,36,49,.18);
}

html[data-theme="light"] .app-drawer-header{
  background:rgba(247,250,252,.96);
}

html[data-theme="light"] .app-drawer-close{
  background:#ffffff;
}

/* Account section */
html[data-theme="light"] .app-account-plan{
  background:linear-gradient(160deg,#ffffff,#f2f6f9);
}

html[data-theme="light"] .app-danger-button,
html[data-theme="light"] .app-secondary-danger-button{
  border-color:rgba(180,35,44,.28)!important;
  color:var(--app-danger)!important;
  background:rgba(180,35,44,.06)!important;
}

html[data-theme="light"] .app-danger-button:hover:not(:disabled),
html[data-theme="light"] .app-secondary-danger-button:hover:not(:disabled){
  border-color:rgba(180,35,44,.45)!important;
  background:rgba(180,35,44,.10)!important;
}

/* Native controls should follow the selected palette as well. */
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select{
  color-scheme:light;
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select{
  color-scheme:dark;
}

@media(max-width:760px){
  .app-theme-toggle{
    min-width:42px;
    width:42px;
    padding:0;
    overflow:hidden;
    color:transparent!important;
    font-size:0!important;
  }

  .app-theme-toggle::before{
    margin:0;
  }
}
