/* Smith Digital R16 — dark-mode contrast, scoped to dark mode only.
 * Loaded after site + admin CSS to correct legacy light-mode declarations.
 * Does not change brand graphics, light-mode choices, article label overrides or custom nav palette.
 */
html[data-theme="dark"] {
  color-scheme:dark;
  --sd16-text:#edf4ff;
  --sd16-muted:#bbcbe4;
  --sd16-soft:#a9bfdc;
  --sd16-link:#a7c7ff;
  --sd16-surface:#1b2b42;
  --sd16-inset:#142237;
  --sd16-border:#445976;
}
/* Common titles / helper copy; preserve the user's selected accent, but not unreadable legacy grey. */
html[data-theme="dark"] body :is(.section-heading,.stat,.empty-state,.receipt,.order-timeline,.policy-article,.analytics-tables,.cart-main,.dashboard-main,.admin-content) :is(h1,h2,h3,strong) {color:var(--sd16-text)}
html[data-theme="dark"] :is(.back-link,.notes,.stat span,.stat small,.checkout-total span,.reference span,.receipt-details dt,.order-timeline small,.order-timeline p,.category-strip small,.guide-steps p,.auth-intro p,.policy-article p,.footer-column a,.v6-notification small,.empty-state,.empty-state p,td small,.field small,.product-card p,.product-bottom small,.checkout-product p) {color:var(--sd16-muted)!important}
html[data-theme="dark"] :is(.eyebrow.muted,.dashboard-heading .eyebrow,.guide .eyebrow,.blog-heading .eyebrow) {color:var(--sd16-link)!important}
html[data-theme="dark"] :is(.stat,.stats-filter,.table-scroll,.admin-sidebar,.admin-content,.auth-panel,.cart-checkout,.checkout-product) {color:var(--sd16-text)}
html[data-theme="dark"] :is(th,.table-scroll th,.admin-articles-table th) {background-color:var(--sd16-inset);color:#c8d8ee!important;border-color:var(--sd16-border)}
html[data-theme="dark"] :is(td,td strong,td a,.table-scroll table,.stat strong,.order-code) {color:var(--sd16-text)}
html[data-theme="dark"] :is(.empty-state>span,.empty-state h3) {color:#c0d4f5}
/* Category cards, product filters and stock labels */
html[data-theme="dark"] .filter-tabs a:not(.active) {color:#c4d6f3!important}
html[data-theme="dark"] .filter-tabs a:hover:not(.active) {background:#263b57;color:#f4f8ff!important}
html[data-theme="dark"] .category-strip :is(strong,small),html[data-theme="dark"] .dynamic-categories :is(strong,small) {color:var(--sd16-text)!important}
html[data-theme="dark"] .category-strip small,html[data-theme="dark"] .dynamic-categories small {color:var(--sd16-muted)!important}
html[data-theme="dark"] #product-grid .product-card.card-soft {background:color-mix(in srgb,var(--card-accent,#436ba8) 8%,#1d2b40)!important}
html[data-theme="dark"] #product-grid .product-card.card-outline {background:#1d2b40!important}
html[data-theme="dark"] :is(.product-arrow,.guide-steps b) {background:#273d60;color:#b8d2ff}
html[data-theme="dark"] .v7-product-metrics small {color:var(--sd16-muted)}
/* Forms and supplementary controls */
html[data-theme="dark"] :is(input,textarea,select)::placeholder {color:#a4b9d8;opacity:1}
html[data-theme="dark"] :is(.field,.check-field,.v7-rating-field) :is(span,legend) {color:var(--sd16-text)}
html[data-theme="dark"] .field input[type=file] {background:#142237;color:var(--sd16-text);border-color:var(--sd16-border)}
html[data-theme="dark"] .field input[type=file]::file-selector-button {background:#273f62;color:#dceaff}
html[data-theme="dark"] :is(.media-setting,.designer-group>summary,.designer-preview-wrap,.designer-preview-switch,.navbar-design-settings,.admin-setting-note,.navbar-edit-row) {background:#1a2b43!important;color:var(--sd16-text);border-color:var(--sd16-border)!important}
html[data-theme="dark"] .designer-preview-switch button:not(.active) {color:var(--sd16-muted)}
html[data-theme="dark"] .designer-preview-switch button.active {background:#2b4570;color:#edf4ff}
/* Admin navigation, stats and analytics. */
html[data-theme="dark"] .admin-sidebar nav a:not(.active),html[data-theme="dark"] .admin-menu-link:not(.active) {color:var(--sd16-muted)}
html[data-theme="dark"] .traffic-chips span {background:#273e5d;color:#d2e2fb}
html[data-theme="dark"] .stats-filter select {background:#142237;color:var(--sd16-text);border-color:var(--sd16-border)}
html[data-theme="dark"] :is(.remove-link,.remove-type,.remove-package) {background:#442b3a;color:#ffb8c7;border:1px solid #75536b}
html[data-theme="dark"] :is(.auth-divider,.admin-sidebar p) {color:var(--sd16-muted)}
html[data-theme="dark"] .google-button {background:#243750;color:#edf4ff;border-color:var(--sd16-border)}
/* Payment, receipt and order detail */
html[data-theme="dark"] :is(.reference,.checkout-total,.help-banner) {background:#1d304c!important;color:var(--sd16-text);border:1px solid var(--sd16-border)!important}
html[data-theme="dark"] .reference code {color:#b4cfff}
html[data-theme="dark"] .receipt-details div,html[data-theme="dark"] .cart-total {border-color:var(--sd16-border)}
html[data-theme="dark"] .order-timeline {border-color:var(--sd16-border)}
html[data-theme="dark"] .fulfillment {background:#173b31;border-color:#306c59;color:#d6f9e8}
html[data-theme="dark"] .fulfillment :is(h3,p,strong) {color:#d6f9e8}
/* Status chips have semantic colors and must not inherit the neutral .badge palette. */
html[data-theme="dark"] .badge.green,html[data-theme="dark"] :is(.status-paid,.status-completed) {background:#174537!important;color:#b9f4d5!important;border-color:#368368!important}
html[data-theme="dark"] .status-pending_payment {background:#49371d!important;color:#ffe4ab!important;border-color:#81633a!important}
html[data-theme="dark"] .status-payment_review {background:#29375e!important;color:#cedbff!important;border-color:#4c67a6!important}
html[data-theme="dark"] .status-processing {background:#1a405a!important;color:#c2ebff!important;border-color:#347da3!important}
html[data-theme="dark"] .status-cancelled {background:#512835!important;color:#ffd0d8!important;border-color:#915465!important}
html[data-theme="dark"] .product-stock-empty {background:#512835!important;color:#ffd0d8!important;border-color:#915465!important}
/* Alerts: retain intentional warning/error semantics with readable contrast. */
html[data-theme="dark"] .alert.error {background:#4a2532!important;color:#ffd6dd!important;border-color:#905162!important}
html[data-theme="dark"] .flash {background:#183a32!important;color:#c5f6de!important;border-color:#3d7865!important}
html[data-theme="dark"] .badge:not(.green):not([class*=status-]) {color:#cbdcf4}
/* Navigation extras and tabbed lists; only target conventional text, not customizable nav buttons. */
html[data-theme="dark"] :is(.header-cart,.footer-brand,.footer-article h2,.footer-column h3,.site-footer .footer-column a,.auth-forgot a) {color:var(--sd16-text)}
html[data-theme="dark"] .footer-article p {color:var(--sd16-muted)}
html[data-theme="dark"] .header-cart span {background:#2d4261;color:#d8e8ff}
html[data-theme="dark"] .back-link:hover,html[data-theme="dark"] .site-footer a:hover {color:#c4daff}
/* Focus/keyboard visibility */
html[data-theme="dark"] :is(a,button,input,select,textarea,summary):focus-visible {outline-color:#9fc1ff}
@media (prefers-reduced-motion:reduce) {html[data-theme="dark"] * {scroll-behavior:auto}}
/* Remaining low-contrast accents verified in Chromium R16 audit. */
html[data-theme="dark"] .receipt .eyebrow {color:#7be6ba!important}
html[data-theme="dark"] .checkout-total strong {color:#d5e7ff!important}

/* R17 auth/link readability — accents configured for light mode can be invisible
 * against dark panels. Keep the chosen light palette completely unchanged. */
html[data-theme="dark"] a.link,
html[data-theme="dark"] a.admin-link {
  color:var(--sd16-link,#a7c7ff);
}
html[data-theme="dark"] a.link:hover,
html[data-theme="dark"] a.link:focus-visible,
html[data-theme="dark"] a.admin-link:hover,
html[data-theme="dark"] a.admin-link:focus-visible {
  color:#e0eeff;
  text-decoration:underline;
  text-underline-offset:3px;
}
html[data-theme="dark"] .auth-panel .auth-switch {
  color:var(--sd16-muted,#bbcbe4);
}
html[data-theme="dark"] .auth-panel .auth-switch a.link {
  color:#b6d3ff;
  font-weight:750;
  text-decoration:underline;
  text-decoration-color:#7395c5;
  text-underline-offset:3px;
}
html[data-theme="dark"] .auth-panel .auth-switch a.link:is(:hover,:focus-visible) {
  color:#f0f6ff;
  text-decoration-color:currentColor;
}
html[data-theme="dark"] .auth-intro .eyebrow {
  color:#b6d3ff;
}

/* =============================================================
   R19 - Hapus garis bawah HANYA link pindah Login <-> Daftar.
   Berlaku pada tema gelap/terang, hover, focus dan active.
   Mengatasi text-decoration, border-bottom, shadow dan
   pseudo element yang sering menyebabkan garis bawah.
   File ini harus dimuat SETELAH CSS utama (app.css).
   ============================================================= */
html body .auth-switch a,
html body .auth-switch a:link,
html body .auth-switch a:visited,
html body .auth-switch a:hover,
html body .auth-switch a:focus,
html body .auth-switch a:focus-visible,
html body .auth-switch a:active,
html body .auth-switch a *,
html body .auth-switch a::before,
html body .auth-switch a::after {
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}
