.adm, .adm-form {
  --adm-ink: #183f36;
  --adm-muted: #536c62;
  --adm-rule: #d9e4dc;
  --adm-accent: #17624c;
  --adm-fill: #f1f6f1;
  color: var(--adm-ink);
  min-width: 0;
}
.adm { display: grid; gap: 22px; }
.adm h1, .adm h2, .adm p { margin: 0; }
.adm h1 { font-size: clamp(26px,3vw,38px); line-height: 1.2; font-weight: 680; letter-spacing: -.055em; }
.adm h2 { font-size: 18px; font-weight: 650; letter-spacing: -.025em; }
.adm-head, .adm-between, .adm-filters, .adm-footer, .adm-vault-tools,
.adm-grant-actions, .adm-vault-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.adm-head, .adm-between { justify-content: space-between; gap: 16px; }
.adm-head { padding: 5px 0; }
.adm-head p { margin-top: 8px; }
.adm-muted, .adm-chart-note { color: #556e63; font-size: 13px; line-height: 1.6; }
.adm-box, .adm-kpi { min-width: 0; border: 1px solid var(--adm-rule); border-radius: 18px; background: #fff; }
.adm-box { padding: clamp(16px,2.1vw,26px); }
.adm-btn, .adm a.adm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 37px;
  padding: 7px 13px; border: 1px solid #cfddd4; border-radius: 9px; background: #fff;
  color: #284e3e; font: inherit; font-size: 13px; font-weight: 590; text-decoration: none;
  line-height: 1.4; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.adm-btn:hover, .adm a.adm-btn:hover { border-color: #86ac98; background: #f1f7f1; }
.adm-btn.adm-primary { border-color: #165944; background: #165944; color: #fff; }
.adm-btn.adm-primary:hover { background: #104934; border-color: #104934; }
.adm-btn:disabled { opacity: .45; cursor: default; }
.adm-scroll, .adm-grant-area { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.adm-scroll { margin-top: 15px; }
.adm table, .adm-grants { border-collapse: collapse; width: 100%; color: var(--adm-ink); font-size: 13px; }
.adm th, .adm td { padding: 13px 10px; border-bottom: 1px solid #e5ece6; text-align: left; line-height: 1.55; }
.adm th, .adm-grants th { background: #f1f5f1; color: #536a5f; font-size: 12px; white-space: nowrap; font-weight: 600; }
.adm td { vertical-align: middle; }
.adm tr:last-child td { border-bottom-color: transparent; }
.adm tbody tr:hover, .adm-grants tbody tr:hover { background: #f8faf7; }
.adm-identity { display: flex; align-items: center; gap: 10px; }
.adm-avatar { display: inline-grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 11px; background: #e6eee4; color: #345b41; font-weight: 700; }
.adm-tag { display: inline-block; white-space: nowrap; padding: 3px 8px; border-radius: 6px; color: #4c6155; background: #edf2ed; font-size: 12px; }
.adm-tag.admin { background: #dff3e6; color: #22613f; }
.adm-tag.empty { background: #f9eed6; color: #7a531b; }
.adm-vault-filters { margin: 17px 0 8px; }
.adm select, .adm-vault-search, .adm-form select, .adm-form input:not([type="checkbox"]) {
  min-height: 39px; min-width: 0; max-width: 100%; padding: 7px 11px;
  border: 1px solid #cad8ce; border-radius: 8px; background-color: #fff; color: #254937;
  font: inherit; font-size: 13px;
}
.adm-vault-search { flex: 1 1 220px; }
.adm-filters label, .adm-form label, .adm-form legend { color: #365742; font-size: 13px; }
.adm-filters label { display: flex; align-items: center; gap: 6px; }
.adm-metrics, .adm-charts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.adm-charts { grid-template-columns: repeat(2,minmax(0,1fr)); }
.adm-kpi { padding: 18px 22px; text-align: left; }
.adm-kpi > span { font-size: 13px; color: var(--adm-muted); }
.adm-kpi strong { display: block; margin-top: 5px; color: #174c35; font-size: clamp(26px,3vw,39px); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
button.adm-kpi { position: relative; cursor: pointer; transition: border-color .15s, background .15s; }
button.adm-kpi:hover { border-color: #8ba992; }
button.adm-kpi[aria-pressed="true"] { border-color: #538266; background: #e8f3e9; }
button.adm-kpi[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 15px; right: 16px; font-size: 15px; color: #286344; }
.adm-trend { display: flex; gap: 8px; height: 155px; margin-top: 17px; padding: 3px 0; }
.adm-day { display: flex; flex-direction: column; flex: 1; justify-content: end; align-items: center; min-width: 0; gap: 4px; font-size: 11px; color: #526b59; font-variant-numeric: tabular-nums; }
.adm-day b { color: #315b44; }
.adm-day i { width: min(100%,31px); background: #54996e; border-radius: 4px 4px 0 0; }
.adm-day:last-child i { background: #2c6447; }
.adm .adm-chart-note { margin-top: 10px; font-size: 12px; }
.adm-rank { display: grid; gap: 13px; margin-top: 18px; }
.adm-line { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 10px; font-size: 13px; }
.adm-line span { overflow-wrap: anywhere; }
.adm-track { grid-column: span 2; background: #edf2eb; height: 5px; border-radius: 6px; overflow: hidden; }
.adm-track i { display: block; height: 100%; background: #71a082; border-radius: inherit; }
.adm td.adm-empty, .adm-empty { color: #5e7063; padding: 28px 10px; text-align: center; font-size: 13px; }
.adm .adm-chart-empty { padding: 55px 8px; }
.adm-vault-entry { display: block; overflow-wrap: anywhere; max-width: 42ch; font-size: 12px; }
.adm-vault td:first-child { min-width: 140px; }
.adm-form { display: grid; gap: 15px; }
.adm-field { display: grid; gap: 6px; }
.adm-form fieldset { min-width: 0; margin: 0; border: 1px solid var(--adm-rule); border-radius: 13px; padding: 12px; }
.adm-form legend { padding: 0 6px; font-weight: 650; }
.adm-form .adm-grant-search { width: 100%; }
.adm-grant-actions { margin: 9px 0; }
.adm-grant-actions .adm-btn, .adm-grant-actions select { min-height: 33px; font-size: 12px; }
.adm-selection { margin: 11px 0 6px; color: #496650; font-size: 12px; line-height: 1.6; }
.adm-grants th, .adm-grants td { padding: 8px 5px; border-bottom: 1px solid #e1e9e1; text-align: center; }
.adm-grants th:first-child, .adm-grants td:first-child { text-align: left; }
.adm-grants thead { position: sticky; top: 0; z-index: 1; }
.adm-grants td:first-child small { display: block; color: var(--adm-muted); font-size: 11px; }
.adm-grants input { width: 18px; height: 18px; accent-color: #256842; cursor: pointer; }
.adm-grant-area { max-height: min(40vh,400px); }
.adm-form .adm-error { color: #a42b24; font-size: 13px; margin: 0; }
.adm-form [hidden], .adm [hidden] { display: none; }
.adm-footer { justify-content: flex-end; }
.adm .adm-footer { margin-top: 13px; }
.adm :is(button, a, input, select):focus-visible, .adm-form :is(button, input, select):focus-visible { outline: 3px solid #78a78c; outline-offset: 2px; }
dialog:has(#adm-user-form) { width: min(710px,95vw); }
@media (max-width: 760px) {
  .adm-charts { grid-template-columns: 1fr; }
  .adm { gap: 15px; }
  .adm-metrics { gap: 7px; }
  .adm-kpi { padding: 14px 12px; }
  .adm-kpi > span { font-size: 12px; }
  button.adm-kpi[aria-pressed="true"]::after { top: auto; bottom: 9px; right: 9px; font-size: 12px; }
  .adm table { min-width: 510px; }
  .adm-vault table { min-width: 650px; }
}
@media (max-width: 500px) {
  .adm-head { align-items: flex-start; }
  .adm-box { padding: 14px; border-radius: 13px; }
  .adm-grants { font-size: 12px; }
  .adm-grants th, .adm-grants td { padding: 8px 3px; }
  .adm-grant-actions { gap: 5px; }
  .adm-filters { gap: 7px; }
  .adm-vault-search { flex-basis: 100%; }
  .adm-vault-filters select { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .adm *, .adm-form * { transition: none !important; animation: none !important; }
}

.adm-log-filters {
  display: grid; grid-template-columns: minmax(170px, 2fr) repeat(3, minmax(94px, 1fr)) auto;
  align-items: end; gap: 12px;
}
.adm-log-filters label { display: grid; gap: 6px; min-width: 0; color: var(--adm-muted); font-size: 13px; }
.adm-log-filters :is(input, select) { width: 100%; }
.adm-log-query input {
  min-height: 39px; min-width: 0; border: 1px solid #cad8ce; border-radius: 8px;
  padding: 7px 11px; font: inherit; color: var(--adm-ink); background: #fff;
}
.adm-log-filters button { min-height: 39px; }
.adm-stat-results { display: grid; gap: 20px; min-width: 0; }
@media (max-width: 1050px) {
  .adm-log-filters { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .adm-log-query { grid-column: span 2; }
}
@media (max-width: 560px) {
  .adm-log-filters { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .adm-log-query { grid-column: 1/-1; }
  .adm-stat-results { gap: 14px; }
}
