/* ===== Tmavý režim administrace =====
   Zapíná se přepínačem v postranním panelu (uloženo v prohlížeči), výchozí = podle systému.
   Atribut data-theme na <html> nastavuje skript v hlavičce admin layoutu. */
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] body.admin{
  --ink:rgba(255,255,255,.9); --warm-white:#262625; --warm-dark:#e4e2df; --gray5:#a8a49f; --gray3:#76726d;
  --blue:#2f8cf0; --blue-active:#1f74d0; --badge-bg:#132a40; --badge-ink:#7dbbff;
  --border:1px solid rgba(255,255,255,.1);
  --shadow-card:0 2px 10px rgba(0,0,0,.4); --shadow-deep:0 10px 40px rgba(0,0,0,.6);
  --d-bg:#181818; --d-surface:#202020; --d-surface2:#2a2a29; --d-hover:#2c2c2b; --d-input:#151515; --d-input-border:#3a3a39;
  background:var(--d-bg); color:var(--ink);
}
html[data-theme="dark"] body.admin :is(h1,h2,h3,b,strong){color:#f1f0ee}
html[data-theme="dark"] .admin .side{background:#1f1f1e}
html[data-theme="dark"] .side nav a:hover{background:rgba(255,255,255,.06)}
html[data-theme="dark"] .side nav a.on{background:rgba(255,255,255,.11);color:#fff}

/* plochy */
html[data-theme="dark"] body.admin :is(.atable,.stats div,.act,.aform fieldset,.inline-form,.props,.cols table,.acal,ul.tasks,.refund,.login-card,table){background:var(--d-surface)}
html[data-theme="dark"] body.admin th{background:var(--d-surface2);color:var(--gray5)}
html[data-theme="dark"] body.admin tr.total td{background:var(--d-surface2)}
html[data-theme="dark"] body.admin :is(.atable tr:hover td,tr[data-controller~="row-link"]:hover td,.stats .clickable:hover){background:var(--d-hover)}
html[data-theme="dark"] body.admin :is(summary:hover,.prop dd:hover){background:rgba(255,255,255,.05)}
html[data-theme="dark"] body.admin :is(.callout,.calc,.quote,.ubyport,.acts div){background:var(--d-surface2)}
html[data-theme="dark"] body.admin .acell.out{background:#1c1c1c}
html[data-theme="dark"] body.admin .refund.done{background:#16261c}
html[data-theme="dark"] body.admin .ok-box{background:#16261c;color:#9fdcb0}
html[data-theme="dark"] body.admin .mailpreview{background:#f6f5f4}
html[data-theme="dark"] body.admin .vars code{background:var(--d-surface2);color:var(--ink)}

/* formuláře */
html[data-theme="dark"] body.admin :is(input,textarea,select),
html[data-theme="dark"] body.admin .aform :is(input:not([type=checkbox]),select,textarea){background:var(--d-input);color:var(--ink);border-color:var(--d-input-border)}
html[data-theme="dark"] body.admin input.copy{background:var(--d-input);border-color:var(--d-input-border)}
html[data-theme="dark"] body.admin .btn.sec{background:rgba(255,255,255,.09);color:var(--ink)}
html[data-theme="dark"] body.admin .btn.sec:hover{background:rgba(255,255,255,.14)}
html[data-theme="dark"] body.admin .chip{background:var(--d-surface);color:var(--warm-dark)}
html[data-theme="dark"] body.admin .chip.on{background:#e4e2df;color:#111}
html[data-theme="dark"] body.admin .act.danger{border-color:#5c2620}

/* štítky stavů */
html[data-theme="dark"] body.admin .badge.st-pending,html[data-theme="dark"] body.admin mark.todo{background:#3d3010;color:#f5cf6b}
html[data-theme="dark"] body.admin .badge.st-paid,html[data-theme="dark"] body.admin .badge.green{background:#15301e;color:#7ed69a}
html[data-theme="dark"] body.admin .badge.st-cancelled,html[data-theme="dark"] body.admin .badge.warm{background:#2e2d2c;color:var(--gray5)}
html[data-theme="dark"] body.admin .badge.st-overdue{background:#3a1714;color:#ff8f84}
html[data-theme="dark"] body.admin .t-blue{background:#132a40;color:#8cc4f5}
html[data-theme="dark"] body.admin .t-green{background:#15301e;color:#8fd3a3}
html[data-theme="dark"] body.admin .t-orange{background:#3a2412;color:#f0a868}
html[data-theme="dark"] body.admin .t-gray{background:#2e2d2c;color:#b5b1ac}

/* kalendář obsazenosti */
html[data-theme="dark"] body.admin .abar{color:#f1f0ee}
html[data-theme="dark"] body.admin .abar.st-pending{background:#5a4512}
html[data-theme="dark"] body.admin .abar.st-confirmed{background:#1d3f63}
html[data-theme="dark"] body.admin .abar.st-paid{background:#1d4a2b}
html[data-theme="dark"] body.admin .abar.blocked{background:repeating-linear-gradient(45deg,#2a2a29,#2a2a29 6px,#323231 6px,#323231 12px);color:var(--gray5)}

/* hlášky a upozornění */
html[data-theme="dark"] body.admin :is(.flash,.hint,.callout.warn){background:#3a2c10;color:#f3cf7e}
html[data-theme="dark"] body.admin .flash--notice{background:#15301e;color:#8fd3a3}
html[data-theme="dark"] body.admin :is(.flash--alert,.form-errors){background:#3a1714;color:#ff9a90}
html[data-theme="dark"] body.admin :is(ul.tasks li.overdue,.atable tr.overdue td){background:#33270f}
html[data-theme="dark"] body.admin .binding-note{background:#33270f;border-color:#6b4b12;border-left-color:#dd8a00}
html[data-theme="dark"] body.admin .binding-note b{color:#f5c56a}
html[data-theme="dark"] body.admin :is(.warn,.backup-status .warn,.quote-error){color:#ff8f84}
html[data-theme="dark"] body.admin .sent{color:#7ed69a}

/* přepínač */
.theme-toggle{display:inline-flex;align-items:center;gap:6px}
