:root {
  --bg: #f6f4ee;
  --panel: #fffef9;
  --ink: #171717;
  --muted: #70706b;
  --line: #dedbd1;
  --green: #087a5b;
  --red: #b7422c;
  --amber: #a36f00;
  --blue: #265f91;
  --chart-open-count: #2387e8;
  --chart-paid-count: #222a95;
  --chart-open-amount: #e0642f;
  --chart-paid-amount: #7b1b91;
  --shadow: 0 14px 40px rgba(23, 23, 23, 0.08);
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", Aptos, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
}

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

.app {
  width: min(1280px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0 34px;
}

.app-header,
.command-bar,
.overview,
.workbench,
.ledger-head,
.header-actions,
.mode-control,
.tabs,
.view-tabs {
  display: flex;
  align-items: center;
}

.app-header {
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
}

.brand {
  color: var(--ink);
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 0;
  text-decoration: none;
}

.header-actions {
  gap: 8px;
}

.account-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfaf5;
  color: var(--ink);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 950;
}

.text-link,
.quiet-button,
.secondary-button,
.primary-button,
.file-button,
.mode-button,
.view-tabs button,
.tabs button,
.row-mode,
.row-action {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
}

.text-link,
.quiet-button,
.secondary-button,
.primary-button,
.file-button,
.mode-button,
.view-tabs button,
.tabs button,
.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  text-decoration: none;
  cursor: pointer;
}

.quiet-button {
  background: transparent;
}

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

.primary-button.is-live {
  border-color: var(--red);
  background: var(--red);
}

.secondary-button.is-live {
  border-color: var(--green);
  background: rgba(8, 122, 91, 0.12);
  color: var(--green);
}

.primary-button:disabled,
.secondary-button:disabled,
.row-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.file-button {
  position: relative;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.command-bar {
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 249, 0.84);
  box-shadow: var(--shadow);
  padding: 10px;
}

.mode-control {
  gap: 7px;
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.mode-control span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.mode-button.is-active,
.view-tabs button.is-active,
.tabs button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.status-line,
.legal-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.status-line {
  min-height: 20px;
  margin: 10px 2px 0;
}

.import-report {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.import-report strong {
  color: var(--ink);
  margin-right: 4px;
}

.import-report span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfaf5;
  padding: 5px 8px;
}

.import-report ul {
  flex-basis: 100%;
  margin: 2px 0 0;
  padding-left: 18px;
}

.auth-shell,
.settings-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 14px;
  align-items: start;
  margin-top: 10px;
}

.auth-copy,
.login-form,
.account-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-copy {
  position: sticky;
  top: 16px;
  padding: 22px;
}

.auth-copy span {
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-copy h1 {
  margin-top: 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 0.98;
}

.auth-copy p,
.form-note {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

.login-form,
.account-form {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.login-form {
  align-self: start;
}

.form-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf5;
  padding: 12px;
}

.form-section > strong {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 950;
}

.single-section {
  grid-template-columns: 1fr;
}

.full-field,
.template-section > label {
  grid-column: 1 / -1;
}

.form-section label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.field-help {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
}

.check-field {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  color: var(--ink);
}

.check-field input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.form-section input,
.form-section select,
.form-section textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.form-section textarea {
  min-height: 86px;
  padding-top: 10px;
  resize: vertical;
}

.template-section textarea {
  min-height: 118px;
}

.signature-source {
  display: none;
}

.signature-section {
  align-items: start;
}

.signature-paste {
  display: grid;
  gap: 8px;
}

.signature-paste-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.signature-paste-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.signature-editor {
  min-height: 150px;
  overflow-x: auto;
  border: 1px dashed #b9b4a7;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.signature-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  font-weight: 750;
}

.signature-editor:focus {
  border-color: var(--green);
  outline: 2px solid rgba(8, 122, 91, 0.12);
}

.signature-editor.is-dragging {
  border-color: var(--green);
  background: #f4fbf8;
}

.signature-preview-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f6f1;
  padding: 12px;
}

.signature-preview-card > span,
.draft-signature-preview > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.signature-preview,
.draft-signature-preview > div {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.signature-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.draft-signature-preview {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.form-section input:focus,
.form-section select:focus,
.form-section textarea:focus {
  border-color: var(--green);
  outline: 2px solid rgba(8, 122, 91, 0.12);
}

.compact-fields label {
  grid-template-columns: minmax(0, 1fr) 86px auto;
  align-items: center;
}

.compact-fields label input {
  text-align: right;
}

.form-note {
  margin: 0;
}

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

.danger-section {
  border-color: #e2c8bd;
  background: #fff9f6;
}

.danger-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.danger-actions span {
  display: block;
  font-size: 13px;
  font-weight: 950;
}

.danger-actions p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.danger-button {
  min-height: 42px;
  flex: 0 0 auto;
  border: 1px solid #d7a293;
  border-radius: 8px;
  background: #fff;
  color: var(--red);
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.workspace-shell {
  display: block;
}

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

.overview article,
.ledger {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.overview article {
  min-width: 0;
  padding: 16px;
}

.overview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overview strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1;
}

.overview em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.25;
}

.workbench {
  display: block;
  align-items: stretch;
  gap: 12px;
  margin-top: 12px;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
}

.empty-copy,
.empty-state span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.mini-button {
  min-height: 30px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.draft-panel {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.draft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.draft-head strong {
  font-size: 15px;
}

.draft-panel textarea {
  width: 100%;
  min-height: 210px;
  margin-top: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf5;
  color: var(--ink);
  padding: 11px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  resize: vertical;
}

.problem-card,
.recipient-card {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf5;
  padding: 11px;
}

.problem-card span,
.recipient-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.problem-card strong,
.recipient-card strong {
  display: block;
  margin-top: 4px;
}

.problem-card p,
.problem-card ul,
.recipient-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.problem-card ul {
  padding-left: 17px;
}

.send-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 9px;
}

.send-box input,
.send-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.send-button {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  cursor: pointer;
}

.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 23, 23, 0.42);
}

.action-modal {
  width: min(680px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(23, 23, 23, 0.26);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.modal-head strong {
  font-size: 16px;
  font-weight: 950;
}

.modal-head .mini-button {
  margin-top: 0;
}

.action-modal .draft-panel {
  margin-top: 0;
  border-top: 0;
  padding: 14px;
}

.ledger {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

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

.dashboard-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.dashboard-grid,
.dashboard-columns {
  display: grid;
  gap: 10px;
}

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

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

.trend-block {
  display: grid;
  gap: 10px;
}

.range-toggle {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f1e8;
  padding: 3px;
}

.trend-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.range-toggle button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

.range-toggle button.is-active {
  background: var(--ink);
  color: var(--panel);
}

.dashboard-grid article,
.dashboard-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf5;
}

.dashboard-grid article {
  padding: 14px;
}

.dashboard-grid span,
.dashboard-block-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dashboard-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.dashboard-grid p,
.dashboard-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
}

.dashboard-block {
  padding: 12px;
}

.dashboard-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-block-head strong {
  font-size: 14px;
  font-weight: 950;
}

.dashboard-bars,
.dashboard-list {
  display: grid;
  gap: 8px;
}

.trend-chart {
  overflow-x: auto;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

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

.trend-legend i {
  display: inline-block;
  width: 18px;
  height: 8px;
  border-radius: 999px;
}

.legend-paid-line {
  background: var(--chart-paid-amount);
}

.legend-open-line {
  background: var(--chart-open-amount);
}

.legend-paid-bar {
  background: var(--chart-paid-count);
}

.legend-open-bar {
  background: var(--chart-open-count);
}

.trend-chart svg {
  display: block;
  width: 100%;
  min-width: 680px;
  height: auto;
}

.trend-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.trend-gridline {
  stroke: #e3dfd2;
  stroke-width: 1;
}

.trend-axis,
.trend-month,
.trend-axis-title,
.trend-count-label,
.trend-value {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.trend-axis-left {
  text-anchor: end;
}

.trend-axis-right {
  text-anchor: start;
}

.trend-axis-title {
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trend-month {
  text-anchor: middle;
}

.trend-bar-paid {
  fill: var(--chart-paid-count);
}

.trend-bar-open {
  fill: var(--chart-open-count);
}

.trend-line-paid,
.trend-line-open {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-line-paid {
  stroke: var(--chart-paid-amount);
}

.trend-line-open {
  stroke: var(--chart-open-amount);
}

.trend-dot-paid {
  fill: var(--chart-paid-amount);
}

.trend-dot-open {
  fill: var(--chart-open-amount);
}

.trend-count-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 950;
  text-anchor: middle;
}

.trend-value {
  paint-order: stroke;
  stroke: var(--panel);
  stroke-width: 4px;
  font-size: 12px;
  font-weight: 950;
}

.trend-value-open {
  fill: #9f3e1d;
}

.trend-value-paid {
  fill: #651273;
}

.bar-row,
.customer-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.bar-row {
  display: grid;
  grid-template-columns: 74px minmax(90px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  text-align: left;
}

.bar-row span {
  font-size: 12px;
  font-weight: 900;
}

.bar-row div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe7dc;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.bar-row strong {
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.customer-row {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  text-align: left;
}

.customer-row span,
.customer-row em {
  display: block;
}

.customer-row strong {
  font-size: 13px;
  font-weight: 950;
}

.customer-row em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.customer-row b {
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.activity-panel {
  min-height: 420px;
  padding: 12px;
}

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

.activity-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 11px 12px;
}

.activity-item time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.activity-item strong,
.activity-item span,
.activity-item p {
  display: block;
}

.activity-item strong {
  font-size: 13px;
  font-weight: 950;
}

.activity-item span,
.activity-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.bar-row:hover,
.customer-row:hover {
  border-color: var(--green);
  background: rgba(8, 122, 91, 0.08);
}

.ledger-head {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.view-tabs {
  gap: 7px;
}

.view-tabs button {
  min-height: 38px;
  font-size: 13px;
}

.search-box {
  display: grid;
  gap: 5px;
  max-width: 420px;
}

.search-box span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.search-box input {
  width: min(420px, 100%);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf5;
  color: var(--ink);
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
}

.search-box input:focus {
  border-color: var(--green);
  outline: 2px solid rgba(8, 122, 91, 0.12);
}

.search-summary {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(8, 122, 91, 0.22);
  border-radius: 8px;
  background: rgba(8, 122, 91, 0.07);
  color: #0f4739;
  padding: 7px 8px 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.search-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-summary strong {
  font-weight: 950;
}

.search-summary button {
  min-height: 28px;
  border: 1px solid rgba(8, 122, 91, 0.28);
  border-radius: 7px;
  background: var(--panel);
  color: var(--green);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 0 9px;
}

.search-summary button:hover {
  border-color: var(--green);
}

.tabs {
  flex-wrap: wrap;
  gap: 7px;
}

.tabs button {
  min-height: 36px;
  font-size: 13px;
}

.empty-state {
  display: grid;
  min-height: 340px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 24px;
  text-align: center;
}

.empty-state strong {
  font-size: 22px;
}

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

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

th {
  background: #f1efe7;
  color: #4f4f4b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

td {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.client-mail {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  margin-top: 2px;
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 950;
}

.tag.overdue {
  background: rgba(183, 66, 44, 0.12);
  color: var(--red);
}

.tag.soon {
  background: rgba(163, 111, 0, 0.14);
  color: var(--amber);
}

.tag.promise {
  background: rgba(38, 95, 145, 0.13);
  color: var(--blue);
}

.tag.dispute {
  background: rgba(23, 23, 23, 0.1);
  color: var(--ink);
}

.tag.ok {
  background: rgba(8, 122, 91, 0.12);
  color: var(--green);
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.stage-action {
  border-color: #efd49a;
  background: #fff3d8;
  color: #7a4b00;
}

.stage-review {
  border-color: #f2bbb0;
  background: #fde7e1;
  color: #963523;
}

.stage-followup {
  border-color: #bad0ea;
  background: #e7f0fb;
  color: #164f85;
}

.stage-paused,
.stage-promise {
  border-color: #c9d9ea;
  background: #edf5fc;
  color: #225b86;
}

.stage-blocked {
  border-color: #d4d0c6;
  background: #efede7;
  color: #2f2f2b;
}

.stage-soon {
  border-color: #eadba9;
  background: #f9f1d7;
  color: #775700;
}

.stage-current,
.stage-done {
  border-color: #adddcb;
  background: #ddf3e9;
  color: #087052;
}

.row-mode {
  width: 122px;
  padding: 0 8px;
}

.row-action {
  min-width: 92px;
  min-height: 36px;
  border-color: var(--green);
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
}

.row-action.is-live {
  background: rgba(8, 122, 91, 0.12);
}

.action-cell {
  max-width: 260px;
}

.action-state {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  margin-top: 5px;
}

.legal-note {
  margin: 12px 2px 0;
}

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

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

  .auth-shell,
  .settings-shell {
    grid-template-columns: 1fr;
  }

  .auth-copy {
    position: static;
  }

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

  .workbench {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 16px, 1280px);
    padding-top: 12px;
  }

  .app-header,
  .header-actions,
  .mode-control {
    align-items: stretch;
    flex-direction: column;
  }

  .command-bar > *,
  .header-actions > *,
  .mode-control > button,
  .file-button {
    width: 100%;
  }

  .mode-control {
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }

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

  .form-section,
  .compact-fields label {
    grid-template-columns: 1fr;
  }

  .send-box {
    grid-template-columns: 1fr;
  }

  .search-box,
  .search-box input {
    max-width: none;
    width: 100%;
  }
}
