@media screen {
  :root { color-scheme: light; }
  :root:not([data-theme="dark"]) { background: #f2f4f5; }
  :root:not([data-theme="dark"]) .topbar,
  :root:not([data-theme="dark"]) .sidebar,
  :root:not([data-theme="dark"]) .login-form,
  :root:not([data-theme="dark"]) .table-wrap,
  :root:not([data-theme="dark"]) dialog,
  :root:not([data-theme="dark"]) .dialog-head { background: #fcfcfc; }
  :root:not([data-theme="dark"]) input,
  :root:not([data-theme="dark"]) select,
  :root:not([data-theme="dark"]) textarea { background: #fdfdfd; }
  :root:not([data-theme="dark"]) button:not(.product-logo):not(.primary) { background: #fcfcfc; }
  :root:not([data-theme="dark"]) button:not(.product-logo):not(.primary):hover { background: #eef3f7; }
  :root:not([data-theme="dark"]) .subnav button { background: transparent; }
  .brand img, .login-form img {
    content: url('/brand/logo-light.png');
    object-fit: contain;
    background: transparent;
    padding: 0;
  }
  .login-form img { height: 50px; }
  :root[data-theme="dark"] {
    color-scheme: dark;
    color: #e2e6eb;
    background: #191c20;
    --brand: #356f97;
    --line: #3a414a;
    --muted: #a9b3bf;
    --green: #77d0a8;
    --amber: #e4b868;
    --red: #f29595;
  }
  [data-theme="dark"] button { color: #d9e2ec; background: #292e35; border-color: #48515d; }
  [data-theme="dark"] button:hover { background: #343c46; border-color: #75879a; }
  [data-theme="dark"] button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
  [data-theme="dark"] button.primary:hover { background: #4382ac; }
  [data-theme="dark"] button.danger { color: var(--red); }
  [data-theme="dark"] input,
  [data-theme="dark"] select,
  [data-theme="dark"] textarea { background: #20242a; color: #e2e6eb; border-color: #4a535f; }
  [data-theme="dark"] input::placeholder { color: #9aa7b5; }
  [data-theme="dark"] .login-page { background: #191c20; }
  [data-theme="dark"] .login-form,
  [data-theme="dark"] .topbar,
  [data-theme="dark"] .sidebar,
  [data-theme="dark"] .table-wrap,
  [data-theme="dark"] dialog,
  [data-theme="dark"] .dialog-head { background: #24282e; color: #e2e6eb; }
  [data-theme="dark"] .brand img,
  [data-theme="dark"] .login-form img {
    content: url('/brand/logo-dark.png');
    background: transparent;
    border-radius: 0;
    padding: 0;
    object-fit: contain;
  }
  [data-theme="dark"] .login-form img { height: 50px; }
  [data-theme="dark"] .login-form h1,
  [data-theme="dark"] .page-head h1,
  [data-theme="dark"] .app-name,
  [data-theme="dark"] .detail-title h3,
  [data-theme="dark"] .detail-meta strong,
  [data-theme="dark"] .summary-strip strong { color: #e2eaf2; }
  [data-theme="dark"] .nav-link { color: #b5c1cf; }
  [data-theme="dark"] .nav-link:hover { background: #303740; }
  [data-theme="dark"] .nav-link.active { background: #273e50; color: #a8d9fa; }
  [data-theme="dark"] .nav-link.active svg { color: #8ccbf3; }
  [data-theme="dark"] .avatar { background: #34434f; border-color: #4a5b69; color: #dceafa; }
  [data-theme="dark"] .preview { color: #f1c36f; background: #40351f; border-color: #776039; }
  [data-theme="dark"] .breadcrumb,
  [data-theme="dark"] .table-foot,
  [data-theme="dark"] .sidebar-foot,
  [data-theme="dark"] .summary-strip span { color: #a5b2bf; }
  [data-theme="dark"] .table-wrap th { color: #b6c3d0; background: #2c333b; border-color: #48515c; }
  [data-theme="dark"] .table-wrap td { border-color: #373e47; }
  [data-theme="dark"] .table-wrap td:first-child { color: #c6dff3; }
  [data-theme="dark"] .table-wrap tbody tr:hover { background: #2e353e; }
  [data-theme="dark"] .table-wrap tbody tr.selected { background: #2a4255; }
  [data-theme="dark"] .empty { color: #adb9c5 !important; }
  [data-theme="dark"] .badge { color: #c1d0dc; background: #36424d; }
  [data-theme="dark"] .badge.pending { color: #f1c875; background: #44391f; }
  [data-theme="dark"] .badge.inProgress { color: #9bd6f4; background: #254658; }
  [data-theme="dark"] .badge.completed,
  [data-theme="dark"] .badge.active { color: #8bdfb6; background: #244638; }
  [data-theme="dark"] .badge.cancelled,
  [data-theme="dark"] .badge.inactive { color: #f2acac; background: #4d2f34; }
  [data-theme="dark"] .version { color: #c3ceda; background: #333d47; border-color: #4c5965; }
  [data-theme="dark"] .subnav button { color: #b5c2cf; background: transparent; }
  [data-theme="dark"] .subnav button.active { color: #9fd5f8; border-bottom-color: #77b8e1; }
  [data-theme="dark"] .detail-meta { background: #2c343e; }
  [data-theme="dark"] .role-label { color: #c5d5e3; }
  [data-theme="dark"] .error { color: #ffb5b5; background: #42292f; }
  [data-theme="dark"] dialog { border-color: #52606c; box-shadow: 0 16px 60px #0008; }
  [data-theme="dark"] dialog::backdrop { background: #080b10aa; }
  [data-theme="dark"] .progress-cell progress::-webkit-progress-bar { background: #485360; }
  [data-theme="dark"] .progress-cell progress::-webkit-progress-value { background: #75b9df; }
}
@media (max-width: 720px) {
  .topbar { gap: 8px; padding-inline: 12px; }
  .top-actions { gap: 6px; }
  .brand img { width: 84px; }
  .login-bottom { gap: 8px; }
}
@media print { :root { color-scheme: light; background: #fff; } }
