:root {
  --ink: #15202b;
  --muted: #647080;
  --line: #d8dde5;
  --paper: #ffffff;
  --background: #f4f6f8;
  --brand-blue: #2563eb;
  --danger: #bf2136;
  --strata-blue: #2563eb;
  --strata-cyan: #38bdf8;
  --strata-violet: #7c3aed;
  --teal: #28766f;
  --amber: #a86616;
  --shadow: 0 16px 36px rgba(28, 39, 55, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--background);
}

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

button {
  cursor: pointer;
}

.topbar {
  min-height: 72px;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.strata-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
}

.strata-mark {
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.strata-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-line {
  font-weight: 800;
  color: #111827;
  font-size: 18px;
  line-height: 1;
}

.sub-brand {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}

.sub-brand span {
  color: var(--danger);
  font-weight: 800;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.tab.is-active {
  border-color: var(--line);
  background: #eef4f9;
  color: var(--brand-blue);
  font-weight: 700;
}

.layout {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.auth-panel-shell {
  width: min(620px, calc(100% - 32px));
  margin: 72px auto;
}

.admin-auth-card {
  padding: 24px;
}

.admin-auth-card h1 {
  margin-bottom: 8px;
}

.admin-auth-card form {
  margin-top: 18px;
}

.admin-app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: calc(100vh - 73px);
}

.admin-nav {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100vh - 73px);
  padding: 22px 14px;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.nav-title {
  margin: 0 8px 18px;
}

.nav-title span {
  display: block;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-title strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.nav-item {
  width: 100%;
  min-height: 42px;
  margin-bottom: 6px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475568;
  text-align: left;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: #c8d7e8;
  background: #edf4fa;
  color: var(--brand-blue);
}

.admin-content {
  min-width: 0;
  padding: 20px;
}

.admin-view {
  display: grid;
  gap: 14px;
}

.hero-heading {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.email-grid {
  display: grid;
  gap: 16px;
}

.email-grid {
  grid-template-columns: minmax(360px, 0.8fr) minmax(0, 1.2fr);
}

.split-panel {
  max-width: 980px;
}

.forms-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(960px, 100%);
  gap: 16px;
  align-items: start;
}

.compact-form {
  gap: 10px;
}

.compact-form textarea {
  min-height: 76px;
}

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

.form-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
  min-width: 0;
}

.form-meta span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
}

.library-row .status-pill {
  min-height: 22px;
  padding: 3px 8px;
  font-size: 11px;
}

.compact-list {
  gap: 6px;
}

.panel-tools {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.panel-tools label {
  display: grid;
  gap: 3px;
  width: 150px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.panel-tools select {
  min-height: 30px;
  margin-top: 0;
  padding: 5px 8px;
  font-size: 12px;
}

.library-section {
  display: grid;
  gap: 0;
  padding-top: 4px;
}

.library-section + .library-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.library-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.library-section-header h3 {
  margin: 0;
  color: #4c5a6b;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.library-section-header span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef4f9;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 800;
}

.category-group {
  padding: 5px 0 2px;
}

.category-group + .category-group {
  margin-top: 6px;
}

.category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 8px;
  border: 1px solid #dbe4ee;
  border-radius: 7px;
  background: #f8fbfd;
}

.category-heading strong {
  color: #243244;
  font-size: 12px;
}

.category-heading span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.library-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(280px, 1.35fr) 34px;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}

.library-row .row-actions {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-content: center;
  max-width: none;
  min-width: 0;
}

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

.library-row.is-archived {
  opacity: 0.82;
}

.library-row.is-archived .library-main strong {
  color: #4c5a6b;
}

.library-main {
  grid-column: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.library-row .form-meta {
  grid-column: 2;
  margin: 0;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.library-main strong {
  display: inline-block;
  min-width: 0;
  max-width: min(360px, 58%);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
}

.library-main span {
  display: inline-block;
  min-width: 0;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 130px;
}

.library-row .form-meta span:first-child {
  max-width: min(360px, 58%);
}

.action-menu {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.action-menu summary {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #c8d4e2;
  border-radius: 999px;
  background: #ffffff;
  color: #243244;
  cursor: pointer;
  font-size: 0;
  font-weight: 900;
  line-height: 1;
  list-style: none;
}

.menu-dots,
.menu-dots::before,
.menu-dots::after {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #243244;
}

.menu-dots {
  position: relative;
  display: block;
}

.menu-dots::before,
.menu-dots::after {
  content: "";
  position: absolute;
  top: 0;
}

.menu-dots::before {
  left: -7px;
}

.menu-dots::after {
  right: -7px;
}

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

.action-menu summary:hover,
.action-menu summary:focus-visible,
.action-menu[open] summary {
  border-color: #8fb2d8;
  background: #f3f8fc;
  outline: 0;
}

.action-menu-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  width: 190px;
  padding: 6px;
  border: 1px solid #d3dbe4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(28, 39, 55, 0.18);
}

.action-menu-list button {
  width: 100%;
  min-height: 32px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #243244;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.action-menu-list button:hover,
.action-menu-list button:focus-visible {
  background: #f3f8fc;
  outline: 0;
}

.action-menu-list button:disabled {
  opacity: 0.45;
}

.action-menu-list .danger-menu-action {
  color: var(--danger);
}

.action-menu-list .danger-menu-action:hover,
.action-menu-list .danger-menu-action:focus-visible {
  background: #fff5f7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(2px);
}

.edit-panel {
  position: fixed;
  z-index: 100;
  top: 50%;
  left: 50%;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  transform: translate(-50%, -50%);
  padding: 16px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.edit-panel .panel-title {
  margin-bottom: 12px;
}

.edit-panel .panel-title h2 {
  font-size: 17px;
}

.edit-panel .panel-title .muted {
  margin: 3px 0 0;
  font-size: 12px;
}

.edit-panel .compact-form {
  gap: 9px;
}

.edit-panel label {
  font-size: 12px;
}

.edit-panel input,
.edit-panel select {
  min-height: 36px;
  padding: 8px 10px;
}

.edit-panel textarea {
  min-height: 68px;
}

.edit-panel .form-actions {
  margin-top: 4px;
}

.config-list {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0 0 18px;
}

.config-list dt {
  color: var(--muted);
  font-weight: 800;
}

.config-list dd {
  margin: 0;
  word-break: break-word;
}

.settings-form {
  margin: 18px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.table-subtext {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.user-list {
  display: grid;
  gap: 6px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.user-row:first-child {
  border-top: 0;
}

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

.user-row strong {
  font-size: 13px;
}

.user-row div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toggle-row input {
  width: auto;
  min-height: 0;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
}

.workspace {
  min-width: 0;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 6px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.muted,
.form-note {
  color: var(--muted);
}

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

.compact {
  box-shadow: none;
}

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

.metric-strip {
  display: inline-flex;
  gap: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.metric-card {
  min-width: 108px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.metric-card:hover,
.metric-card:focus-visible,
.metric-card.is-active {
  border-color: #c8d7e8;
  background: #ffffff;
  outline: 0;
}

.metric-card strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  border-radius: 999px;
  background: #eef4f9;
  color: var(--brand-blue);
  font-size: 12px;
}

.metric-card span {
  display: block;
  color: #344153;
  font-size: 12px;
  font-weight: 800;
}

.overview-detail-panel {
  padding: 12px 14px;
}

.compact-title {
  margin-bottom: 10px;
}

.compact-title h2 {
  font-size: 16px;
}

.compact-title .muted {
  margin: 3px 0 0;
  font-size: 12px;
}

.overview-list {
  display: grid;
  gap: 6px;
}

.overview-list-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.overview-list-item:first-child {
  border-top: 0;
}

.overview-list-item time,
.overview-list-item strong,
.overview-list-item span {
  display: block;
}

.overview-list-item time {
  color: #344153;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.overview-list-item strong {
  font-size: 13px;
}

.overview-list-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.issue-item .error-text {
  margin-top: 6px;
  color: var(--danger);
}

.overview-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.compact-action {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
}

.recipient-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(28, 39, 55, 0.06);
}

.recipient-progress span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.recipient-progress span:first-child {
  background: #eef8f5;
  color: var(--teal);
}

.recipient-progress strong {
  color: #15202b;
  font-size: 15px;
}

.pack-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #d7e4f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(28, 39, 55, 0.05);
}

.pack-notice strong,
.pack-notice span {
  display: block;
}

.pack-notice strong {
  color: #15202b;
  font-size: 14px;
}

.pack-notice span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.pack-notice.is-complete {
  border-color: #bfe6d8;
  background: #f8fffc;
}

.admin-grid {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.stacked-form,
.inline-form {
  display: grid;
  gap: 14px;
}

.inline-form {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
}

.test-access {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px dashed #b8c7d8;
  border-radius: 8px;
  background: #f8fafc;
}

.test-access span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

label,
legend {
  color: #344153;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 11px;
  border: 1px solid #c7ced8;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

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

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-list,
.library-list,
.outbox-list,
.assignment-list {
  display: grid;
  gap: 10px;
}

.send-form-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.send-form-row {
  position: relative;
  display: grid;
  grid-template-columns: 42px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

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

.send-form-row:hover {
  background: #f8fbfd;
}

.send-form-row.is-dragging {
  background: #edf4fa;
  box-shadow: 0 10px 22px rgba(21, 32, 43, 0.16);
  outline: 2px solid rgba(37, 99, 235, 0.18);
  outline-offset: -2px;
  opacity: 0.9;
  transform: scale(1.01);
}

.send-form-row.is-unselected {
  background: #fbfbfc;
}

.send-form-row.is-unselected .send-form-check span,
.send-form-row.is-unselected .sequence-number {
  opacity: 0.55;
}

.send-row-actions {
  min-width: 96px;
}

.send-preview-action {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #c7d3e3;
  border-radius: 6px;
  background: #ffffff;
  color: #16436f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.send-preview-action:hover,
.send-preview-action:focus-visible {
  border-color: #8fb2d8;
  background: #f3f8fc;
  outline: 0;
}

.drag-handle {
  align-self: stretch;
  width: 42px;
  min-height: 48px;
  margin: -10px 0 -10px -10px;
  display: grid;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: linear-gradient(90deg, #f8fbfd, #ffffff);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: element;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle:hover,
.drag-handle:focus-visible {
  border-right-color: #bfd0e3;
  background: linear-gradient(90deg, #eaf3fb, #f8fbfd);
  outline: 0;
}

.send-form-row.is-dragging .drag-handle {
  border-right-color: transparent;
  background: linear-gradient(180deg, var(--strata-cyan), var(--strata-blue), var(--strata-violet));
}

.drag-handle span,
.drag-handle span::before,
.drag-handle span::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: #7d8998;
  content: "";
}

.send-form-row.is-dragging .drag-handle span,
.send-form-row.is-dragging .drag-handle span::before,
.send-form-row.is-dragging .drag-handle span::after {
  background: #ffffff;
}

.drag-handle span {
  position: relative;
}

.drag-handle span::before,
.drag-handle span::after {
  position: absolute;
  left: 0;
}

.drag-handle span::before {
  transform: translateY(-6px);
}

.drag-handle span::after {
  transform: translateY(4px);
}

.sequence-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #d2dde9;
  border-radius: 999px;
  background: #f4f8fb;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 800;
}

.send-form-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.send-form-check input {
  width: auto;
  margin: 2px 0 0;
}

.send-form-check strong {
  display: block;
}

.send-form-check span span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.choice-row input {
  width: auto;
  margin: 2px 0 0;
}

.choice-row strong,
.assignment-card strong {
  display: block;
}

.choice-row span,
.assignment-card span,
.library-card p,
.outbox-item p {
  color: var(--muted);
  font-size: 12px;
}

.contract-box {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: #f8fafb;
  border: 1px dashed #c3ccd6;
}

.primary-action,
.secondary-action,
.link-action,
.danger-action {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 9px 13px;
  font-weight: 800;
}

.primary-action {
  color: #ffffff;
  background: var(--brand-blue);
}

.secondary-action {
  color: var(--brand-blue);
  background: #ffffff;
  border-color: #b8c7d8;
}

.quiet-action {
  color: #4f5d6d;
  border-color: #d3dbe4;
}

.danger-action {
  color: var(--danger);
  background: #ffffff;
  border-color: #f0b8c3;
}

.danger-action:hover,
.danger-action:focus-visible {
  background: #fff5f7;
  outline: 0;
}

.secondary-action:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.link-action {
  color: var(--danger);
  background: transparent;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4f9;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 800;
}

.status-not_started,
.status-draft {
  background: #eef1f5;
  color: #4f5d6d;
}

.status-in_progress,
.status-opened,
.status-sent {
  background: #fff4e2;
  color: var(--amber);
}

.status-completed {
  background: #e8f5f2;
  color: var(--teal);
}

.status-expired,
.status-failed {
  background: #fae9ed;
  color: var(--danger);
}

.status-preview {
  background: #eef1f5;
  color: #4f5d6d;
}

.status-archived {
  background: #f3f4f6;
  color: #5f6c7b;
}

.status-sent {
  background: #e8f5f2;
  color: var(--teal);
}

.error-text {
  color: var(--danger) !important;
  font-weight: 700;
}

.notification-host {
  position: fixed;
  z-index: 200;
  top: 18px;
  right: 18px;
  width: min(360px, calc(100vw - 36px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.notification-toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #c8d7e8;
  border-left: 4px solid var(--brand-blue);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.2);
  pointer-events: auto;
}

.notification-toast strong,
.notification-toast span {
  display: block;
}

.notification-toast strong {
  margin-bottom: 3px;
  color: #1f2c3d;
  font-size: 13px;
}

.notification-toast span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.notification-toast button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: #f3f6f9;
  color: #4f5d6d;
  font-size: 18px;
  line-height: 1;
}

.notification-toast button:hover,
.notification-toast button:focus-visible {
  background: #e8eef5;
  outline: 0;
}

.notification-toast.is-info {
  border-left-color: var(--amber);
}

.notification-toast.is-error {
  border-color: #f0b8c3;
  border-left-color: var(--danger);
}

.notification-toast.is-error strong {
  color: var(--danger);
}

.empty-state {
  margin: 8px 0 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.library-card,
.outbox-item,
.assignment-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #ffffff;
}

.library-card form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #4c5a6b;
  font-size: 12px;
  text-transform: uppercase;
}

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

.recipient-shell {
  max-width: 1180px;
}

.auth-panel {
  max-width: 620px;
  margin: 40px auto;
  padding: 26px 28px;
  box-shadow: 0 18px 42px rgba(28, 39, 55, 0.1);
}

.auth-panel h1 {
  font-size: 28px;
}

.auth-panel .inline-form {
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  margin-top: 20px;
}

.auth-panel .primary-action {
  min-width: 160px;
}

.recipient-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
}

.assignment-card {
  text-align: left;
  cursor: pointer;
}

.assignment-card.is-active {
  border-color: var(--brand-blue);
  box-shadow: inset 4px 0 0 var(--brand-blue);
}

.form-panel {
  min-height: 620px;
}

.form-section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.form-section:first-child {
  border-top: 0;
  padding-top: 0;
}

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

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

.beneficiary-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.beneficiary-row-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  padding-top: 28px;
}

.beneficiary-row-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(150px, 1fr) minmax(90px, 0.55fr);
  gap: 10px;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.radio-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.radio-choice input {
  width: auto;
  margin: 0;
}

.signature-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.signature-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.signature-canvas {
  display: block;
  width: 100%;
  height: 160px;
  border: 1px solid #c7ced8;
  border-radius: 6px;
  background: #fff;
  touch-action: none;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.required-mark {
  color: var(--danger);
}

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

@media (max-width: 1080px) {
  .admin-shell,
  .admin-grid,
  .recipient-grid,
  .admin-app,
  .email-grid,
  .choice-grid,
  .forms-workspace,
  .library-row {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-title {
    grid-column: 1 / -1;
  }

  .library-main,
  .library-row .form-meta,
  .library-row .row-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .library-row .row-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .side-rail {
    order: 2;
  }
}

@media (max-width: 720px) {
  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .layout {
    padding: 16px;
  }

  .metric-strip,
  .recipient-progress,
  .view-tabs,
  .admin-nav,
  .inline-form {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .pack-notice span {
    text-align: left;
  }

  .field-grid,
  .beneficiary-row,
  .beneficiary-row-fields,
  .library-card form {
    grid-template-columns: 1fr;
  }

  .beneficiary-row-title {
    padding-top: 0;
  }

  .overview-list-item {
    grid-template-columns: 1fr;
  }

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

  .overview-item-actions {
    justify-content: flex-start;
  }

  .send-form-row {
    grid-template-columns: 34px 34px minmax(0, 1fr);
  }

  .send-form-row .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
