:root {
  --ink: #0f172a;
  --ink-subtle: #1f2937;
  --muted: #5c6475;
  --primary: #2c4d7a;
  --primary-dark: #1b3557;
  --primary-rgb: 44, 77, 122;
  --accent: #f5b642;
  --success: #2f8a5d;
  --success-soft: #e3f5ea;
  --surface: #ffffff;
  --surface-alt: #f6f7fb;
  --surface-tint: #f9fafc;
  --border: #e1e4ee;
  --border-strong: #d3d8e6;
  --label-width: 1.5in;
  --label-height: 2.4in;
  --label-pad-x: 0.0085in;
  --label-pad-top: 0.3in;
  --label-pad-bottom: 0.005in;
  --destruction-red: #ff2b2b;
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.12);
  --shadow-strong: 0 20px 48px rgba(15, 23, 42, 0.16);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --topbar-height: 96px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fdf2d0 0%, #f6f7fb 45%, #e8edf7 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.text-link {
  color: var(--primary);
  font-weight: 600;
}

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

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0 0 0.5rem;
}

:where(.btn, .nav-link, .nav-icon, .dropdown-link, .account-trigger, .segmented-btn, .icon-btn, .warn-icon, .help-link, summary):focus-visible {
  outline: 3px solid rgba(var(--primary-rgb), 0.25);
  outline-offset: 2px;
}

p {
  margin: 0.5rem 0;
}

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

.page {
  padding: 2.5rem clamp(1.5rem, 4vw, 4rem) 4rem;
  max-width: 1480px;
  margin: 0 auto;
}

.page.wide {
  max-width: 1680px;
}

:target {
  scroll-margin-top: 7.5rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem clamp(1.5rem, 4vw, 4rem);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: grid;
  place-items: center;
}

.brand-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.brand-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-link {
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
}

.nav-link:hover {
  background: var(--surface-alt);
}

.nav-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--surface-alt);
  font-size: 1.1rem;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.notification-menu summary::-webkit-details-marker {
  display: none;
}

.notification-menu {
  position: relative;
}

.notification-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.8rem;
  min-width: 260px;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.15);
  display: none;
  z-index: 10;
}

.notification-menu[open] .notification-dropdown {
  display: block;
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.notification-title {
  font-weight: 600;
}

.notification-link {
  font-size: 0.85rem;
  color: var(--primary);
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.notification-item {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  background: var(--surface-alt);
}

.notification-item:hover {
  background: #e8edf7;
}

.notification-case {
  font-weight: 600;
}

.notification-action {
  font-size: 0.85rem;
  color: var(--muted);
}

.notification-empty {
  font-size: 0.85rem;
  color: var(--muted);
}

.nav-icon:hover {
  background: #e7ecf7;
}

.nav-bell {
  line-height: 1;
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  box-shadow: 0 6px 12px rgba(220, 38, 38, 0.35);
}

.account-menu {
  position: relative;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-trigger {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-weight: 700;
  border: none;
}

.account-initials {
  font-size: 0.95rem;
}

.account-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.8rem;
  min-width: 220px;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.15);
  display: none;
  z-index: 10;
}

.account-menu[open] .account-dropdown {
  display: block;
}

.account-meta {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.6rem;
}

.account-name {
  font-weight: 600;
}

.account-email {
  font-size: 0.85rem;
  color: var(--muted);
}

.dropdown-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.dropdown-link:hover {
  background: var(--surface-alt);
}

.dropdown-link.danger {
  color: #b91c1c;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-alt);
  color: var(--ink);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 20px rgba(var(--primary-rgb), 0.22);
}

.btn.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
}

.btn.ghost:hover {
  background: var(--surface-alt);
  border-color: rgba(var(--primary-rgb), 0.3);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.inline {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  margin-bottom: 2rem;
}

.panel.page-header {
  padding: 1.2rem 1.4rem;
  background: linear-gradient(140deg, #ffffff 0%, #f4f6fb 100%);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.panel-head.compact {
  margin-bottom: 0.6rem;
}

.panel-head h3,
.panel-head h4 {
  margin: 0;
}

.panel-head p,
.panel-head .meta {
  margin: 0.35rem 0 0;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid rgba(44, 77, 122, 0.35);
  padding-left: 0.9rem;
}

.page-title {
  font-size: 1.35rem;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.page-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 640px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--primary);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.page-head .icon-badge {
  display: none;
}

.panel.page-header .page-head {
  margin-bottom: 0;
}

.panel.page-header .icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.panel.page-header .icon-badge svg {
  width: 16px;
  height: 16px;
}

.segmented {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.2rem;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.segmented-btn {
  border: none;
  background: transparent;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.segmented-btn.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 18px rgba(var(--primary-rgb), 0.2);
}

.status-toggle {
  padding: 0.15rem;
  gap: 0.15rem;
  box-shadow: none;
}

.status-toggle .segmented-btn {
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
}

.status-toggle .segmented-btn.missing.is-active {
  background: #f59e0b;
  color: #1f2937;
  box-shadow: 0 8px 14px rgba(245, 158, 11, 0.25);
}

.status-toggle + .tag {
  margin-left: 0;
  margin-top: 0.35rem;
  display: inline-block;
}

.icon-badge svg {
  width: 18px;
  height: 18px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dashboard-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.8rem;
}

.dashboard-edit-panel {
  display: none;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  margin-bottom: 2rem;
}

.dashboard-page.dashboard-editing .dashboard-edit-panel {
  display: block;
}

.dashboard-edit-block + .dashboard-edit-block {
  margin-top: 1.2rem;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  background: var(--surface-alt);
  font-weight: 500;
}

.check-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.order-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px dashed transparent;
  cursor: grab;
  user-select: none;
}

.order-item.dragging {
  opacity: 0.65;
  border-color: rgba(var(--primary-rgb), 0.4);
  background: #eef3ff;
}

.order-handle {
  font-weight: 700;
  color: var(--muted);
  letter-spacing: -1px;
}

.dashboard-edit-actions {
  margin-top: 1.4rem;
}

.progress-card {
  display: grid;
  gap: 0.9rem;
}

.progress-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.progress-meta-right {
  text-align: right;
  display: grid;
  gap: 0.3rem;
}

.verify-year-form {
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.verify-year-form select {
  min-width: 120px;
}

.verify-year-form select,
.verification-page-size-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  min-height: 38px;
  padding: 0.42rem 2rem 0.42rem 0.78rem;
  background-color: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7a99 50%),
    linear-gradient(135deg, #6b7a99 50%, transparent 50%);
  background-position:
    calc(100% - 15px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.verify-year-form select:hover,
.verification-page-size-form select:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
  background-color: #fcfdff;
}

.verify-year-form select:focus,
.verification-page-size-form select:focus {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.14);
}

.progress-track {
  width: 100%;
  height: 12px;
  background: #e6ebf4;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(120deg, var(--primary), #4f79b1);
  border-radius: 999px;
}

.progress-foot {
  margin-top: 0.2rem;
}

.verify-page-meta {
  margin: 0;
}

.verify-batch-context {
  margin: 0;
  color: var(--ink-subtle);
  font-weight: 600;
}

.verify-scan-panel {
  margin-top: 1rem;
  margin-bottom: 0.2rem;
  padding: 0.9rem 1rem;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: grid;
  gap: 0.45rem;
}

.verify-scan-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-end;
}

.verify-scan-field {
  max-width: 460px;
}

.verify-scan-field input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.verify-scan-panel .meta {
  margin: 0;
}

.verify-scan-panel .meta.success {
  color: var(--success);
}

.verify-scan-panel .meta.warn {
  color: #b45309;
}

.verify-scan-panel .meta.error {
  color: #b91c1c;
  font-weight: 700;
}

.verification-control-dock {
  position: sticky;
  top: calc(var(--topbar-height) + 10px);
  z-index: 4;
  margin-top: 0.8rem;
  margin-bottom: 0.95rem;
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 0.9fr);
  gap: 0.8rem;
  align-items: stretch;
}

.verification-control-dock .verify-scan-panel {
  margin: 0;
}

.verify-scan-panel-compact {
  padding: 0.75rem 0.85rem;
}

.verify-scan-panel-compact .verify-scan-toolbar {
  gap: 0.6rem;
}

.verify-scan-panel-compact .verify-scan-field {
  max-width: 100%;
}

.verification-controls-card {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-tint);
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.verification-controls-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.verification-controls-copy {
  display: grid;
  gap: 0.3rem;
  min-width: 220px;
  flex: 1 1 260px;
}

.verification-nav-block {
  display: grid;
  gap: 0.45rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.1rem;
  border-bottom: 1px solid var(--border);
}

.verification-nav-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.verification-controls-card .verify-batch-nav {
  width: 100%;
  justify-content: space-between;
}

.verification-controls-card .verify-batch-nav .meta {
  margin: 0;
}

.verification-batch-jump-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.verification-batch-jump-form input[type="number"] {
  width: 84px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
  background: #fff;
  color: var(--ink);
  font-size: 0.92rem;
}

.verification-pagination {
  margin-top: 0.9rem;
}

.verification-pagination-inline {
  margin-top: 0;
  justify-content: space-between;
  flex-wrap: wrap;
}

.verify-head-primary {
  flex-wrap: wrap;
}

.verification-bulk-form {
  margin-left: auto;
}

.verification-bulk-form-docked {
  margin-left: 0;
  flex: 0 0 auto;
}

.verification-process-btn {
  white-space: nowrap;
}

.verification-list-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.8rem;
}

.verification-page-size-form {
  gap: 0.45rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.verification-page-size-form select {
  min-width: 92px;
}

.verify-batch-nav {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.verification-controls-card .btn {
  padding: 0.48rem 0.92rem;
  font-size: 0.9rem;
}

.verify-batch-nav-btn {
  min-width: 38px;
  padding-inline: 0.55rem;
}

.verify-group {
  margin-top: 1rem;
}

.verify-grid .table-row.scan-hit {
  box-shadow: 0 0 0 3px rgba(47, 138, 93, 0.24);
  border-color: rgba(47, 138, 93, 0.52);
}

.verify-group-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.verify-group .table-row div:last-child {
  text-align: left;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.3rem;
  border: 1px solid var(--border);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
}

a.card {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--primary-rgb), 0.22);
  box-shadow: var(--shadow);
}

a.card:active {
  transform: translateY(-1px);
}

.dropdown-card {
  display: grid;
  gap: 1.25rem;
}

.dropdown-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.dropdown-head form {
  min-width: min(320px, 100%);
}

.dropdown-tools {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.field-input {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  min-width: 220px;
}

.dropdown-pagination {
  margin-top: 0.6rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-title h3 {
  margin: 0;
}

.detail-meta {
  color: var(--muted);
  margin-top: 0.35rem;
}

.detail-meta.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.meta-pair {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-btn.tiny {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.detail-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.edit-identifiers {
  position: relative;
}

.edit-identifiers summary {
  list-style: none;
}

.edit-identifiers summary::-webkit-details-marker {
  display: none;
}

.edit-identifiers form {
  position: absolute;
  left: 0;
  top: calc(100% + 0.6rem);
  min-width: 260px;
  max-width: min(360px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
  z-index: 10;
}

.btn.icon {
  padding: 0.55rem 1rem;
  gap: 0.5rem;
}

.btn.icon svg {
  width: 16px;
  height: 16px;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.section-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.dashboard-grid {
  margin-bottom: 2.8rem;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 500;
  position: relative;
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  font-size: 0.96rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.field input.field-error,
.field select.field-error,
.field textarea.field-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.field-inline-error {
  margin-top: -0.25rem;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
  color: #b91c1c;
}

.field textarea {
  resize: vertical;
}

.help-text {
  font-size: 0.85rem;
  color: #6b7a99;
}

.markdown {
  font-size: 0.98rem;
  line-height: 1.65;
  color: #1f2a44;
}

.markdown h1,
.markdown h2,
.markdown h3 {
  margin: 1.6rem 0 0.6rem;
  color: #122033;
}

.markdown h2 {
  font-size: 1.2rem;
}

.markdown h3 {
  font-size: 1.05rem;
}

.markdown p {
  margin: 0.6rem 0;
}

.markdown ul {
  margin: 0.6rem 0 1rem;
  padding-left: 1.4rem;
}

.markdown li {
  margin: 0.3rem 0;
}

.markdown hr {
  border: 0;
  border-top: 1px solid #e2e8f6;
  margin: 1.8rem 0;
}

.markdown code {
  background: #eef2fb;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  font-size: 0.9em;
}

.markdown pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 14px;
  overflow: auto;
  margin: 0.9rem 0 1.4rem;
}

.markdown pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.markdown blockquote {
  border-left: 3px solid #3b82f6;
  padding-left: 0.8rem;
  color: #3b4a66;
  margin: 0.8rem 0;
}

.help-panel {
  padding-bottom: 0;
}

.help-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.help-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  padding: 16px;
  border-radius: 16px;
  background: #f6f8fe;
  border: 1px solid #e3e9f7;
}

.help-search {
  position: relative;
  margin-bottom: 16px;
}

.help-search input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #d8e0f3;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #fff;
}

.help-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e1e8f6;
  border-radius: 12px;
  box-shadow: 0 16px 30px -24px rgba(15, 23, 42, 0.35);
  z-index: 5;
  max-height: 320px;
  overflow: auto;
}

.help-search-results.is-active {
  display: block;
}

.help-result {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: #1f2a44;
  border-bottom: 1px solid #eef2fb;
}

.help-result:last-child {
  border-bottom: none;
}

.help-result-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.help-result-meta {
  font-size: 0.8rem;
  color: #6b7a99;
}

.help-result.empty {
  color: #7a879f;
}

.help-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7a99;
  margin-bottom: 6px;
}

.help-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #1f2a44;
  border: 1px solid transparent;
}

.help-link:hover {
  background: #eef2fb;
}

.help-link.is-active {
  background: #1f3c88;
  color: #fff;
  border-color: #1f3c88;
}

.help-link.is-active .help-link-summary {
  color: rgba(255, 255, 255, 0.7);
}

.help-link-summary {
  font-size: 0.8rem;
  color: #6b7a99;
}

.help-content {
  padding-bottom: 24px;
}

.help-breadcrumbs {
  font-size: 0.85rem;
  color: #6b7a99;
  display: flex;
  gap: 8px;
  align-items: center;
}

.help-header h1 {
  margin: 12px 0 6px;
  font-size: 1.6rem;
}

.help-summary {
  color: #5d6b86;
  margin-bottom: 18px;
}

.help-content .markdown h1:first-child {
  display: none;
}

@media (max-width: 960px) {
  .help-layout {
    grid-template-columns: 1fr;
  }
  .help-sidebar {
    position: static;
  }
}

.field.is-saved input,
.field.is-saved select,
.field.is-saved textarea {
  border-color: rgba(47, 138, 93, 0.55);
  box-shadow: 0 0 0 3px rgba(47, 138, 93, 0.15);
}

.field.is-saved::after {
  content: '';
  position: absolute;
  top: 36px;
  right: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(47, 138, 93, 0.35);
  animation: pulseSoft 2.4s ease-out;
}

.field.is-saved::before {
  content: '';
  position: absolute;
  top: 40px;
  right: 20px;
  width: 6px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  z-index: 1;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 1rem;
}

.stat-card {
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  display: grid;
  gap: 0.35rem;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.integrity-stat-grid .stat-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 1rem;
}

.integrity-plain-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 1rem;
}

.integrity-plain-card {
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
}

.integrity-plain-card h5 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-subtle);
}

.integrity-plain-card p {
  margin-top: 0.4rem;
}

.integrity-tech {
  margin-top: 1rem;
}

.integrity-signature {
  margin-top: 1rem;
  word-break: break-word;
}

.integrity-signature code {
  font-size: 0.8rem;
  background: rgba(var(--primary-rgb), 0.08);
  padding: 0.12rem 0.35rem;
  border-radius: 8px;
}

.integrity-banner {
  margin-top: 1rem;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  background: #eff4ff;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}

.integrity-banner.active {
  border-color: #f59e0b;
  background: #fffbeb;
}

.integrity-banner.stale {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.integrity-banner .meta {
  margin-top: 0.25rem;
}

.integrity-mute-grid {
  align-items: end;
}

.integrity-issue-list {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
}

.integrity-issue-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafd 100%);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  padding: 0.95rem;
}

.integrity-issue-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.integrity-row-id {
  font-size: 0.9rem;
  color: #40506f;
  font-weight: 600;
}

.integrity-issue-summary-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: 1.8fr 1.2fr 0.9fr;
  gap: 0.9rem;
  align-items: flex-start;
}

.integrity-summary-block {
  min-width: 0;
}

.integrity-summary-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.integrity-compare-summary {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink-subtle);
}

.integrity-disclosure {
  margin-top: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fdfefe;
}

.integrity-disclosure summary {
  list-style: none;
  cursor: pointer;
  padding: 0.72rem 0.82rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--primary);
  background: #f1f5fd;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.integrity-disclosure summary::-webkit-details-marker {
  display: none;
}

.integrity-disclosure summary::after {
  content: '';
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid rgba(44, 77, 122, 0.9);
  border-bottom: 2px solid rgba(44, 77, 122, 0.9);
  transform: rotate(45deg);
  transition: transform 0.16s ease;
  flex: 0 0 auto;
  margin-right: 0.1rem;
}

.integrity-disclosure[open] summary {
  border-bottom: 1px solid var(--border);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.integrity-disclosure[open] summary::after {
  transform: rotate(-135deg);
}

.integrity-disclosure-body {
  display: grid;
  gap: 0.9rem;
  padding: 0.82rem;
}

.integrity-hash-table {
  display: grid;
  gap: 0.4rem 0.65rem;
  grid-template-columns:
    minmax(130px, 0.9fr)
    minmax(170px, 1fr)
    minmax(260px, 1.5fr)
    minmax(260px, 1.5fr);
  align-items: start;
}

.integrity-hash-head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 700;
}

.integrity-hash-cell {
  min-width: 0;
}

.integrity-hash-cell code {
  display: inline-block;
  width: 100%;
  font-size: 0.76rem;
  line-height: 1.34;
  overflow-wrap: anywhere;
  color: #1f2d47;
  background: #f4f7fc;
  border: 1px solid #dbe4f3;
  border-radius: 9px;
  padding: 0.36rem 0.42rem;
}

.integrity-value-label {
  font-weight: 700;
  color: var(--ink-subtle);
  padding-top: 0.36rem;
}

.integrity-chain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.75rem;
}

.integrity-chain-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.72rem;
  background: #f4f8ff;
}

.integrity-chain-panel h6 {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.integrity-chain-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.62rem;
}

.integrity-chain-item {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0.62rem;
  background: #fff;
}

.integrity-chain-item.current {
  border-color: rgba(var(--primary-rgb), 0.45);
  background: #eaf2ff;
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.1);
}

.integrity-chain-slot {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.integrity-chain-line {
  font-size: 0.79rem;
  line-height: 1.35;
  margin-top: 0.24rem;
  overflow-wrap: anywhere;
}

.integrity-chain-line code {
  font-size: 0.74rem;
}

.integrity-action-cell {
  display: grid;
  gap: 0.45rem;
  justify-items: start;
}

.integrity-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: min(520px, calc(100vw - 2rem));
  padding: 1rem;
  box-shadow: var(--shadow-strong);
}

.integrity-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.integrity-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.integrity-dialog .field {
  max-width: 100%;
}

.integrity-dialog input[name="password"] {
  max-width: 320px;
}

.integrity-restore-alert {
  border: 1px solid #fca5a5;
  border-left: 5px solid #b91c1c;
  border-radius: 12px;
  background: #fef2f2;
  color: #7f1d1d;
  padding: 0.72rem 0.82rem;
  line-height: 1.35;
  font-size: 0.9rem;
}

.integrity-restore-alert strong {
  display: block;
  margin-bottom: 0.2rem;
}

.integrity-diff-list {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
  line-height: 1.35;
  padding: 0.62rem;
  border-radius: 10px;
  border: 1px solid #e6ebf6;
  background: #f8fbff;
}

.integrity-diff-list code {
  font-size: 0.78rem;
  overflow-wrap: anywhere;
  color: #1d2c48;
}

.form-section {
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: grid;
  gap: 1rem;
}

.form-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-subtle);
}

.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.form-actions.spaced {
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
}

.search-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.6rem 0.85rem;
  font-size: 0.94rem;
  font-family: inherit;
  background: #fff;
  min-height: 44px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar input:focus {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.header-search {
  margin-top: 0.75rem;
}

.header-search input {
  flex: 1 1 360px;
  max-width: 520px;
}

.search-feedback {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: #6b7a99;
}

.search-help {
  margin-top: 0.5rem;
}

.batch-scan {
  display: grid;
  gap: 0.65rem;
}

.batch-scan-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.batch-scan-field {
  flex: 1;
  min-width: 260px;
}

.batch-scan-actions {
  display: inline-flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.batch-scan-hint {
  font-size: 0.88rem;
}

.scanner-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.batch-status {
  display: none;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  font-size: 0.88rem;
  border: 1px solid transparent;
  background: var(--surface-alt);
}

.batch-status.is-visible {
  display: block;
}

.batch-status[data-tone="success"] {
  background: var(--success-soft);
  border-color: rgba(47, 138, 93, 0.2);
  color: var(--success);
}

.batch-status[data-tone="error"] {
  background: #fee2e2;
  border-color: rgba(220, 38, 38, 0.25);
  color: #b91c1c;
}

.batch-summary {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.batch-count {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--ink-subtle);
}

.batch-empty {
  margin-top: 0.6rem;
}

.batch-divider {
  height: 1px;
  background: var(--border);
  margin: 1.2rem 0 1rem;
}

.table.wide.batch-grid .table-row {
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1fr) minmax(90px, 0.7fr) minmax(120px, 0.9fr) minmax(160px, 1.2fr) minmax(120px, 1fr) minmax(120px, 1fr) 90px;
}

.table.wide.batch-grid .table-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.scanner-mode .batch-scan-field input {
  background: var(--surface-alt);
}

.table {
  display: grid;
  gap: 0.5rem;
}

.table-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #566582;
}

.table-meta strong {
  color: #1f2a44;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
  margin-top: 1rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.table-scroll .table {
  margin-bottom: 0.25rem;
}

.table-scroll::-webkit-scrollbar {
  display: none;
}

.table.wide {
  display: inline-grid;
  min-width: 100%;
}

.table.wide .table-row {
  grid-template-columns: repeat(9, minmax(120px, 1fr)) 80px;
}

.table.wide.search-grid .table-row {
  grid-template-columns: repeat(10, minmax(110px, 1fr)) 80px;
}

.table.wide.import-grid .table-row {
  grid-template-columns: 40px repeat(7, minmax(110px, 1fr)) 110px;
}

.table.wide.import-grid .import-review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  align-items: center;
}

.table.wide.audit-grid .table-row {
  grid-template-columns:
    minmax(150px, 0.95fr)
    minmax(200px, 1.25fr)
    minmax(200px, 1.2fr)
    minmax(200px, 1.2fr)
    minmax(130px, 0.8fr)
    minmax(240px, 1.7fr)
    minmax(200px, 1.15fr);
  align-items: start;
}

.table.wide.audit-grid .table-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.audit-action,
.audit-target {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.88rem;
  color: #24324a;
}

.audit-ua {
  font-size: 0.86rem;
  line-height: 1.25;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.table.wide.audit-batch-grid .table-row {
  grid-template-columns: minmax(120px, 0.6fr) minmax(180px, 1fr) minmax(120px, 0.7fr) minmax(260px, 2fr) 110px;
}

.table.wide.audit-report-grid .table-row {
  grid-template-columns: minmax(120px, 1fr) minmax(80px, 0.7fr) minmax(110px, 0.9fr) minmax(160px, 1.2fr) minmax(140px, 1fr) minmax(110px, 0.8fr) minmax(140px, 1fr) minmax(140px, 1fr);
}

.table.wide.report-summary-grid .table-row {
  grid-template-columns: minmax(180px, 2fr) minmax(90px, 0.8fr) minmax(110px, 0.9fr) minmax(110px, 0.9fr) minmax(110px, 0.9fr) minmax(120px, 0.9fr);
}

.table.wide.destruction-report-grid .table-row {
  grid-template-columns: minmax(120px, 1fr) minmax(80px, 0.7fr) minmax(180px, 1.2fr) minmax(160px, 1.2fr) minmax(140px, 1fr) minmax(150px, 1fr);
}

.table.wide.latest-grid .table-row {
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 1fr) minmax(180px, 1.2fr) minmax(200px, 1.2fr) 110px;
}

.table.wide.notification-grid .table-row {
  grid-template-columns: minmax(110px, 0.9fr) minmax(140px, 1fr) minmax(260px, 2fr) 140px;
}

.table.wide.notification-grid .table-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.audit-batch-progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.audit-batch-track {
  width: 140px;
  height: 8px;
  background: #e6ebf4;
  border-radius: 999px;
  overflow: hidden;
}

.audit-batch-fill {
  height: 100%;
  background: linear-gradient(120deg, var(--primary), #4f79b1);
  border-radius: 999px;
}

.audit-batch-meta {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.report-page .page-head {
  margin-bottom: 1.2rem;
}

.report-grid {
  align-items: stretch;
}

.report-card {
  display: grid;
  gap: 1rem;
}

.report-card-head h4 {
  margin: 0 0 0.35rem;
}

.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}

.report-eyebrow {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 600;
}

.report-title {
  margin: 0.3rem 0 0.4rem;
  font-size: 1.45rem;
}

.report-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.report-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.report-summary {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1.2rem;
}

.report-summary-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}

.report-summary-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.report-summary-card .value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 0.35rem;
}

.report-section {
  margin-top: 1.4rem;
}

.field.compact select {
  min-width: 160px;
}

.notification-action .meta {
  margin-top: 0.25rem;
}

.table.wide.notification-grid .inline {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.table.wide.notification-grid .inline .btn {
  white-space: nowrap;
  min-width: 96px;
  justify-content: center;
}

.table.wide.action-grid .table-row {
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.4fr) minmax(220px, 2fr) minmax(160px, 1.2fr) 140px;
  align-items: flex-start;
}

.table.wide.action-grid .table-row > div {
  min-width: 0;
}

.action-list {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 1.4rem;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(220px, 2.2fr) minmax(200px, 1.1fr) minmax(150px, 0.9fr) 84px;
  gap: 1rem;
  align-items: center;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  background: var(--surface-alt);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.04);
}

.action-row.is-complete {
  background: #f2f7f3;
}

.action-main {
  min-width: 0;
}

.action-title {
  font-weight: 600;
  font-size: 0.98rem;
}

.action-sub {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.action-notes {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.action-date-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
}

.action-date-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.date-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.date-label svg {
  width: 14px;
  height: 14px;
}

.action-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.action-status .meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.action-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.action-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
}

.date-input {
  border: none;
  padding: 0;
  font-size: 0.85rem;
  background: transparent;
  font-family: inherit;
  width: 120px;
}

.date-input.full {
  width: 100%;
}

.date-input:focus {
  outline: none;
}

.date-chip:focus-within {
  border-color: rgba(var(--primary-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.action-form .date-input.full {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  background: #fff;
}

.action-form .date-input.full:focus {
  border-color: rgba(var(--primary-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.chip-icon svg {
  width: 16px;
  height: 16px;
}

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1f2937;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn.primary {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 18px rgba(var(--primary-rgb), 0.25);
}

.icon-btn.ghost:hover {
  background: var(--surface-alt);
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.15);
}

.icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, -4px);
  background: #0f172a;
  color: #fff;
  font-size: 0.75rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}

.icon-btn[data-tooltip]::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  z-index: 199;
}

.icon-btn[data-tooltip]:hover::after,
.icon-btn[data-tooltip]:focus::after,
.icon-btn[data-tooltip]:focus-visible::after,
.icon-btn[data-tooltip]:hover::before,
.icon-btn[data-tooltip]:focus::before,
.icon-btn[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.icon-btn[data-tooltip]:hover,
.icon-btn[data-tooltip]:focus,
.icon-btn[data-tooltip]:focus-visible {
  z-index: 50;
}

.app-tooltip-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2147483000;
  overflow: visible;
}

.app-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  max-width: 280px;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.3;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.24);
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.app-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

.app-tooltip.is-below::after {
  top: -6px;
  bottom: auto;
  border-width: 0 6px 6px 6px;
  border-color: transparent transparent #0f172a transparent;
}

.app-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltips-enhanced .icon-btn[data-tooltip]::after,
.tooltips-enhanced .icon-btn[data-tooltip]::before,
.tooltips-enhanced .warn-icon[data-tooltip]::after,
.tooltips-enhanced .warn-icon[data-tooltip]::before {
  content: none;
}

.tooltips-enhanced .icon-btn[data-tooltip]:hover,
.tooltips-enhanced .icon-btn[data-tooltip]:focus,
.tooltips-enhanced .icon-btn[data-tooltip]:focus-visible {
  z-index: auto;
}

.icon-btn[data-tooltip]::after,
.icon-btn[data-tooltip]::before,
.warn-icon[data-tooltip]::after,
.warn-icon[data-tooltip]::before {
  content: none !important;
  display: none !important;
}

.table.wide.destruction-grid .table-row {
  grid-template-columns: 40px minmax(140px, 1fr) minmax(120px, 1fr) minmax(160px, 1.2fr) minmax(160px, 1.2fr) minmax(160px, 1fr) 180px;
}

.table.wide.verify-grid .table-row {
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr) 180px 140px;
}

.table.wide.error-grid .table-row {
  grid-template-columns: 80px 1fr 2fr;
}

.table.wide.dropdown-grid .table-row {
  grid-template-columns: minmax(220px, 2fr) minmax(120px, 1fr) 130px;
}

.table.wide.container-grid .table-row {
  grid-template-columns: minmax(200px, 1.4fr) minmax(160px, 1.2fr) minmax(160px, 1fr) 120px 240px;
}

.container-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.container-tools {
  display: grid;
  gap: 0.8rem;
  min-width: min(520px, 100%);
}

.search-input {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.search-input input {
  flex: 1;
}

.container-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.container-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1rem 1.2rem;
  background: var(--surface);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.container-card.is-open {
  border-color: rgba(var(--primary-rgb), 0.6);
  box-shadow: 0 18px 32px rgba(var(--primary-rgb), 0.12);
}

.container-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.container-title h5 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.container-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.container-card-body {
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.container-card-body.active {
  display: block;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
}

.table-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 0.5rem;
  background: var(--surface-tint);
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  align-items: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.table-row:not(.table-head):not(.resolved):not(.edit-row):hover {
  border-color: rgba(var(--primary-rgb), 0.18);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.table-row.table-head {
  font-weight: 600;
  background: #e2e7f1;
  border-color: var(--border-strong);
  font-size: 0.85rem;
}

.table-row.resolved {
  background: #f1f3f8;
  opacity: 0.6;
}

.table-row.resolved .segmented {
  box-shadow: none;
  border-color: #d6dbe6;
}

.table-row.resolved .segmented-btn {
  opacity: 0.7;
}

.status-toggle .segmented-btn:disabled {
  cursor: not-allowed;
}

.table.audit-table {
  display: inline-grid;
  min-width: 720px;
}

.table.audit-table .table-row {
  grid-template-columns: 140px 160px 150px 100px minmax(170px, 1fr);
}

.table.audit-table .table-row div {
  word-break: break-word;
}

.table.audit-table.friendly {
  min-width: 640px;
}

.table.audit-table.friendly .table-row {
  grid-template-columns: 150px minmax(180px, 0.8fr) minmax(280px, 1.4fr);
}

.table.audit-table.friendly .table-head {
  background: #eef2f8;
}

.audit-activity-title {
  font-weight: 700;
  color: var(--ink);
}

.table.audit-table.friendly .audit-detail {
  margin-top: 0.25rem;
}

.table-row.full {
  grid-column: 1 / -1;
}

.table-row.edit-row {
  display: none;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.table-row.edit-row.active {
  display: grid;
}

.edit-form {
  display: grid;
  gap: 1rem;
}

.raw-row {
  margin-top: 0.6rem;
}

.raw-row summary {
  list-style: none;
  cursor: pointer;
}

.raw-row summary::-webkit-details-marker {
  display: none;
}

.raw-row .code {
  margin-top: 0.6rem;
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: 10px;
}

.audit-detail {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.audit-meta summary {
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--muted);
}

.audit-meta summary::-webkit-details-marker {
  display: none;
}

.audit-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.audit-subtext {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
}

.audit-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--success-soft);
  color: var(--success);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.audit-chip svg {
  width: 14px;
  height: 14px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1.1rem;
  margin-top: 1rem;
  padding-left: 0.6rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 0.3rem;
  bottom: 0.3rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(47, 138, 93, 0.2) 0%, rgba(44, 77, 122, 0.7) 100%);
}

.timeline-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 1rem;
  align-items: flex-start;
  position: relative;
}

.timeline-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--primary);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  z-index: 1;
}

.timeline-icon svg {
  width: 18px;
  height: 18px;
}

.timeline-card {
  background: #fff;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.timeline-tag {
  background: #f0f3fa;
  color: var(--primary);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.timeline-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.timeline-detail {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.timeline-detail strong {
  color: var(--ink);
}

.timeline-kv {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.timeline-dot {
  color: #c0c7d4;
}

.timeline-item.is-recent .timeline-icon {
  animation: pulseSoft 2.6s ease-out 2;
}

.stepper {
  background: var(--surface-alt);
  border-radius: 18px;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}

.stepper-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.stepper-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.stepper-bar {
  height: 8px;
  border-radius: 999px;
  background: #e5eaf3;
  overflow: hidden;
  margin-top: 0.4rem;
}

.stepper-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--success) 0%, #4fbf7a 100%);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.stepper-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.step-chip {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.step-chip.is-active {
  background: var(--success-soft);
  color: var(--primary);
  border-color: rgba(47, 138, 93, 0.4);
  box-shadow: 0 6px 16px rgba(47, 138, 93, 0.15);
}

.step-panel {
  display: none;
}

.step-panel.is-active {
  display: block;
}

.review-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 0.8rem;
}

.review-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 0.8rem 0.9rem;
}

.review-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.review-value {
  font-weight: 600;
  margin-top: 0.2rem;
}

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

.step-actions-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.table-row div:last-child {
  text-align: right;
}

.tag {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.tag.green {
  background: #d8f6df;
  color: #0f6a2f;
}

.tag.gray {
  background: #e5e7eb;
  color: #4b5563;
}

.tag.amber {
  background: #fef3c7;
  color: #92400e;
}

.tag.red {
  background: #fee2e2;
  color: #7f1d1d;
}

.tag.no-margin {
  margin-left: 0;
}

.flash {
  padding: 0.8rem 1rem;
  border-radius: 14px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.flash.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  margin-bottom: 0;
  animation: toastIn 0.25s ease;
}

.flash.toast.hide {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.flash.error {
  background: #fee2e2;
  color: #7f1d1d;
}

.flash.success {
  background: #dcfce7;
  color: #14532d;
}

.flash.info {
  background: #dbeafe;
  color: #1e3a8a;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.auth-card {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 24px;
  box-shadow: var(--shadow);
  width: min(480px, 92vw);
}

.auth-brand {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.badge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(140deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: grid;
  place-items: center;
}

.brand-icon {
  width: 32px;
  height: 32px;
}

.badge .brand-icon {
  width: 36px;
  height: 36px;
}

.auth-note {
  font-size: 0.9rem;
  color: var(--muted);
}

.notes-block {
  background: var(--surface-alt);
  border-radius: 18px;
  padding: 1rem;
}

.notes-header {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.notes-empty {
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.note {
  background: var(--surface-alt);
  border-radius: 16px;
  padding: 0.9rem 1rem;
}

.note-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface-alt);
  border-radius: 14px;
}

.tabs {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.tab {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
}

.tab.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.tab-panels {
  display: grid;
  gap: 1.5rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel > .card + .card {
  margin-top: 1.5rem;
}

.meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.meta.warn,
.warn-text {
  color: #b45309;
  font-weight: 600;
}

.meta.success {
  color: var(--success);
  font-weight: 700;
}

.warn-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #b45309;
  font-size: 0.85rem;
  font-weight: 600;
}

.warn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: #b45309;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: help;
  position: relative;
  touch-action: manipulation;
}

.warn-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.warn-icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, -4px);
  background: #0f172a;
  color: #fff;
  font-size: 0.75rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  white-space: normal;
  max-width: 240px;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}

.warn-icon[data-tooltip]::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  z-index: 199;
}

.warn-icon[data-tooltip]:hover::after,
.warn-icon[data-tooltip]:focus::after,
.warn-icon[data-tooltip]:focus-visible::after,
.warn-icon[data-tooltip]:hover::before,
.warn-icon[data-tooltip]:focus::before,
.warn-icon[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mini-select {
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  background: #fff;
}

.flatpickr-calendar {
  border-radius: 16px;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-family: inherit;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.flatpickr-day.today {
  border-color: rgba(var(--primary-rgb), 0.5);
}

.filter-rows {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.filter-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 1.2fr auto auto;
  gap: 0.8rem;
  align-items: center;
}

.filter-row.is-first {
  grid-template-columns: 1fr 1fr 1.2fr auto auto;
}

.filter-row.no-value {
  grid-template-columns: 80px 1fr 1fr auto auto;
}

.filter-row.is-first.no-value {
  grid-template-columns: 1fr 1fr auto auto;
}

.filter-row.is-first .mini-select.hidden {
  display: none;
}

.is-collapsed {
  display: none !important;
}

.filter-row select,
.filter-row input {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  min-height: 40px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-row select:focus,
.filter-row input:focus {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.filter-row .mini-select {
  border-radius: 14px;
  padding: 0.55rem 0.75rem;
}

.grid.two select {
  width: 100%;
}

.filter-row .btn {
  padding: 0.5rem 1rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.hidden {
  visibility: hidden;
}

.ipad-form input,
.ipad-form select,
.ipad-form textarea {
  font-size: 1.05rem;
  padding: 1rem 1.2rem;
}

.scanner {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.scanner.active {
  display: flex;
}

.scanner-frame {
  background: #0f172a;
  border-radius: 20px;
  padding: 1rem;
  position: relative;
  width: min(520px, 92vw);
}

.scanner video {
  width: 100%;
  border-radius: 16px;
}

.scanner-fallback {
  display: none;
}

.scanner.fallback #scannerVideo,
.scanner.fallback #dashboardScannerVideo,
.scanner.fallback #containerScannerVideo {
  display: none;
}

.scanner.fallback .scanner-fallback {
  display: block;
}

.scanner-fallback video,
.scanner-fallback canvas {
  width: 100%;
  border-radius: 16px;
}

.scanner-overlay {
  position: absolute;
  inset: 1rem;
  border: 2px dashed rgba(245, 182, 66, 0.8);
  border-radius: 16px;
  pointer-events: none;
}

.scanner-line {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 2px;
  background: rgba(245, 182, 66, 0.9);
  animation: scan 2s infinite;
}

@keyframes scan {
  0% { transform: translateY(-40px); }
  50% { transform: translateY(40px); }
  100% { transform: translateY(-40px); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes pulseSoft {
  0% { box-shadow: 0 0 0 0 rgba(47, 138, 93, 0.35); }
  70% { box-shadow: 0 0 0 12px rgba(47, 138, 93, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 138, 93, 0); }
}

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

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .segmented {
    width: 100%;
  }

  .segmented-btn {
    flex: 1;
    text-align: center;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-row {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    grid-auto-rows: auto;
  }

  .table.audit-table {
    min-width: 640px;
  }

  .table.audit-table .table-row {
    grid-template-columns: 120px 150px 130px 90px minmax(140px, 1fr);
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .integrity-issue-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .integrity-issue-summary-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .integrity-hash-table {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .integrity-hash-head {
    display: none;
  }

  .integrity-value-label {
    margin-top: 0.4rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--border);
  }

  .integrity-chain-grid {
    grid-template-columns: 1fr;
  }

  .panel-head-actions {
    width: 100%;
  }

  .progress-meta-right {
    text-align: left;
    width: 100%;
  }

  .verify-year-form {
    justify-content: flex-start;
  }

  .verify-batch-nav {
    width: 100%;
    justify-content: space-between;
  }

  .verification-control-dock {
    position: static;
    grid-template-columns: 1fr;
    margin-bottom: 0.75rem;
  }

  .verification-controls-card {
    padding: 0.7rem 0.8rem;
  }

  .verification-controls-top {
    flex-direction: column;
    align-items: stretch;
  }

  .verification-controls-copy {
    min-width: 0;
    width: 100%;
  }

  .verification-controls-card .verify-batch-nav {
    justify-content: flex-start;
    gap: 0.4rem;
  }

  .verification-batch-jump-form {
    justify-content: flex-start;
  }

  .verification-bulk-form {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .verification-bulk-form-docked .btn {
    width: 100%;
    justify-content: center;
  }

  .verification-list-toolbar {
    justify-content: flex-start;
  }

  .verification-page-size-form {
    width: 100%;
    justify-content: flex-start;
  }

  .verify-scan-toolbar {
    align-items: stretch;
  }

  .verify-scan-field {
    max-width: 100%;
    width: 100%;
  }

  .detail-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .edit-identifiers form {
    position: static;
    width: 100%;
    margin-top: 0.6rem;
    box-shadow: none;
  }

  .action-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .action-date-cell,
  .action-status,
  .action-controls {
    justify-self: start;
    align-items: flex-start;
  }

  .action-date-edit {
    width: 100%;
    justify-content: flex-start;
  }

  .action-controls {
    width: 100%;
  }

  .action-inline {
    width: 100%;
    justify-content: flex-start;
  }

  .date-chip {
    width: 100%;
  }

  .timeline {
    padding-left: 0;
  }

  .timeline::before {
    left: 18px;
  }

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

  .step-actions-right {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (min-width: 1800px) {
  .page.wide {
    max-width: 1760px;
  }
}

@media (max-width: 1024px) {
  .panel {
    padding: 1.2rem;
  }

  .edit-identifiers form {
    position: static;
    width: 100%;
    margin-top: 0.6rem;
    box-shadow: none;
  }

  .table {
    gap: 0.4rem;
  }

  .table-row {
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
    font-size: 0.85rem;
  }

  .table-row.table-head {
    font-size: 0.8rem;
  }

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

  .list-row .inline {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .list-row .inline form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .list-row .inline form .btn,
  .list-row .inline form select {
    width: 100%;
  }

  .account-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .account-grid .card {
    padding: 1.2rem;
  }

  .account-grid .field input {
    padding: 0.85rem 1rem;
  }

  .account-grid .btn {
    width: 100%;
    justify-content: center;
  }
}

.label-print {
  display: none;
  width: var(--label-width);
  height: var(--label-height);
  padding: var(--label-pad-top) var(--label-pad-x) var(--label-pad-bottom);
  background: #fff;
  color: #000;
  border: 1px dashed rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.012in;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  break-inside: avoid;
}

.label-print.rotated {
  padding: var(--label-pad-x) var(--label-pad-top) var(--label-pad-bottom) var(--label-pad-x);
  justify-content: center;
}

.label-rotator {
  width: var(--label-height);
  height: var(--label-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-90deg);
  transform-origin: center;
}

.label-barcode {
  width: 100%;
  display: flex;
  justify-content: center;
}

.label-barcode svg {
  width: 100%;
  height: 0.68in;
}

.label-meta {
  width: 100%;
  font-size: 0.184in;
  letter-spacing: 0;
  display: flex;
  flex-direction: column;
  gap: 0.012in;
  align-items: center;
  line-height: 0.95;
}

.label-line {
  display: flex;
  width: 100%;
  gap: 0.02in;
  justify-content: center;
  align-items: baseline;
  white-space: nowrap;
  line-height: 1;
  flex-wrap: nowrap;
}

.label-key {
  font-weight: 600;
  font-size: 0.155in;
}

.label-value {
  font-weight: 600;
  font-size: 0.207in;
  letter-spacing: 0;
}

.label-agency {
  font-size: 0.155in;
  letter-spacing: 0;
  white-space: nowrap;
}

.label-destruction {
  --label-width: 3in;
  --label-height: 2.4in;
  background: var(--destruction-red);
  color: #fff;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  justify-content: center;
}

.label-destruction .label-destruction-text {
  font-size: 0.276in;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.label-destruction .label-agency {
  font-size: 0.161in;
  letter-spacing: 0.05em;
}

.attachment-list {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.attachment-card {
  display: grid;
  align-items: center;
  grid-template-columns: 92px 1fr auto;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid #e4e9f5;
  background: #f9fbff;
  box-shadow: 0 12px 24px -20px rgba(20, 38, 79, 0.25);
}

.attachment-preview {
  width: 92px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef2fb;
  border: 1px solid #dbe3f4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #5a6a8a;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.attachment-doc svg {
  width: 28px;
  height: 28px;
}

.attachment-name a {
  color: #182747;
  font-weight: 600;
  text-decoration: none;
}

.attachment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7a99;
  font-size: 0.85rem;
  margin-top: 4px;
}

.attachment-meta .dot {
  color: #b3bdd6;
}

.attachment-form {
  margin-top: 12px;
}

@media print {
  @page {
    size: auto;
    margin: 0.5in;
  }

  html,
  body {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .topbar,
  .page-actions,
  .panel-head-actions,
  .form-actions,
  .btn,
  .segmented,
  .search-bar,
  .dashboard-edit-panel,
  .notification-menu,
  .account-menu,
  .no-print {
    display: none !important;
  }

  .page {
    padding: 0;
    max-width: none;
  }

  .panel {
    box-shadow: none;
    border-color: #d8dbe6;
    break-inside: avoid;
  }

  .table-row {
    break-inside: avoid;
  }

  .tag {
    border: 1px solid #cfd5e3;
  }

  body.print-label {
    width: var(--label-width);
    height: var(--label-height);
    overflow: hidden;
  }

  body.print-label * {
    display: none !important;
  }

  body.print-label .label-print {
    display: none !important;
    position: fixed;
    left: 0;
    top: 0;
    border: none;
    border-radius: 0;
  }

  body.print-label .label-print[data-ready="true"] {
    display: flex !important;
  }

  body.print-label .label-print * {
    display: block !important;
  }

  body.print-label .label-print .label-meta {
    display: flex !important;
    align-items: center;
  }

  body.print-label .label-print .label-line {
    display: flex !important;
    justify-content: center;
    align-items: baseline;
    white-space: nowrap;
  }

  body.print-label .label-print .label-line span {
    display: inline !important;
    white-space: nowrap;
  }

  body.print-label .label-print .label-agency {
    display: block !important;
    white-space: nowrap;
  }
}
