html[data-theme="dark"] {
    color-scheme: dark;
    --brand: #e45b83;
    --brand-dark: #ffc1d1;
    --brand-light: #a83257;
    --soft: #38212b;
    --bg: #10151c;
    --text: #e5eaf0;
    --muted: #a4afbd;
    --line: #303b49;
    --white: #171e27;
    --shadow: 0 10px 30px rgba(0, 0, 0, .28);
    background: #10151c;
}
html[data-theme="dark"] body,
html[data-theme="dark"] #page,
html[data-theme="dark"] .container { background: #10151c; color: var(--text); }
html[data-theme="dark"] body { background: radial-gradient(ellipse at top left, #20202a 0, #10151c 54%); }
html[data-theme="dark"] #page { border-color: #303b49; }
html[data-theme="dark"] #header { background: linear-gradient(180deg, #470c20 0%, #260b18 100%); }
html[data-theme="dark"] #mainmenu a:hover,
html[data-theme="dark"] #mainmenu li.active a,
html[data-theme="dark"] .nav-form button:hover { color: #fff; background: rgba(255,255,255,.14); }
html[data-theme="dark"] .project-context strong,
html[data-theme="dark"] a,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] .dashboard-card strong { color: #f0a1b8; }
html[data-theme="dark"] .project-context span,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .dashboard-card span { color: var(--muted); }
html[data-theme="dark"] .card,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .password-reset form { background: #171e27; border-color: var(--line); color: var(--text); }
html[data-theme="dark"] .dashboard-card:hover { border-color: #805064; }
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .readonly-grid,
html[data-theme="dark"] .detail-card dt { background: #202a36; border-color: var(--line); color: var(--text); }
html[data-theme="dark"] .field,
html[data-theme="dark"] label { color: #d8e0e9; }
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input:not([type]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .filter-row input { color: var(--text); background: #101720; border-color: #465363; color-scheme: dark; }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #8793a2; }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus { border-color: #e45b83; box-shadow: 0 0 0 3px rgba(228,91,131,.2); }
html[data-theme="dark"] table th { color: #f1dce3; background: #38212b; border-color: #573141; }
html[data-theme="dark"] table td { color: #d6dee8; background: #171e27; border-color: #2b3541; }
html[data-theme="dark"] table tr:hover td { background: #202a36; }
html[data-theme="dark"] .table-wrap { border-color: var(--line); }
html[data-theme="dark"] .error,
html[data-theme="dark"] .flash-error { color: #fecaca; background: #391c24; border-color: #75313f; }
html[data-theme="dark"] .flash-success { color: #bbf7d0; background: #142c25; border-color: #245941; }
html[data-theme="dark"] .flash-notice { color: #fde68a; background: #342b17; border-color: #66521c; }
html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] .password-toggle,
html[data-theme="dark"] .user-action,
html[data-theme="dark"] .pagination a,
html[data-theme="dark"] #logout { color: #e8dce1; background: #202a36; border-color: #465363; }
html[data-theme="dark"] .pagination-summary { color: var(--muted); background: transparent; }
html[data-theme="dark"] .record-update-meta,
html[data-theme="dark"] .person-review-panel,
html[data-theme="dark"] .coord-node,
html[data-theme="dark"] .coord-depth-1,
html[data-theme="dark"] .coord-depth-2 { color: var(--text); background: #202a36; border-color: #465363; }
html[data-theme="dark"] .coord-group-zone td,
html[data-theme="dark"] .coord-group-section td,
html[data-theme="dark"] .coord-group-block td,
html[data-theme="dark"] .small-section-total td,
html[data-theme="dark"] .small-section-coordinator td,
html[data-theme="dark"] .small-section-promoter td,
html[data-theme="dark"] .structure-progress-table .coordinator-self-row td { background: #202a36; }
html[data-theme="dark"] .feature-toggle,
html[data-theme="dark"] .feature-toggle-copy strong,
html[data-theme="dark"] .user-action { color: var(--text); }
html[data-theme="dark"] .feature-toggle:hover,
html[data-theme="dark"] .user-action:hover { background: #293543; }
html[data-theme="dark"] .google-map-message { background: #342b17; color: #fde68a; }
html[data-theme="dark"] .google-map-message.is-error { background: #391c24; color: #fecaca; }
html[data-theme="dark"] .google-section-label { color: #17324d; background: rgba(255,255,255,.92); }
html[data-theme="dark"] #footer { color: #8d99a8; }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 12px; color: #475569; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; font-weight: 650; box-shadow: none; }
.theme-toggle:hover { color: var(--brand-dark); background: var(--soft); filter: none; }
.logout-form { display: flex; align-items: center; gap: 8px; }
.guest-theme-toggle { position: absolute; top: 18px; right: 22px; z-index: 2; }
.theme-setting-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.theme-setting-copy { display: flex; align-items: center; gap: 16px; }
.theme-setting-copy h2 { margin: 0 0 5px; }
.theme-setting-copy p { margin: 0; }
.theme-setting-icon { display: grid; width: 52px; height: 52px; flex: 0 0 52px; place-items: center; color: var(--brand); background: var(--soft); border-radius: 14px; font-size: 28px; }
.theme-setting-control { display: flex; align-items: center; gap: 14px; color: var(--muted); font-weight: 700; }
html[data-theme="dark"] .theme-toggle { color: #f4dce4; background: #202a36; border-color: #465363; }
html[data-theme="dark"] .theme-toggle:hover { background: #293543; }
@media (max-width: 600px) { .theme-toggle { padding: 8px 10px; font-size: 12px; } .logout-form { flex-wrap: wrap; justify-content: flex-end; } .guest-theme-toggle { top: 10px; right: 10px; } }
@media (max-width: 700px) { .theme-setting-card, .theme-setting-control { align-items: flex-start; flex-direction: column; } }
