:root {
  --page: #eef3f6;
  --surface: #ffffff;
  --surface-alt: #f7fafb;
  --ink: #1e2933;
  --muted: #627180;
  --line: #d6dee5;
  --line-strong: #bbc8d2;
  --teal: #0f6c81;
  --teal-dark: #0a5263;
  --teal-soft: #e5f4f7;
  --green: #237a57;
  --green-soft: #eaf7f0;
  --amber: #9a5b05;
  --amber-soft: #fff3d6;
  --red: #a33a32;
  --red-soft: #fff0ee;
  --navy: #172536;
  --shadow: 0 14px 34px rgba(23, 37, 54, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
  background: var(--page);
}

a {
  color: inherit;
}

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

button,
.button {
  min-width: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 2rem;
  line-height: 1.15;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.28rem;
  line-height: 1.25;
}

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

.eyebrow {
  margin-bottom: 5px;
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

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

.button-primary:hover,
.button-primary:focus-visible {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--teal-dark);
  background: #fff;
}

.button-secondary:hover,
.button-secondary:focus-visible,
.button-quiet:hover,
.button-quiet:focus-visible {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.button-quiet {
  border-color: var(--line);
  color: #3f5060;
  background: transparent;
}

.button-danger {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

.button-danger:hover,
.button-danger:focus-visible {
  background: #842e28;
}

.button-small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.88rem;
}

.button-full {
  width: 100%;
}

.text-link {
  color: var(--teal-dark);
  font-weight: 750;
}

.alert {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.alert-success {
  border-color: #b8ddca;
  color: #185f43;
  background: var(--green-soft);
}

.alert-error {
  border-color: #e5b7b2;
  color: #7e2924;
  background: var(--red-soft);
}

.alert-warning {
  border-color: #e8cf91;
  color: #704300;
  background: var(--amber-soft);
}

.alert-info {
  border-color: #b9dbe2;
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(140deg, rgba(15, 108, 129, 0.11), transparent 42%),
    var(--page);
}

.auth-shell {
  display: grid;
  width: min(440px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  align-content: center;
  gap: 16px;
  padding: 28px 0;
}

.back-link {
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.auth-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 1.65rem;
}

.auth-mark,
.app-brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal), var(--green));
}

.auth-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.auth-intro {
  margin-bottom: 22px;
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 15px;
}

.stack-form label,
.form-grid label {
  display: grid;
  gap: 6px;
}

label > span {
  color: #344556;
  font-size: 0.88rem;
  font-weight: 750;
}

label small {
  color: var(--muted);
  font-size: 0.78rem;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

input,
select {
  min-height: 42px;
  padding: 8px 11px;
}

textarea {
  min-height: 96px;
  padding: 10px 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 108, 129, 0.14);
  outline: none;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset:disabled {
  opacity: 0.66;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(360px, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 68px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 5px 18px rgba(23, 37, 54, 0.05);
}

.app-brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  text-decoration: none;
}

.app-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 7px;
}

.app-brand strong,
.app-brand small {
  display: block;
}

.app-brand small {
  color: var(--muted);
  font-size: 0.76rem;
}

.app-nav {
  display: flex;
  min-width: 0;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.app-nav a {
  padding: 9px 11px;
  border-radius: 6px;
  color: #425363;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.app-nav a:hover,
.app-nav a.active {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.account-area {
  display: flex;
  gap: 10px;
  align-items: center;
}

.account-name {
  max-width: 150px;
  overflow: hidden;
  color: #425363;
  font-size: 0.88rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.page-heading {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-heading p:last-child {
  max-width: 740px;
  margin-bottom: 0;
  color: var(--muted);
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.metric {
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

a.metric {
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease;
}

a.metric:hover,
a.metric:focus-visible {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.metrics-six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-ready {
  border-color: #acd5bf;
  background: var(--green-soft);
}

.metric-disposal {
  border-color: #d8b7b2;
  background: var(--red-soft);
}

.metric span,
.metric small,
.metric strong {
  display: block;
}

.metric span {
  color: #4d5e6e;
  font-size: 0.82rem;
  font-weight: 750;
}

.metric strong {
  margin: 6px 0 3px;
  font-size: 1.85rem;
  line-height: 1;
}

.metric small {
  color: var(--muted);
}

.metric-attention {
  border-color: #e4c57d;
  background: var(--amber-soft);
}

.data-section,
.form-section,
.activity-section,
.workflow-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.data-section,
.activity-section,
.form-section {
  padding: 22px;
}

.section-title-row {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title-row h2,
.section-title-row p {
  margin-bottom: 0;
}

.section-title-row > small,
.section-title-row > span {
  color: var(--muted);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) minmax(170px, 220px) auto auto;
  gap: 9px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

.search-field {
  min-width: 0;
}

.table-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.table-wrap,
.history-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.asset-table,
.history-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.asset-table {
  min-width: 1040px;
}

.history-table {
  min-width: 860px;
}

th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  color: #4c5d6d;
  font-size: 0.74rem;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  background: #f3f7f9;
}

td {
  padding: 12px;
  border-bottom: 1px solid #e4eaef;
  vertical-align: middle;
}

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

tbody tr:hover td {
  background: #fbfdfe;
}

td strong,
td small,
td span {
  display: block;
}

td small {
  margin-top: 2px;
  color: var(--muted);
}

.asset-identity {
  color: var(--teal-dark);
  text-decoration: none;
}

.asset-identity:hover strong {
  text-decoration: underline;
}

.serial,
.serial-input {
  font-family: Consolas, "Courier New", monospace;
}

.serial {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 27px;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
}

.status-available {
  border-color: #acd5bf;
  color: #196244;
  background: var(--green-soft);
}

.status-assigned {
  border-color: #a9d2da;
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.status-shared {
  border-color: #c8b9df;
  color: #5d397e;
  background: #f2edf9;
}

.status-wipe_pending,
.status-wiping {
  border-color: #e4c57d;
  color: #704300;
  background: var(--amber-soft);
}

.status-repair {
  border-color: #c6cdd4;
  color: #455565;
  background: #f2f4f6;
}

.status-retired,
.status-disposal,
.status-lost {
  border-color: #e0b0ab;
  color: #7c2b26;
  background: var(--red-soft);
}

.attention-text {
  color: var(--amber);
  font-weight: 750;
}

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

.empty-state {
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 1rem;
}

.activity-section {
  margin-top: 24px;
}

.activity-list {
  display: grid;
}

.activity-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-item time,
.activity-item > small {
  color: var(--muted);
  font-size: 0.82rem;
}

.activity-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.activity-item a {
  color: var(--teal-dark);
  font-weight: 750;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.check-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.check-row strong,
.check-row small {
  display: block;
}

.type-list {
  display: grid;
}

.type-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.type-row:last-child {
  border-bottom: 0;
}

.type-row strong,
.type-row span {
  display: block;
}

.type-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.85rem;
}

.type-row.is-inactive {
  opacity: 0.62;
}

.asset-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.asset-summary > div {
  min-width: 0;
  padding: 15px 17px;
  border-right: 1px solid var(--line);
}

.asset-summary > div:last-child {
  border-right: 0;
}

.asset-summary span,
.asset-summary strong,
.asset-summary small {
  display: block;
}

.asset-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.asset-summary strong {
  margin: 4px 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-summary .summary-attention {
  background: var(--amber-soft);
}

.asset-form-section {
  margin-bottom: 18px;
}

.asset-form fieldset {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 16px;
}

.compact-grid {
  gap: 12px;
}

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

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.workflow-section {
  padding: 22px;
}

.workflow-attention {
  border-color: #e4c57d;
  box-shadow: inset 4px 0 0 #d19a25;
}

.section-copy {
  color: var(--muted);
}

.current-assignment {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #b8dbe1;
  border-radius: 6px;
  background: var(--teal-soft);
}

.current-assignment strong,
.current-assignment span,
.current-assignment small {
  display: block;
}

.current-assignment span,
.current-assignment small {
  color: #496473;
}

.history-table td:nth-child(1) {
  white-space: nowrap;
}

.history-table td:nth-child(1),
.history-table td:nth-child(5) {
  color: var(--muted);
  font-size: 0.86rem;
}

.history-table td small {
  display: block;
}

.danger-section {
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid #e1b5b0;
  border-radius: 8px;
  background: var(--red-soft);
}

.danger-section h2,
.danger-section p:last-child {
  margin-bottom: 0;
}

.danger-section p:last-child {
  color: #724641;
}

.archive-alert form {
  flex: 0 0 auto;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.quick-actions a {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
  background: var(--surface);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.quick-actions a:hover,
.quick-actions a:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
  transform: translateY(-1px);
}

.quick-actions a.needs-attention {
  border-color: #d6aa4d;
  background: var(--amber-soft);
}

.quick-actions strong,
.quick-actions span {
  display: block;
}

.quick-actions strong {
  margin-bottom: 3px;
  color: var(--ink);
}

.quick-actions span {
  color: var(--muted);
  font-size: 0.82rem;
}

.workflow-form {
  display: grid;
  gap: 18px;
}

.conditional-field[hidden],
[data-storage-field][hidden],
[data-ram-field][hidden],
[data-imei-field][hidden],
[data-computer-field][hidden],
[data-wipe-detail][hidden],
[data-employee-fields][hidden],
[data-shared-fields][hidden],
[data-manual-employee-fields][hidden] {
  display: none;
}

.segmented-control {
  display: grid;
  width: min(520px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

.segmented-control label {
  position: relative;
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.segmented-control span {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.segmented-control input:checked + span {
  border-color: var(--line-strong);
  color: var(--teal-dark);
  background: #fff;
  box-shadow: 0 2px 7px rgba(23, 37, 54, 0.08);
}

.segmented-control input:focus-visible + span {
  outline: 3px solid rgba(15, 108, 129, 0.18);
}

.accessory-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 10px;
}

.accessory-heading strong,
.accessory-heading span {
  display: block;
}

.accessory-heading span {
  color: var(--muted);
  font-size: 0.82rem;
}

.accessory-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.accessory-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(170px, 1fr) minmax(130px, 0.7fr) minmax(170px, 1fr) 36px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
}

.accessory-row label {
  display: grid;
  gap: 5px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 42px;
  min-width: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--red);
  font-size: 1.35rem;
  line-height: 1;
  background: #fff;
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--red);
  background: var(--red-soft);
}

.field-note {
  display: grid;
  min-height: 42px;
  align-content: center;
  padding: 8px 11px;
  border: 1px solid #b8ddca;
  border-radius: 6px;
  color: var(--green);
  background: var(--green-soft);
}

.field-note strong,
.field-note span {
  display: block;
}

.field-note span {
  font-size: 0.78rem;
}

.compact-empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
}

.manual-return {
  margin-top: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.manual-return > summary {
  display: flex;
  min-height: 68px;
  align-items: center;
  padding: 15px 20px;
  cursor: pointer;
  list-style-position: inside;
}

.manual-return > summary strong,
.manual-return > summary small {
  display: block;
}

.manual-return > summary small {
  color: var(--muted);
}

.manual-return[open] > summary {
  border-bottom: 1px solid var(--line);
}

.manual-return-form {
  gap: 0;
}

.manual-section {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.manual-section:last-child {
  border-bottom: 0;
}

.manual-section h2 {
  margin-bottom: 16px;
}

.wipe-list {
  display: grid;
  gap: 14px;
}

.wipe-card {
  border: 1px solid var(--line);
  border-left: 4px solid #d19a25;
  border-radius: 8px;
  background: var(--surface);
}

.wipe-card.is-selected {
  box-shadow: 0 0 0 3px rgba(209, 154, 37, 0.18);
}

.wipe-card-summary {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.wipe-card-summary h2,
.wipe-card-summary p {
  margin-bottom: 0;
}

.wipe-card-summary p {
  margin-top: 5px;
  color: var(--muted);
}

.wipe-meta {
  flex: 0 0 auto;
  text-align: right;
}

.wipe-meta span,
.wipe-meta strong,
.wipe-meta small {
  display: block;
}

.wipe-meta span,
.wipe-meta small {
  color: var(--muted);
  font-size: 0.78rem;
}

.wipe-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 9px;
  align-items: end;
  padding: 14px 20px 18px;
}

.pending-disposal-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(150px, 0.8fr)) auto;
  gap: 9px;
  align-items: end;
  padding: 14px 20px;
  border-top: 1px solid #e8cf91;
  background: var(--amber-soft);
}

.pending-disposal-form > div {
  align-self: center;
}

.pending-disposal-form strong,
.pending-disposal-form > div > span {
  display: block;
}

.pending-disposal-form > div > span {
  margin-top: 2px;
  color: #704300;
  font-size: 0.78rem;
}

.pending-disposal-form label {
  display: grid;
  gap: 5px;
}

.wipe-form label {
  display: grid;
  gap: 5px;
}

.catalog-forms {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.catalog-form {
  display: grid;
  min-width: 0;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.catalog-form h2,
.catalog-form .eyebrow {
  margin-bottom: 0;
}

.catalog-form label {
  display: grid;
  gap: 5px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.catalog-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.catalog-list > div {
  min-width: 0;
  padding: 11px 12px;
  background: #fff;
}

.catalog-list strong,
.catalog-list span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-list span {
  color: var(--muted);
  font-size: 0.8rem;
}

.catalog-lists {
  margin-top: 18px;
}

.reference-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.reference-columns > div {
  display: grid;
  gap: 7px;
  align-content: start;
}

.reference-columns span {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.dashboard-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-links a {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  background: var(--surface);
}

.dashboard-links a:hover,
.dashboard-links a:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.dashboard-links strong,
.dashboard-links span {
  display: block;
}

.dashboard-links span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.inventory-control-panel {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.inventory-command-row,
.inventory-period-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.inventory-command-row {
  align-items: flex-start;
  margin-bottom: 12px;
}

.inventory-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.inventory-tabs {
  display: flex;
  min-width: 0;
  gap: 5px;
  margin: 0;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.inventory-tabs a {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.inventory-tabs a:hover,
.inventory-tabs a.active {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.inventory-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.inventory-toolbar > span {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

.period-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

.period-tabs a {
  padding: 7px 11px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.period-tabs a:hover,
.period-tabs a.active {
  color: var(--teal-dark);
  background: #fff;
  box-shadow: 0 1px 4px rgba(23, 37, 54, 0.08);
}

.calendar-navigation {
  display: flex;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
}

.calendar-navigation > strong {
  min-width: 220px;
  font-size: 0.94rem;
  text-align: center;
}

.calendar-arrow {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--teal-dark);
  font-size: 1.12rem;
  font-weight: 800;
  text-decoration: none;
  background: var(--surface);
}

.calendar-arrow:hover,
.calendar-arrow:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.calendar-today {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  margin-left: 2px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  background: var(--surface);
}

.inventory-filter,
.history-filter {
  display: grid;
  gap: 9px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

.inventory-filter {
  grid-template-columns: minmax(300px, 1fr) minmax(180px, 240px) auto;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.history-filter {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 220px) 150px 150px auto auto;
}

.inventory-filter label,
.history-filter label {
  display: grid;
  gap: 5px;
}

.inventory-table {
  min-width: 1120px;
}

.inventory-results {
  margin-top: 16px;
}

.inventory-results-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.inventory-results-summary h2 {
  margin: 0;
  font-size: 1rem;
}

.inventory-results-summary span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.device-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(410px, 1fr));
  gap: 12px;
}

.device-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 106px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 5px 14px rgba(23, 37, 54, 0.05);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.device-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 9px 22px rgba(23, 37, 54, 0.09);
  transform: translateY(-1px);
}

.device-card-visual {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: #f4f8fa;
}

.device-card-visual img {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.device-card-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 13px 14px 12px;
}

.device-card-topline {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.device-card-topline > a {
  overflow: hidden;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-card h3 {
  margin-bottom: 2px;
  overflow-wrap: anywhere;
  font-size: 1.02rem;
  line-height: 1.25;
}

.device-kind {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.device-details {
  display: grid;
  gap: 5px;
  margin: 0 0 10px;
}

.device-details > div {
  display: grid;
  min-width: 0;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 7px;
  align-items: baseline;
}

.device-details dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.device-details dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-details dd small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-card-footer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.device-card-dates {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.device-card-dates span,
.device-card-dates small,
.device-card-dates strong {
  display: block;
}

.device-card-dates small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.device-card-dates strong {
  font-size: 0.76rem;
}

.device-card-dates .date-attention strong {
  color: var(--amber);
}

.device-card-action {
  min-height: 34px;
  flex: 0 0 auto;
}

.device-card[hidden],
.device-card-grid[hidden],
.inventory-no-results[hidden] {
  display: none;
}

.inventory-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.trace-table {
  min-width: 1280px;
}

@media (max-width: 1080px) {
  .app-topbar {
    grid-template-columns: auto 1fr;
  }

  .app-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .account-area {
    justify-self: end;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions,
  .catalog-forms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 190px)) auto;
  }

  .filter-bar .button-quiet {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .asset-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-summary > div:nth-child(2) {
    border-right: 0;
  }

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

  .accessory-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) 36px;
  }

  .accessory-row .icon-button {
    grid-column: 3;
    grid-row: 1;
  }

  .wipe-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pending-disposal-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: 1.65rem;
  }

  .app-topbar {
    gap: 10px;
    padding: 9px 14px;
  }

  .app-brand small,
  .account-name {
    display: none;
  }

  .app-nav {
    margin: 0 -14px;
    padding: 2px 14px 4px;
  }

  .app-main {
    width: min(100% - 24px, 1480px);
    padding: 24px 0 40px;
  }

  .page-heading,
  .section-title-row,
  .danger-section {
    align-items: stretch;
    flex-direction: column;
  }

  .heading-actions {
    justify-content: flex-start;
  }

  .metrics,
  .quick-actions,
  .catalog-forms,
  .dashboard-links,
  .split-layout,
  .workflow-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .inventory-filter,
  .history-filter {
    grid-template-columns: 1fr;
  }

  .inventory-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-command-row,
  .inventory-period-row {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-actions,
  .inventory-actions .button {
    flex: 1 1 0;
  }

  .inventory-tabs {
    width: 100%;
  }

  .inventory-toolbar > span {
    text-align: left;
  }

  .period-tabs {
    overflow-x: auto;
  }

  .calendar-navigation {
    width: 100%;
    justify-content: center;
  }

  .calendar-navigation > strong {
    min-width: 0;
    flex: 1 1 auto;
  }

  .calendar-today {
    width: 100%;
    margin-left: 0;
    justify-content: center;
    text-align: center;
  }

  .device-card-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar .button-quiet {
    grid-column: auto;
    justify-self: stretch;
  }

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

  .data-section,
  .activity-section,
  .form-section,
  .workflow-section {
    padding: 16px;
  }

  .asset-summary {
    grid-template-columns: 1fr;
  }

  .asset-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .asset-summary > div:last-child {
    border-bottom: 0;
  }

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

  .activity-item > small {
    grid-column: 2;
  }

  .accessory-heading,
  .wipe-card-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .accessory-row,
  .wipe-form,
  .pending-disposal-form,
  .catalog-list,
  .reference-columns {
    grid-template-columns: 1fr;
  }

  .accessory-row .icon-button {
    grid-column: auto;
    grid-row: auto;
  }

  .wipe-meta {
    text-align: left;
  }

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

  .archive-alert form,
  .archive-alert .button {
    width: 100%;
  }

  .auth-panel {
    padding: 22px;
  }
}

@media (max-width: 430px) {
  .metrics {
    gap: 8px;
  }

  .metric {
    padding: 14px;
  }

  .heading-actions,
  .heading-actions .button,
  .form-actions,
  .form-actions .button,
  .danger-section .button {
    width: 100%;
  }

  .device-card {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .device-card-visual {
    padding: 10px 6px;
  }

  .device-card-visual img {
    width: 68px;
    height: 68px;
  }

  .device-card-content {
    padding: 11px;
  }

  .device-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .device-card-action {
    width: 100%;
  }
}
