:root[data-theme="dark"]{
  color-scheme: dark;
  --gray-100:#0b1220;
  --gray-300:#2a3548;
  --gray-500:#94a3b8;
  --gray-700:#cbd5e1;
  --gray-900:#e5e7eb;
  --white:#111827;
  --off-white:#0b1220;
  --cream:#0f172a;
}
:root[data-theme="dark"] body{
  background:var(--gray-100)!important;
  color:var(--gray-900)!important;
}

/* Doar suprafețele deschise devin dark; zonele navy rămân intacte. */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .item,
:root[data-theme="dark"] .tab,
:root[data-theme="dark"] .table-wrap,
:root[data-theme="dark"] .draw,
:root[data-theme="dark"] .modal-card,
:root[data-theme="dark"] .pm-card{
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#2a3548!important;
}

:root[data-theme="dark"] .table th,
:root[data-theme="dark"] .table td{
  border-color:#2a3548!important;
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea{
  background:#0f172a!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

:root[data-theme="dark"] .btn-ghost{
  background:#0f172a!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}

:root[data-theme="dark"] .muted{
  color:#94a3b8!important;
}

:root[data-theme="dark"] img,
:root[data-theme="dark"] video,
:root[data-theme="dark"] iframe{
  filter:none!important;
}
.pe-skip-link{
  position:fixed;left:8px;top:-80px;z-index:5000;background:#111827;color:#fff;padding:10px 12px;border-radius:8px;
}
.pe-skip-link:focus{top:8px}
.pe-theme-btn{
  position:fixed;right:12px;bottom:12px;z-index:4000;border:1px solid #d1d5db;border-radius:999px;padding:10px 12px;background:#fff;cursor:pointer;
}

/* Panourile din cont/ au pe mobil o bară de navigare fixă jos (64px, aceeași limită de 1024px):
   butonul de temă stă deasupra ei ca să nu acopere „Mai mult”, iar sub sertare și modale. */
@media (max-width:1024px){
  body.pe-has-bottom-nav .pe-theme-btn{bottom:calc(76px + env(safe-area-inset-bottom));z-index:65}
}
