.safety-register {
  --safety-border: #dce6ee;
  --safety-muted: #526675;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.safety-heading,
.safety-toolbar,
.safety-dialog footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.safety-heading {
  justify-content: space-between;
}

.safety-heading h2,
.safety-dialog h3 {
  margin: 0;
  color: #12354d;
  font-size: 24px;
}

.safety-heading p {
  margin: 6px 0 0;
  color: var(--safety-muted);
}

.safety-toolbar {
  align-items: end;
}

.safety-toolbar label,
.safety-dialog label {
  display: grid;
  gap: 5px;
  color: #28485e;
  font-weight: 600;
}

.safety-search {
  width: min(100%, 300px);
}

.safety-register input:not([type="checkbox"]),
.safety-register select {
  min-width: 0;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #c7d7e4;
  border-radius: 6px;
  background: white;
  color: #12354d;
  font: inherit;
  font-weight: 400;
}

.safety-notice {
  margin: 0;
  color: var(--safety-muted);
}

.safety-notice:empty {
  display: none;
}

.safety-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--safety-border);
  border-radius: 12px;
  background: white;
}

.safety-table {
  width: 100%;
  min-width: 800px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.safety-table :is(th, td) {
  padding: 14px 12px;
  border-bottom: 1px solid var(--safety-border);
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

.safety-table thead th {
  background: #eef5fa;
  color: #224359;
}

.safety-table tr > :first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 23%;
}

.safety-table tbody th {
  background: white;
  color: #12354d;
}

.safety-table tbody tr:nth-child(even) > * {
  background: #f7fafc;
}

.safety-table tbody tr:last-child > * {
  border-bottom: none;
}

.safety-action-heading {
  width: 74px;
}

.safety-table small,
.safety-table time {
  display: block;
  margin-top: 5px;
}

.safety-table small {
  color: var(--safety-muted);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.safety-table time {
  font-variant-numeric: tabular-nums;
}

.safety-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #eef3f7;
  color: #526675;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.safety-status--current { color: #17633d; background: #e3f5eb; }
.safety-status--soon { color: #785000; background: #fff1cb; }
.safety-status--expired { color: #9f282d; background: #ffe8e7; }
.safety-status--unknown { color: #43517a; background: #eaf0fc; }

.safety-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--safety-border);
  border-radius: 14px;
  background: white;
  color: #12354d;
}

.safety-dialog::backdrop { background: rgb(13 38 60 / 55%); }

.safety-dialog form,
.safety-editor-fields,
.safety-editor-fields fieldset {
  display: grid;
  gap: 12px;
}

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

.safety-editor-fields fieldset {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--safety-border);
  border-radius: 8px;
}

.safety-editor-fields legend {
  padding: 0 4px;
  color: #12354d;
  font-weight: 700;
}

.safety-dialog .safety-checkbox {
  display: flex;
  align-items: center;
  gap: 7px;
}

.safety-dialog footer { justify-content: flex-end; }

@media (max-width: 560px) {
  .safety-table { min-width: 735px; }
  .safety-table tr > :first-child { width: 142px; }
  .safety-editor-fields { grid-template-columns: 1fr; }
}

