/* Тёмная тема — ручные правки поверх сгенерированного app-dark.css. Палитра — как в согласованном макете сводки. */
@media screen{
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] body{background:#0b141a!important;color:#e7eff4}
html[data-theme="dark"] body::before{background:#0b141a!important;background-image:none!important}
html[data-theme="dark"] body::after{display:none!important}
html[data-theme="dark"] .app{background:transparent}

/* Шапка */
html[data-theme="dark"] .top{background:#0f1c24!important;box-shadow:0 1px 0 #22333d}
html[data-theme="dark"] .top .nav button{color:#a8b9c4}
html[data-theme="dark"] .top .nav button:hover,html[data-theme="dark"] .top .nav button.active{background:#152733;color:#fff;box-shadow:inset 0 -3px #3aa6d8}
html[data-theme="dark"] .top-logo{background:#1683b5;color:#fff;box-shadow:none}
html[data-theme="dark"] .help-btn,html[data-theme="dark"] .logout-btn,html[data-theme="dark"] #theme{background:#16242d;color:#e7eff4;box-shadow:none;border:1px solid #22333d}
html[data-theme="dark"] .top-user,html[data-theme="dark"] .book-date{color:#a8b9c4}
html[data-theme="dark"] .session-role{background:#22333d;color:#cfe0ea}

/* Общие поверхности и текст */
html[data-theme="dark"] .card,html[data-theme="dark"] .home-card,html[data-theme="dark"] .dialog,html[data-theme="dark"] .auth-box{background:#121e26!important;border-color:#22333d;color:#e7eff4}
html[data-theme="dark"] .home-card:hover{border-color:#3aa6d8;box-shadow:0 9px 24px rgba(0,0,0,.4)}
html[data-theme="dark"] .home-card h2,html[data-theme="dark"] .page-head h1,html[data-theme="dark"] .home-welcome h1{color:#e7eff4}
html[data-theme="dark"] .muted,html[data-theme="dark"] .page-head p,html[data-theme="dark"] .home-welcome p,html[data-theme="dark"] small{color:#8ea3af}
html[data-theme="dark"] .home-icon{background:#16283a;color:#5fb8e3}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background-color:#16242d;color:#e7eff4;border-color:#2a3d48}
html[data-theme="dark"] input[readonly]{background-color:#121e26;color:#a8b9c4}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#6f8591}
html[data-theme="dark"] .btn{background:#16242d;color:#e7eff4;border-color:#2a3d48}
html[data-theme="dark"] .btn:hover{border-color:#3aa6d8}
html[data-theme="dark"] .btn.primary{background:#1683b5;border-color:#1683b5;color:#fff}
html[data-theme="dark"] .btn.danger{background:#2a1517;border-color:#5a2a2c;color:#f07272}
html[data-theme="dark"] .modal,html[data-theme="dark"] .dsh-modal{background:rgba(3,8,12,.72)}
html[data-theme="dark"] .toast{background:#e7eff4;color:#0f2230}
html[data-theme="dark"] .auth-modal{background:linear-gradient(135deg,#071017,#0f2a3a)}
html[data-theme="dark"] .auth-head{background:#16242d;border-color:#22333d}
html[data-theme="dark"] .auth-head h2{color:#e7eff4}
html[data-theme="dark"] a{color:#5fb8e3}

/* Таблицы */
html[data-theme="dark"] table.data th,html[data-theme="dark"] .daily-table th,html[data-theme="dark"] .ref-table th{background:#16242d;color:#8ea3af;border-color:#22333d}
html[data-theme="dark"] table.data td,html[data-theme="dark"] .daily-table td,html[data-theme="dark"] .resource-table td,html[data-theme="dark"] .ref-table td{border-color:#1d2c35}
html[data-theme="dark"] table.data tbody tr:hover,html[data-theme="dark"] .daily-table tr:hover td{background:#16283a}
html[data-theme="dark"] .daily-table tr:nth-child(even) td{background:#0f1a21}

/* График (Гант) */
html[data-theme="dark"] .gantt,html[data-theme="dark"] .gantt .timeline,html[data-theme="dark"] .gantt .g-label{background-color:#121e26}
html[data-theme="dark"] .gantt .timeline{background-image:linear-gradient(to right,#1d2c35 1px,transparent 1px),linear-gradient(90deg,rgba(58,166,216,.05) 50%,transparent 50%)}
html[data-theme="dark"] .gantt .g-row:nth-child(odd) .timeline,html[data-theme="dark"] .gantt .g-row:nth-child(odd) .g-label{background-color:#0f1a21}
html[data-theme="dark"] .gantt .months,html[data-theme="dark"] .gantt .month-band{background:#16242d;color:#a8b9c4;border-color:#22333d}
html[data-theme="dark"] .gantt .period-cell{color:#8ea3af;border-color:#22333d}
html[data-theme="dark"] .gantt .g-label,html[data-theme="dark"] .g-row{border-color:#22333d}
html[data-theme="dark"] .gantt .bar:after{color:#a8b9c4}
html[data-theme="dark"] .gantt-filterbar,html[data-theme="dark"] .gantt-subbar,html[data-theme="dark"] .gantt-analytics{background:#121e26;border-color:#22333d}
html[data-theme="dark"] .today:before{background:#121e26}

/* Подсветка и подложки, заданные в разметке напрямую */
html[data-theme="dark"] [style*="background:#fff"],html[data-theme="dark"] [style*="background: #fff"],html[data-theme="dark"] [style*="background:white"]{background:#121e26!important}
html[data-theme="dark"] svg text[fill="#687985"],html[data-theme="dark"] svg text[fill="#526570"]{fill:#8ea3af}
html[data-theme="dark"] svg path[stroke="#dce4e9"],html[data-theme="dark"] svg line[stroke="#dce4e9"]{stroke:#22333d}

/* Сводка: токены тёмного макета */
html[data-theme="dark"] .dsh{--d-brand:#3aa6d8;--d-plan:#6f8591;--d-ink:#e7eff4;--d-ink-2:#a8b9c4;--d-muted:#7f939f;--d-surface:#121e26;--d-surface-2:#16242d;--d-line:#22333d;--d-grid:#1d2c35;--d-good-ink:#2fc22f;--d-crit-ink:#f07272;--d-h0:#18262f;--d-h1:#184f95;--d-h2:#256abf;--d-h3:#3987e5;--d-h4:#86b6ef}
html[data-theme="dark"] .dsh-blk{box-shadow:none}
html[data-theme="dark"] .dsh-dialog{background:#121e26;color:#e7eff4}
html[data-theme="dark"] #dshTip{background:#e7eff4;color:#0f2230}
html[data-theme="dark"] .dsh-pill.warn{color:#e7eff4}
html[data-theme="dark"] .dsh svg circle[stroke="#fff"]{stroke:#121e26}
}
#theme{min-width:34px;height:30px;border-radius:7px;border:0;cursor:pointer;font-size:14px;background:#f8fbfd;color:#36566a;box-shadow:0 1px 4px #0a608833}
