html[data-theme] {
    --theme-bg: #eaf5ee;
    --theme-surface: #fff;
    --theme-soft: #edf8f1;
    --theme-border: #cfe7d9;
    --theme-ink: #203d39;
    --theme-muted: #54746c;
    --theme-accent: #18795b;
    --theme-hover: #115c46;
    --theme-sidebar: #1c5146;
    --theme-sidebar-text: #eaf9f2;
    --theme-sidebar-active: #367765;
    --theme-shadow: rgba(32, 90, 67, .10);
}
html[data-theme="biru-klasik"] {
    --theme-bg: #edf4fb; --theme-soft: #e8f3fc; --theme-border: #c6ddee;
    --theme-ink: #203d57; --theme-muted: #526e82; --theme-accent: #1a69bf;
    --theme-hover: #115294; --theme-sidebar: #1a75d9; --theme-sidebar-active: #155ca8;
    --theme-shadow: rgba(26, 78, 140, .12);
}
html[data-theme="hijau-klasik"] {
    --theme-bg: #f2f7f6; --theme-soft: #edf8f3; --theme-border: #d3ebe4;
    --theme-ink: #28444b; --theme-muted: #536f70; --theme-accent: #126f66;
    --theme-hover: #0c5952; --theme-sidebar: #145d5a; --theme-sidebar-active: #277873;
}
html[data-theme="laut"] {
    --theme-bg: #eaf3fa; --theme-soft: #edf7fc; --theme-border: #cadfe9;
    --theme-ink: #203e50; --theme-muted: #536f80; --theme-accent: #176f96;
    --theme-hover: #105570; --theme-sidebar: #234e69; --theme-sidebar-active: #397795;
    --theme-shadow: rgba(36, 83, 113, .10);
}
html[data-theme="tosca"] {
    --theme-bg: #e7f7f5; --theme-soft: #e9faf7; --theme-border: #bce6df;
    --theme-ink: #1c4948; --theme-muted: #527a75; --theme-accent: #087c75;
    --theme-hover: #065d58; --theme-sidebar: #166c68; --theme-sidebar-active: #268a82;
    --theme-shadow: rgba(28, 102, 94, .12);
}
html[data-theme="lavender"] {
    --theme-bg: #f1eef9; --theme-soft: #f6f1fc; --theme-border: #ded3ee;
    --theme-ink: #3d3453; --theme-muted: #70677f; --theme-accent: #72549c;
    --theme-hover: #583d80; --theme-sidebar: #4b3b66; --theme-sidebar-active: #725b93;
    --theme-shadow: rgba(80, 57, 110, .10);
}
html[data-theme="nila"] {
    --theme-bg: #edf0fc; --theme-soft: #f1f3ff; --theme-border: #d3daf2;
    --theme-ink: #303c60; --theme-muted: #636f8c; --theme-accent: #4a5dae;
    --theme-hover: #35478e; --theme-sidebar: #394a84; --theme-sidebar-active: #5b6eb0;
    --theme-shadow: rgba(57, 69, 125, .12);
}
html[data-theme="senja"] {
    --theme-bg: #fbf1e8; --theme-soft: #fff5eb; --theme-border: #ecd7c6;
    --theme-ink: #503c32; --theme-muted: #806b5d; --theme-accent: #a7512b;
    --theme-hover: #823d1f; --theme-sidebar: #704633; --theme-sidebar-active: #a36245;
    --theme-shadow: rgba(116, 72, 47, .10);
}
html[data-theme="mawar"] {
    --theme-bg: #fbf0f3; --theme-soft: #fff3f6; --theme-border: #efd4dc;
    --theme-ink: #543747; --theme-muted: #806773; --theme-accent: #a63e66;
    --theme-hover: #80304f; --theme-sidebar: #713e55; --theme-sidebar-active: #a75e7c;
    --theme-shadow: rgba(116, 55, 80, .10);
}
html[data-theme="berry"] {
    --theme-bg: #f9edf4; --theme-soft: #fff1f8; --theme-border: #ecd2e2;
    --theme-ink: #503449; --theme-muted: #806477; --theme-accent: #963663;
    --theme-hover: #73274b; --theme-sidebar: #6c3555; --theme-sidebar-active: #9c517b;
    --theme-shadow: rgba(110, 53, 89, .12);
}
html[data-theme="emas"] {
    --theme-bg: #faf3e6; --theme-soft: #fff7e8; --theme-border: #ebdcc0;
    --theme-ink: #4d402b; --theme-muted: #796c55; --theme-accent: #885c16;
    --theme-hover: #68460f; --theme-sidebar: #6b542d; --theme-sidebar-active: #95723e;
    --theme-shadow: rgba(105, 78, 36, .12);
}
html[data-mode="dark"] {
    color-scheme: dark;
    --theme-bg: #172431; --theme-surface: #253747; --theme-soft: #304657;
    --theme-border: #4b6372; --theme-ink: #f0f8f6; --theme-muted: #c3d4d7;
    --theme-sidebar: #101e2b;
    --theme-sidebar-text: #e7f5f2; --theme-sidebar-active: #31525f;
    --theme-shadow: rgba(0, 0, 0, .22);
    --nik-muted: #c3d4d7; --nik-valid: #93e8b3; --nik-invalid: #ffaaa5;
}

.staff-body, body.portal-body, html[data-theme] body { background: var(--theme-bg); color: var(--theme-ink); }
.staff-body #header, .portal-body #header, .site-header { background: var(--theme-surface); border-color: var(--theme-border); }
html[data-theme="biru-klasik"]:not([data-mode="dark"]) .staff-body #header,
html[data-theme="hijau-klasik"]:not([data-mode="dark"]) .staff-body #header { background: var(--theme-sidebar); }
html[data-theme="biru-klasik"]:not([data-mode="dark"]) .staff-body #header h1#logo-text,
html[data-theme="hijau-klasik"]:not([data-mode="dark"]) .staff-body #header h1#logo-text { color: #fff; }
html[data-theme="biru-klasik"]:not([data-mode="dark"]) .staff-body #header p#slogan,
html[data-theme="hijau-klasik"]:not([data-mode="dark"]) .staff-body #header p#slogan { color: #f0faf7; }
.portal-body #header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.theme-mode-toggle, .staff-body button.theme-mode-toggle {
    display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center;
    padding: 0; border: 1px solid var(--theme-border); border-radius: 50%;
    background: var(--theme-soft); color: var(--theme-ink); cursor: pointer;
}
.theme-mode-toggle:hover, .staff-body button.theme-mode-toggle:hover { background: var(--theme-border); color: var(--theme-ink); }
.theme-mode-toggle[hidden], .staff-body button.theme-mode-toggle[hidden] { display: none; }
.theme-mode-toggle svg { width: 20px; height: 20px; }
.theme-mode-toggle .theme-icon-sun, html[data-mode="dark"] .theme-mode-toggle .theme-icon-moon { display: none; }
html[data-mode="dark"] .theme-mode-toggle .theme-icon-sun { display: block; }
.theme-mode-error { margin: 0; padding: 10px 20px; background: #ffebeb; color: #8d2929; }
.staff-body .theme-inline-error { color: #b42318; }
html[data-mode="dark"] .staff-body .theme-inline-error { color: #ffaaa5; }
.staff-body #header h1#logo-text, .portal-body #header h1#logo-text,
.staff-body h2, .staff-body h3, .portal-page .portal-intro h1, .portal-page .portal-card h2,
.hero h1, .section-heading h2, .registration-card h2, .catalog-hero h1,
.product-copy h3, .brand { color: var(--theme-ink); }
.staff-body #header p#slogan, .portal-body #header p#slogan,
.portal-page .portal-intro p, .portal-page .portal-card-heading p,
.hero-copy > p, .section-heading p, .registration-card p, .product-copy p, .product-preview,
.catalog-hero p, .brand small { color: var(--theme-muted); }
.product-expand, .product-collapse { color: var(--theme-accent); }
html[data-mode="dark"] .product-expand, html[data-mode="dark"] .product-collapse { color: var(--theme-ink); }
.staff-body .staff-sidebar { background: var(--theme-sidebar); border-color: var(--theme-sidebar); }
.staff-body .staff-sidebar-heading { color: var(--theme-sidebar-text); opacity: .7; }
.staff-body #menu ul li a, .staff-body .staff-sidebar #header-links a { color: var(--theme-sidebar-text); }
.staff-body #menu ul li#current a, .staff-body #menu ul li a:hover,
.staff-body .staff-sidebar #header-links a:hover, .staff-body .staff-sidebar #header-links a:focus-visible {
    color: #fff; background: var(--theme-sidebar-active);
}
.staff-body #content-wrap, .staff-body #wrap > .container, .portal-page .portal-card,
.product-card, .art-card { background: var(--theme-surface); border-color: var(--theme-border); box-shadow: 0 12px 30px var(--theme-shadow); }
.staff-body form, .registration-card, .empty-products { background: var(--theme-soft); border-color: var(--theme-border); }
.staff-body input[type="text"], .staff-body input[type="number"], .staff-body input[type="password"],
.staff-body input[type="date"], .staff-body input[type="time"], .staff-body select, .staff-body textarea,
.portal-page .portal-field input, .portal-page .portal-field select, .portal-page .portal-field textarea {
    color: var(--theme-ink); background: var(--theme-surface); border-color: var(--theme-border);
}
.staff-body input[type="submit"], .staff-body .formulir input[type="submit"], .staff-body input[type="button"],
.staff-body button, .staff-body .tombol,
.portal-page .portal-button, .nav-button, .button-primary {
    background: var(--theme-accent); color: #fff;
}
.staff-body input[type="submit"]:hover, .staff-body .formulir input[type="submit"]:hover,
.staff-body input[type="button"]:hover, .staff-body button:hover, .staff-body .tombol:hover,
.portal-page .portal-button:hover, .nav-button:hover, .button-primary:hover {
    background: var(--theme-hover); color: #fff;
}
html[data-mode="dark"] .staff-body .patient-search-fields button { background: #e8f5f2; }
html[data-mode="dark"] .staff-body .patient-search-fields button:hover { background: #fff; }
html[data-mode="dark"] .staff-body a.patient-add { color: #9de0d4; }
.staff-body a, .staff-body a:visited, .portal-page .portal-staff-link,
.portal-page .portal-search-option summary, .catalog-link, .catalog-back { color: var(--theme-accent); }
html[data-mode="dark"] .staff-body a:not(.patient-add), html[data-mode="dark"] .portal-page .portal-staff-link,
html[data-mode="dark"] .portal-page .portal-search-option summary,
html[data-mode="dark"] .catalog-link, html[data-mode="dark"] .catalog-back { color: #9de0d4; }
.staff-body table.data th, .portal-page .portal-results th { color: var(--theme-ink); background: var(--theme-soft); }
.staff-body table.data td { color: var(--theme-ink); background: var(--theme-surface); }
.staff-body table.data tr:hover td { background: var(--theme-soft); }
.staff-body table.data th, .staff-body table.data td, .portal-page .portal-results th,
.portal-page .portal-results td { border-color: var(--theme-border); }
.staff-body .patient-search { background: transparent; }
.staff-body #footer, .portal-body #footer { background: var(--theme-soft); color: var(--theme-muted); }
.staff-body #footer a, .portal-body #footer a { color: var(--theme-accent); }
html[data-mode="dark"] .portal-body #footer a { color: #9de0d4; }
.portal-page .portal-field label, .portal-page .portal-section-label,
.portal-page .portal-steps li, .portal-page .portal-consent,
.portal-page .portal-field small, .portal-page .portal-field-status { color: var(--theme-ink); }
.portal-page .portal-icon, .portal-page .portal-patient-details, .product-image { background: var(--theme-soft); color: var(--theme-ink); }
.portal-page .portal-patient-details dt, .portal-page .portal-patient-details dd { color: var(--theme-ink); }
.portal-page .portal-steps .is-current { color: var(--theme-ink); }
.portal-page .portal-steps .is-current span { background: var(--theme-accent); border-color: var(--theme-accent); color: #fff; }
.portal-page .portal-button-secondary, .button-outline { background: var(--theme-soft); border-color: var(--theme-border); color: var(--theme-ink); }
.portal-page .portal-button-secondary:hover, .button-outline:hover { background: var(--theme-border); color: var(--theme-ink); }
.hero, .catalog-hero { background: var(--theme-soft); }
.eyebrow { color: var(--theme-accent); }
html[data-mode="dark"] .eyebrow, html[data-mode="dark"] .portal-page .portal-eyebrow { color: #9de0d4; }
.hero .eyebrow { background: var(--theme-surface); border-color: var(--theme-border); }
.hero .eyebrow span, .art-dot { background: var(--theme-accent); }
.art-mark, .hero-note span { background: var(--theme-soft); color: var(--theme-ink); }
.art-card strong, .art-card > span:last-child, .hero-note { color: var(--theme-ink); }
.site-footer { color: var(--theme-muted); border-color: var(--theme-border); }

.staff-body .theme-intro { margin: 0 0 16px; padding: 0; color: var(--theme-muted); }
.staff-body .theme-message, .staff-body .theme-error { margin: 0 0 16px; padding: 12px; border-radius: 9px; }
.staff-body .theme-message { color: #154e38; background: #d9f3e5; }
.staff-body .theme-error { color: #8d2929; background: #ffebeb; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.staff-body form.theme-choice { width: auto; margin: 0; padding: 0; border: 0; background: none; }
.staff-body button.theme-card, .staff-body button.theme-card:hover {
    display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; overflow: hidden; text-align: left;
    background: var(--theme-surface); color: var(--theme-ink); border: 2px solid var(--theme-border);
    border-radius: 14px; box-shadow: 0 5px 16px var(--theme-shadow);
}
.staff-body button.theme-card:hover, .staff-body button.theme-card.is-selected { border-color: var(--theme-accent); }
.theme-preview { display: flex; height: 95px; gap: 9px; padding: 12px; background: var(--preview-bg); }
.theme-preview-sidebar { width: 25%; border-radius: 7px; background: var(--preview-side); }
.theme-preview-content { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 9px; border-radius: 7px; background: var(--preview-panel); }
.theme-preview-content i { width: 80%; height: 10px; border-radius: 6px; background: var(--preview-accent); }
.theme-preview-content i + i { width: 50%; opacity: .45; }
.theme-preview-hijau { --preview-bg: #eaf5ee; --preview-side: #1c5146; --preview-panel: #fff; --preview-accent: #18795b; }
.theme-preview-biru-klasik { --preview-bg: #e8f3fc; --preview-side: #1a75d9; --preview-panel: #fff; --preview-accent: #1a69bf; }
.theme-preview-hijau-klasik { --preview-bg: #f2f7f6; --preview-side: #145d5a; --preview-panel: #fff; --preview-accent: #126f66; }
.theme-preview-laut { --preview-bg: #eaf3fa; --preview-side: #234e69; --preview-panel: #fff; --preview-accent: #176f96; }
.theme-preview-tosca { --preview-bg: #e7f7f5; --preview-side: #166c68; --preview-panel: #fff; --preview-accent: #087c75; }
.theme-preview-lavender { --preview-bg: #f1eef9; --preview-side: #4b3b66; --preview-panel: #fff; --preview-accent: #72549c; }
.theme-preview-nila { --preview-bg: #edf0fc; --preview-side: #394a84; --preview-panel: #fff; --preview-accent: #4a5dae; }
.theme-preview-senja { --preview-bg: #fbf1e8; --preview-side: #704633; --preview-panel: #fff; --preview-accent: #a7512b; }
.theme-preview-mawar { --preview-bg: #fbf0f3; --preview-side: #713e55; --preview-panel: #fff; --preview-accent: #a63e66; }
.theme-preview-berry { --preview-bg: #f9edf4; --preview-side: #6c3555; --preview-panel: #fff; --preview-accent: #963663; }
.theme-preview-emas { --preview-bg: #faf3e6; --preview-side: #6b542d; --preview-panel: #fff; --preview-accent: #885c16; }
.theme-card-text { display: block; padding: 14px; }
.theme-card-text strong, .theme-card-text small, .theme-selected { display: block; }
.theme-card-text strong { font-size: 15px; }
.theme-card-text small { margin-top: 5px; color: var(--theme-muted); font: 13px/1.4 Arial, sans-serif; }
.theme-selected { margin-top: 10px; color: var(--theme-muted); font-size: 12px; }
@media (max-width: 480px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
