:root {
  --ink: #17201d;
  --ink-soft: #33413c;
  --muted: #6a7772;
  --green: #1e6b53;
  --green-dark: #14513e;
  --green-pale: #e9f4ef;
  --lime: #cde4a1;
  --paper: #fbfcfa;
  --surface: #ffffff;
  --line: #dce5e1;
  --line-strong: #c7d3ce;
  --warning: #b46510;
  --warning-pale: #fff3de;
  --danger: #a63d3d;
  --danger-pale: #fdecec;
  --blue: #315b78;
  --shadow: 0 12px 35px rgba(28, 59, 47, 0.08);
  --radius: 18px;
  --radius-small: 11px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f3f6f3;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: inherit;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 26px 18px 18px;
  overflow-y: auto;
  color: #eaf2ee;
  background:
    radial-gradient(circle at 15% 0%, rgba(122, 184, 149, 0.22), transparent 32%),
    linear-gradient(165deg, #163a2e 0%, #102b23 58%, #0c211b 100%);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 8px 30px;
  color: white;
  text-decoration: none;
}

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

.brand strong {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 2px;
  color: #a9c0b6;
  font-size: 11px;
}

.brand-mark {
  display: inline-flex;
  width: 39px;
  height: 39px;
  align-items: center;
  justify-content: center;
  flex: 0 0 39px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 13px 13px 13px 4px;
  color: #14382c;
  background: var(--lime);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

.brand-mark-large {
  width: 58px;
  height: 58px;
  margin-bottom: 36px;
  flex-basis: 58px;
  border-radius: 19px 19px 19px 6px;
  font-size: 17px;
}

.nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 45px;
  padding: 0 13px;
  border-radius: 11px;
  color: #bdd0c7;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(2px);
}

.nav-link.active {
  color: #112c23;
  background: var(--lime);
}

.nav-icon {
  display: inline-flex;
  width: 22px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav-spacer {
  flex: 1;
  min-height: 20px;
}

.sidebar-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 20px 11px 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: #8da79c;
  font-size: 11px;
}

.secure-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8bc898;
  box-shadow: 0 0 0 4px rgba(139, 200, 152, 0.1);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  padding: 17px clamp(22px, 4vw, 54px);
  border-bottom: 1px solid rgba(199, 211, 206, 0.75);
  background: rgba(243, 246, 243, 0.94);
  backdrop-filter: blur(15px);
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: clamp(23px, 3vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: var(--lime);
}

.topbar-actions,
.button-group,
.page-actions,
.filter-row,
.check-row,
.document-toolbar,
.document-state {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar-actions form,
.button-group form,
.document-toolbar form,
.action-list form,
.payment-row form {
  margin: 0;
}

.content {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 30px clamp(22px, 4vw, 54px) 64px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: white;
  background: var(--green);
  box-shadow: 0 7px 20px rgba(30, 107, 83, 0.19);
}

.button-primary:hover {
  background: var(--green-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--ink-soft);
  background: white;
}

.button-secondary:hover,
.button-ghost:hover {
  border-color: #a9bbb3;
  background: #f7faf8;
}

.button-warning {
  color: #744008;
  background: var(--warning-pale);
  border-color: #ecc793;
}

.button-danger {
  color: white;
  background: var(--danger);
}

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

.button-full {
  width: 100%;
}

.icon-button {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink-soft);
  background: white;
  cursor: pointer;
  font-size: 18px;
}

.icon-button.danger,
.text-button.danger {
  color: var(--danger);
}

.text-button {
  padding: 4px 0;
  border: 0;
  color: var(--green);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.mobile-menu {
  display: none;
}

.flash-stack {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

.flash {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-soft);
  background: white;
  box-shadow: var(--shadow);
  transition: opacity 300ms ease;
}

.flash-fade {
  opacity: 0.55;
}

.flash-success {
  border-color: #badbc9;
  color: #14513e;
  background: #edf8f2;
}

.flash-danger {
  border-color: #efc0c0;
  color: #822f2f;
  background: var(--danger-pale);
}

.flash-warning {
  border-color: #eed09f;
  color: #77430a;
  background: var(--warning-pale);
}

.panel {
  margin-bottom: 20px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin: 3px 0 0;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

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

.metric-grid-small {
  grid-template-columns: minmax(280px, 420px);
}

.metric-card {
  min-height: 146px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.metric-card p,
.metric-card span {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.metric-card strong {
  display: block;
  margin: 16px 0 13px;
  font-size: clamp(23px, 3vw, 31px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.metric-primary {
  border-color: transparent;
  color: white;
  background:
    radial-gradient(circle at 100% 0%, rgba(205, 228, 161, 0.2), transparent 38%),
    linear-gradient(145deg, #1e6b53, #164b3c);
}

.metric-primary p,
.metric-primary span {
  color: #c8ddd4;
}

.metric-danger strong {
  color: var(--danger);
}

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

.bar-chart {
  display: grid;
  height: 225px;
  grid-template-columns: repeat(12, minmax(12px, 1fr));
  gap: clamp(6px, 1.1vw, 13px);
  align-items: end;
  padding-top: 14px;
}

.bar-column {
  display: grid;
  height: 100%;
  grid-template-rows: 1fr 22px;
  gap: 6px;
  align-items: end;
  text-align: center;
}

.bar-column progress {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 7px 7px 3px 3px;
  appearance: none;
  writing-mode: vertical-rl;
  direction: rtl;
}

.bar-column progress::-webkit-progress-bar {
  border-radius: 7px 7px 3px 3px;
  background: #edf1ef;
}

.bar-column progress::-webkit-progress-value {
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #65a88b, var(--green));
}

.bar-column progress::-moz-progress-bar {
  border-radius: 7px 7px 3px 3px;
  background: var(--green);
}

.bar-column span {
  color: var(--muted);
  font-size: 10px;
}

.text-link {
  color: var(--green);
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
}

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

.compliance-row {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  align-items: start;
}

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

.compliance-row strong {
  font-size: 12px;
}

.compliance-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: #aab5b0;
  box-shadow: 0 0 0 4px rgba(170, 181, 176, 0.12);
}

.status-compliant {
  background: #48a36f;
  box-shadow: 0 0 0 4px rgba(72, 163, 111, 0.12);
}

.status-pending {
  background: #d9983f;
  box-shadow: 0 0 0 4px rgba(217, 152, 63, 0.13);
}

.status-blocked {
  background: #c44e4e;
  box-shadow: 0 0 0 4px rgba(196, 78, 78, 0.12);
}

.status-not_applicable {
  background: #92a19b;
}

.threshold-panel {
  padding: 20px 23px;
}

.threshold-progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
}

.threshold-progress::-webkit-progress-bar {
  background: #e8eeeb;
}

.threshold-progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--green), #d6a647);
}

.threshold-progress::-moz-progress-bar {
  background: var(--green);
}

.threshold-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
}

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

.hint {
  margin: 12px 0 0;
  font-size: 10px;
}

.pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: #f3f6f4;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.025em;
}

.pill-compliant,
.pill-paid,
.pill-accepted {
  border-color: #b8dcca;
  color: #176044;
  background: #eaf7f0;
}

.pill-warning,
.pill-partial,
.pill-sent,
.pill-issued {
  border-color: #eecb92;
  color: #80500e;
  background: #fff5e5;
}

.pill-overdue,
.pill-refused,
.pill-cancelled {
  border-color: #efbebe;
  color: #923838;
  background: #fdecEC;
}

.pill-draft,
.pill-muted {
  color: var(--muted);
  background: #f0f3f1;
}

.pill-credited {
  color: #315b78;
  background: #eaf2f7;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table,
.preview-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.preview-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table td,
.preview-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: middle;
  font-size: 12px;
}

.data-table tbody tr:hover {
  background: #f8faf8;
}

.data-table strong,
.data-table small {
  display: block;
}

.data-table small {
  max-width: 380px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.align-right {
  text-align: right !important;
}

.empty-state {
  padding: 45px 20px;
  text-align: center;
}

.empty-state > span {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  color: var(--green);
  background: var(--green-pale);
  font-size: 23px;
}

.empty-state h3 {
  margin: 13px 0 4px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.page-actions {
  justify-content: space-between;
  margin-bottom: 17px;
}

.page-actions-end {
  justify-content: flex-end;
}

.search-form {
  display: flex;
  width: min(620px, 100%);
  gap: 8px;
}

.search-form input {
  flex: 1;
}

.filter-row select,
.filter-row input {
  min-width: 155px;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.field small {
  color: var(--muted);
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: white;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: #5b9d82;
  box-shadow: 0 0 0 3px rgba(57, 134, 102, 0.11);
}

input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  accent-color: var(--green);
}

.stack-form {
  display: grid;
  gap: 0;
}

.form-section {
  padding: 26px;
}

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

.field-wide {
  grid-column: span 2;
}

.check-field {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.check-row {
  margin-top: 18px;
}

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

.sticky-actions {
  position: sticky;
  z-index: 20;
  bottom: 15px;
  width: fit-content;
  margin-left: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

details {
  border: 0;
}

summary {
  cursor: pointer;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
}

.details-grid {
  margin-top: 18px;
}

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

.callout {
  margin-bottom: 20px;
  padding: 15px 17px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--green);
  border-radius: 11px;
  color: var(--ink-soft);
  background: #f8fbf9;
  font-size: 12px;
}

.callout strong {
  display: block;
  margin-bottom: 3px;
}

.callout a {
  color: var(--green);
  font-weight: 750;
}

.callout-warning {
  border-color: #e6c99c;
  border-left-color: var(--warning);
  background: var(--warning-pale);
}

.callout-danger {
  border-color: #ecc1c1;
  border-left-color: var(--danger);
  background: var(--danger-pale);
}

.line-editor {
  overflow-x: auto;
}

.line-editor-head,
.line-row {
  display: grid;
  min-width: 1060px;
  grid-template-columns: minmax(300px, 2.4fr) 72px 80px 105px 78px 76px 115px 40px;
  gap: 8px;
}

.line-editor-head {
  padding: 0 6px 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.line-row {
  align-items: start;
  padding: 11px 6px;
  border-top: 1px solid var(--line);
}

.line-main {
  display: grid;
  gap: 7px;
}

.line-row input,
.line-row select,
.line-row textarea {
  min-height: 39px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 11px;
}

.line-row textarea {
  min-height: 55px;
}

.live-total {
  display: flex;
  width: min(340px, 100%);
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 0 0 auto;
  padding: 14px 17px;
  border-radius: 12px;
  color: white;
  background: var(--green);
}

.live-total span {
  font-size: 10px;
  font-weight: 700;
}

.live-total strong {
  font-size: 21px;
}

.document-toolbar {
  justify-content: space-between;
  margin-bottom: 17px;
}

.immutable-badge {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.document-preview {
  padding: clamp(24px, 5vw, 55px);
  box-shadow: 0 18px 50px rgba(28, 59, 47, 0.1);
}

.preview-header {
  display: flex;
  gap: 30px;
  justify-content: space-between;
  padding-bottom: 25px;
  border-bottom: 2px solid var(--green);
}

.preview-header h2 {
  margin: 6px 0;
  font-size: 20px;
}

.preview-header h2 span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.preview-header p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.preview-number {
  display: grid;
  justify-items: end;
}

.preview-number span {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.preview-number strong {
  font-size: clamp(20px, 3vw, 30px);
  letter-spacing: -0.04em;
}

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

.preview-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 24px 0;
  padding: 20px;
  border-radius: 13px;
  background: var(--green-pale);
}

.preview-parties > div,
.preview-parties dl {
  display: grid;
  align-content: start;
  gap: 3px;
  margin: 0;
  font-size: 11px;
}

.preview-parties dt {
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.preview-parties dd {
  margin: 0 0 5px;
}

.preview-table th {
  color: white;
  background: var(--green);
}

.preview-table th:first-child {
  border-radius: 9px 0 0;
}

.preview-table th:last-child {
  border-radius: 0 9px 0 0;
}

.preview-table th:not(:first-child),
.preview-table td:not(:first-child) {
  text-align: right;
}

.preview-table td small {
  display: block;
  margin-top: 3px;
  color: var(--warning);
  font-size: 9px;
}

.preview-total {
  display: grid;
  width: min(370px, 100%);
  gap: 3px;
  margin: 20px 0 0 auto;
}

.preview-total > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 11px;
}

.preview-total .grand-total {
  margin-top: 4px;
  padding: 13px 12px;
  border-radius: 9px;
  color: white;
  background: var(--green);
}

.preview-total .grand-total strong {
  font-size: 19px;
}

.preview-integrity {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 28px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  color: #315b78;
  background: #edf3f6;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.action-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(380px, 1.3fr);
  gap: 20px;
}

.action-list {
  display: grid;
  gap: 8px;
}

.compact-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.compact-form .field-wide {
  grid-column: span 2;
}

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

.payment-list {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f6f8f7;
}

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

.payment-row span {
  color: var(--muted);
  font-size: 9px;
}

.payment-row.reversed,
.row-reversal {
  color: var(--danger);
  background: #fff5f5;
}

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

.identity-summary > div {
  padding: 12px;
  border-radius: 10px;
  background: #f5f8f6;
}

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

.identity-summary span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.identity-summary strong {
  margin-top: 3px;
  font-size: 12px;
}

.inner-form {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.bank-box {
  display: grid;
  gap: 13px;
  margin-top: 16px;
  padding: 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fafcfb;
}

.bank-box span,
.bank-box strong {
  display: block;
}

.bank-box span {
  color: var(--muted);
  font-size: 9px;
}

.settings-item {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.settings-item strong,
.settings-item span,
.settings-item small {
  display: block;
}

.settings-item strong {
  font-size: 12px;
}

.settings-item span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.settings-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.settings-item + details,
.settings-layout .panel > details {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.totp-panel {
  max-width: 880px;
}

.totp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}

.totp-grid h2 {
  margin: 6px 0;
}

.totp-grid p {
  color: var(--muted);
  font-size: 12px;
}

.qr-code {
  width: 210px;
  height: 210px;
  margin: 14px 0;
  border: 8px solid white;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.secret-code {
  display: block;
  width: fit-content;
  margin-top: 8px;
  padding: 8px 11px;
  letter-spacing: 0.08em;
  word-break: break-all;
}

.totp-input {
  height: 60px;
  text-align: center;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.compliance-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.compliance-card {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow);
}

.compliance-card-compliant {
  border-left-color: #48a36f;
}

.compliance-card-pending {
  border-left-color: #d9983f;
}

.compliance-card-blocked {
  border-left-color: #c44e4e;
}

.compliance-card h2 {
  margin: 3px 0 5px;
  font-size: 14px;
}

.compliance-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.deadline {
  display: inline-block;
  margin-top: 9px;
  padding: 4px 7px;
  border-radius: 6px;
  color: #80500e;
  background: var(--warning-pale);
  font-size: 9px;
  font-weight: 700;
}

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

.source-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease;
}

.source-list a:hover {
  border-color: #a9bbb3;
  background: #f8faf8;
}

.source-list span,
.source-list strong {
  display: block;
}

.source-list span {
  grid-column: 1;
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.source-list strong {
  grid-column: 1;
  font-size: 11px;
}

.source-list b {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--green);
}

.audit-list {
  display: grid;
}

.audit-list > div {
  display: grid;
  grid-template-columns: 92px 85px minmax(160px, 1fr) minmax(120px, 0.8fr);
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.audit-list span,
.audit-list small {
  color: var(--muted);
}

.login-page {
  background: #f7f8f5;
}

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(410px, 1.15fr) minmax(420px, 0.85fr);
}

.login-visual {
  display: grid;
  padding: clamp(50px, 8vw, 110px);
  align-items: center;
  color: white;
  background:
    linear-gradient(rgba(10, 42, 32, 0.82), rgba(9, 37, 29, 0.94)),
    radial-gradient(circle at 25% 10%, #4d8b70, transparent 50%),
    #12382c;
}

.login-visual-inner {
  max-width: 650px;
}

.login-visual h1 {
  margin: 12px 0 22px;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.login-visual p:not(.eyebrow) {
  max-width: 550px;
  color: #c5d8d0;
  font-size: 16px;
  line-height: 1.65;
}

.login-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 35px;
}

.login-proof span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #d8e6df;
  font-size: 10px;
}

.login-panel {
  display: grid;
  padding: 40px;
  place-items: center;
}

.login-card {
  width: min(420px, 100%);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: 0 30px 80px rgba(22, 65, 50, 0.12);
}

.login-card h2 {
  margin: 6px 0 4px;
  font-size: 31px;
  letter-spacing: -0.04em;
}

.login-card > .muted {
  margin: 0 0 25px;
  font-size: 12px;
}

.login-card .field {
  margin: 14px 0;
}

.login-card .button {
  margin-top: 8px;
}

.login-security {
  margin: 17px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 9px;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .sidebar {
    position: fixed;
    left: -275px;
    width: 252px;
    transition: left 180ms ease;
  }

  .sidebar.is-open {
    left: 0;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.25);
  }

  .mobile-menu {
    display: inline-flex;
    margin-right: 12px;
  }

  .topbar {
    justify-content: flex-start;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
  }

  .compliance-cards,
  .source-list {
    grid-template-columns: 1fr;
  }

  .audit-list > div {
    grid-template-columns: 85px 1fr;
  }

  .audit-list small {
    display: none;
  }
}

@media (max-width: 650px) {
  .content {
    padding: 20px 14px 55px;
  }

  .topbar {
    min-height: 78px;
    padding: 12px 14px;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .hide-mobile {
    display: none;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .metric-card {
    min-height: 125px;
    padding: 16px;
  }

  .metric-card strong {
    font-size: 21px;
  }

  .panel {
    padding: 18px;
    border-radius: 14px;
  }

  .page-actions,
  .document-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions .button-group,
  .document-toolbar .button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .search-form,
  .filter-row {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid,
  .compact-form,
  .expense-form,
  .totp-grid {
    grid-template-columns: 1fr;
  }

  .field-wide,
  .compact-form .field-wide {
    grid-column: span 1;
  }

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

  .preview-number {
    justify-items: start;
  }

  .preview-parties {
    grid-template-columns: 1fr;
  }

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

  .threshold-legend {
    gap: 6px;
    flex-direction: column;
  }

  .bar-chart {
    height: 170px;
  }

  .login-panel {
    padding: 18px;
  }

  .login-card {
    padding: 27px 22px;
  }
}
