:root {
  color-scheme: light;
  --epmrs-btn-height:2.5rem;
  --epmrs-btn-sm-height:2.125rem;
  --epmrs-btn-lg-height:3rem;
}
:root[data-theme="dark"] { color-scheme: dark; --epmrs-bg:#09111f; --epmrs-surface:#111c2e; --epmrs-ink:#e7edf7; --epmrs-muted:#9eacc0; --epmrs-accent:#65a1ff; }
:root[data-theme="dark"] body { background:#09111f; color:var(--epmrs-ink); }
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .modal-content,
:root[data-theme="dark"] .dropdown-menu,
:root[data-theme="dark"] .list-group-item,
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select,
:root[data-theme="dark"] .input-group-text,
:root[data-theme="dark"] .table { background-color:var(--epmrs-surface); color:var(--epmrs-ink); border-color:#2d3b51; }
:root[data-theme="dark"] .text-dark { color:var(--epmrs-ink)!important; }
:root[data-theme="dark"] .text-muted,
:root[data-theme="dark"] .text-secondary { color:var(--epmrs-muted)!important; }
:root[data-theme="dark"] .btn-light,
:root[data-theme="dark"] .bg-light { background:#1b2940!important; border-color:#34445d!important; color:var(--epmrs-ink)!important; }
:root[data-theme="dark"] .table > :not(caption) > * > * { color:inherit; background:transparent; border-color:#2d3b51; }
:root[data-contrast="high"] { --epmrs-accent:#005fcc; }
:root[data-contrast="high"] *:focus-visible { outline:4px solid #ffbf00!important; outline-offset:3px; }
:root[data-density="compact"] .table > :not(caption) > * > * { padding:.35rem .5rem; }
:root[data-density="compact"] .card-body { padding:.85rem; }
.epmrs-skip-link { position:fixed; inset-inline-start:1rem; top:-5rem; z-index:2000; background:#fff; color:#111; padding:.75rem 1rem; border-radius:.5rem; box-shadow:0 4px 20px #0004; }
.epmrs-skip-link:focus { top:1rem; }
:focus-visible { outline:3px solid color-mix(in srgb, var(--epmrs-accent) 75%, white); outline-offset:2px; }
.epmrs-search-trigger kbd { font-size:.68rem; color:#607085; background:#fff; border:1px solid #d8e0eb; }
.epmrs-command-palette { border:0; border-radius:1.25rem; box-shadow:0 24px 80px #0f172a55; }
.epmrs-command-result.active { background:rgba(31,111,235,.1); color:inherit; }
.epmrs-breadcrumb { min-width:0; }
.epmrs-breadcrumb .breadcrumb { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.epmrs-breadcrumb .breadcrumb-item.active { overflow:hidden; text-overflow:ellipsis; }
.epmrs-autosave-banner { border-inline-start:4px solid var(--epmrs-accent); }
.epmrs-draft-state { position:fixed; bottom:1rem; inset-inline-start:1rem; z-index:1020; font-size:.8rem; opacity:0; transition:opacity .2s; }
.epmrs-draft-state.show { opacity:1; }
.epmrs-upload-progress { height:.65rem; }
.epmrs-upload-list { max-height:11rem; overflow:auto; }

/* Keep links, native buttons and submit controls aligned throughout the UI. */
.btn {
  display:inline-flex;
  min-height:var(--epmrs-btn-height);
  align-items:center;
  justify-content:center;
  gap:.35rem;
  line-height:1.2;
  vertical-align:middle;
}
.btn-sm,
.btn-group-sm > .btn {
  min-height:var(--epmrs-btn-sm-height);
}
.btn-lg,
.btn-group-lg > .btn {
  min-height:var(--epmrs-btn-lg-height);
}
.btn > i,
.btn > svg {
  flex:0 0 auto;
  line-height:1;
}
.btn.rounded-circle {
  width:var(--epmrs-btn-height);
  padding-inline:0;
}
.btn-sm.rounded-circle {
  width:var(--epmrs-btn-sm-height);
}
.btn-lg.rounded-circle {
  width:var(--epmrs-btn-lg-height);
}
form.d-inline,
form.d-inline-block {
  vertical-align:middle;
}

/* Reusable table action layouts prevent translated labels from producing ragged controls. */
.epmrs-actions-cell {
  min-width:12.5rem;
  vertical-align:middle;
}
.epmrs-table-actions {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:.375rem;
}
.epmrs-table-actions > form {
  display:flex;
  margin:0;
}
.epmrs-table-actions--grid {
  display:grid;
  grid-template-columns:repeat(2, minmax(5.5rem, 1fr));
  width:12rem;
  margin-inline-start:auto;
}
.epmrs-table-actions--grid > .btn,
.epmrs-table-actions--grid > form,
.epmrs-table-actions--grid > form > .btn {
  width:100%;
}
.epmrs-table-actions--grid > .epmrs-action-wide,
.epmrs-table-actions--grid > form.epmrs-action-wide {
  grid-column:1 / -1;
}
.epmrs-resizable-table {
  table-layout:fixed;
}
.epmrs-resizable-table textarea.form-control {
  width:100%;
  min-width:10rem;
  max-width:none!important;
  overflow:auto;
  resize:both!important;
}
.epmrs-resizable-column {
  position:relative;
}
.epmrs-column-resizer {
  position:absolute;
  z-index:3;
  inset-block:0;
  inset-inline-end:-.35rem;
  width:.7rem;
  cursor:col-resize;
  touch-action:none;
  outline:0;
}
.epmrs-column-resizer::after {
  content:"";
  position:absolute;
  inset-block:.3rem;
  inset-inline-start:calc(50% - 1px);
  width:2px;
  border-radius:2px;
  background:transparent;
}
.epmrs-resizable-column:hover > .epmrs-column-resizer::after,
.epmrs-column-resizer:focus-visible::after,
.epmrs-column-resizer.is-resizing::after {
  background:var(--epmrs-accent);
}
body.epmrs-column-resizing {
  cursor:col-resize!important;
  user-select:none;
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition-duration:.01ms!important; animation-duration:.01ms!important; animation-iteration-count:1!important; } }
@media (max-width:767.98px) {
  .epmrs-main { padding:.75rem!important; }
  .epmrs-topbar { gap:.4rem!important; }
  .epmrs-top-actions { gap:.35rem!important; margin-inline-start:auto!important; }
  .epmrs-locale > .dropdown-toggle { display:flex; width:2.5rem; height:2.5rem; align-items:center; justify-content:center; font-size:0; }
  .epmrs-locale > .dropdown-toggle i { font-size:1rem; margin:0!important; }
  .epmrs-top-actions .rounded-pill { padding:.5rem .7rem; }
  .epmrs-search-trigger { width:2.5rem; height:2.5rem; justify-content:center; border-radius:50%; }
  .epmrs-breadcrumb .breadcrumb { display:none; }
  .table-responsive[data-card-table] { overflow:visible; }
  .table-responsive[data-card-table] table,.table-responsive[data-card-table] tbody,.table-responsive[data-card-table] tr,.table-responsive[data-card-table] td { display:block; width:100%; }
  .table-responsive[data-card-table] thead { display:none; }
  .table-responsive[data-card-table] tr { background:var(--epmrs-surface,#fff); border:1px solid #dfe6ef; border-radius:.85rem; padding:.65rem; margin-bottom:.75rem; box-shadow:0 3px 12px #0f172a0d; }
  .table-responsive[data-card-table] td { display:grid; grid-template-columns:minmax(7rem,38%) 1fr; gap:.6rem; text-align:start!important; border:0; padding:.35rem; }
  .table-responsive[data-card-table] td::before { content:attr(data-label); color:var(--epmrs-muted,#607085); font-weight:600; font-size:.78rem; }
  .table-responsive[data-card-table] td[colspan] { display:block; }
  .table-responsive[data-card-table] td[colspan]::before { display:none; }
}
