:root {
  --paper: #f4f7f5;
  --surface: #ffffff;
  --ink: #172522;
  --muted: #61716d;
  --faint: #879590;
  --line: #d8e1de;
  --line-strong: #bdcbc6;
  --teal: #0d766e;
  --teal-deep: #085b56;
  --teal-wash: #e5f3f0;
  --amber: #a86f14;
  --amber-wash: #fbf2df;
  --danger: #ae3846;
  --danger-wash: #faeaec;
  --disabled: #87918e;
  --shadow: 0 18px 55px rgba(23, 37, 34, 0.13);
  --font-body: "Be Vietnam Pro", "Avenir Next", "Segoe UI", sans-serif;
  --font-data: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

:focus-visible {
  outline: 3px solid rgba(13, 118, 110, 0.26);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 25px 18px 18px;
  background: #102a27;
  border-right: 1px solid #29433f;
  color: #e6f1ee;
}

.brand,
.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
}

.brand-mark path:first-child {
  fill: var(--teal);
  stroke: none;
}

.brand-mark path:not(:first-child),
.brand-mark circle {
  fill: none;
  stroke: #d9f1ec;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.brand span,
.login-brand span {
  display: grid;
  gap: 1px;
}

.brand b,
.login-brand b {
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.085em;
}

.brand small,
.login-brand small {
  color: #9eb5b0;
  font-family: var(--font-data);
  font-size: 0.63rem;
  letter-spacing: 0.11em;
}

.nav-list {
  display: grid;
  gap: 4px;
  margin-top: 47px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: #b8cbc7;
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.nav-link svg,
.button svg,
.icon-button svg,
.search-field svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.045);
}

.nav-link.is-active {
  color: white;
  background: #1b3b36;
  border-color: #31514c;
  box-shadow: inset 3px 0 0 #49b7aa;
}

.sidebar-foot {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px 11px;
  border-top: 1px solid #314b47;
  color: #dce8e5;
}

.sidebar-foot > span:last-child {
  display: grid;
  gap: 2px;
}

.sidebar-foot b {
  font-size: 0.74rem;
}

.sidebar-foot small {
  color: #91aaa5;
  font-size: 0.66rem;
}

.system-dot {
  width: 9px;
  height: 9px;
  border: 2px solid #102a27;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.system-dot.is-online {
  background: #54c69e;
}

.system-dot.is-error {
  background: #ef7180;
}

.workspace {
  width: 100%;
  min-width: 0;
  max-width: 1540px;
  margin: 0 auto;
  padding: 0 34px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  min-height: 91px;
  border-bottom: 1px solid var(--line);
}

.page-heading {
  margin-right: auto;
}

.page-heading p,
.eyebrow {
  margin: 0 0 3px;
  color: var(--teal);
  font-family: var(--font-data);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.owner-identity {
  display: flex;
  align-items: center;
  gap: 9px;
}

.owner-identity > span:first-child {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  background: var(--ink);
  color: white;
  font-family: var(--font-data);
  font-size: 0.78rem;
  font-weight: 700;
}

.owner-identity > span:last-child {
  display: grid;
  gap: 1px;
}

.owner-identity b {
  font-size: 0.75rem;
}

.owner-identity small {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  text-overflow: ellipsis;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 720;
  transition: transform 120ms ease, background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button {
  min-height: 38px;
  gap: 8px;
  padding: 0 14px;
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button-primary {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.button-primary:hover {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
}

.button-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
}

.button-secondary:hover,
.button-quiet:hover {
  background: var(--teal-wash);
  border-color: #a8cbc4;
  color: var(--teal-deep);
}

.button-danger {
  color: white;
  background: var(--danger);
  border-color: var(--danger);
}

.button-block {
  width: 100%;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
}

.mobile-nav-button {
  display: none;
  margin-right: 13px;
}

.route-view {
  padding-top: 30px;
}

.rail-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.36fr) minmax(400px, 0.64fr);
  gap: 46px;
  align-items: end;
  padding: 27px 30px 25px;
  border: 1px solid #b9d3cd;
  background: #eaf4f1;
}

.section-copy h2,
.section-bar h2,
.dialog-head h2,
.confirm-dialog h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 780;
  letter-spacing: -0.025em;
}

.section-copy > p:last-child,
.section-bar p,
.confirm-dialog p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

.key-rail {
  min-width: 0;
}

.rail-track {
  display: flex;
  gap: 3px;
  height: 19px;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.77);
  background: white;
  box-shadow: 0 0 0 1px #b8cec8;
}

.rail-segment {
  min-width: 5px;
  height: 100%;
  transform-origin: left;
  animation: rail-in 500ms cubic-bezier(0.2, 0.75, 0.3, 1) both;
}

.rail-segment.available { background: #55b9a8; }
.rail-segment.active { background: var(--teal-deep); }
.rail-segment.revoked { background: var(--danger); }
.rail-segment.expired { background: #899692; }

.rail-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.rail-legend div {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 0 7px;
  align-items: center;
}

.rail-legend i {
  grid-row: 1 / 3;
  width: 7px;
  height: 19px;
  border-radius: 1px;
}

.rail-legend b {
  font-family: var(--font-data);
  font-size: 0.82rem;
}

.rail-legend small {
  color: var(--muted);
  font-size: 0.62rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.metric {
  display: grid;
  min-width: 0;
  padding: 19px 22px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.metric strong {
  margin: 7px 0 3px;
  font-family: var(--font-data);
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: -0.05em;
}

.metric small {
  overflow: hidden;
  color: var(--faint);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-section {
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-height: 77px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 155px 170px auto;
  gap: 8px;
  padding: 11px 12px;
  background: #f8faf9;
  border-bottom: 1px solid var(--line);
}

input,
select {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  outline: none;
  background: var(--surface);
  font-size: 0.76rem;
}

input:hover,
select:hover {
  border-color: #8eaaa4;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 118, 110, 0.1);
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  top: 10px;
  left: 11px;
  width: 17px;
  color: var(--muted);
}

.search-field input {
  padding-left: 37px;
}

.table-wrap {
  min-height: 244px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  height: 49px;
  padding: 8px 13px;
  border-bottom: 1px solid #e5ebe9;
  text-align: left;
  vertical-align: middle;
}

th {
  height: 37px;
  background: #fbfcfc;
  color: var(--muted);
  font-family: var(--font-data);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

th:first-child { width: 30%; }
th:nth-child(2) { width: 11%; }
th:nth-child(3) { width: 14%; }
th:nth-child(4) { width: 15%; }
th:nth-child(5) { width: 16%; }
th:last-child { width: 14%; }

tbody tr {
  transition: background-color 100ms ease;
}

tbody tr:hover {
  background: #f8fbfa;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td {
  color: #40504c;
  font-size: 0.72rem;
}

.key-cell {
  min-width: 0;
}

.key-cell button {
  display: block;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font-data);
  font-size: 0.72rem;
  font-weight: 650;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-cell small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.61rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.badge-available { color: var(--teal); background: #eef8f6; }
.badge-active { color: var(--teal-deep); background: var(--teal-wash); }
.badge-revoked { color: var(--danger); background: var(--danger-wash); }
.badge-expired { color: #697571; background: #f0f3f2; }

.type-label {
  color: var(--muted);
  font-family: var(--font-data);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.row-action {
  min-height: 29px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: white;
  color: var(--ink);
  font-size: 0.63rem;
  font-weight: 700;
}

.row-action:hover {
  border-color: #91aaa5;
  background: var(--teal-wash);
}

.row-action.is-danger {
  color: var(--danger);
}

.align-right {
  text-align: right;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 55px;
  padding: 8px 13px;
  border-top: 1px solid var(--line);
}

.pagination p {
  color: var(--muted);
  font-size: 0.67rem;
}

.pagination > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pagination .icon-button {
  width: 30px;
  height: 30px;
}

.pagination span {
  min-width: 26px;
  font-family: var(--font-data);
  font-size: 0.72rem;
  text-align: center;
}

.empty-state {
  padding: 52px 20px;
  text-align: center;
}

.empty-glyph {
  display: inline-grid;
  width: 39px;
  height: 39px;
  place-items: center;
  margin-bottom: 11px;
  border: 1px solid var(--line-strong);
  color: var(--teal);
  font-family: var(--font-data);
  font-weight: 700;
}

.empty-state h3 {
  margin: 0;
  font-size: 0.82rem;
}

.empty-state p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.loading-row td {
  height: 58px;
}

.loading-line {
  height: 8px;
  border-radius: 10px;
  background: linear-gradient(90deg, #eef2f0 25%, #e2e9e6 45%, #eef2f0 65%);
  background-size: 240% 100%;
  animation: loading 1.3s infinite linear;
}

.audit-section {
  margin-top: 0;
}

.audit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.audit-item {
  display: grid;
  grid-template-columns: 112px 15px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.audit-item time {
  color: var(--muted);
  font-family: var(--font-data);
  font-size: 0.64rem;
  line-height: 1.5;
}

.audit-marker {
  position: relative;
  width: 9px;
  height: 9px;
  margin-top: 3px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}

.audit-marker::after {
  position: absolute;
  top: 10px;
  left: 2px;
  width: 1px;
  height: 38px;
  background: var(--line);
  content: "";
}

.audit-item:last-child .audit-marker::after {
  display: none;
}

.audit-copy b {
  display: block;
  margin-bottom: 4px;
  font-size: 0.73rem;
}

.audit-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.5;
}

.audit-actor {
  color: var(--faint);
  font-size: 0.62rem;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(330px, 0.7fr) minmax(520px, 1.3fr);
  min-height: 100vh;
  background: var(--surface);
}

.login-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 36px 42px 50px;
  overflow: hidden;
  background: #102a27;
  color: white;
}

.login-aside::after {
  position: absolute;
  right: -80px;
  bottom: -140px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(119, 195, 181, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(72, 149, 136, 0.06), 0 0 0 140px rgba(72, 149, 136, 0.035);
  content: "";
}

.login-aside > p {
  position: relative;
  z-index: 1;
  margin: auto 0 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 1.04;
}

.login-rail {
  display: flex;
  gap: 3px;
  width: min(370px, 85%);
  height: 15px;
  margin-top: 70px;
  border: 3px solid rgba(255, 255, 255, 0.18);
}

.login-rail span { flex: 1; background: #4db4a5; }
.login-rail span:nth-child(3n) { background: #d6a34e; }
.login-rail span:nth-child(5n) { background: #bc5260; }

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
  background: var(--paper);
}

.login-form {
  width: min(100%, 410px);
}

.login-form h1 {
  margin: 8px 0 0;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 780;
  letter-spacing: -0.055em;
}

.login-lead {
  margin: 13px 0 33px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.login-form label,
.form-grid label {
  display: grid;
  gap: 7px;
  margin-bottom: 17px;
  color: #394a46;
  font-size: 0.7rem;
  font-weight: 700;
}

.login-form input {
  height: 46px;
  font-size: 0.84rem;
}

.login-form .button {
  height: 46px;
  margin-top: 6px;
}

.login-note {
  display: block;
  margin-top: 17px;
  color: var(--faint);
  font-size: 0.62rem;
  line-height: 1.5;
  text-align: center;
}

.form-error {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-left: 3px solid var(--danger);
  background: var(--danger-wash);
  color: #872b36;
  font-size: 0.69rem;
  line-height: 1.5;
}

dialog {
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(10, 28, 25, 0.53);
  backdrop-filter: blur(2px);
}

.modal,
.confirm-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.dialog-shell {
  padding: 25px;
  background: white;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 24px;
}

.dialog-head .icon-button {
  flex: 0 0 auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 15px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

.form-grid label span {
  color: var(--faint);
  font-weight: 500;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.secret-modal {
  width: min(760px, calc(100vw - 28px));
}

.one-time-warning {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-left: 3px solid var(--amber);
  background: var(--amber-wash);
  color: #6f4c13;
  font-size: 0.7rem;
}

.one-time-warning span {
  color: #82652f;
}

.secret-list {
  max-height: 330px;
  margin: 15px 0 0;
  padding: 15px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #f7f9f8;
  color: #153d38;
  font-family: var(--font-data);
  font-size: 0.69rem;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
}

.split-actions {
  justify-content: space-between;
}

.split-actions > div {
  display: flex;
  gap: 7px;
}

.drawer-dialog {
  width: min(520px, 100vw);
  height: 100vh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line-strong);
  box-shadow: -18px 0 55px rgba(23, 37, 34, 0.14);
}

.drawer-dialog[open] {
  animation: drawer-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.drawer-shell {
  min-height: 100%;
  padding: 24px;
  background: white;
}

.drawer-content {
  display: grid;
  gap: 23px;
}

.detail-key {
  padding: 14px;
  border: 1px solid #b7d1cb;
  background: var(--teal-wash);
  color: var(--teal-deep);
  font-family: var(--font-data);
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.6;
  word-break: break-all;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.detail-grid div {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-grid span,
.drawer-section h3 {
  color: var(--muted);
  font-family: var(--font-data);
  font-size: 0.61rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.detail-grid b {
  align-self: end;
  font-size: 0.73rem;
}

.drawer-section h3 {
  margin: 0 0 10px;
}

.activation-list {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.activation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.activation-item b,
.activation-item small {
  display: block;
}

.activation-item b {
  overflow: hidden;
  font-family: var(--font-data);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activation-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.61rem;
}

.confirm-dialog {
  width: min(440px, calc(100vw - 28px));
}

.confirm-dialog h2 {
  margin-top: 7px;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  width: min(340px, calc(100vw - 36px));
  gap: 8px;
}

.toast {
  display: grid;
  grid-template-columns: 5px 1fr;
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-strong);
  background: white;
  box-shadow: 0 10px 25px rgba(23, 37, 34, 0.12);
  font-size: 0.7rem;
  animation: toast-in 180ms ease-out;
}

.toast::before {
  width: 5px;
  height: 100%;
  min-height: 24px;
  background: var(--teal);
  content: "";
}

.toast.is-error::before {
  background: var(--danger);
}

@keyframes rail-in {
  from { opacity: 0; transform: scaleX(0); }
}

@keyframes loading {
  to { background-position: -240% 0; }
}

@keyframes drawer-in {
  from { transform: translateX(25px); opacity: 0; }
}

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: 228px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: 15px 0 40px rgba(6, 25, 22, 0.25);
  }

  .app-shell.nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-nav-button {
    display: inline-flex;
  }

  .rail-section {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .login-screen {
    grid-template-columns: minmax(270px, 0.65fr) minmax(460px, 1.35fr);
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 0 14px 35px;
  }

  .topbar {
    min-height: 74px;
  }

  .page-heading p,
  .owner-identity,
  .button-quiet#logoutButton {
    display: none;
  }

  .route-view {
    padding-top: 15px;
  }

  .rail-section {
    padding: 21px;
  }

  .rail-legend {
    grid-template-columns: 1fr 1fr;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  table {
    min-width: 790px;
  }

  .login-screen {
    display: block;
    min-height: 100vh;
    background: var(--paper);
  }

  .login-aside {
    min-height: 190px;
    padding: 23px;
  }

  .login-aside > p {
    margin-top: 40px;
    font-size: 1.65rem;
  }

  .login-rail {
    display: none;
  }

  .login-panel {
    padding: 42px 22px;
  }

  .split-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .split-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .audit-item {
    grid-template-columns: 15px minmax(0, 1fr);
  }

  .audit-item time,
  .audit-actor {
    grid-column: 2;
  }
}

@media (max-width: 480px) {
  .section-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .section-bar .button {
    width: 100%;
  }

  .filters,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .search-field,
  .form-grid .full-width {
    grid-column: auto;
  }

  .metric {
    padding: 16px;
  }

  .dialog-shell,
  .drawer-shell {
    padding: 18px;
  }

  .drawer-dialog {
    width: 100vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
