@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f5f9fb;
  --surface: #ffffff;
  --surface-soft: #eef8fb;
  --ink: #23282d;
  --muted: #65727c;
  --line: #d7e7ee;
  --primary: #064e6f;
  --primary-ink: #ffffff;
  --accent: #218aa7;
  --accent-strong: #1683a5;
  --accent-soft: #dff3f8;
  --danger: #a13d3d;
  --warning: #8a6419;
  --ok: #217345;
  --shadow: 0 16px 34px rgba(6, 78, 111, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--primary);
}

h2 {
  margin-bottom: 14px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--primary);
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #eaf7fb;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(33, 138, 167, 0.16);
}

label span,
.canvas-label,
.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.mobile-menu-button,
.mobile-menu-close,
.sidebar-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 0;
  background: var(--primary);
  color: #fff;
  padding: 22px 16px;
}

.brand-mark,
.public-brand {
  display: block;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  padding: 4px 8px 10px;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 170px;
  max-height: 86px;
  margin: 0 auto;
  object-fit: contain;
}

.side-nav {
  display: grid;
  gap: 4px;
  margin-top: 28px;
}

.side-nav a {
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 800;
  padding: 10px 12px;
  text-transform: uppercase;
}

.side-nav a:hover,
.side-nav a.is-active {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.app-shell {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 22px 28px;
}

.topbar__account {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__account form {
  margin: 0;
}

.main-content {
  display: grid;
  gap: 22px;
  padding: 28px;
}

.public-body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ffffff 0, #ffffff 92px, var(--primary) 92px, var(--primary) 138px, var(--accent) 138px, var(--accent) 182px, var(--bg) 182px);
}

.public-shell {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0;
}

.public-panel {
  display: grid;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
}

.public-brand {
  color: var(--primary);
  font-weight: 800;
}

.page-header {
  max-width: 760px;
}

.page-header p {
  color: var(--muted);
}

.page-header--compact {
  max-width: 520px;
}

.login-page {
  display: grid;
  gap: 22px;
  justify-items: center;
  text-align: center;
}

.login-header {
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
}

.login-logo {
  display: block;
  max-width: 210px;
  max-height: 90px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.login-logo-fallback {
  color: var(--primary);
  font-size: 26px;
  font-weight: 800;
}

.login-form {
  width: min(100%, 420px);
  text-align: center;
}

.login-form label span {
  text-align: center;
}

.login-form input {
  text-align: center;
}

.login-help-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.security-notice {
  width: 100%;
  border: 1px solid rgba(33, 138, 167, 0.24);
  border-left: 5px solid var(--accent);
  border-radius: 4px;
  background: #f1fafc;
  color: var(--ink);
  padding: 14px;
}

.security-notice strong {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.security-notice p {
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.55;
}

.security-notice dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.security-notice div {
  min-width: 0;
  border: 1px solid rgba(33, 138, 167, 0.16);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
  padding: 7px 8px;
}

.security-notice dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.security-notice dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  background: var(--primary);
  color: var(--primary-ink);
  cursor: pointer;
  font-weight: 800;
  padding: 9px 14px;
  text-decoration: none;
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
  filter: none;
  text-decoration: none;
}

.button svg {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.button--icon {
  width: 40px;
  padding: 0;
}

.button--icon svg {
  margin-right: 0;
}

.button:disabled,
.button.is-submitting {
  cursor: wait;
  opacity: 0.76;
  pointer-events: none;
}

.button.is-submitting::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: submit-spin 0.7s linear infinite;
}

.button--ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--primary);
}

.button--ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--primary);
}

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

.button--danger:hover {
  border-color: #96332e;
  background: #96332e;
}

@keyframes submit-spin {
  to {
    transform: rotate(360deg);
  }
}

.alert {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 12px 14px;
}

.alert--error {
  border-color: rgba(161, 61, 61, 0.35);
  background: #fff5f4;
  color: var(--danger);
}

.alert--success {
  border-color: rgba(33, 115, 69, 0.35);
  background: #f1faf4;
  color: var(--ok);
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  border-radius: 4px;
  background:
    linear-gradient(120deg, rgba(6, 78, 111, 0.95), rgba(25, 132, 162, 0.88)),
    var(--primary);
  color: #fff;
  padding: 26px;
  box-shadow: 0 22px 45px rgba(6, 78, 111, 0.18);
}

.dashboard-hero h2 {
  margin-bottom: 8px;
  color: #fff;
  font-size: 30px;
}

.dashboard-hero p {
  max-width: 760px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
}

.dashboard-hero .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

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

.dashboard-hero .button--ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 18px;
}

.metric--prime {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  border-color: rgba(33, 138, 167, 0.2);
  background: linear-gradient(180deg, #fff, #f4fbfd);
  box-shadow: 0 18px 36px rgba(6, 78, 111, 0.09);
}

.metric--prime::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -42px;
  width: 112px;
  height: 112px;
  border: 18px solid rgba(33, 138, 167, 0.12);
  border-radius: 50%;
}

.metric--attention {
  border-color: rgba(161, 61, 61, 0.28);
  background: linear-gradient(180deg, #fff, #fff5f4);
}

.metric span,
.detail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 34px;
  line-height: 1;
  color: var(--primary);
}

.metric small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
}

.panel--prime {
  min-height: 320px;
}

.kpi-rings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  height: calc(100% - 58px);
  align-items: center;
}

.kpi-ring {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.kpi-ring__chart {
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 0 58%, transparent 59%),
    conic-gradient(var(--accent) calc(var(--value) * 1%), #dcecf2 0);
  box-shadow: inset 0 0 0 1px rgba(6, 78, 111, 0.06);
}

.kpi-ring__chart strong {
  color: var(--primary);
  font-size: 24px;
  line-height: 1;
}

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

.bar-chart {
  display: grid;
  min-height: 210px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(180deg, #f7fcfd, #fff);
  padding: 18px 18px 12px;
}

.bar-chart__group {
  display: grid;
  gap: 9px;
  align-items: end;
  text-align: center;
}

.bar-chart__bars {
  display: flex;
  height: 150px;
  align-items: end;
  justify-content: center;
  gap: 7px;
}

.bar {
  display: block;
  width: 15px;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
}

.bar--invites {
  background: var(--primary);
}

.bar--signed {
  background: var(--accent);
}

.bar-chart__group strong,
.chart-legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot--invites {
  background: var(--primary);
}

.legend-dot--signed {
  background: var(--accent);
}

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

.panel,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

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

.table-wrap--embedded {
  border: 0;
  box-shadow: none;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  background: #e8f3f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 9px;
  text-transform: capitalize;
}

.badge--ok,
.badge--approved {
  background: #e7f5ec;
  color: var(--ok);
}

.badge--warn,
.badge--pending {
  background: #fff4d8;
  color: var(--warning);
}

.badge--denied,
.badge--canceled {
  background: #fae7e6;
  color: var(--danger);
}

.badge--muted {
  background: #eef0ed;
  color: var(--muted);
}

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

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

.form-grid--inner {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  padding: 16px;
}

.span-2 {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.check-row input {
  width: auto;
  margin-top: 4px;
}

.check-row span {
  margin-bottom: 0;
  color: var(--ink);
}

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

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inline-resend-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 72px auto;
  gap: 8px;
  align-items: center;
}

.inline-resend-form input {
  min-width: 0;
}

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

.code-editor,
.json-view {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
}

.wysiwyg {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.wysiwyg__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 8px;
}

.wysiwyg__toolbar button,
.wysiwyg__toolbar select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 9px;
}

.wysiwyg__toolbar button:hover,
.wysiwyg__toolbar select:hover {
  border-color: var(--accent);
}

.wysiwyg__editor {
  min-height: 180px;
  padding: 14px;
  outline: none;
}

.wysiwyg__editor:focus {
  box-shadow: inset 0 0 0 2px rgba(33, 142, 169, 0.2);
}

.wysiwyg.is-invalid {
  border-color: var(--danger);
}

.wysiwyg.is-invalid .wysiwyg__editor {
  box-shadow: inset 0 0 0 2px rgba(184, 63, 56, 0.18);
}

.wysiwyg__editor h2,
.wysiwyg__editor h3,
.wysiwyg__editor p,
.wysiwyg__editor ul,
.wysiwyg__editor ol {
  margin-bottom: 12px;
}

.wysiwyg__editor ul,
.wysiwyg__editor ol {
  padding-left: 24px;
}

.helper-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  padding: 12px;
}

.helper-band span {
  border-radius: 4px;
  background: var(--surface);
  color: var(--primary);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  padding: 4px 7px;
}

.clause-builder,
.clause-list {
  display: grid;
  gap: 16px;
}

.clause-editor {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  padding: 16px;
}

.clause-editor__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo-tool {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  padding: 16px;
}

.logo-preview {
  display: grid;
  min-height: 130px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  padding: 12px;
}

.logo-preview img {
  display: block;
  max-width: 100%;
  max-height: 110px;
  object-fit: contain;
}

.logo-tool__controls {
  display: grid;
  gap: 14px;
}

.logo-library {
  border: 0;
  margin: 0;
  padding: 0;
}

.logo-library legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.logo-library__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.logo-choice {
  display: grid;
  gap: 6px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  padding: 10px;
}

.logo-choice input {
  width: auto;
}

.logo-choice img {
  width: 100%;
  height: 64px;
  object-fit: contain;
}

.logo-choice span {
  margin-bottom: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.table-logo {
  display: block;
  max-width: 72px;
  max-height: 38px;
  object-fit: contain;
}

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

.detail {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 14px;
}

.detail strong {
  display: block;
  margin-top: 4px;
  word-break: break-word;
}

.delivery-detail-panel .detail-grid {
  margin-bottom: 28px;
}

.delivery-subject-block {
  display: grid;
  gap: 14px;
  margin: 30px 0 18px;
}

.delivery-subject-block h2 {
  margin-bottom: 0;
}

.document-view {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
}

.document-view h2,
.document-view h3 {
  margin-top: 20px;
}

.document-view h2:first-child,
.document-view h3:first-child {
  margin-top: 0;
}

.agreement-title {
  margin-bottom: 24px;
  text-align: center;
}

.signing-progress {
  position: sticky;
  z-index: 4;
  top: 12px;
  display: grid;
  gap: 7px;
  margin: -8px -8px 24px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96);
  padding: 10px 12px;
  box-shadow: 0 10px 24px rgba(6, 78, 111, 0.08);
}

.signing-progress span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.signing-progress div {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #dcecf2;
}

.signing-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease;
}

.agreement-logo {
  display: block;
  max-width: 230px;
  max-height: 96px;
  width: auto;
  height: auto;
  margin: 0 auto 24px;
  object-fit: contain;
}

.agreement-title h1 {
  color: var(--primary);
  font-size: 30px;
}

.agreement-summary {
  margin: 22px 0;
}

.agreement-clause {
  border-top: 1px solid var(--line);
  padding: 24px 0;
}

.agreement-clause h2 {
  margin-bottom: 10px;
}

.agreement-clause__body {
  color: var(--ink);
}

.initial-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--primary);
  font-weight: 800;
  padding: 8px 10px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.initial-box:hover,
.initial-box.is-current-step {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.initial-box.is-complete {
  border-color: rgba(33, 115, 69, 0.28);
  background: #e7f5ec;
  color: var(--ok);
}

.initial-box.is-complete button::before {
  content: "Done: ";
}

.signature-pad.is-current-step,
[data-signing-step].is-current-step {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(33, 138, 167, 0.14);
}

.initial-box input {
  width: 64px;
  border-color: var(--accent);
  background: #fff;
  color: var(--primary);
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.initial-box button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  margin-bottom: 0;
  color: var(--primary);
  font-size: 14px;
  text-transform: none;
}

.json-view {
  white-space: pre-wrap;
}

.signature-image {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
}

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

.signature-pad {
  width: 100%;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(to bottom, transparent 74%, rgba(23, 32, 27, 0.12) 75%, transparent 76%),
    var(--surface-soft);
  touch-action: none;
}

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

  .mobile-menu-button {
    position: fixed;
    z-index: 31;
    top: 14px;
    left: 14px;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .mobile-menu-button span:not(.sr-only) {
    display: block;
    width: 20px;
    height: 2px;
    margin: 2px 0;
    border-radius: 2px;
    background: var(--primary);
  }

  .mobile-menu-close {
    display: inline-grid;
    width: 36px;
    height: 36px;
    margin-left: auto;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font-size: 24px;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 29;
    display: block;
    background: rgba(6, 78, 111, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: min(310px, 84vw);
    height: 100vh;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 20px 0 44px rgba(6, 78, 111, 0.2);
  }

  .menu-open .sidebar {
    transform: translateX(0);
  }

  .menu-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar {
    padding-left: 74px;
  }

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

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

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

  .kpi-rings {
    grid-template-columns: 1fr;
  }
}

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

  .main-content,
  .public-panel {
    padding: 18px;
  }

  .metric-grid,
  .dashboard-grid,
  .detail-grid,
  .form-grid,
  .initial-grid,
  .inline-resend-form,
  .logo-tool,
  .security-notice dl {
    grid-template-columns: 1fr;
  }

  .dashboard-hero h2 {
    font-size: 24px;
  }

  .bar-chart {
    gap: 8px;
    padding-inline: 10px;
  }

  .span-2 {
    grid-column: auto;
  }

  th,
  td {
    padding: 10px;
  }
}
