@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");
@import url("../../shared/browser/css/invofy_scrollbars.css?v=14");

:root {
  --bg: #edf3fb;
  --surface: #ffffff;
  --sidebar: #f5f8ff;
  --soft: #f3f7ff;
  --line: #e0e8f3;
  --line-strong: #d4deec;
  --text: #0b111b;
  --muted: #78869a;
  --muted-light: #a5b1c1;
  --blue: #326ee8;
  --blue-dark: #245bd1;
  --shadow: 0 20px 60px rgba(43, 72, 118, 0.09);
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --bg: #0d141d;
  --surface: #151e2a;
  --sidebar: #111b27;
  --soft: #101823;
  --line: #243244;
  --line-strong: #314257;
  --text: #edf4fc;
  --muted: #93a3b8;
  --muted-light: #64748b;
  --blue: #6ea2ff;
  --blue-dark: #3d7df2;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--text);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .72;
}

input,
select,
textarea {
  border: 0;
  outline: 0;
  min-width: 0;
  background: transparent;
  color: var(--text);
}

select,
textarea {
  width: 100%;
}

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

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.visually-hidden,
.drop-area input[type="file"],
.stack-form input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  white-space: nowrap;
}

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

.sidebar-section {
  min-width: 0;
  min-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  border-radius: 24px;
  background: var(--sidebar);
  box-shadow: var(--shadow);
}

.brand,
.brand-mark,
.nav-icon,
.extension-mark,
.icon-button,
.activity-icon,
.status-dot {
  display: grid;
  place-items: center;
}

.brand {
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 11px;
  min-height: 42px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-button {
  min-height: 48px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  padding: 0 14px 0 8px;
  background: transparent;
  color: #637187;
  font-weight: 700;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  background: #fff;
  color: var(--text);
}

.nav-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.nav-button.active .nav-icon {
  color: var(--blue);
}

.extension-card {
  margin-top: auto;
  min-height: 72px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(50, 110, 232, 0.08);
  color: var(--text);
  text-align: left;
}

.extension-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--blue) 0 22%, transparent 23%),
    radial-gradient(circle at 50% 50%, #dce8ff 0 60%, transparent 61%);
}

.extension-card strong,
.extension-card span {
  display: block;
}

.extension-card strong {
  font-size: 13px;
  line-height: 1.15;
}

.extension-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.content-section {
  min-width: 0;
  height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: clip;
}

.content-topbar,
.content-footer {
  min-width: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 38px rgba(43, 72, 118, 0.06);
}

.content-topbar {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 14px 12px 18px;
}

.page-title span,
.page-title strong {
  display: block;
}

.page-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.page-title strong {
  margin-top: 3px;
  font-size: 22px;
  letter-spacing: 0;
}

.topbar-actions {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.search-field {
  min-width: 0;
  flex: 1 1 420px;
  max-width: 560px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--muted-light);
}

.search-field input {
  width: 100%;
}

.icon-button {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: #fff;
  color: #516075;
  border: 1px solid var(--line);
}

.theme-button {
  flex: 0 0 auto;
}

.notification-button span {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f35f62;
  border: 2px solid #fff;
}

.profile-button {
  min-height: 46px;
  display: grid;
  grid-template-columns: 34px minmax(0, auto) 16px;
  align-items: center;
  gap: 10px;
  border-radius: 15px;
  padding: 5px 10px 5px 6px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.profile-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #18233a, #6f7b92);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.profile-copy {
  display: grid;
  line-height: 1.1;
  text-align: left;
}

.profile-copy strong {
  font-size: 13px;
}

.profile-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.auth-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(320px, calc(100vw - 36px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(43, 72, 118, 0.16);
}

.auth-popover[hidden] {
  display: none;
}

.auth-form {
  display: grid;
  gap: 8px;
}

.auth-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-form input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.auth-logout-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  font-weight: 800;
}

.auth-link-button {
  min-height: 36px;
  border-radius: 8px;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  text-align: center;
}

.content-body {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 0 2px 14px 0;
}

.app-view {
  min-width: 0;
  min-height: 100%;
  display: none;
}

.app-view.active {
  display: grid;
}

.app-view--dashboard,
.app-view--workspace {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 14px;
}

.app-view--settings {
  align-items: start;
}

.app-view--auth-flow {
  align-items: start;
}

.auth-flow-main {
  width: min(760px, 100%);
  display: grid;
  gap: 14px;
}

.auth-flow-panel {
  display: none;
}

.auth-flow-panel.active {
  display: block;
}

.dashboard-main,
.dashboard-side,
.workspace-main,
.workspace-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
}

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

.kpi-card,
.panel,
.upgrade-card,
.drop-area {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(43, 72, 118, 0.045);
}

.kpi-card {
  min-height: 112px;
  padding: 18px;
  border-radius: 20px;
}

.cube {
  width: 18px;
  height: 18px;
  display: block;
  margin-bottom: 15px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: #e7edf6;
}

.kpi-card.active .cube {
  background: var(--blue);
}

.kpi-card small,
.kpi-card em,
.panel-head p,
.panel-head span,
.legend-list span,
.saving-layout span,
.activity-row span,
.activity-row small,
.content-footer small {
  color: var(--muted);
}

.kpi-card small,
.kpi-card em {
  display: block;
  font-style: normal;
  font-size: 12px;
}

.kpi-card strong {
  display: block;
  margin: 5px 0 2px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.panel,
.upgrade-card {
  border-radius: 22px;
  padding: 20px;
}

.overview-panel {
  padding-bottom: 16px;
}

.panel-head {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-head.compact {
  margin-bottom: 14px;
}

.panel-head h2,
.panel-head p {
  margin: 0;
}

.panel-head h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.panel-head p {
  margin-top: 3px;
  font-size: 12px;
}

.panel-head span {
  font-size: 13px;
  white-space: nowrap;
}

.range-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: var(--soft);
}

.range-tabs button {
  height: 32px;
  min-width: 58px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.range-tabs .active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(43, 72, 118, 0.08);
}

.chart-frame {
  position: relative;
  min-height: clamp(290px, 30vw, 410px);
  padding: 16px 0 0 42px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% 25%;
}

.axis-labels {
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 34px;
  width: 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted-light);
  font-size: 11px;
}

.chart-frame svg {
  width: 100%;
  height: calc(100% - 28px);
  min-height: 250px;
  display: block;
  overflow: visible;
}

.chart-area {
  fill: url(#areaFill);
}

.chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.focus-line {
  stroke: var(--blue);
  stroke-dasharray: 5 7;
  opacity: .38;
}

.focus-dot {
  fill: var(--blue);
  stroke: #fff;
  stroke-width: 4;
}

.chart-tip rect {
  fill: var(--blue);
}

.chart-tip text:first-of-type {
  fill: #c7d7ff;
  font-size: 11px;
}

.chart-tip text:last-of-type {
  fill: #fff;
  font-size: 13px;
  font-weight: 800;
}

.month-labels {
  display: flex;
  justify-content: space-between;
  padding-right: 2px;
  color: var(--muted-light);
  font-size: 12px;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 14px;
}

.workspace-panel {
  min-height: 0;
  padding: 20px;
  border-radius: 20px;
}

.toolbar-row {
  margin: 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-row button,
.primary-action,
.secondary-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 0 14px;
  background: var(--soft);
  color: var(--text);
  font-weight: 800;
}

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

.primary-action.is-busy,
.secondary-action.is-busy,
button.is-busy {
  pointer-events: none;
}

.secondary-action {
  width: 100%;
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
}

.data-table {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.document-table,
.payment-import-table,
.expense-table,
.report-export-table {
  width: 100%;
}

.payment-import-table .data-table__head,
.payment-import-table .data-table__row {
  grid-template-columns: 1fr .75fr .8fr .55fr .7fr;
}

.data-table__head,
.data-table__row {
  min-width: 0;
  display: grid;
  grid-template-columns: 1.15fr 1fr .75fr .75fr .65fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
}

.data-table__head {
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.data-table__row {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, var(--soft));
  font-size: 13px;
}

.data-table__row--managed {
  cursor: pointer;
}

.data-table__row--managed:hover,
.data-table__row--managed:focus-visible {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
  outline: 0;
}

.data-table__row--active {
  border-color: color-mix(in srgb, var(--blue) 56%, var(--line));
  background: color-mix(in srgb, var(--blue) 10%, var(--surface));
}

.data-table__row span,
.data-table__row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.status-pill.paid {
  color: #09744e;
  background: #ddf8eb;
}

.status-pill.draft {
  color: #5e6878;
  background: #edf2f8;
}

.status-pill.review {
  color: #9a5d00;
  background: #fff2d5;
}

.status-pill.sent {
  color: #2258c8;
  background: #e3ecff;
}

.compact-form-card {
  padding: 20px;
  border-radius: 20px;
}

.activity-panel,
.intake-drop-panel,
.payment-matching-panel {
  min-width: 0;
}

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

.reminder-template-form,
.catalog-item-form {
  align-content: start;
}

.stack-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stack-form input,
.stack-form select,
.stack-form textarea {
  min-height: 42px;
  margin-bottom: 4px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
}

.stack-form textarea {
  padding-top: 11px;
}

.stack-form .inline-check {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 800;
}

.stack-form .inline-check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: #26c66f;
}

.payment-rule-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.document-partner-results {
  display: none;
  gap: 8px;
  max-height: 272px;
  margin: -2px 0 8px;
  overflow-y: auto;
}

.document-partner-results.is-open {
  display: grid;
}

.document-partner-option,
.document-partner-results__empty {
  min-width: 0;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--blue) 14%, var(--line));
  border-radius: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 6%, transparent), transparent 58%),
    var(--surface);
  color: var(--text);
}

.document-partner-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.document-partner-option:hover,
.document-partner-option:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--blue) 36%, var(--line));
  box-shadow: 0 12px 28px color-mix(in srgb, var(--shadow) 46%, transparent);
  outline: none;
}

.document-partner-option strong,
.document-partner-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-partner-option strong {
  font-size: 12px;
}

.document-partner-option small {
  color: var(--muted);
  font-size: 11px;
}

.document-partner-option em {
  grid-row: span 2;
  align-self: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.document-partner-results__empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.drop-area {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 34px 24px;
  border-style: dashed;
  border-radius: 24px;
  text-align: center;
}

.drop-area.is-dragging {
  border-color: var(--blue);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--blue) 14%, transparent);
}

.drop-area svg {
  width: 38px;
  height: 38px;
  color: var(--blue);
}

.drop-area h2 {
  min-width: 0;
  max-width: 640px;
  margin: 0;
  font-size: 34px;
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.drop-area p {
  min-width: 0;
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.file-queue,
.partner-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.file-queue div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.file-queue__row {
  min-width: 0;
}

.file-queue div:hover,
.file-queue div:focus-visible {
  border-color: color-mix(in srgb, var(--blue) 26%, var(--line));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--shadow) 54%, transparent);
  outline: 0;
}

.file-queue div.is-selected {
  border-color: color-mix(in srgb, var(--blue) 58%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 10%, transparent), transparent 58%),
    var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent);
}

.file-queue div.is-assigned {
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
}

.file-queue div.warning {
  border-color: color-mix(in srgb, #d98a22 42%, var(--line));
  background: color-mix(in srgb, #fff2d5 38%, var(--surface));
}

.file-queue span,
.file-queue strong,
.file-queue small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-queue strong,
.file-queue small {
  font-size: 12px;
}

.intake-assignment-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.intake-assignment-list:empty {
  display: none;
}

.intake-assignment-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--blue) 16%, var(--line));
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 7%, transparent), transparent 62%),
    var(--soft);
}

.intake-assignment-row strong,
.intake-assignment-row span,
.intake-assignment-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.intake-assignment-row span,
.intake-assignment-row small {
  color: var(--muted);
  font-size: 12px;
}

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

.partner-grid article {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.partner-grid article[data-managed-partner-card],
.partner-grid article.partner-card--managed {
  cursor: pointer;
  border-color: color-mix(in srgb, var(--blue) 16%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 7%, transparent), transparent 58%),
    var(--surface);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--shadow) 40%, transparent);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.partner-grid article[data-managed-partner-card]::after {
  content: attr(data-sync-label);
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.partner-grid article[data-managed-partner-card]:hover,
.partner-grid article[data-managed-partner-card]:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--blue) 38%, var(--line));
  box-shadow: 0 18px 44px color-mix(in srgb, var(--shadow) 58%, transparent);
  outline: none;
}

.partner-grid article.partner-card--saved {
  border-color: color-mix(in srgb, #2f9d6a 24%, var(--line));
}

.partner-grid article.partner-card--local {
  border-color: color-mix(in srgb, #d98a22 30%, var(--line));
}

.partner-grid article.partner-card--active {
  border-color: color-mix(in srgb, var(--blue) 58%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 13%, transparent), transparent 62%),
    var(--surface);
}

.partner-grid article span {
  grid-row: span 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.partner-grid article.partner-card--local span {
  background: #d98a22;
}

.partner-grid strong,
.partner-grid small,
.partner-grid em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partner-grid small,
.partner-grid em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.partner-detail-panel {
  display: grid;
  gap: 18px;
}

.partner-detail-form {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.partner-detail-panel .partner-person-field {
  display: none;
}

.partner-detail-panel.is-natural-person .partner-person-field {
  display: grid;
}

.partner-detail-panel.is-natural-person .partner-entity-field {
  display: none;
}

.partner-cc-extra-list,
.partner-contact-list {
  display: grid;
  gap: 10px;
}

.partner-cc-extra-list {
  margin-bottom: 2px;
}

.partner-cc-extra-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.partner-cc-extra-field input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
}

.partner-cc-add {
  color: #09744e;
  border-color: color-mix(in srgb, #26c66f 36%, var(--line));
  background: color-mix(in srgb, #26c66f 10%, var(--surface));
}

.partner-contact-list article {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.partner-contact-list strong,
.partner-contact-list small,
.partner-contact-list em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partner-contact-list strong {
  display: block;
  font-size: 13px;
}

.partner-contact-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.partner-contact-list em {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.partner-contact-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.partner-contact-actions .icon-button {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.partner-contact-list:empty {
  min-height: 84px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.document-builder {
  display: grid;
  gap: 18px;
}

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

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

.line-item-form .primary-action {
  min-height: 40px;
}

.line-item-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.line-item-field input,
.line-item-field select {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
}

.line-item-table {
  display: grid;
  gap: 8px;
}

.line-item-table__head,
.line-item-table__row {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(180px, 1fr) .65fr .75fr .55fr .75fr 46px;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 14px;
}

.line-item-table__head {
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.line-item-table__body {
  display: grid;
  gap: 8px;
}

.line-item-table__row {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, var(--soft));
  font-size: 13px;
}

.line-item-table__row span,
.line-item-table__row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-item-remove {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

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

.document-totals div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.document-totals span,
.document-totals strong {
  display: block;
}

.document-totals span {
  color: var(--muted);
  font-size: 12px;
}

.document-totals strong {
  margin-top: 5px;
  font-size: 18px;
}

.document-totals__grand {
  background: color-mix(in srgb, var(--blue) 10%, var(--surface)) !important;
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line)) !important;
}

.payment-overview-panel {
  overflow: clip;
}

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

.payment-metric {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.payment-metric.is-primary {
  background: color-mix(in srgb, var(--blue) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
}

.payment-metric span,
.payment-metric strong,
.payment-metric small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-metric span,
.payment-metric small {
  color: var(--muted);
  font-size: 12px;
}

.payment-metric strong {
  margin: 6px 0 3px;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

.payment-split-grid {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr);
  gap: 14px;
}

.payment-queue,
.payment-match-table {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.payment-queue h3,
.payment-match-table h3 {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  letter-spacing: 0;
}

.payment-queue h3 span,
.payment-match-table h3 span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.payment-queue-list,
.payment-assignment-list {
  display: grid;
  gap: 10px;
}

.payment-queue-list article,
.payment-assignment-list article {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.payment-queue-list article {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  padding: 12px;
}

.payment-assignment-list article {
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 13px 14px;
}

.payment-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #dde7f6;
  color: #384861;
  font-size: 12px;
  font-weight: 900;
}

.payment-avatar.plus {
  background: color-mix(in srgb, #26c66f 18%, var(--surface));
  color: #09744e;
}

.payment-avatar.fee {
  background: color-mix(in srgb, #d98a22 18%, var(--surface));
  color: #7a4a00;
}

.payment-transaction-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.payment-transaction-action {
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 11px;
  line-height: 1;
}

.payment-transaction-action.is-danger {
  border-color: color-mix(in srgb, #d85a4a 24%, var(--line));
  color: #9d3328;
}

.payment-queue-list strong,
.payment-queue-list small,
.payment-queue-list em,
.payment-assignment-list strong,
.payment-assignment-list span,
.payment-assignment-list small,
.payment-assignment-list em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-queue-list strong,
.payment-assignment-list strong {
  display: block;
  font-size: 13px;
}

.payment-queue-list small,
.payment-assignment-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.payment-queue-list em,
.payment-assignment-list em {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.payment-mini-table {
  display: grid;
  gap: 8px;
}

.payment-mini-table div {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr .82fr .72fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, var(--soft));
  font-size: 12px;
}

.payment-mini-table div:first-child {
  background: var(--soft);
  color: var(--muted);
  font-weight: 900;
}

.payment-mini-table span,
.payment-mini-table strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-document-action {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.payment-assignment-list:empty {
  min-height: 84px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.expense-overview-panel {
  overflow: clip;
}

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

.expense-metric {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.expense-metric.is-primary {
  background: color-mix(in srgb, #26c66f 10%, var(--surface));
  border-color: color-mix(in srgb, #26c66f 34%, var(--line));
}

.expense-metric span,
.expense-metric strong,
.expense-metric small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-metric span,
.expense-metric small {
  color: var(--muted);
  font-size: 12px;
}

.expense-metric strong {
  margin: 6px 0 3px;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

.expense-card-list,
.expense-staging-list {
  display: grid;
  gap: 10px;
}

.ai-proposal-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ai-proposal-card,
.ai-proposal-empty {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.ai-proposal-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 12px;
}

.ai-proposal-card strong,
.ai-proposal-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-proposal-card small {
  color: var(--muted);
  font-size: 12px;
}

.ai-proposal-apply {
  grid-row: span 2;
  width: auto;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 11px;
  font-size: 11px;
}

.ai-proposal-empty {
  padding: 11px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.expense-card-list article,
.expense-staging-list article {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.expense-card-list article {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  padding: 12px;
}

.expense-staging-list article {
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 13px 14px;
}

.expense-source-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, #26c66f 14%, var(--surface));
  color: #09744e;
}

.expense-card-list strong,
.expense-card-list small,
.expense-card-list em,
.expense-staging-list strong,
.expense-staging-list span,
.expense-staging-list small,
.expense-staging-list em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-card-list strong,
.expense-staging-list strong {
  display: block;
  font-size: 13px;
}

.expense-card-list small,
.expense-staging-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.expense-card-list em,
.expense-staging-list em {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.expense-staging-list:empty {
  min-height: 84px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.report-overview-panel {
  overflow: clip;
}

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

.report-metric {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.report-metric.is-primary {
  background: color-mix(in srgb, var(--blue) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
}

.report-metric span,
.report-metric strong,
.report-metric small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-metric span,
.report-metric small {
  color: var(--muted);
  font-size: 12px;
}

.report-metric strong {
  margin: 6px 0 3px;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

.report-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, .95fr);
  gap: 14px;
}

.report-spark-panel {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.report-spark-panel h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.report-bar-list,
.report-readiness-list,
.report-export-list {
  display: grid;
  gap: 10px;
}

.report-bar-list div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
}

.report-bar-list span,
.report-bar-list strong,
.report-readiness-list span,
.report-readiness-list strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-bar-list span,
.report-readiness-list span {
  color: var(--muted);
  font-size: 12px;
}

.report-bar-list strong,
.report-readiness-list strong {
  font-size: 12px;
}

.report-bar-list em {
  grid-column: 1 / -1;
  height: 9px;
  display: block;
  max-width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), #25c07a);
}

.report-bar-list em.metric-fill-84 {
  width: 84%;
}

.report-bar-list em.metric-fill-62 {
  width: 62%;
}

.report-bar-list em.metric-fill-24 {
  width: 24%;
}

.report-readiness-list div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

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

.report-pack-grid article {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.report-pack-grid svg {
  color: var(--blue);
}

.report-pack-grid strong,
.report-pack-grid small,
.report-pack-grid em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-pack-grid strong {
  white-space: nowrap;
  font-size: 13px;
}

.report-pack-grid small {
  min-height: 44px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.report-pack-grid em {
  width: max-content;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.report-export-list article {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.report-export-list strong,
.report-export-list span,
.report-export-list small,
.report-export-list em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-export-list strong {
  display: block;
  font-size: 13px;
}

.report-export-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.report-export-list em {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.report-export-list:empty {
  min-height: 84px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.template-overview-panel,
.template-canvas-panel {
  overflow: clip;
}

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

.template-metric {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.template-metric.is-primary {
  background: color-mix(in srgb, var(--blue) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
}

.template-metric span,
.template-metric strong,
.template-metric small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-metric span,
.template-metric small {
  color: var(--muted);
  font-size: 12px;
}

.template-metric strong {
  margin: 6px 0 3px;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

.template-canvas {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    var(--soft);
  background-size: 24px 24px;
}

.template-page-head,
.template-page-address,
.template-page-body,
.template-page-footer {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.template-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.template-page-head span,
.template-page-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-page-head span {
  color: var(--muted);
  font-size: 12px;
}

.template-page-address {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
}

.template-page-address div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.template-page-address small,
.template-page-address span {
  color: var(--muted);
  font-size: 12px;
}

.template-page-address strong,
.template-page-address span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-page-body {
  min-height: 180px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.template-page-body:empty::before {
  content: "Stage layout blocks to build this template.";
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.template-block-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.template-block-row[data-align="center"] {
  text-align: center;
}

.template-block-row[data-align="right"] {
  text-align: right;
}

.template-block-row[data-align="justify"] {
  text-align: justify;
}

.template-block-row strong,
.template-block-row span,
.template-block-row small,
.template-block-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.template-block-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.template-block-row small {
  margin-top: 3px;
  color: var(--muted-light);
  font-size: 11px;
}

.template-block-row em {
  align-self: start;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.template-page-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
}

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

.placeholder-grid article,
.template-pack-grid article {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.placeholder-grid strong,
.placeholder-grid span,
.template-pack-grid strong,
.template-pack-grid small,
.template-pack-grid em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.placeholder-grid strong,
.template-pack-grid strong {
  white-space: nowrap;
  font-size: 13px;
}

.placeholder-grid span {
  padding: 7px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.template-pack-grid svg {
  color: var(--blue);
}

.template-pack-grid small {
  min-height: 44px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.template-pack-grid em {
  width: max-content;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.signature-pad-shell {
  display: grid;
  gap: 10px;
}

.signature-pad {
  width: 100%;
  height: 110px;
  border: 1px dashed color-mix(in srgb, var(--blue) 42%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  touch-action: none;
}

.signature-asset-list {
  display: grid;
  gap: 10px;
}

.signature-asset-list article {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.signature-asset-list strong,
.signature-asset-list small,
.signature-asset-list em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signature-asset-list strong {
  display: block;
  font-size: 13px;
}

.signature-asset-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.signature-asset-list em {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.signature-asset-list:empty {
  min-height: 84px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.settings-form,
.settings-fieldset {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.settings-fieldset {
  padding-top: 2px;
}

.settings-fieldset + .settings-fieldset {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.settings-fieldset h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.settings-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-field--wide {
  margin-top: 12px;
}

.settings-field--small {
  max-width: 180px;
}

.settings-field input,
.settings-field select,
.settings-field textarea {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
}

.settings-field textarea {
  min-height: 86px;
  padding-top: 11px;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-list div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.settings-list--compact div {
  padding: 10px 12px;
}

.settings-list div.settings-list-row--with-action {
  grid-template-columns: minmax(0, 1fr) auto;
}

.settings-list div.settings-list-row--with-action strong {
  grid-column: 1 / -1;
  text-align: left;
}

.settings-list div.settings-list-row-actions {
  min-width: max-content;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.settings-list-row-actions .icon-button {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.icon-button--danger {
  color: #cf3c4f;
  background: color-mix(in srgb, #cf3c4f 8%, var(--surface));
  border-color: color-mix(in srgb, #cf3c4f 26%, var(--line));
}

.icon-button--danger:hover {
  color: #fff;
  background: #cf3c4f;
  border-color: #cf3c4f;
}

.settings-list span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-inline-status {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-list strong {
  font-size: 12px;
  text-align: right;
}

.storage-region-lock {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px dashed color-mix(in srgb, var(--blue) 42%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
}

.storage-region-lock svg {
  color: var(--blue);
}

.storage-region-lock strong,
.storage-region-lock span {
  display: block;
}

.storage-region-lock span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.quota-meter {
  height: 10px;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.quota-meter span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #25c07a);
}

.quota-meter span.quota-meter-fill-38 {
  width: 38%;
}

.app-toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 800;
}

.app-toast--success {
  border-color: color-mix(in srgb, #26c66f 34%, var(--line));
}

.app-toast--warning {
  border-color: color-mix(in srgb, #d98a22 42%, var(--line));
}

.app-toast--error {
  border-color: color-mix(in srgb, #e25858 44%, var(--line));
}

.statistics-layout {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut {
  width: min(148px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0 43%, #111 43% 57%, #e7ebf1 57% 100%);
}

.donut span {
  width: 66%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  font-weight: 800;
}

.legend-list {
  display: grid;
  gap: 12px;
}

.legend-list strong,
.legend-list span,
.saving-layout strong,
.saving-layout span {
  display: block;
}

.saving-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.ring {
  width: min(118px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.ring.blue {
  background: conic-gradient(var(--blue) 0 72%, #f0f3f8 72% 100%);
}

.ring.dark {
  background: conic-gradient(#111 0 58%, #f0f3f8 58% 100%);
}

.ring::after {
  content: "";
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
}

.saving-layout span {
  margin-top: 10px;
}

.upgrade-card {
  min-height: 310px;
  background: #f2f6ff;
}

.cube-stage {
  height: 142px;
  position: relative;
  margin-bottom: 16px;
}

.big-cube {
  position: absolute;
  width: 54px;
  height: 62px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(145deg, #e8edf8, #ffffff);
}

.big-cube.c1 { left: 14%; top: 7%; }
.big-cube.c2 { left: 38%; top: 23%; }
.big-cube.c3 { right: 12%; top: 7%; }
.big-cube.c4 { left: 52%; top: 64%; transform: translateX(-50%); background: var(--blue); }

.upgrade-card small {
  color: var(--muted);
}

.upgrade-card h2 {
  margin: 8px 0 18px;
  font-size: 36px;
  line-height: .96;
  letter-spacing: 0;
}

.upgrade-card button {
  min-height: 46px;
  border-radius: 10px;
  padding: 0 20px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

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

.activity-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--soft);
  color: #657184;
}

.activity-row strong,
.activity-row span,
.activity-row b,
.activity-row small {
  display: block;
}

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

.activity-row b {
  text-align: right;
  white-space: nowrap;
  font-size: 13px;
}

.activity-row small {
  margin-top: 2px;
  font-weight: 500;
  font-size: 11px;
}

.content-footer {
  min-height: 64px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
}

.content-footer div {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 9px;
  align-items: center;
}

.content-footer strong,
.content-footer small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-footer strong {
  font-size: 13px;
}

.content-footer small {
  grid-column: 2;
  font-size: 11px;
}

.content-footer svg {
  color: var(--blue);
}

.content-footer .is-warning strong,
.content-footer .is-warning small,
.content-footer .is-warning svg {
  color: var(--danger);
}

.content-footer .is-warning .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 7px rgba(228, 77, 77, .14);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #26c66f;
  box-shadow: 0 0 0 7px rgba(38, 198, 111, .12);
}

html[data-theme="dark"] .nav-button:hover,
html[data-theme="dark"] .nav-button.active,
html[data-theme="dark"] .extension-card,
html[data-theme="dark"] .search-field,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .profile-button,
html[data-theme="dark"] .range-tabs .active,
html[data-theme="dark"] .donut span,
html[data-theme="dark"] .ring::after {
  background: var(--surface);
}

html[data-theme="dark"] .content-topbar,
html[data-theme="dark"] .content-footer {
  background: rgba(21, 30, 42, 0.78);
}

html[data-theme="dark"] .nav-button,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .activity-icon {
  color: var(--muted);
}

html[data-theme="dark"] .notification-button span,
html[data-theme="dark"] .focus-dot {
  border-color: var(--surface);
}

html[data-theme="dark"] .donut {
  background: conic-gradient(var(--blue) 0 43%, #e6edf8 43% 57%, #263244 57% 100%);
}

html[data-theme="dark"] .ring.blue {
  background: conic-gradient(var(--blue) 0 72%, #263244 72% 100%);
}

html[data-theme="dark"] .ring.dark {
  background: conic-gradient(#e6edf8 0 58%, #263244 58% 100%);
}

html[data-theme="dark"] .upgrade-card {
  background: #121d2a;
}

html[data-theme="dark"] .big-cube {
  background: linear-gradient(145deg, #1e2a39, #314054);
}

html[data-theme="dark"] .big-cube.c4 {
  background: var(--blue);
}

@media (max-width: 1280px) {
  .app-view--dashboard,
  .app-view--workspace {
    grid-template-columns: 1fr;
  }

  .dashboard-side,
  .workspace-side {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  }
}

@media (max-width: 1120px) {
  .profile-copy {
    display: none;
  }

  .profile-button {
    grid-template-columns: 34px 16px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
  }

  .sidebar-section {
    align-items: center;
    padding: 18px 12px;
  }

  .brand {
    grid-template-columns: 30px;
  }

  .brand-name,
  .nav-button > span:last-child,
  .extension-card div {
    display: none;
  }

  .nav-button {
    width: 52px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .extension-card {
    width: 52px;
    min-height: 52px;
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .content-topbar {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .search-field {
    max-width: none;
  }

  .lower-grid,
  .dashboard-side,
  .workspace-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
    padding: 0;
  }

  .sidebar-section {
    position: sticky;
    top: 0;
    z-index: 5;
    max-width: 100vw;
  min-height: 0;
  display: block;
  border-radius: 0 0 22px 22px;
  padding: 14px;
  overflow: clip;
  }

  .brand {
    grid-template-columns: 30px minmax(0, 1fr);
    margin-bottom: 12px;
  }

  .brand-name {
    display: block;
  }

  .nav {
    max-width: 100%;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-button {
    flex: 0 0 54px;
    min-width: 54px;
    min-height: 46px;
    grid-template-columns: 38px;
    padding: 0 8px;
  }

  .nav-icon {
    display: grid;
  }

  .extension-card {
    display: none;
  }

  .content-section {
    width: 100%;
    max-width: 100vw;
    height: auto;
    min-height: auto;
    padding: 14px;
    overflow: visible;
  }

  .content-section,
  .content-topbar,
  .content-body,
  .workspace-main,
  .workspace-side,
  .panel,
  .workspace-panel,
  .compact-form-card {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .content-topbar {
  grid-template-columns: 1fr;
  min-height: 0;
  padding: 14px;
  overflow: clip;
  }

  .page-title {
    min-width: 0;
  }

  .page-title strong {
    overflow-wrap: anywhere;
  }

  .topbar-actions {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
    min-width: 0;
  }

  .search-field {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 44px;
    padding: 0 12px;
    overflow: hidden;
  }

  .icon-button {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }

  .notification-button {
    display: none;
  }

  .profile-button {
    display: none;
  }

  .content-body {
    max-width: 100%;
    overflow: visible;
    padding: 0;
  }

  .app-view {
    width: 100%;
    max-width: 100%;
  }

  .kpi-grid,
  .lower-grid,
  .statistics-layout,
  .app-view--dashboard,
  .app-view--workspace,
  .partner-grid,
  .settings-grid,
  .line-item-form,
  .payment-metric-grid,
  .expense-metric-grid,
  .report-metric-grid,
  .report-control-grid,
  .report-pack-grid,
  .template-metric-grid,
  .template-page-address,
  .placeholder-grid,
  .template-pack-grid,
  .payment-split-grid,
  .document-totals,
  .saving-layout,
  .content-footer {
    grid-template-columns: 1fr;
  }

  .line-item-table__head {
    display: none;
  }

  .line-item-table__row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .line-item-table__row span,
  .line-item-table__row strong {
    white-space: normal;
  }

  .line-item-remove {
    width: 44px;
    height: 38px;
  }

  .workspace-panel,
  .compact-form-card,
  .drop-area {
    min-width: 0;
    border-radius: 18px;
    padding: 16px;
  }

  .panel {
    max-width: 100%;
    overflow: clip;
  }

  .drop-area {
    width: 100%;
    max-width: calc(100vw - 60px);
    margin: 0 auto;
  }

  .panel-head {
    display: grid;
  }

  .panel-head > div,
  .panel-head h2,
  .panel-head p {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .payment-metric span,
  .payment-metric strong,
  .payment-metric small {
    white-space: normal;
  }

  .range-tabs {
    max-width: 100%;
    overflow-x: auto;
  }

  .data-table__head {
    display: none;
  }

  .data-table__row {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
  }

  .data-table__row span,
  .data-table__row strong {
    white-space: normal;
  }

  .payment-queue-list article,
  .payment-assignment-list article,
  .expense-card-list article,
  .expense-staging-list article,
  .partner-contact-list article,
  .report-export-list article,
  .signature-asset-list article,
  .template-block-row,
  .payment-mini-table div {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .payment-transaction-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .payment-queue-list strong,
  .payment-queue-list small,
  .payment-queue-list em,
  .payment-assignment-list strong,
  .payment-assignment-list span,
  .payment-assignment-list small,
  .payment-assignment-list em,
  .expense-metric span,
  .expense-metric strong,
  .expense-metric small,
  .expense-card-list strong,
  .expense-card-list small,
  .expense-card-list em,
  .expense-staging-list strong,
  .expense-staging-list span,
  .expense-staging-list small,
  .expense-staging-list em,
  .partner-contact-list strong,
  .partner-contact-list small,
  .partner-contact-list em,
  .report-metric span,
  .report-metric strong,
  .report-metric small,
  .report-bar-list span,
  .report-bar-list strong,
  .report-readiness-list span,
  .report-readiness-list strong,
  .report-pack-grid strong,
  .report-pack-grid small,
  .report-pack-grid em,
  .report-export-list strong,
  .report-export-list span,
  .report-export-list small,
  .report-export-list em,
  .template-metric span,
  .template-metric strong,
  .template-metric small,
  .template-page-head span,
  .template-page-head strong,
  .template-page-address strong,
  .template-page-address span,
  .template-block-row strong,
  .template-block-row span,
  .template-block-row small,
  .template-block-row em,
  .placeholder-grid strong,
  .placeholder-grid span,
  .template-pack-grid strong,
  .template-pack-grid small,
  .template-pack-grid em,
  .signature-asset-list strong,
  .signature-asset-list small,
  .signature-asset-list em,
  .payment-mini-table span,
  .payment-mini-table strong {
    white-space: normal;
  }

  .template-page-head {
    grid-template-columns: 1fr;
  }

  .template-canvas {
    padding: 12px;
  }

  .file-queue div {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .file-queue strong,
  .file-queue small {
    grid-column: 2;
  }

  .file-queue span,
  .file-queue strong,
  .file-queue small {
    white-space: normal;
  }

  .drop-area h2 {
    width: min(100%, 300px);
    max-width: 300px;
    font-size: 22px;
  }

  .drop-area p {
    width: min(100%, 300px);
    max-width: 300px;
  }

  .settings-list div {
    grid-template-columns: 1fr;
  }

  .settings-list strong {
    text-align: left;
  }

  .chart-frame {
    min-height: 260px;
    padding-left: 34px;
  }

  .axis-labels {
    width: 30px;
    font-size: 10px;
  }

  .content-footer {
    padding: 14px;
  }
}
