/* ============================================================
   FSG Theme — Light (default) + Dark
   Aktif melalui atribut <html data-theme="dark">.
   ============================================================ */

:root{color-scheme:light}

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

  /* --- style.css --- */
  --bg:#0A1410; --bg2:#101E18; --card:#111E18;
  --brand:#4CC38A; --brand2:#6FDCA1; --brand-deep:#0F3B2A;
  --ink:#E7F0EA; --muted:#9BB2A6; --line:#24382E;
  --shadow:0 16px 40px rgba(0,0,0,.45);

  /* --- market-tool.html --- */
  --bg0:#07110D; --panel:#111E18; --card2:#16261E;
  --gold:#4CC38A; --gold2:#39B87C; --gold-deep:#9FE7BE;
  --text:#E7F0EA; --border:#24382E; --border2:#4CC38A;
  --green:#4ADE80; --red:#F87171;
  --brand-black:#EAF3EE; --brand-green:#4CC38A; --brand-green2:#39B87C;
}

/* ---------- Butang toggle ---------- */
.theme-toggle{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:42px;padding:10px 14px;border-radius:10px;
  border:1px solid var(--line,var(--border,#DCE7E0));
  background:var(--card,#fff);
  color:var(--ink,var(--text,#1B2420));
  font:inherit;font-size:13px;font-weight:800;line-height:1;
  cursor:pointer;
  transition:transform .2s,border-color .2s,color .2s,background-color .2s,box-shadow .2s;
}
.theme-toggle:hover{
  transform:translateY(-1px);
  border-color:var(--brand,var(--gold,#0E7A52));
  color:var(--brand,var(--gold,#0E7A52));
  box-shadow:var(--shadow,0 10px 24px rgba(14,122,82,.16));
}
.theme-toggle:focus-visible{outline:2px solid var(--brand,var(--gold,#0E7A52));outline-offset:2px}
.theme-toggle svg{width:16px;height:16px;flex:none}
.theme-toggle .i-sun{display:none}
html[data-theme="dark"] .theme-toggle .i-moon{display:none}
html[data-theme="dark"] .theme-toggle .i-sun{display:block}
.theme-toggle .tt-light{display:none}
html[data-theme="dark"] .theme-toggle .tt-dark{display:none}
html[data-theme="dark"] .theme-toggle .tt-light{display:inline}
html[data-theme="dark"] .theme-toggle{background:#13241D;border-color:#2A4034;color:#E7F0EA}
html[data-theme="dark"] .theme-toggle:hover{border-color:var(--brand);color:var(--brand)}

/* Saiz padan dalam header market-tool */
.top-actions .theme-toggle{min-height:36px;padding:8px 12px;font-size:12px}

@media(max-width:560px){
  .theme-toggle .tt-label{display:none}
  .theme-toggle{min-width:42px;padding:10px 12px}
  .top-actions .theme-toggle{min-width:38px;padding:8px 10px}
}

/* ---------- Halaman: style.css ---------- */
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] header.site{background:rgba(10,20,16,.9);border-bottom-color:var(--line)}
html[data-theme="dark"] .logo{background:#0F1B16}
html[data-theme="dark"] .brandname,
html[data-theme="dark"] .company-name{color:#EAF3EE}
html[data-theme="dark"] .reg-number{color:#9BB2A6}
html[data-theme="dark"] .tagline{color:#9FE7BE;background:rgba(47,169,104,.14);border-color:rgba(47,169,104,.32)}
html[data-theme="dark"] .btn{background:var(--card);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .btn.primary{background:linear-gradient(135deg,#0F8B5C,#0B5C3F);color:#fff;border:none}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{background:#0F1B16;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .badge{background:rgba(76,195,138,.12);color:#7BD89A;border-color:var(--line)}
html[data-theme="dark"] footer{background:#081310;border-top:1px solid var(--line)}
html[data-theme="dark"] ::placeholder{color:#7E958A}

/* ---------- Halaman: market-tool.html ---------- */
html[data-theme="dark"] body.tool-page{
  background:
    radial-gradient(1000px 400px at 15% 0%, rgba(76,195,138,.10), transparent 60%),
    var(--bg0);
}
html[data-theme="dark"] header{background:rgba(9,18,14,.92)}
html[data-theme="dark"] .monogram{background:#0F1B16}
html[data-theme="dark"] .hero h2{color:#EAF3EE}
html[data-theme="dark"] .hero h2 em{background:linear-gradient(135deg,#6FDCA1,#2FA968);-webkit-background-clip:text;background-clip:text;color:transparent}
html[data-theme="dark"] .stat{background:var(--card)}
html[data-theme="dark"] .stat strong{color:#EAF3EE}
html[data-theme="dark"] .seg{background:#0F1B16}
html[data-theme="dark"] .card h3{color:#EAF3EE}
html[data-theme="dark"] .price{color:#EAF3EE}
html[data-theme="dark"] section.block h2{color:#EAF3EE}
html[data-theme="dark"] canvas.chart{background:#0C1813;border-color:var(--border)}
html[data-theme="dark"] .result div{color:#DCEAE1}
html[data-theme="dark"] .links a{background:rgba(76,195,138,.10)}
html[data-theme="dark"] .chg.up{background:rgba(74,222,128,.14);color:#6EE7A2;border-color:rgba(74,222,128,.28)}
html[data-theme="dark"] .chg.down{background:rgba(248,113,113,.14);color:#FCA5A5;border-color:rgba(248,113,113,.28)}

/* ---------- Halaman: admin.html ---------- */
html[data-theme="dark"] table{background:var(--card)}
html[data-theme="dark"] .kard{background:var(--card)}
html[data-theme="dark"] #gateMsg{color:#FCA5A5 !important}
html[data-theme="dark"] .pill{border-color:#2A4034}
html[data-theme="dark"] .p-pending{background:rgba(234,179,8,.16);color:#FDE68A}
html[data-theme="dark"] .p-confirmed{background:rgba(59,130,246,.16);color:#BFDBFE}
html[data-theme="dark"] .p-invoiced{background:rgba(99,102,241,.16);color:#C7D2FE}
html[data-theme="dark"] .p-issued{background:rgba(249,115,22,.16);color:#FED7AA}
html[data-theme="dark"] .p-paid,
html[data-theme="dark"] .p-sent{background:rgba(34,197,94,.16);color:#BBF7D0}
html[data-theme="dark"] .p-void,
html[data-theme="dark"] .p-cancelled,
html[data-theme="dark"] .p-failed{background:rgba(239,68,68,.16);color:#FECACA}
html[data-theme="dark"] .p-skipped{background:rgba(148,163,184,.16);color:#E2E8F0}
